text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
			<pattern>%date{ISO8601} %-5level [%X{traceId}][%thread] - %msg%n
			</pattern>
		</encoder>
	</appender>

	<appender name="ROLLING_FILE"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${user.home}/logs/logTest.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${user.home}/logs/logTest.log.%d{yyyy-MM-dd}
			</fileNamePattern>
			<maxHistory>1</maxHistory>
		</rollingPolicy>
		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
			<pattern>%date{ISO8601} %-5level [%X{traceId}][%thread] - %msg%n
			</pattern>
		</encoder>
	</appender>

	<appender name="ASYNC_ROLLING" class="ch.qos.logback.classic.AsyncAppender">
		<queueSize>256</queueSize>
		<!--不丢日志 -->
		<discardingThreshold>0</discardingThreshold>
		<appender-ref ref="ROLLING_FILE" />
	</appender>

	<root>
		<level value="info" />
		<appender-ref ref="STDOUT" />
		<appender-ref ref="ASYNC_ROLLING" />
	</root>

</configuration>

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) 2014-2017, Oracle and/or its affiliates.

// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html

#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_POINTLIKE_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_POINTLIKE_HPP

#include <boost/core/ignore_unused.hpp>
#include <boost/range.hpp>

#include <boost/geometry/core/tags.hpp>

#include <boost/geometry/algorithms/validity_failure_type.hpp>
#include <boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp>
#include <boost/geometry/algorithms/dispatch/is_valid.hpp>

#include <boost/geometry/util/condition.hpp>

namespace boost { namespace geometry
{

#ifndef DOXYGEN_NO_DISPATCH
namespace dispatch
{

// A point is always simple
template <typename Point>
struct is_valid<Point, point_tag>
{
    template <typename VisitPolicy, typename Strategy>
    static inline bool apply(Point const& point, VisitPolicy& visitor, Strategy const&)
    {
        boost::ignore_unused(visitor);
        return ! detail::is_valid::has_invalid_coordinate
            <
                Point
            >::apply(point, visitor);
    }
};

// A MultiPoint is simple if no two Points in the MultiPoint are equal
// (have identical coordinate values in X and Y)
//
// Reference: OGC 06-103r4 (6.1.5)
template <typename MultiPoint, bool AllowEmptyMultiGeometries>
struct is_valid<MultiPoint, multi_point_tag, AllowEmptyMultiGeometries>
{
    template <typename VisitPolicy, typename Strategy>
    static inline bool apply(MultiPoint const& multipoint,
                             VisitPolicy& visitor,
                             Strategy const&)
    {
        boost::ignore_unused(multipoint, visitor);

        if (BOOST_GEOMETRY_CONDITION(
                AllowEmptyMultiGeometries || !boost::empty(multipoint)))
        {
            // we allow empty multi-geometries, so an empty multipoint
            // is considered valid
            return ! detail::is_valid::has_invalid_coordinate
                <
                    MultiPoint
                >::apply(multipoint, visitor);
        }
        else
        {
            // we do not allow an empty multipoint
            return visitor.template apply<failure_few_points>();
        }
    }
};

} // namespace dispatch
#endif // DOXYGEN_NO_DISPATCH

}} // namespace boost::geometry

#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_POINTLIKE_HPP


text:
package com.tobedevoured.naether.repo;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonatype.aether.transfer.AbstractTransferListener;
import org.sonatype.aether.transfer.TransferEvent;
import org.sonatype.aether.transfer.TransferResource;

/**
 * Base on https://github.com/sonatype/sonatype-aether/blob/master/aether-demo/src/main/java/demo/util/ConsoleTransferListener.java
 *
 */
public class LogTransferListener extends AbstractTransferListener {

    private static final int INITAL_CAPACITY = 64;
    private static final int KB = 1024;

    private Logger log = LoggerFactory.getLogger( "NaetherTransfer" );
    private Map<TransferResource, Long> downloads = new ConcurrentHashMap<TransferResource, Long>();

    private int lastLength;

    @Override
    public void transferInitiated( TransferEvent event ) {
        String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";

        log.info( message + ": " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
    }

    @Override
    public void transferProgressed( TransferEvent event ) {
        if ( log.isDebugEnabled() ) {
            TransferResource resource = event.getResource();
            downloads.put( resource, Long.valueOf( event.getTransferredBytes() ) );

            StringBuilder buffer = new StringBuilder( INITAL_CAPACITY );

            for ( Map.Entry<TransferResource, Long> entry : downloads.entrySet() )
            {
                long total = entry.getKey().getContentLength();
                long complete = entry.getValue().longValue();

                buffer.append( getStatus( complete, total ) ).append( "  " );
            }

            int pad = lastLength - buffer.length();
            lastLength = buffer.length();
            pad( buffer, pad );

            log.debug( buffer.toString() );
        }
    }

    private String getStatus( long complete, long total ) {
        if ( total >= KB )
        {
            return toKB( complete ) + "/" + toKB( total ) + " KB ";
        }
        else if ( total >= 0 )
        {
            return complete + "/" + total + " B ";
        }
        else if ( complete >= KB )
        {
            return toKB( complete ) + " KB ";
        }
        else
        {
            return complete + " B ";
        }
    }

    private void pad( StringBuilder buffer, int spaces ) {
        String block = "                                        ";
        int spacesLeft = spaces;
        while ( spacesLeft > 0 ) {
            int n = Math.min( spaces, block.length() );
            buffer.append( block, 0, n );
            spacesLeft -= n;
        }
    }

    @Override
    public void transferSucceeded( TransferEvent event ) {
        transferCompleted( event );

        TransferResource resource = event.getResource();
        long contentLength = event.getTransferredBytes();
        if ( contentLength >= 0 )
        {
            String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
            String len = contentLength >= KB ? toKB( contentLength ) + " KB" : contentLength + " B";

            String throughput = "";
            long duration = System.currentTimeMillis() - resource.getTransferStartTime();
            if ( duration > 0 )
            {
                DecimalFormat format = new DecimalFormat( "0.0", new DecimalFormatSymbols( Locale.ENGLISH ) );
                double kbPerSec = ( contentLength / KB ) / ( duration / 1000.0 );
                throughput = " at " + format.format( kbPerSec ) + " KB/sec";
            }

            log.debug( type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len
                + throughput + ")" );
        }
    }

    @Override
    public void transferFailed( TransferEvent event ) {
        transferCompleted( event );

        log.debug( "Transfer Failed from repo {} for {}", event.getResource().getRepositoryUrl(), event.getResource().getResourceName() );
        log.debug( "Transfer Failed Exception", event.getException() );
    }

    private void transferCompleted( TransferEvent event ) {
        downloads.remove( event.getResource() );

        StringBuilder buffer = new StringBuilder( INITAL_CAPACITY );
        pad( buffer, lastLength );
        log.debug( buffer.toString() );
    }

    public void transferCorrupted( TransferEvent event ) {
        log.error( "Transfer Corrupted", event.getException() );
    }

    protected long toKB( long bytes ) {
        return ( bytes + 1023 ) / KB ;
    }

}


text:
/*
 * watchdog.h
 *
 * Created: 10/2/2015 11:17:31 AM
 *  Author: Yahia
 */

#ifndef WATCHDOG_H_
#define WATCHDOG_H_

#include <avr/io.h>

/*Define Timeout reset action by a_WDP2,a_WDP1,a_WDP0 */
#define watch_dog_Enable(a_WDP2,a_WDP1,a_WDP0) WDTCR=((1<<WDE)|(a_WDP2<<WDP2)|(a_WDP1<<WDP1)|(a_WDP0<<WDP0))

/*Disable watch dog timer*/
#define watch_dog_Disable {WDTCR |= (1<<WDTOE) | (1<<WDE); WDTCR = 0x00;} /*from the datasheet*/

/*
  Execute a certain function in case of The TimeOut.
  In case another parameters needed in the function call ,just change the function pointer definition
  here and in .c file.
  @this function is not called automatically when the reset happens ,you should placed it in the start
  @of the main program.

*/
extern void watch_dog_TimeOutAction(void (*FunctionPtr)(void));

#endif /* WATCHDOG_H_ */


text:
package robocode.control;

import java.io.File;

import net.sf.robocode.security.IHiddenSpecificationHelper;

/**
 * Defines the properties of a robot, which is returned from
 * {@link RobocodeEngine#getLocalRepository()}.
 *
 * @author Mathew A. Nelson (original)
 * @author Flemming N. Larsen (contributor)
 */
public class RobotSpecification implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	private final Object fileSpecification;
	private final String name;
	private final String author;
	private final String webpage;
	private final String version;
	private final String robocodeVersion;
	private final String jarFile;
	private final String fullClassName;
	private final String description;
	private String teamId;

	private RobotSpecification(Object fileSpecification, String name, String author, String webpage, String version, String robocodeVersion, String jarFile, String fullClassName, String description) {
		this.fileSpecification = fileSpecification;
		this.name = name;
		this.author = author;
		this.webpage = webpage;
		this.version = version;
		this.robocodeVersion = robocodeVersion;
		this.jarFile = jarFile;
		this.fullClassName = fullClassName;
		this.description = description;
	}

	/**
	 * Returns the name of this robot or team.
	 *
	 * @return the name of this robot or team.
	 * @see #getVersion()
	 * @see #getNameAndVersion()
	 */
	public String getName() {
		return name;
	}

	/**
	 * Returns the version of this robot or team.
	 *
	 * @return the version of this robot or team.
	 * @see #getName()
	 * @see #getNameAndVersion()
	 */
	public String getVersion() {
		return version;
	}

	/**
	 * Returns the name and version of this robot or team.
	 *
	 * @return the name and version of this robot or team.
	 * @see #getName()
	 * @see #getVersion()
	 * @since 1.3
	 */
	public String getNameAndVersion() {
		String nameAndVersion = getName();
		String version = getVersion();

		if (version != null && version.trim().length() > 0) {
			nameAndVersion += ' ' + version.trim();
		}
		return nameAndVersion;
	}

	/**
	 * Returns the full class name of this robot or team.
	 *
	 * @return the full class name of this robot or team.
	 */
	public String getClassName() {
		return fullClassName;
	}

	/**
	 * Returns the JAR file containing this robot or team, or {@code null} if it
	 * does not come from a JAR file (could be class files instead).
	 *
	 * @return the JAR file containing this robot or team, or {@code null} if it
	 *         does not come from a JAR file (could be class files instead).
	 */
	public File getJarFile() {
		return new File(jarFile);
	}

	/**
	 * Returns the description provided by the author of this robot or team.
	 *
	 * @return the description provided by the author of this robot or team.
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Returns the version of Robocode this robot or team was build with.
	 *
	 * @return the version of Robocode this robot or team was build with.
	 */
	public String getRobocodeVersion() {
		return robocodeVersion;
	}

	/**
	 * Returns the link to the web page for this robot or team.
	 *
	 * @return the link to the web page for this robot or team.
	 */
	public String getWebpage() {
		return webpage;
	}

	/**
	 * Returns the name of the author of this robot or team.
	 *
	 * @return the name of the author of this robot or team.
	 */
	public String getAuthorName() {
		return author;
	}

	/**
	 * Returns id of the team in current battle.
	 *
	 * @return id of the team in current battle.
	 */
	public String getTeamId() {
		return teamId != null ? teamId : getNameAndVersion();
	}

	static IHiddenSpecificationHelper createHiddenHelper() {
		return new HiddenHelper();
	}

	private static class HiddenHelper implements IHiddenSpecificationHelper {

		public RobotSpecification createSpecification(Object fileSpecification, String name, String author, String webpage, String version, String robocodeVersion, String jarFile, String fullClassName, String description) {
			return new RobotSpecification(fileSpecification, name, author, webpage, version, robocodeVersion, jarFile,
					fullClassName, description);
		}

		public Object getFileSpecification(RobotSpecification specification) {
			return specification.fileSpecification;
		}

		public void setTeamName(RobotSpecification specification, String teamName) {
			specification.teamId = teamName;
		}

		public String getTeamName(RobotSpecification specification) {
			return specification.teamId;
		}
	}
}


text:
package csv.converter;

import de.bytefish.jtinycsvparser.typeconverter.ITypeConverter;
import utils.StringUtils;

import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.List;

public class IgnoreMissingValuesConverter implements ITypeConverter<Float> {

    private List<String> missingValueRepresentation;

    public IgnoreMissingValuesConverter(String... missingValueRepresentation) {
        this(Arrays.asList(missingValueRepresentation));
    }

    public IgnoreMissingValuesConverter(List<String> missingValueRepresentation) {
        this.missingValueRepresentation = missingValueRepresentation;
    }

    @Override
    public Float convert(final String s) {

        if(StringUtils.isNullOrWhiteSpace(s)) {
            return null;
        }

        boolean isMissingValue = missingValueRepresentation
                .stream()
                .anyMatch(x -> x.equals(s));

        if(isMissingValue) {
            return null;
        }

        return Float.parseFloat(s);
    }

    @Override
    public Type getTargetType() {
        return Float.class;
    }
}


text:
using System;
using System.Runtime.Serialization;

namespace SerializationTestTypes
{
    [Serializable]
    [KnownType(typeof(PublicDC))]
    public class SerIObjRef : IObjectReference
    {
        [NonSerialized]
        private static PublicDC s_containedData = new PublicDC();

        object IObjectReference.GetRealObject(StreamingContext context)
        {
            return s_containedData;
        }

        public override bool Equals(object obj)
        {
            return obj.Equals(s_containedData);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }

    [DataContract(IsReference = false)]
    [KnownType(typeof(PublicDC))]
    public class DCExplicitInterfaceIObjRef : IObjectReference
    {
        [DataMember]
        public SelfRef1 data;

        [NonSerialized]
        static public SelfRef1 containedData = new SelfRef1();

        public DCExplicitInterfaceIObjRef() { }
        public DCExplicitInterfaceIObjRef(bool init)
        {
            data = new SelfRef1(true);
        }

        object IObjectReference.GetRealObject(StreamingContext context)
        {
            return containedData;
        }

        public override bool Equals(object obj)
        {
            return DCRUtils.CompareIObjectRefTypes(containedData, obj);
        }

        public override int GetHashCode()
        {
            return containedData.GetHashCode();
        }
    }

    [DataContract(IsReference = false)]
    [KnownType(typeof(PublicDC))]
    public class DCIObjRef : IObjectReference
    {
        [DataMember]
        public SimpleDCWithRef data;

        [NonSerialized]
        private static SimpleDCWithRef s_containedData = new SimpleDCWithRef(true);

        public DCIObjRef() { }
        public DCIObjRef(bool init) { }

        public object GetRealObject(StreamingContext context)
        {
            return s_containedData;
        }

        public override bool Equals(object obj)
        {
            return DCRUtils.CompareIObjectRefTypes(s_containedData, obj);
        }

        public override int GetHashCode()
        {
            return s_containedData.GetHashCode();
        }
    }

    [Serializable]
    [KnownType(typeof(PrivateDC))]
    public class SerExplicitInterfaceIObjRefReturnsPrivate : IObjectReference
    {
        [NonSerialized]
        private static PrivateDC s_containedData = new PrivateDC();

        object IObjectReference.GetRealObject(StreamingContext context)
        {
            return s_containedData;
        }

        public override bool Equals(object obj)
        {
            return DCRUtils.CompareIObjectRefTypes(s_containedData, obj);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }

    [Serializable]
    [KnownType(typeof(PrivateDC))]
    public class SerIObjRefReturnsPrivate : IObjectReference
    {
        [NonSerialized]
        private static PrivateDC s_containedData = new PrivateDC();

        object IObjectReference.GetRealObject(StreamingContext context)
        {
            return s_containedData;
        }

        public override bool Equals(object obj)
        {
            return DCRUtils.CompareIObjectRefTypes(s_containedData, obj);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }

    [DataContract(IsReference = false)]
    [KnownType(typeof(PrivateDC))]
    public class DCExplicitInterfaceIObjRefReturnsPrivate : IObjectReference
    {
        [DataMember]
        private PrivateDC _data = new PrivateDC();

        [NonSerialized]
        private static PrivateDC s_containedData = new PrivateDC();

        object IObjectReference.GetRealObject(StreamingContext context)
        {
            return s_containedData;
        }

        public override bool Equals(object obj)
        {
            return DCRUtils.CompareIObjectRefTypes(s_containedData, obj);
        }

        public override int GetHashCode()
        {
            return s_containedData.GetHashCode();
        }
    }

    [DataContract(IsReference = false)]
    [KnownType(typeof(PrivateDC))]
    public class DCIObjRefReturnsPrivate : IObjectReference
    {
        [DataMember]
        private PrivateDC _data = new PrivateDC();

        [NonSerialized]
        private static PrivateDC s_containedData = new PrivateDC();

        public object GetRealObject(StreamingContext context)
        {
            return s_containedData;
        }

        public override bool Equals(object obj)
        {
            return DCRUtils.CompareIObjectRefTypes(s_containedData, obj);
        }

        public override int GetHashCode()
        {
            return s_containedData.GetHashCode();
        }
    }
}


text:
using System;

class Test{
public static int Main(){
  int mi_RetCode;
  C c = new C();
  mi_RetCode = c.Test();

  if(mi_RetCode == 100)
    Console.WriteLine("Pass");
  else
    Console.WriteLine("FAIL");

  return mi_RetCode;
}
}

interface A{
int MethPubInst();
}

interface B : A{
int MethPubInstB();
}

struct C : B{
public int MethPubInst(){
  Console.WriteLine("B::MethPubInst()");
  return 100;
}

public int MethPubInstB(){
  Console.WriteLine("B::MethPubInstB()");
  return 100;
}

public int Test(){
  int mi_RetCode = 100;

  /////////////////////////////////
  // Test instance method access
  if(MethPubInst() != 100)
    mi_RetCode = 0;

  if(MethPubInstB() != 100)
    mi_RetCode = 0;

  return mi_RetCode;
}
}


text:
#import "RTCVideoCapturer.h"

#include "talk/app/webrtc/videosourceinterface.h"

@interface RTCVideoCapturer (Internal)

@property(nonatomic, assign, readonly) const talk_base::scoped_ptr<cricket::VideoCapturer> &capturer;

- (id)initWithCapturer:(cricket::VideoCapturer*)capturer;

@end


text:
using CharacterGen.CharacterClasses;
using CharacterGen.Feats;
using CharacterGen.Races;
using System.Collections.Generic;
using TreasureGen.Items;

namespace CharacterGen.Domain.Generators.Items
{
    internal interface IWeaponGenerator
    {
        Weapon GenerateFrom(IEnumerable<Feat> feats, CharacterClass characterClass, Race race);
        Weapon GenerateAmmunition(CharacterClass characterClass, Race race, string ammunitionType);
        Weapon GenerateMeleeFrom(IEnumerable<Feat> feats, CharacterClass characterClass, Race race);
        Weapon GenerateOneHandedMeleeFrom(IEnumerable<Feat> feats, CharacterClass characterClass, Race race);
        Weapon GenerateRangedFrom(IEnumerable<Feat> feats, CharacterClass characterClass, Race race);
    }
}


text:
package org.wso2.msf4j.example;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;
import org.wso2.msf4j.Interceptor;
import org.wso2.msf4j.Request;
import org.wso2.msf4j.Response;
import org.wso2.msf4j.ServiceMethodInfo;

/**
 * Spring based MSF4J Interceptor class which print HTTP headers from incoming messages.
 */
@Component
public class LogHeadersInterceptor implements Interceptor {

    private final Log log = LogFactory.getLog(LogHeadersInterceptor.class);

    @Override
    public boolean preCall(Request request, Response responder, ServiceMethodInfo serviceMethodInfo) throws Exception {
        request.getHeaders().getAll()
               .forEach(header -> log.info("Header - " + header.getName() + " : " + header.getValue()));
        return true;
    }

    @Override
    public void postCall(Request request, int status, ServiceMethodInfo serviceMethodInfo) throws Exception {

    }
}


text:
package org.apache.pulsar.broker.admin.v1;

import io.swagger.annotations.Api;
import org.apache.pulsar.broker.admin.impl.TenantsBase;

import javax.ws.rs.Consumes;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("/properties")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Api(value = "/properties", description = "TenantsBase admin apis", tags = "properties", hidden = true)
public class Properties extends TenantsBase {
}


text:
/*
 *Clean Blog v1.0.0 (http://startbootstrap)
 *Some code were fromm Hux and Custom code from BING
 *
 */

// Tooltip Init
$(function(){
	$("[data-toggle='tooltip']").tooltip();
});

// responsive tables
$(document).ready(function() {
	$("table").wrap("

");
	$("table").addClass("table");
});

// responsive embed videos
$(document).ready(function () {
    $('iframe[src*="youtube.com"]').wrap('

');
	$('iframe[src*="youtube.com"]').addClass('embed-responsive-item');
    $('iframe[src*="vimeo.com"]').wrap('

');
	$('iframe[src*="vimeo.com"]').addClass('embed-responsive-item');
});

// Navigation Script to show Header on Scroll-up
$(document).ready(function(){
    var MQL = 1170;

    if($(window).width() > MQL) {
    	var headerHeight = $('.navbar-custom').height();
    	$(window).on('scroll', {
    		previousTop: 0
    	},
        function() {
        	var currentTop = $(window).scrollTop();
        	//check if user is scrolling up
        	if (currentTop < this.previousTop) {
                //if scrolling up...
                if(currentTop > 0 && $('.navbar-custom').hasClass('is-fixed')) {
                	$('.navbar-custom').addClass('is-visible');
                } else {
                    $('.navbar-custom').removeClass('is-visible is-fixed');
                }
        	} else {
                //if scrolling down...
                $('.navbar-custom').removeClass('is-visible');
                if(currentTop > headerHeight && !$('.navbar-custom').hasClass('is-fixed')){
                	$('.navbar-custom').addClass('is-fixed');
                }
        	}
        	this.previousTop = currentTop;
         }
    	)
    }
})


text:
window.onload = init;

function init() {
    getPetData();
}

function getPetData() {
    var request = new XMLHttpRequest();
    request.open("GET", "pets.json");
    request.onreadystatechange = function() {
        var div = document.getElementById("pets");
        if (this.readyState == this.DONE && this.status == 200) {
            var type = request.getResponseHeader("Content-Type");
            console.log("Content-type: " + type);
            console.log("Status: " + this.statusText);
            if (this.responseText != null) {
                div.innerHTML = this.responseText;
            }
            else {
                div.innerHTML = "Error: no data";
            }
        }
    };
    request.send();
}


text:
require 'test/unit'
require_relative '../../lib/trepanning'

class TestTrepanCallBug < Test::Unit::TestCase

    def define_singleton_method_by_proc(obj, name, block)
        metaclass = class << obj; self; end
        metaclass.send(:define_method, name, block)
    end

    def test_debugger_call_bug
        $calls = []
        mydbgr = nil
        2.times do
            x = 1
            mydbgr = Trepan.new
            core = mydbgr.core
            def core.event_processor_tp(tp)
                frame = tp.frame
                $calls << [frame.source_container, frame.source_location].flatten
            end
            mydbgr.debugger
            y = 2
        end
        mydbgr.stop
        assert_equal true, $calls.size > 0, $calls
    end

end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>src/away/containers/Scene.ts</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">

            API Docs for: 0.1.0

APIs

Classes

Modules

            <input type="search" id="api-filter" placeholder="Type to filter APIs">

away.events.AssetEvent

away.events.CameraEvent

away.events.Event

away.events.EventDispatcher

away.events.HTTPStatusEvent

away.materials.IMaterial

away.partition.CameraNode

away.partition.EntityNode

away.partition.NodeBase

away.partition.NullNode

away.partition.Partition

away.pick.PickingCollisionVO

away.pool.EntityListItem

away.pool.EntityListItemPool

away.pool.RenderableListItem

away.pool.RenderablePool

away.render.DefaultRenderer

away.render.IRenderable

away.render.IRenderer

away.render.RendererBase

away.sort.RenderableMergeSort

away.traverse.EntityCollector

away.traverse.ICollector

away.base

away.data

away.events

away.materials

away.partition

away.pick

away.pool

away.render

away.sort

away.traverse

        Show:

            <input type="checkbox" id="api-show-inherited" checked>
            Inherited

            <input type="checkbox" id="api-show-protected">
            Protected

            <input type="checkbox" id="api-show-private">
            Private

            <input type="checkbox" id="api-show-deprecated">
            Deprecated

File: src/away/containers/Scene.ts

///<reference path="../_definitions.ts" />

module away.containers
{
	export class Scene extends away.events.EventDispatcher
	{
		private _expandedPartitions:Array<away.partition.Partition> = new Array<away.partition.Partition>();
		private _partitions:Array<away.partition.Partition> = new Array<away.partition.Partition>();

		public _iSceneGraphRoot:away.containers.DisplayObjectContainer;
		public _iCollectionMark = 0;

		constructor()
		{
			super();

			this._iSceneGraphRoot = new away.containers.DisplayObjectContainer();

			this._iSceneGraphRoot._iSetScene(this);
			this._iSceneGraphRoot._iIsRoot = true;
			this._iSceneGraphRoot.partition = new away.partition.Partition(new away.partition.NodeBase());
		}

		public traversePartitions(traverser:away.traverse.ICollector)
		{
			var i:number = 0;
			var len:number = this._partitions.length;

			traverser.scene = this;

			while (i < len) {
				this._iCollectionMark++;
				this._partitions[i++].traverse(traverser);
			}
		}

		public get partition():away.partition.Partition
		{
			return this._iSceneGraphRoot.partition;
		}

		public set partition(value:away.partition.Partition)
		{
			this._iSceneGraphRoot.partition = value;

			this.dispatchEvent(new away.events.SceneEvent(away.events.SceneEvent.PARTITION_CHANGED, this._iSceneGraphRoot));
		}

		public contains(child:away.base.DisplayObject):boolean
		{
			return this._iSceneGraphRoot.contains(child);
		}

		public addChild(child:away.base.DisplayObject):away.base.DisplayObject
		{
			return this._iSceneGraphRoot.addChild(child);
		}

		public removeChild(child:away.base.DisplayObject)
		{
			this._iSceneGraphRoot.removeChild(child);
		}

		public removeChildAt(index:number)
		{
			this._iSceneGraphRoot.removeChildAt(index);
		}

		public getChildAt(index:number):away.base.DisplayObject
		{
			return this._iSceneGraphRoot.getChildAt(index);
		}

		public get numChildren():number
		{
			return this._iSceneGraphRoot.numChildren;
		}

		/**
		 * @internal
		 */
		public iRegisterEntity(displayObject:away.base.DisplayObject)
		{
			if (displayObject.partition)
				this.iRegisterPartition(displayObject.partition);

			if (displayObject.isEntity)
				displayObject._iAssignedPartition.iMarkForUpdate(<away.entities.IEntity> displayObject);
		}

		/**
		 * @internal
		 */
		public iRegisterPartition(partition:away.partition.Partition)
		{
			this._expandedPartitions.push(partition);

			//ensure duplicates are not found in partitions array
			if (this._partitions.indexOf(partition) == -1)
				this._partitions.push(partition);
		}

		/**
		 * @internal
		 */
		public iUnregisterEntity(displayObject:away.base.DisplayObject)
		{
			if (displayObject.partition)
				this.iUnregisterPartition(displayObject.partition);

			if (displayObject.isEntity)
				displayObject._iAssignedPartition.iRemoveEntity(<away.entities.IEntity> displayObject);
		}

		/**
		 * @internal
		 */
		public iUnregisterPartition(partition:away.partition.Partition)
		{
			this._expandedPartitions.splice(this._expandedPartitions.indexOf(partition), 1);

			//if no more partition references found, remove from partitions array
			if (this._expandedPartitions.indexOf(partition) == -1)
				this._partitions.splice(this._partitions.indexOf(partition), 1);
		}
	}
}


text:
from __future__ import unicode_literals
import unittest
from imbox.parser import *

raw_email = """Delivered-To: johndoe@gmail.com
X-Originating-Email: [martin@amon.cx]
Message-ID: <test0@example.com>
Return-Path: martin@amon.cx
Date: Tue, 30 Jul 2013 15:56:29 +0300
From: Martin Rusev <martin@amon.cx>
MIME-Version: 1.0
To: John Doe <johndoe@gmail.com>
Subject: Test email - no attachment
Content-Type: multipart/alternative;
    boundary="------------080505090108000500080106"
X-OriginalArrivalTime: 30 Jul 2013 12:56:43.0604 (UTC) FILETIME=[3DD52140:01CE8D24]

--------------080505090108000500080106
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit

Hi, this is a test email with no attachments

--------------080505090108000500080106
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
Hi, this is a test email with no attachments

--------------080505090108000500080106--
"""

class TestParser(unittest.TestCase):

    def test_parse_email(self):
        parsed_email = parse_email(raw_email)

        self.assertEqual(raw_email, parsed_email.raw_email)
        self.assertEqual('Test email - no attachment', parsed_email.subject)
        self.assertEqual('Tue, 30 Jul 2013 15:56:29 +0300', parsed_email.date)
        self.assertEqual('<test0@example.com>', parsed_email.message_id)

    def test_parse_email_ignores_header_casing(self):
        self.assertEqual('one', parse_email('Message-ID: one').message_id)
        self.assertEqual('one', parse_email('Message-Id: one').message_id)
        self.assertEqual('one', parse_email('Message-id: one').message_id)
        self.assertEqual('one', parse_email('message-id: one').message_id)

    # TODO - Complete the test suite
    def test_parse_attachment(self):
        pass

    def test_decode_mail_header(self):
        pass

    def test_get_mail_addresses(self):

        to_message_object = email.message_from_string("To: John Doe <johndoe@gmail.com>")
        self.assertEqual([{'email': 'johndoe@gmail.com', 'name': 'John Doe'}], get_mail_addresses(to_message_object, 'to'))

        from_message_object = email.message_from_string("From: John Smith <johnsmith@gmail.com>")
        self.assertEqual([{'email': 'johnsmith@gmail.com', 'name': 'John Smith'}], get_mail_addresses(from_message_object, 'from'))


text:
package org.apache.cassandra.distributed.upgrade;

import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

import org.apache.cassandra.distributed.UpgradeableCluster;
import org.apache.cassandra.distributed.api.ConsistencyLevel;
import org.apache.cassandra.distributed.api.ICoordinator;
import org.apache.cassandra.distributed.api.IMessageFilters;
import org.apache.cassandra.distributed.api.NodeToolResult;
import org.apache.cassandra.distributed.shared.Versions;
import static org.apache.cassandra.distributed.shared.AssertUtils.*;

public class CompactStorage2to3UpgradeTest extends UpgradeTestBase
{
    @Test
    public void multiColumn() throws Throwable
    {
        new TestCase()
        .upgrade(Versions.Major.v22, Versions.Major.v3X)
        .setup(cluster -> {
            assert cluster.size() == 3;
            int rf = cluster.size() - 1;
            assert rf == 2;
            cluster.schemaChange("CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': " + (cluster.size() - 1) + "};");
            cluster.schemaChange("CREATE TABLE ks.tbl (pk int, v1 int, v2 text, PRIMARY KEY (pk)) WITH COMPACT STORAGE");
            ICoordinator coordinator = cluster.coordinator(1);
            // these shouldn't be replicated by the 3rd node
            coordinator.execute("INSERT INTO ks.tbl (pk, v1, v2) VALUES (3, 3, '3')", ConsistencyLevel.ALL);
            coordinator.execute("INSERT INTO ks.tbl (pk, v1, v2) VALUES (9, 9, '9')", ConsistencyLevel.ALL);
            for (int i = 0; i < cluster.size(); i++)
            {
                int nodeNum = i + 1;
                System.out.println(String.format("****** node %s: %s", nodeNum, cluster.get(nodeNum).config()));
            }
        })
        .runAfterNodeUpgrade(((cluster, node) -> {
            if (node != 2)
                return;

            Object[][] rows = cluster.coordinator(3).execute("SELECT * FROM ks.tbl LIMIT 2", ConsistencyLevel.ALL);
            Object[][] expected = {
            row(9, 9, "9"),
            row(3, 3, "3")
            };
            assertRows(rows, expected);
        })).run();
    }

    @Test
    public void singleColumn() throws Throwable
    {
        new TestCase()
        .upgrade(Versions.Major.v22, Versions.Major.v3X)
        .setup(cluster -> {
            assert cluster.size() == 3;
            int rf = cluster.size() - 1;
            assert rf == 2;
            cluster.schemaChange("CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': " + (cluster.size() - 1) + "};");
            cluster.schemaChange("CREATE TABLE ks.tbl (pk int, v int, PRIMARY KEY (pk)) WITH COMPACT STORAGE");
            ICoordinator coordinator = cluster.coordinator(1);
            // these shouldn't be replicated by the 3rd node
            coordinator.execute("INSERT INTO ks.tbl (pk, v) VALUES (3, 3)", ConsistencyLevel.ALL);
            coordinator.execute("INSERT INTO ks.tbl (pk, v) VALUES (9, 9)", ConsistencyLevel.ALL);
            for (int i = 0; i < cluster.size(); i++)
            {
                int nodeNum = i + 1;
                System.out.println(String.format("****** node %s: %s", nodeNum, cluster.get(nodeNum).config()));
            }
        })
        .runAfterNodeUpgrade(((cluster, node) -> {

            if (node < 2)
                return;

            Object[][] rows = cluster.coordinator(3).execute("SELECT * FROM ks.tbl LIMIT 2", ConsistencyLevel.ALL);
            Object[][] expected = {
            row(9, 9),
            row(3, 3)
            };
            assertRows(rows, expected);
        })).run();
    }

    @Test
    public void testDropCompactWithClusteringAndValueColumn() throws Throwable
    {
        final String table = "clustering_and_value";
        final int partitions = 10;
        final int rowsPerPartition = 10;

        final ResultsRecorder recorder = new ResultsRecorder();
        new TestCase()
        .nodes(2)
        .upgrade(Versions.Major.v22, Versions.Major.v3X)
        .setup(cluster -> {
            cluster.schemaChange(String.format(
            "CREATE TABLE %s.%s (key int, c1 int, c2 int, c3 int, PRIMARY KEY (key, c1, c2)) WITH COMPACT STORAGE",
            KEYSPACE, table));
            ICoordinator coordinator = cluster.coordinator(1);

            for (int i = 1; i <= partitions; i++)
            {
                for (int j = 1; j <= rowsPerPartition; j++)
                {
                    coordinator.execute(String.format("INSERT INTO %s.%s (key, c1, c2, c3) VALUES (%d, %d, 1, 1)",
                                                      KEYSPACE, table, i, j), ConsistencyLevel.ALL);
                    coordinator.execute(String.format("INSERT INTO %s.%s (key, c1, c2, c3) VALUES (%d, %d, 2, 1)",
                                                      KEYSPACE, table, i, j), ConsistencyLevel.ALL);
                }
            }

            runQueries(cluster.coordinator(1), recorder, new String[] {
            String.format("SELECT * FROM %s.%s", KEYSPACE, table),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 = %d",
                          KEYSPACE, table, partitions - 3, rowsPerPartition - 2),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 = %d",
                          KEYSPACE, table, partitions - 1, rowsPerPartition - 5),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 = %d and c2 = %d",
                          KEYSPACE, table, partitions - 1, rowsPerPartition - 5, 1),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 = %d and c2 = %d",
                          KEYSPACE, table, partitions - 4, rowsPerPartition - 9, 1),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 = %d and c2 > %d",
                          KEYSPACE, table, partitions - 4, rowsPerPartition - 9, 1),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 = %d and c2 > %d",
                          KEYSPACE, table, partitions - 4, rowsPerPartition - 9, 2),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 > %d",
                          KEYSPACE, table, partitions - 8, rowsPerPartition - 3),

            });
        }).runAfterClusterUpgrade(cluster ->
                                  {
                                      for (int i = 1; i <= cluster.size(); i++)
                                      {
                                          NodeToolResult result = cluster.get(1).nodetoolResult("upgradesstables");
                                          assertEquals("upgrade sstables failed for node " + i, 0, result.getRc());
                                      }

                                      // make sure the results are the same after upgrade and upgrade sstables but before dropping compact storage
                                      recorder.validateResults(cluster, 1);
                                      recorder.validateResults(cluster, 2);

                                      // make sure the results are the same after dropping compact storage on only the first node
                                      IMessageFilters.Filter filter = cluster.verbs().allVerbs().to(2).drop();
                                      cluster.schemaChange(String.format("ALTER TABLE %s.%s DROP COMPACT STORAGE", KEYSPACE, table), 1);

                                      recorder.validateResults(cluster, 1, ConsistencyLevel.ONE);

                                      filter.off();
                                      recorder.validateResults(cluster, 1);
                                      recorder.validateResults(cluster, 2);

                                      // make sure the results continue to be the same after dropping compact storage on the second node
                                      cluster.schemaChange(String.format("ALTER TABLE %s.%s DROP COMPACT STORAGE", KEYSPACE, table), 2);
                                      recorder.validateResults(cluster, 1);
                                      recorder.validateResults(cluster, 2);
                                  })
        .run();
    }

    @Test
    public void testDropCompactWithClusteringAndValueColumnWithDeletesAndWrites() throws Throwable
    {
        final String table = "clustering_and_value_with_deletes";
        final int partitions = 10;
        final int rowsPerPartition = 10;
        final int additionalParititons = 5;

        new TestCase()
        .nodes(2)
        .upgrade(Versions.Major.v22, Versions.Major.v3X)
        .setup(cluster -> {
            cluster.schemaChange(String.format(
            "CREATE TABLE %s.%s (key int, c1 int, c2 int, c3 int, PRIMARY KEY (key, c1, c2)) WITH COMPACT STORAGE",
            KEYSPACE, table));
            ICoordinator coordinator = cluster.coordinator(1);

            for (int i = 1; i <= partitions; i++)
            {
                for (int j = 1; j <= rowsPerPartition; j++)
                {
                    coordinator.execute(String.format("INSERT INTO %s.%s (key, c1, c2, c3) VALUES (%d, %d, 1, 1)",
                                                      KEYSPACE, table, i, j), ConsistencyLevel.ALL);
                    coordinator.execute(String.format("INSERT INTO %s.%s (key, c1, c2, c3) VALUES (%d, %d, 2, 2)",
                                                      KEYSPACE, table, i, j), ConsistencyLevel.ALL);
                    coordinator.execute(String.format("INSERT INTO %s.%s (key, c1, c2, c3) VALUES (%d, %d, 3, 3)",
                                                      KEYSPACE, table, i, j), ConsistencyLevel.ALL);
                }
            }

        })
        .runAfterClusterUpgrade(cluster -> {
            for (int i = 1; i <= cluster.size(); i++)
            {
                NodeToolResult result = cluster.get(1).nodetoolResult("upgradesstables");
                assertEquals("upgrade sstables failed for node " + i, 0, result.getRc());
            }

            // drop compact storage on only one node before performing writes
            IMessageFilters.Filter filter = cluster.verbs().allVerbs().to(2).drop();
            cluster.schemaChange(String.format("ALTER TABLE %s.%s DROP COMPACT STORAGE", KEYSPACE, table), 1);
            filter.off();

            // add new partitions and delete some of the old ones
            ICoordinator coordinator = cluster.coordinator(1);
            for (int i = 0; i < additionalParititons; i++)
            {
                for (int j = 1; j <= rowsPerPartition; j++)
                {
                    coordinator.execute(String.format("INSERT INTO %s.%s (key, c1, c2, c3) VALUES (%d, %d, 1, 1)",
                                                      KEYSPACE, table, i, j), ConsistencyLevel.ALL);
                }
            }

            coordinator.execute(String.format("DELETE FROM %s.%s WHERE key = %d and c1 = %d",
                                              KEYSPACE, table, 0, 3), ConsistencyLevel.ALL);

            coordinator.execute(String.format("DELETE FROM %s.%s WHERE key = %d",
                                              KEYSPACE, table, 1), ConsistencyLevel.ALL);

            coordinator.execute(String.format("DELETE FROM %s.%s WHERE key = %d and c1 = %d and c2 = %d",
                                              KEYSPACE, table, 7, 2, 2), ConsistencyLevel.ALL);

            coordinator.execute(String.format("DELETE FROM %s.%s WHERE key = %d and c1 = %d and c2 = %d",
                                              KEYSPACE, table, 7, 6, 1), ConsistencyLevel.ALL);

            coordinator.execute(String.format("DELETE FROM %s.%s WHERE key = %d and c1 = %d and c2 = %d",
                                              KEYSPACE, table, 4, 1, 1), ConsistencyLevel.ALL);

            coordinator.execute(String.format("DELETE c3 FROM %s.%s WHERE key = %d and c1 = %d and c2 = %d",
                                              KEYSPACE, table, 8, 1, 3), ConsistencyLevel.ALL);

            coordinator.execute(String.format("DELETE FROM %s.%s WHERE key = %d and c1 = %d and c2 > 1",
                                              KEYSPACE, table, 6, 2, 4), ConsistencyLevel.ALL);

            ResultsRecorder recorder = new ResultsRecorder();
            runQueries(coordinator, recorder, new String[] {
            String.format("SELECT * FROM %s.%s", KEYSPACE, table),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 = %d",
                          KEYSPACE, table, partitions - 3, rowsPerPartition - 2),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 = %d",
                          KEYSPACE, table, partitions - 1, rowsPerPartition - 5),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 > %d",
                          KEYSPACE, table, partitions - 8, rowsPerPartition - 3),

            String.format("SELECT * FROM %s.%s WHERE key = %d",
                          KEYSPACE, table, 7),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 = %d",
                          KEYSPACE, table, 7, 2),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 = %d",
                          KEYSPACE, table, 8, 1),

            String.format("SELECT c1, c2 FROM %s.%s WHERE key = %d and c1 = %d",
                          KEYSPACE, table, 8, 1),

            String.format("SELECT c1, c2 FROM %s.%s WHERE key = %d and c1 = %d",
                          KEYSPACE, table, 8, 1),

            String.format("SELECT c1, c2 FROM %s.%s WHERE key = %d and c1 = %d",
                          KEYSPACE, table, 4, 1),

            String.format("SELECT c1, c2 FROM %s.%s WHERE key = %d",
                          KEYSPACE, table, 6),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 > %d",
                          KEYSPACE, table, 0, 1),

            String.format("SELECT * FROM %s.%s WHERE key = %d",
                          KEYSPACE, table, partitions - (additionalParititons - 2)),

            String.format("SELECT * FROM %s.%s WHERE key = %d and c1 > %d",
                          KEYSPACE, table, partitions - (additionalParititons - 3), 4)

            });

            // drop compact storage on remaining node and check result
            cluster.schemaChange(String.format("ALTER TABLE %s.%s DROP COMPACT STORAGE", KEYSPACE, table), 2);
            recorder.validateResults(cluster, 1);
            recorder.validateResults(cluster, 2);
        }).run();
    }

    private void runQueries(ICoordinator coordinator, ResultsRecorder helper, String[] queries)
    {
        for (String query : queries)
            helper.addResult(query, coordinator.execute(query, ConsistencyLevel.ALL));
    }

    public static class ResultsRecorder
    {
        final private Map<String, Object[][]> preUpgradeResults = new HashMap<>();

        public void addResult(String query, Object[][] results)
        {
            preUpgradeResults.put(query, results);
        }

        public Map<String, Object[][]> queriesAndResults()
        {
            return preUpgradeResults;
        }

        public void validateResults(UpgradeableCluster cluster, int node)
        {
            validateResults(cluster, node, ConsistencyLevel.ALL);
        }

        public void validateResults(UpgradeableCluster cluster, int node, ConsistencyLevel cl)
        {
            for (Map.Entry<String, Object[][]> entry : queriesAndResults().entrySet())
            {
                Object[][] postUpgradeResult = cluster.coordinator(node).execute(entry.getKey(), cl);
                assertRows(postUpgradeResult, entry.getValue());
            }

        }
    }
}


text:
(() => {

    'use strict';

    const gulp = require('gulp');
    const jasmine = require('gulp-jasmine');

    gulp.task('test-promise', () => gulp.src('spec/promise.js')
        .pipe(jasmine()));

})();


text:
define(function() {
  /**
   * fnBind is a super small [bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) polyfill.
   *
   * @access private
   * @function fnBind
   * @param {function} fn - a function you want to change `this` reference to
   * @param {object} that - the `this` you want to call the function with
   * @returns {function} The wrapped version of the supplied function
   */

  function fnBind(fn, that) {
    return function() {
      return fn.apply(that, arguments);
    };
  }

  return fnBind;
});


text:
/* globals chrome */
'use strict';

/**
 * Very lightweight utility class relating to the chrome apis.
 */

/**
 * @return {boolean} true if chrome.runtime.lastError is set, else false
 */
exports.wasError = function() {
  if (chrome.runtime.lastError) {
    return true;
  } else {
    return false;
  }
};

/**
 * @return {chrome.runtime} returns chrome.runtime
 */
exports.getRuntime = function() {
  return chrome.runtime;
};

/**
 * @return {string} the value of chrome.runtime.lastError. Does not guarantee
 * that this value is set.
 */
exports.getError = function() {
  return chrome.runtime.lastError;
};

/**
 * @return {chrome.filesystem} returns the chrome.filesystem object.
 */
exports.getFileSystem = function() {
  return chrome.fileSystem;
};

/**
 * @return {StorageArea} chrome.storage.local
 */
exports.getStorageLocal = function() {
  return chrome.storage.local;
};

/**
 * @return {chrome.sockets.udp}
 */
exports.getUdp = function() {
  return chrome.sockets.udp;
};

/**
 * This is a complicated function to understand. The need for it arises from
 * the fact that we are trying to mirror the Chrome API. Several of its
 * functions include optional parameters, which complicates just passing in
 * positional arguments directly. To circumvent this issue, we can use the
 * apply() argument to make the call with the exact arguments.
 *
 * Complicating this is that most of the calls also accept a callback
 * parameter. Since we want to Promise-ify the calls and account for errors,
 * this leads to a lot of boiler plate code. This method takes care of all of
 * this.
 *
 * It takes a function and an an arguments object. The function's last
 * parameter is expected to be a function callback. The returned Promise
 * resolves when this function is evoked and rejects if
 * chrome.runtime.lastError indicates that there was an error.
 *
 * @param {function} fn function that accepts a callback as its last parameter
 * @param {arguments} callArgs the arguments object with which fn should be
 * invoked
 *
 * @return {Promise.<any, Error>} Promise that resolves with the result to the
 * callback parameter or rejects with an Error.
 */
exports.applyArgsCheckLastError = function(fn, callArgs) {
  return new Promise(function(resolve, reject) {
    console.log('fn in apply: ', fn);
    console.log('callArgs: ', callArgs);
    // Some of these parameters are "optional", which it seems like the
    // sendMessage function interprets based on type, etc. Rather than passing
    // directly, we are going to pass the arguments variable directly, adding a
    // callback function.
    let args = Array.prototype.slice.call(callArgs);
    args.push(function(response) {
      if (exports.wasError()) {
        reject(exports.getError());
      } else {
        resolve(response);
      }
    });
    console.log('going to apply');
    fn.apply(null, args);
  });
};


text:
package org.genericsystem.cv;

import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;

import javafx.scene.image.ImageView;
import javafx.scene.layout.GridPane;

import org.genericsystem.cv.lm.LevenbergImpl;
import org.genericsystem.cv.utils.Line;
import org.genericsystem.cv.utils.NativeLibraryLoader;
import org.genericsystem.cv.utils.Ransac;
import org.genericsystem.cv.utils.Ransac.Model;
import org.genericsystem.cv.utils.Tools;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfPoint2f;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.core.Size;
import org.opencv.imgproc.Imgproc;
import org.opencv.utils.Converters;
import org.opencv.videoio.VideoCapture;

public class LinesDetector6 extends AbstractApp {

	static {
		NativeLibraryLoader.load();
	}

	public static void main(String[] args) {
		launch(args);
	}

	private final VideoCapture capture = new VideoCapture(0);
	private ScheduledExecutorService timer = Executors.newSingleThreadScheduledExecutor();
	private Point vp = new Point(0, 0);

	@Override
	protected void fillGrid(GridPane mainGrid) {
		Mat frame = new Mat();
		capture.read(frame);
		ImageView frameView = new ImageView(Tools.mat2jfxImage(frame));
		mainGrid.add(frameView, 0, 0);
		ImageView deskewedView = new ImageView(Tools.mat2jfxImage(frame));
		mainGrid.add(deskewedView, 0, 1);
		Mat dePerspectived = frame.clone();

		if (Lines.K == null) {
			Lines.K = new Mat(3, 3, CvType.CV_64FC1, new Scalar(0));
			Lines.K.put(0, 0, frame.width());
			Lines.K.put(0, 2, frame.width() / 2);
			Lines.K.put(1, 1, frame.height());
			Lines.K.put(1, 2, frame.height() / 2);
			Lines.K.put(2, 2, 1);
		}
		timer.scheduleAtFixedRate(() -> {
			try {
				capture.read(frame);
				Img grad = new Img(frame, false).morphologyEx(Imgproc.MORPH_GRADIENT, Imgproc.MORPH_ELLIPSE, new Size(2, 2)).otsu().morphologyEx(Imgproc.MORPH_CLOSE, Imgproc.MORPH_ELLIPSE, new Size(7, 7));
				Lines lines = new Lines(grad.houghLinesP(1, Math.PI / 180, 10, 100, 10));
				if (lines.size() > 10) {
					lines.draw(frame, new Scalar(0, 0, 255));
					frameView.setImage(Tools.mat2jfxImage(frame));
					Mat vpCalib = calibrate(Converters.vector_double_to_Mat(Arrays.asList(vp.x, vp.y, 1d)));

					LevenbergImpl<Line> fitHost = new LevenbergImpl<>((datas, params) -> {
						Mat lineMat = Lines.getLineMat(datas);
						double di = params[0] * lineMat.get(0, 0)[0] + params[1] * lineMat.get(1, 0)[0] + params[2] * lineMat.get(2, 0)[0];
						di /= (Math.sqrt(params[0] * params[0] + params[1] * params[1] + params[2] * params[2]) * Core.norm(lineMat));
						return di * di;
					}, lines.getLines(), new double[] { vpCalib.get(0, 0)[0], vpCalib.get(1, 0)[0], vpCalib.get(2, 0)[0] });
					double[] newVp = fitHost.getParams();
					Mat result = unCalibrate(Converters.vector_double_to_Mat(Arrays.asList(newVp[0], newVp[1], newVp[2])));
					vp = new Point(result.get(0, 0)[0], result.get(1, 0)[0]);

					System.out.println("vp = " + vp);
					Point bary = new Point(frame.width() / 2, frame.height() / 2);
					Mat homography = findHomography(vp, bary, frame.width(), frame.height());
					Imgproc.warpPerspective(frame, dePerspectived, homography, frame.size(), Imgproc.INTER_LINEAR, Core.BORDER_REPLICATE, Scalar.all(255));
					deskewedView.setImage(Tools.mat2jfxImage(dePerspectived));

				} else
					System.out.println("Not enough lines : " + lines.size());

			} catch (Throwable e) {
				e.printStackTrace();
			}

		}, 33, 250, TimeUnit.MILLISECONDS);

	}

	public static Mat calibrate(Mat uncalibrated) {
		Mat dst = new Mat();
		Core.gemm(Lines.K.inv(), uncalibrated, 1, new Mat(), 0, dst);
		Core.normalize(dst, dst);
		return dst;
	}

	public static Mat unCalibrate(Mat calibrated) {
		Mat dst = new Mat();
		Core.gemm(Lines.K, calibrated, 1, new Mat(), 0, dst);
		if (dst.get(2, 0)[0] != 0) {
			dst.put(0, 0, dst.get(0, 0)[0] / dst.get(2, 0)[0]);
			dst.put(1, 0, dst.get(1, 0)[0] / dst.get(2, 0)[0]);
			dst.put(2, 0, 1d);
		}
		return dst;
	}

	public Point[] rotate(Point bary, double alpha, Point... p) {
		Mat matrix = Imgproc.getRotationMatrix2D(bary, alpha / Math.PI * 180, 1);
		MatOfPoint2f results = new MatOfPoint2f();
		Core.transform(new MatOfPoint2f(p), results, matrix);
		return results.toArray();
	}

	private Mat findHomography(Point vp, Point bary, double width, double height) {

		double alpha_ = Math.atan2((vp.y - bary.y), (vp.x - bary.x));
		if (alpha_ < -Math.PI / 2 && alpha_ > -Math.PI)
			alpha_ = alpha_ + Math.PI;
		if (alpha_ < Math.PI && alpha_ > Math.PI / 2)
			alpha_ = alpha_ - Math.PI;
		double alpha = alpha_;

		Point rotatedVp = rotate(bary, alpha, vp)[0];

		Point A = new Point(0, 0);
		Point B = new Point(width, 0);
		Point C = new Point(width, height);
		Point D = new Point(0, height);

		Point AB2 = new Point(width / 2, 0);
		Point CD2 = new Point(width / 2, height);

		Point A_, B_, C_, D_;
		if (rotatedVp.x >= width / 2) {
			A_ = new Line(AB2, rotatedVp).intersection(0);
			D_ = new Line(CD2, rotatedVp).intersection(0);
			C_ = new Line(A_, bary).intersection(new Line(CD2, rotatedVp));
			B_ = new Line(D_, bary).intersection(new Line(AB2, rotatedVp));
		} else {
			B_ = new Line(AB2, rotatedVp).intersection(width);
			C_ = new Line(CD2, rotatedVp).intersection(width);
			A_ = new Line(C_, bary).intersection(new Line(AB2, rotatedVp));
			D_ = new Line(B_, bary).intersection(new Line(CD2, rotatedVp));
		}

		System.out.println("vp : " + vp);
		System.out.println("rotated vp : " + rotatedVp);
		System.out.println("Alpha : " + alpha * 180 / Math.PI);
		// System.out.println("A : " + A + " " + A_);
		// System.out.println("B : " + B + " " + B_);
		// System.out.println("C : " + C + " " + C_);
		// System.out.println("D : " + D + " " + D_);

		return Imgproc.getPerspectiveTransform(new MatOfPoint2f(rotate(bary, -alpha, A_, B_, C_, D_)), new MatOfPoint2f(A, B, C, D));
	}

	public static class Lines extends org.genericsystem.cv.utils.Lines {

		private static Mat K;

		public Lines(Mat src) {
			super(src);
		}

		public Lines(Collection<Line> lines) {
			super(lines);
		}

		public static Lines of(Collection<Line> lines) {
			return new Lines(lines);
		}

		public static void calibrate(Mat uncalibrate) {
			Core.gemm(Lines.K.inv(), uncalibrate, 1, new Mat(), 0, uncalibrate);
			Core.normalize(uncalibrate, uncalibrate);
		}

		public static Mat uncalibrate(Mat calibrated) {
			Mat uncalibrate = new Mat(3, 1, CvType.CV_64FC1);
			Core.gemm(Lines.K, calibrated, 1, new Mat(), 0, uncalibrate);
			if (uncalibrate.get(2, 0)[0] != 0) {
				uncalibrate.put(0, 0, uncalibrate.get(0, 0)[0] / uncalibrate.get(2, 0)[0]);
				uncalibrate.put(1, 0, uncalibrate.get(1, 0)[0] / uncalibrate.get(2, 0)[0]);
				uncalibrate.put(2, 0, 1);
			}
			return uncalibrate;
		}

		private static Mat getLineMat(Line line) {
			Mat a = new Mat(3, 1, CvType.CV_64FC1);
			Mat b = new Mat(3, 1, CvType.CV_64FC1);
			a.put(0, 0, line.getX1());
			a.put(1, 0, line.getY1());
			a.put(2, 0, 1d);
			b.put(0, 0, line.getX2());
			b.put(1, 0, line.getY2());
			b.put(2, 0, 1d);
			Mat an = new Mat(3, 1, CvType.CV_64FC1);
			Mat bn = new Mat(3, 1, CvType.CV_64FC1);
			Core.gemm(K.inv(), a, 1, new Mat(), 0, an);
			Core.gemm(K.inv(), b, 1, new Mat(), 0, bn);
			Mat li = an.cross(bn);
			Core.normalize(li, li);
			a.release();
			b.release();
			an.release();
			bn.release();
			return li;
		}

		public Ransac<Line> vanishingPointRansac(double width, double height) {
			int minimal_sample_set_dimension = 2;
			double maxError = (float) 0.01623 * 2;
			if (K == null) {
				K = new Mat(3, 3, CvType.CV_64FC1, new Scalar(0));
				K.put(0, 0, width);
				K.put(0, 2, width / 2);
				K.put(1, 1, height);
				K.put(1, 2, height / 2);
				K.put(2, 2, 1d);
			}
			return new Ransac<>(getLines(), getModelProvider(minimal_sample_set_dimension, maxError), minimal_sample_set_dimension, 100, maxError, Double.valueOf(Math.floor(this.size() * 0.7)).intValue());
		}

		private Function<Collection<Line>, Model<Line>> getModelProvider(int minimal_sample_set_dimension, double maxError) {
			return datas -> {
				Mat[] vp = new Mat[1];
				if (datas.size() == minimal_sample_set_dimension) {
					Iterator<Line> it = datas.iterator();
					vp[0] = getLineMat(it.next()).cross(getLineMat(it.next()));
					Core.normalize(vp[0], vp[0]);
				} else {
					// Extract the line segments corresponding to the indexes contained in the set
					Mat li_set = new Mat(3, datas.size(), CvType.CV_64FC1);
					Mat tau = new Mat(datas.size(), datas.size(), CvType.CV_64FC1, new Scalar(0, 0, 0));
					int i = 0;
					for (Line line : datas) {
						Mat li = getLineMat(line);
						li_set.put(0, i, li.get(0, 0));
						li_set.put(1, i, li.get(1, 0));
						li_set.put(2, i, li.get(2, 0));
						tau.put(i, i, line.size());
						i++;
					}

					// Least squares solution
					// Generate the matrix ATA (from LSS_set=A)
					Mat L = li_set.t();
					Mat ATA = new Mat(3, 3, CvType.CV_64FC1);
					Mat dst = new Mat();

					Core.gemm(L.t(), tau.t(), 1, new Mat(), 0, dst);
					Core.gemm(dst, tau, 1, new Mat(), 0, dst);
					Core.gemm(dst, L, 1, new Mat(), 0, ATA);

					// Obtain eigendecomposition
					Mat v = new Mat();
					Core.SVDecomp(ATA, new Mat(), v, new Mat());

					// Check eigenvecs after SVDecomp
					if (v.rows() < 3)
						throw new IllegalStateException();

					// Assign the result (the last column of v, corresponding to the eigenvector with lowest eigenvalue)
					vp[0] = new Mat(3, 1, CvType.CV_64FC1);
					vp[0].put(0, 0, v.get(0, 2));
					vp[0].put(1, 0, v.get(1, 2));
					vp[0].put(2, 0, v.get(2, 2));
					Core.normalize(vp[0], vp[0]);
					vp[0] = uncalibrate(vp[0]);
				}

				return new Model<Line>() {
					@Override
					public double computeError(Line line) {
						Mat lineMat = getLineMat(line);
						double di = vp[0].dot(lineMat);
						di /= (Core.norm(vp[0]) * Core.norm(lineMat));
						return di * di;
					}

					@Override
					public double computeGlobalError(List<Line> datas, Collection<Line> consensusDatas) {
						double globalError = 0;
						for (Line line : datas) {
							double error = computeError(line);
							if (error > maxError)
								error = maxError;
							globalError += error;
						}
						globalError = globalError / datas.size();
						return globalError;
					}

					@Override
					public Object[] getParams() {
						return new Object[] { vp[0] };
					}

				};
			};
		}
	}

	@Override
	public void stop() throws Exception {
		super.stop();
		timer.shutdown();
		timer.awaitTermination(5000, TimeUnit.MILLISECONDS);
		capture.release();
	}

}


text:
<?php
/**
 * @var $map Hugeit_Maps_Map
 */

?>

        <img src="<?php echo HUGEIT_MAPS_IMAGES_URL.'menu-icons/polyline.svg'; ?>" width="20" />
        <?php _e( 'Polylines', 'hugeit_maps' ); ?>

?

<?php _e( 'Continuous line composed of one or more line segments, which creates specific track. Right click on the map to add point. Hold pressed and drag to move it. Left click to remove it.', 'hugeit_maps' ); ?>

            <form action="" method="post">
                +<?php _e( 'Add New Polyline', 'hugeit_maps' ); ?>

                    ◄ <?php _e( 'Back', 'hugeit_maps' ); ?>

                            <?php _e( 'Name', 'hugeit_maps' ); ?>
                            <input type="text" id="polyline_name" name="polyline_name"/>

                            <?php _e( 'data', 'hugeit_maps' ); ?>
                            <textarea id="polyline_coords" class="polycoords" name="polyline_coords" readonly="readonly"
                                      placeholder="<?php _e( 'Right click on the map to add point. Hold pressed and drag to move it. Left click to remove it.', 'hugeit_maps' ); ?>"></textarea>

                            <?php _e( 'Line Transparency', 'hugeit_maps' ); ?>

                                <input type="text" name="polyline_line_opacity" id="polyline_line_opacity"
                                       class="polyline_options_input" data-slider-highlight="true"
                                       data-slider-values="0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1" data-slider="true"
                                       value="0.9"/>
                                0.9

                            <?php _e( 'Line Color', 'hugeit_maps' ); ?>
                            <input type="text" class="jscolor polyline_options_input" name="polyline_line_color"
                                   id="polyline_line_color" value="18A326"/>

                            <?php _e( 'Line Width', 'hugeit_maps' ); ?>

                                <input type="text" name="polyline_line_width" class="polyline_options_input " id="polyline_line_width"
                                       data-slider-highlight="true" data-slider-values="<?php echo implode( ',', range( 0, 50 ) ); ?>" data-slider="true" value="5"/>
                                5

                            <?php _e( 'On-Hover Line Color', 'hugeit_maps' ); ?>
                            <input disabled type="text" class="jscolor polyline_options_input" name="hover_polyline_line_color"
                                   id="hover_polyline_line_color" value="11A000"/>

                            <?php _e( 'On-Hover Line Transparency', 'hugeit_maps' ); ?>

                                <input disabled type="text" name="hover_polyline_line_opacity" class="polyline_options_input "
                                       id="hover_polyline_line_opacity" data-slider-highlight="true"
                                       data-slider-values="0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1" data-slider="true"
                                       value="0.5"/>
                                0.5

                        <input type="submit" class="button-primary" id="polyline_submit" name="polyline_submit" value="<?php _e( 'Save', 'hugeit_maps' ); ?>"/>
                        <?php _e( 'Cancel', 'hugeit_maps' ); ?>

            </form>

<?php _e( 'ID', 'hugeit_maps' ); ?>

<?php _e( 'Title', 'hugeit_maps' ); ?>

<?php _e( 'Action', 'hugeit_maps' ); ?>

                <?php

                $polylines = Hugeit_Maps_Query::get_polylines( array( 'map_id' => $map->get_id() ) );

                if( $polylines ){
                    ?>

                        <?php
                        foreach( $polylines as $i=>$polyline ){
                            ?>
                            <li class="edit_list" data-list_id="<?php echo $polyline->get_id(); ?>">

<?php echo $i; ?>

<?php echo $polyline->get_name(); ?>

                                    <form class="edit_list_delete_form" method="post" action="">
                                        <input type="submit" class="button edit_list_delete_submit" name="edit_list_delete_submit"
                                               value="x"/>
                                        <input type="hidden" class="edit_list_delete_type" name="edit_list_delete_type"
                                               value="polyline"/>
                                        <input type="hidden" class="edit_list_delete_table" value="hugeit_maps_polylines"/>
                                        <input type="hidden" name="delete_polyline_id" class="edit_list_delete_id"
                                               value="<?php echo $polyline->get_id() ?>"/>
                                    </form>

                                    <input type="hidden" class="polyline_edit_id" name="polyline_edit_id" value="<?php echo $polyline->get_id(); ?>" />

                            <?php
                        }
                        ?>

                    <?php
                }else{
                    echo "
".__('You have 0 polylines on this map','hugeit_maps')."
";
                }
                ?>

            <form action="" method="post">
                <input type="hidden" id="polyline_get_id" name="polyline_get_id"/>

                    ◄ <?php _e( 'Back', 'hugeit_maps' ); ?>

                            <?php _e( 'Name', 'hugeit_maps' ); ?>
                            <input type="text" id="polyline_edit_name" name="polyline_edit_name"/>

                            <?php _e( 'data', 'hugeit_maps' ); ?>
                            <textarea id="polyline_edit_coords" class="polycoords" name="polyline_edit_coords" readonly="readonly"
                                      placeholder="<?php _e( 'Right click on the map to add point. Hold pressed and drag to move it. Left click to remove it.', 'hugeit_maps' ); ?>"></textarea>

                            <?php _e( 'Line Transparency', 'hugeit_maps' ); ?>

                                <input type="text" name="polyline_edit_line_opacity" id="polyline_edit_line_opacity"
                                       class="polyline_edit_options_input" data-slider-highlight="true"
                                       data-slider-values="0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1" data-slider="true"
                                       value="0.9"/>
                                0.9

                            <?php _e( 'Line Color', 'hugeit_maps' ); ?>
                            <input type="text" class="jscolor polyline_edit_options_input" name="polyline_edit_line_color"
                                   id="polyline_edit_line_color" value="FF0F0F"/>

                            <?php _e( 'Line Width', 'hugeit_maps' ); ?>

                                <input type="text" name="polyline_edit_line_width" class="polyline_edit_options_input "
                                       id="polyline_edit_line_width" data-slider-highlight="true"
                                       data-slider-values="<?php echo implode( ',', range( 0, 50 ) ); ?>" data-slider="true" value="5"/>
                                5

                            <?php _e( 'On-Hover Line Color', 'hugeit_maps' ); ?>
                            <input disabled type="text" class="jscolor polyline_options_input" name="hover_polyline_edit_line_color"
                                   id="hover_polyline_edit_line_color"/>

                            <?php _e( 'On-Hover Line Transparency', 'hugeit_maps' ); ?>

                                <input disabled type="text" name="hover_polyline_edit_line_opacity" class="polyline_options_input "
                                       id="hover_polyline_edit_line_opacity" data-slider-highlight="true"
                                       data-slider-values="0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1" data-slider="true"/>

                        <input type="submit" class="button-primary" id="polyline_edit_submit" name="polyline_edit_submit" value="<?php _e( 'Save', 'hugeit_maps' ); ?>"/>
                        <?php _e( 'Cancel', 'hugeit_maps' ); ?>

            </form>


text:
{% extends "account/base.html" %}
{% load staticfiles %}
{% load static %}

{% block mainContent %}

Vous êtes déjà membre premium

		        Nous vous remercions pour la confiance que vous placez en notre service.

		        N'hésitez pas à nous faire part de vos idées, suggestions, ou remarques, pour nous aider à mieux répondre à vos besoins.

	             Contacter

{% endblock %}


text:
<?xml version="1.0" encoding="UTF-8"?>

<recipeml version="0.5">
  <recipe>
    <head>
      <title>Baked Chicken in Spicy Tomato and Grilled Pepper Sauce</title>
      <categories>
        <cat>None</cat></categories>
      <yield>1</yield></head>
    <ingredients>
      <ing>
        <amt>
          <qty>3</qty>
          <unit>large</unit></amt>
        <item>Green bell peppers</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>large</unit></amt>
        <item>Red bell pepper</item></ing>
      <ing>
        <amt>
          <qty>3</qty>
          <unit/></amt>
        <item>Jalapeno peppers</item></ing>
      <ing>
        <amt>
          <qty>5</qty>
          <unit/></amt>
        <item>Garlic cloves; peeled</item></ing>
      <ing>
        <amt>
          <qty>1/2</qty>
          <unit>cups</unit></amt>
        <item>Small cilantro sprigs</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>can</unit></amt>
        <item>(28-ounce) and 1 (14 1/2-ounce) can plum tomatoes; drained</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>tablespoon</unit></amt>
        <item>Olive oil</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit/></amt>
        <item>Tablepoon paprika; divided use</item></ing>
      <ing>
        <amt>
          <qty>2 1/4</qty>
          <unit>teaspoons</unit></amt>
        <item>Ground cumin; divided use</item></ing>
      <ing>
        <amt>
          <qty/>
          <unit/></amt>
        <item>Salt and freshly ground black pepper</item></ing>
      <ing>
        <amt>
          <qty/>
          <unit/></amt>
        <item>Optional: pinch of cayenne pepper</item></ing>
      <ing>
        <amt>
          <qty>4 1/2</qty>
          <unit>pounds</unit></amt>
        <item>Chicken pieces; skin removed</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>large</unit></amt>
        <item>Onion; halved and sliced</item></ing>
      <ing>
        <amt>
          <qty/>
          <unit/></amt>
        <item>Cilantro sprigs for garnish</item></ing></ingredients>
    <directions>
      <step>  Notes: From Orange County Register

  1. Broil green and red bell peppers, turning every 4-5 minutes, until their
  skins are blistered and charred, a total of about 20 minutes. Meanwhile,
  broil jalapeno peppers, turning often, about 5 minutes in all. Transfer
  peppers to a bowl and cover; or put in plastic or paper bag and close bag.
  Let stand 10 minutes.

  2. Meanwhile, mince garlic in a food processor, add cilantro sprigs, and
  mince together. Add tomatoes and chop coarsely by pulsing.

  3. Peel the jalapeno and bell peppers using a paring knife. (Wear gloves
  when handling jalapeno peppers if your skin is sensitive. Be careful not to
  touch eyes or face.) Halve the peppers; discard the seeds and ribs. Cut
  bell peppers into 1/2-inch dice. Chop jalapeno peppers. Preheat oven to 400
  degrees.

  4. In a medium saute pan, warm the olive oil over low heat. Add 1 1/2
  teaspoons of the paprika and 3/4 teaspoon of the cumin and mix well. Stir
  in tomato-garlic mixture, jalapeno and bell peppers and salt and pepper.
  Bring sauce to a simmer. Cook uncovered over medium heat, stirring often,
  10 minutes or until sauce thickens. Taste and adjust the seasoning; add
  cayenne pepper if desired.

  5. Put chicken pieces in shallow roasting pan large enough to hold them in
  1 layer. Season them on both sides with salt, pepper, remaining 1 1/2
  teaspoons cumin, and remaining 1 1/2 teaspoons paprika. Rub spices into
  chicken pieces. Top chicken with sliced onion.

  6. Cover chicken with foil and bake 30 minutes. Uncover, turn pieces over,
  and bake 20 minutes. Add one-third cup hot water to pan juices. Spoon
  pepper sauce over the chicken. Bake, uncovered, basting once or twice,
  about 15-25 minutes or until chicken is tender and juices run clear when
  thickest part of a thigh piece is pierced with sharp knife. Serve chicken
  with sauce; garnish with cilantro sprigs.

  Yield: 6 servings

  Nutritional information (per serving): 414 calories, 10.7 grams fat, 2.3
  grams saturated fat, 61 milligrams cholesterol, 623 milligrams sodium, 23
  percent calories from fat

  Source: "The Low-Fat Jewish Cookbook"

  Posted to recipelu-digest by ncanty@juno.com (Nadia I Canty) on Mar 28,
  1998

</step></directions></recipe></recipeml>


text:
if(NOT MSVC)
  message(FATAL_ERROR "CRT options are available only for MSVC")
endif()

if (WINRT)
  if (CMAKE_SYSTEM_VERSION MATCHES 10)
    add_definitions(/DWINVER=_WIN32_WINNT_WIN10 /DNTDDI_VERSION=NTDDI_WIN10 /D_WIN32_WINNT=_WIN32_WINNT_WIN10)
  elseif(CMAKE_SYSTEM_VERSION MATCHES 8.1)
    add_definitions(/DWINVER=_WIN32_WINNT_WINBLUE /DNTDDI_VERSION=NTDDI_WINBLUE /D_WIN32_WINNT=_WIN32_WINNT_WINBLUE)
  else()
    add_definitions(/DWINVER=_WIN32_WINNT_WIN8 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=_WIN32_WINNT_WIN8)
  endif()
endif()

# Removing LNK4075 warnings for debug WinRT builds
# "LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification"
# "LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification"
if(MSVC AND WINRT)
  # Optional verification checks since we don't know existing contents of variables below
  string(REPLACE "/OPT:ICF " "/OPT:NOICF " CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/OPT:REF " "/OPT:NOREF " CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL:YES " "/INCREMENTAL:NO " CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL " "/INCREMENTAL:NO " CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")

  string(REPLACE "/OPT:ICF " "/OPT:NOICF " CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/OPT:REF " "/OPT:NORE F" CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL:YES " "/INCREMENTAL:NO " CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL " "/INCREMENTAL:NO " CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")

  string(REPLACE "/OPT:ICF " "/OPT:NOICF " CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/OPT:REF " "/OPT:NOREF " CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL:YES " "/INCREMENTAL:NO " CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL " "/INCREMENTAL:NO " CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")

  # Mandatory
  set(CMAKE_MODULE_LINKER_FLAGS_DEBUG  "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF")
  set(CMAKE_EXE_LINKER_FLAGS_DEBUG     "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF")
  set(CMAKE_SHARED_LINKER_FLAGS_DEBUG  "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF")
endif()

# Ignore warning: This object file does not define any previously undefined public symbols, ...
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221")

if(NOT BUILD_SHARED_LIBS AND BUILD_WITH_STATIC_CRT)
  foreach(flag_var
          CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
          CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
          CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
          CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
    if(${flag_var} MATCHES "/MD")
      string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
    endif()
    if(${flag_var} MATCHES "/MDd")
      string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}")
    endif()
  endforeach(flag_var)

  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:atlthunk.lib")
  set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:msvcrt.lib")
  set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:libcpmtd.lib /NODEFAULTLIB:msvcrtd.lib")
else()
  foreach(flag_var
          CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
          CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
          CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
          CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
    if(${flag_var} MATCHES "/MT")
      string(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}")
    endif()
    if(${flag_var} MATCHES "/MTd")
      string(REGEX REPLACE "/MTd" "/MDd" ${flag_var} "${${flag_var}}")
    endif()
  endforeach(flag_var)
endif()

if(CMAKE_VERSION VERSION_GREATER "2.8.6")
  include(ProcessorCount)
  ProcessorCount(N)
  if(NOT N EQUAL 0)
    SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   /MP${N} ")
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${N} ")
  endif()
endif()

if(NOT BUILD_WITH_DEBUG_INFO AND NOT MSVC)
  string(REPLACE "/debug" "" CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/DEBUG" "" CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL:YES" "/INCREMENTAL:NO" CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL " "/INCREMENTAL:NO " CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")

  string(REPLACE "/debug" "" CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/DEBUG" "" CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL:YES" "/INCREMENTAL:NO" CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL " "/INCREMENTAL:NO " CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG}")

  string(REPLACE "/debug" "" CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/DEBUG" "" CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL:YES" "/INCREMENTAL:NO" CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
  string(REPLACE "/INCREMENTAL " "/INCREMENTAL:NO " CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")

  string(REPLACE "/Zi" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
  string(REPLACE "/Zi" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
endif()


text:
'use strict';

//Setting up route
angular.module('thelinks').config(['$stateProvider',
	function($stateProvider) {
		// Thelinks state routing
		$stateProvider.
		state('thelinks', {
			url: '/thelinks',
			templateUrl: 'modules/thelinks/views/thelinks.client.view.html'
		}).
		state('listThelinks', {
			url: '/thelinks',
			templateUrl: 'modules/thelinks/views/list-thelinks.client.view.html'
		}).
		state('createThelink', {
			url: '/thelinks/create',
			templateUrl: 'modules/thelinks/views/create-thelink.client.view.html'
		}).
		state('viewThelink', {
			url: '/thelinks/:thelinkId',
			templateUrl: 'modules/thelinks/views/view-thelink.client.view.html'
		}).
		state('editThelink', {
			url: '/thelinks/:thelinkId/edit',
			templateUrl: 'modules/thelinks/views/edit-thelink.client.view.html'
		});
	}
]);


text:
package javax.xml.bind;

/**
 * This event indicates that a problem was encountered resolving an ID/IDREF.
 *
 *
 * @author

Ryan Shoemaker, Sun Microsystems, Inc.

Kohsuke Kawaguchi, Sun Microsystems, Inc.

Joe Fialli, Sun Microsystems, Inc.

 * @see Validator
 * @see ValidationEventHandler
 * @since JAXB1.0
 */
public interface NotIdentifiableEvent extends ValidationEvent {

}


text:
{% extends "aldryn_events/two_column.html" %}
{% load i18n aldryn_events cms_tags %}

{% block events_content %}
    {# INFO: if configuration is set, show ongoing events first #}
    {% if view.config.app_data.config.show_ongoing_first %}
        {% render_placeholder view.config.placeholder_events_list_top_ongoing %}

            {% regroup ongoing_objects by start_date as ongoing_objects_grouped %}
            {% for event in ongoing_objects_grouped %}

{{ event.start_date|date:"l, j F o" }}

                {% include "aldryn_events/includes/event.html" with is_ongoing_events="true" %}
            {% empty %}

{% trans "No items available" %}

            {% endfor %}

    {% endif %}

    {# INFO: show upcoming events #}
    {% render_placeholder view.config.placeholder_events_list_top %}

        {% regroup page_obj.object_list|default:object_list by start_date as event_list_grouped %}
        {% for ev_group in event_list_grouped %}

{{ ev_group.grouper|date:"l, j F o" }}

            {% for event in ev_group.list %}
                {% include "aldryn_events/includes/event.html" with is_upcoming_events="true" %}
            {% endfor %}
        {% empty %}

{% trans "No items available" %}

        {% endfor %}

    {% render_placeholder view.config.placeholder_events_list_bottom %}

        {% include "aldryn_events/includes/pagination.html" %}

{% endblock events_content %}

{% block events_sidebar %}
    {% get_current_language as language %}

        {% calendar event_year event_month language view.namespace %}

{% endblock events_sidebar %}


text:
/**
 * The Util service is for thin, globally reusable, utility functions
 */

export default class Utils {

    /**
     * Return hostname from url string
     *
     * @param  {String} url - the url to parse
     * @return {Function}
     */
    static extractHost(url:string){
        let hostname;

        if (url.indexOf("://") > -1) {
            hostname = url.split('/')[2];
        }
        else {
            hostname = url.split('/')[0];
        }

        hostname = hostname.split(':')[0];
        hostname = hostname.split('?')[0];

        return hostname;
    }

}


text:
namespace spvtools {
namespace opt {

// This pass implements local redundancy elimination. Its goal is to reduce the
// number of times the same value is computed. It works on each basic block
// independently, ie local. For each instruction in a basic block, it gets the
// value number for the result id, |id|, of the instruction. If that value
// number has already been computed in the basic block, it tries to replace the
// uses of |id| by the id that already contains the same value. Then the
// current instruction is deleted.
class LocalRedundancyEliminationPass : public Pass {
 public:
  const char* name() const override { return "local-redundancy-elimination"; }
  Status Process(ir::IRContext*) override;
  virtual ir::IRContext::Analysis GetPreservedAnalyses() override {
    return ir::IRContext::kAnalysisDefUse |
           ir::IRContext::kAnalysisInstrToBlockMapping |
           ir::IRContext::kAnalysisDecorations |
           ir::IRContext::kAnalysisCombinators | ir::IRContext::kAnalysisCFG |
           ir::IRContext::kAnalysisDominatorAnalysis |
           ir::IRContext::kAnalysisNameMap;
  }

 protected:
  // Deletes instructions in |block| whose value is in |value_to_ids| or is
  // computed earlier in |block|.
  //
  // |vnTable| must have computed a value number for every result id defined
  // in |bb|.
  //
  // |value_to_ids| is a map from value number to ids.  If {vn, id} is in
  // |value_to_ids| then vn is the value number of id, and the definition of id
  // dominates |bb|.
  //
  // Returns true if the module is changed.
  bool EliminateRedundanciesInBB(ir::BasicBlock* block,
                                 const ValueNumberTable& vnTable,
                                 std::map<uint32_t, uint32_t>* value_to_ids);
};

}  // namespace opt
}  // namespace spvtools

#endif  // LIBSPIRV_OPT_LOCAL_REDUNDANCY_ELIMINATION_H_


text:
package com.waimai.da.shockwave.web.service;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.jdbc.ScriptRunner;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 初始化时自动创建数据块表
 * Created by jsong on 2017/7/28.
 */
@Service
public class InitService extends BaseService implements InitializingBean, DisposableBean {

    private final DBService dbService;
    private final SqlSessionFactory factory;
    private final ConfigService configService;
    private final QuartzManagerService quartzManagerService;

    private static List<String> tableNames = new ArrayList<>();

    static {
        tableNames.add("t_shockwave_config");
        tableNames.add("t_shockwave_field_info");
        tableNames.add("t_shockwave_flush_back_execute");
        tableNames.add("t_shockwave_job_execute");
        tableNames.add("t_shockwave_job_info");
        tableNames.add("t_shockwave_job_sync");
        tableNames.add("t_shockwave_join_source");
        tableNames.add("t_shockwave_source");
        tableNames.add("t_shockwave_source_field_info");
        tableNames.add("t_shockwave_source_field_info");
        tableNames.add("t_shockwave_emitter_metrics");
    }

    @Autowired
    public InitService(
            DBService dbService,
            SqlSessionFactory factory,
            QuartzManagerService quartzManagerService,
            ConfigService configService) {
        this.factory = factory;
        this.dbService = dbService;
        this.quartzManagerService = quartzManagerService;
        this.configService = configService;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        // 开始调度任务
        quartzManagerService.initJob();
        quartzManagerService.initDataProducer();

        quartzManagerService.startJob();
        Boolean flag = false;
        for (String tableName : tableNames) {
            // 检查表是否存在
            boolean isExistence = dbService.isExistenceTable(tableName);
            flag = flag || isExistence;
        }
        if (!flag) {
            // 首次运行(全部不存在)则创建
            initTables();
            // 加载默认配置
            configService.initConfig();
        }
    }

    private void initTables() throws IOException {
        SqlSession session = factory.openSession();
        ScriptRunner runner = new ScriptRunner(session.getConnection());
        runner.setErrorLogWriter(null);
        runner.setLogWriter(null);
        runner.runScript(Resources.getResourceAsReader("db.sql"));
    }

    @Override
    public void destroy() throws Exception {
        // 停止调度
        quartzManagerService.shutdown();
    }
}


text:
<!DOCTYPE html>

<title>EaselJS: API Test</title>

<link href="assets/tricolore.css" rel="stylesheet" type="text/css"/>
<link href="assets/demoStyles.css" rel="stylesheet" type="text/css"/>

EaselJS API Test

This demo shows the usage of many of the visual APIs.


text:
#ifndef __NET_WIRELESS_REG_H
#define __NET_WIRELESS_REG_H

extern const struct ieee80211_regdomain __rcu *cfg80211_regdomain;

bool is_world_regdom(const char *alpha2);
bool reg_supported_dfs_region(u8 dfs_region);

int reg_device_uevent(struct device *dev, struct kobj_uevent_env *env);
void wiphy_regulatory_register(struct wiphy *wiphy);
void wiphy_regulatory_deregister(struct wiphy *wiphy);

int __init regulatory_init(void);
void regulatory_exit(void);

int set_regdom(const struct ieee80211_regdomain *rd);

bool reg_last_request_cell_base(void);

/**
 * regulatory_hint_found_beacon - hints a beacon was found on a channel
 * @wiphy: the wireless device where the beacon was found on
 * @beacon_chan: the channel on which the beacon was found on
 * @gfp: context flags
 *
 * This informs the wireless core that a beacon from an AP was found on
 * the channel provided. This allows the wireless core to make educated
 * guesses on regulatory to help with world roaming. This is only used for
 * world roaming -- when we do not know our current location. This is
 * only useful on channels 12, 13 and 14 on the 2 GHz band as channels
 * 1-11 are already enabled by the world regulatory domain; and on
 * non-radar 5 GHz channels.
 *
 * Drivers do not need to call this, cfg80211 will do it for after a scan
 * on a newly found BSS. If you cannot make use of this feature you can
 * set the wiphy->disable_beacon_hints to true.
 */
int regulatory_hint_found_beacon(struct wiphy *wiphy,
				 struct ieee80211_channel *beacon_chan,
				 gfp_t gfp);

/**
 * regulatory_hint_11d - hints a country IE as a regulatory domain
 * @wiphy: the wireless device giving the hint (used only for reporting
 *	conflicts)
 * @band: the band on which the country IE was received on. This determines
 *	the band we'll process the country IE channel triplets for.
 * @country_ie: pointer to the country IE
 * @country_ie_len: length of the country IE
 *
 * We will intersect the rd with the what CRDA tells us should apply
 * for the alpha2 this country IE belongs to, this prevents APs from
 * sending us incorrect or outdated information against a country.
 *
 * The AP is expected to provide Country IE channel triplets for the
 * band it is on. It is technically possible for APs to send channel
 * country IE triplets even for channels outside of the band they are
 * in but for that they would have to use the regulatory extension
 * in combination with a triplet but this behaviour is currently
 * not observed. For this reason if a triplet is seen with channel
 * information for a band the BSS is not present in it will be ignored.
 */
void regulatory_hint_11d(struct wiphy *wiphy,
			 enum ieee80211_band band,
			 const u8 *country_ie,
			 u8 country_ie_len);

/**
 * regulatory_hint_disconnect - informs all devices have been disconneted
 *
 * Regulotory rules can be enhanced further upon scanning and upon
 * connection to an AP. These rules become stale if we disconnect
 * and go to another country, whether or not we suspend and resume.
 * If we suspend, go to another country and resume we'll automatically
 * get disconnected shortly after resuming and things will be reset as well.
 * This routine is a helper to restore regulatory settings to how they were
 * prior to our first connect attempt. This includes ignoring country IE and
 * beacon regulatory hints. The ieee80211_regdom module parameter will always
 * be respected but if a user had set the regulatory domain that will take
 * precedence.
 *
 * Must be called from process context.
 */
void regulatory_hint_disconnect(void);

#endif  /* __NET_WIRELESS_REG_H */


text:
<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Login extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		$this->load->database();
		$this->load->library(array('ion_auth','form_validation'));
		$this->load->helper(array('url','language'));
		$this->form_validation->set_error_delimiters($this->config->item('error_start_delimiter', 'ion_auth'), $this->config->item('error_end_delimiter', 'ion_auth'));
		$this->lang->load('auth');
	}

		     //Registrar el usuario en
	function index()
	{
		$this->data['title'] = "Login";

			// Validar la entrada del formulario
		$this->form_validation->set_rules('identity', 'Identity', 'required');
		$this->form_validation->set_rules('password', 'Password', 'required');

		if ($this->form_validation->run() == true)
		{
			// Comprobar para ver si el usuario se está conectando
			// Comprobar si hay " recuérdame "

			$remember = (bool) $this->input->post('remember');
			$this->load->model('Login_Model');

			if ($this->Login_Model->login($this->input->post('identity'), $this->input->post('password'), $remember))
			{
				// Si el inicio de sesión se realiza correctamente
				// Redirigirlos volver a la página principal

				$this->session->set_flashdata('message', $this->Login_Model->messages());
				redirect('planilla', 'refresh');
			}
			else
			{
				// Si la entrada era un- éxito
				// Redirigirlos volver a la página de inicio de sesión

				$this->session->set_flashdata('message', $this->Login_Model->errors());
				redirect('login', 'refresh');
				//  se redirecciona en lugar de puntos de vista de carga para la compatibilidad con bibliotecas MY_Controller
			}
		}
		else
		{
			// El usuario no está registrando en la que aparezca la página de inicio de sesión
			// Establecer el mensaje de error de datos flash si hay uno

			$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');

			$this->data['identity'] = array('name' => 'identity',
				'id' => 'identity',
				'type' => 'text',
				'value' => $this->form_validation->set_value('identity'),
			);
			$this->data['password'] = array('name' => 'password',
				'id' => 'password',
				'type' => 'password',
			);

			if ($this->ion_auth->logged_in())
				//si esta logeado entonces no se podra ir de nuevo al login...
				redirect('planilla', 'refresh');
			else
				$this->_render_page('login', $this->data);

		}
	}

	//log the user out
	function salir()
	{
		$this->data['title'] = "Logout";

		//log the user out
		$logout = $this->ion_auth->logout();

		//redirect them to the login page
		$this->session->set_flashdata('message', $this->ion_auth->messages());
		redirect('login', 'refresh');
	}

	function _render_page($view, $data=null, $render=false)
	{

		$this->viewdata = (empty($data)) ? $this->data: $data;

		$view_html = $this->load->view($view, $this->viewdata, $render);

		if (!$render) return $view_html;
	}

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Serialized Form (flow 1.1.0 API)</title>
<meta name="date" content="2017-04-30">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Serialized Form

Package hr.caellian.flow.data

Class hr.caellian.flow.data.Property extends java.lang.Object implements Serializable

Serialization Methods

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException

Throws:

java.io.IOException - includes any I/O exceptions that may
                                occur.

java.lang.ClassNotFoundException - if the class for an object being restored
                                cannot be found.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException

Throws:

java.io.IOException - includes any I/O exceptions that may occur.

Package hr.caellian.flow.network.transfer

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes