text:
import os

from .conftest import load

TESTS = os.path.dirname(__file__)
ROOT = os.path.dirname(TESTS)

class TestImage:

    def test_get_visible_jpg(self, client):
        path = os.path.join(ROOT, 'data', 'images', 'iw', 'hello', 'world.jpg')
        if os.path.exists(path):
            os.remove(path)

        response = client.get("/iw/hello/world.jpg")
        assert response.status_code == 200
        assert response.mimetype == 'image/jpeg'

        assert os.path.isfile(path)

    def test_get_visible_jpg_1_line(self, client):
        response = client.get("/iw/hello.jpg")
        assert response.status_code == 200
        assert response.mimetype == 'image/jpeg'

    def test_get_hidden_jpg(self, client):
        response = client.get("/_aXcJaGVsbG8vd29ybGQJ.jpg")
        assert response.status_code == 200
        assert response.mimetype == 'image/jpeg'

    def test_redirects_to_dashes(self, client):
        response = client.get("/iw/HelloThere_World/How-areYOU.jpg")
        assert response.status_code == 302
        assert '' in \
            load(response, as_json=False)

    def test_get_unknown_template(self, client):
        response = client.get("/make/sudo/give.me.jpg")
        assert response.status_code == 404

    def test_get_redirects_to_default(self, client):
        response = client.get("/live.jpg")
        assert response.status_code == 302
        assert '' in \
            load(response, as_json=False)

    def test_get_redirects_when_alias(self, client):
        response = client.get("/insanity-wolf/hello/world.jpg")
        assert response.status_code == 302
        assert '' in \
            load(response, as_json=False)

    def test_get_redirects_when_jpeg_without_text(self, client):
        response = client.get("/iw.jpeg")
        assert response.status_code == 302
        assert '' in \
            load(response, as_json=False)

    def test_get_redirects_when_jpeg_with_text(self, client):
        response = client.get("/iw/hello/world.jpeg")
        assert response.status_code == 302
        assert '' in \
            load(response, as_json=False)


text:
package com.armandgray.shared.application;

import android.app.Activity;
import android.app.Application;

import com.armandgray.shared.db.DatabaseManagerImpl;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.robolectric.annotation.Config;

import dagger.android.AndroidInjector;

import static org.hamcrest.CoreMatchers.is;

@RunWith(PowerMockRunner.class)
@PrepareForTest({TAAPApplication.class, Application.class})
@Config(manifest = Config.NONE)
public class TAAPApplicationTest {

    @Rule
    public MockitoRule mockitoRule = MockitoJUnit.rule();

    @Mock
    TAAPAppComponent mockAppComponent;

    @Mock
    DatabaseManagerImpl mockDatabaseManager;

    private TAAPApplication testApplication;

    @Before
    public void setUp() {
        testApplication = new TAAPApplication() {
            @Override
            public AndroidInjector<Activity> activityInjector() {
                return null;
            }
        };

        testApplication.databaseManager = mockDatabaseManager;

        PowerMockito.mockStatic(Application.class);
    }

    @Test
    public void testOnCreate_DoesPopulateDefaults() {
        // TODO Implement Test
//        testApplication.onCreate();
//        Mockito.verify(mockDatabaseManager, Mockito.times(1)).populateDefaults();
    }

    @Test
    public void testGetAppComponent() {
        TAAPApplication.appComponent = mockAppComponent;
        Assert.assertThat(TAAPApplication.getAppComponent(), is(TAAPApplication.appComponent));
    }

    @After
    public void tearDown() {
        testApplication = null;
    }
}

redpajama_set_name: RedPajamaGithub


text:
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : PROTOBUF_WARNINGS )
#endif
#include "aeongames/ProtoBufClasses.h"
#include <google/protobuf/text_format.h>
#include "pipeline.pb.h"
#ifdef _MSC_VER
#pragma warning( pop )
#endif

#include <fstream>
#include <sstream>
#include <ostream>
#include <iostream>
#if defined(__unix__) || defined(__MINGW32__)
#include "sys/stat.h"
#endif
#include "PipelineTool.h"
#include "aeongames/Pipeline.h"

namespace AeonGames
{
    PipelineTool::PipelineTool() = default;
    PipelineTool::~PipelineTool() = default;
    void PipelineTool::ProcessArgs ( int argc, char** argv )
    {
        if ( argc < 2 || ( strcmp ( argv[1], "pipeline" ) != 0 ) )
        {
            std::ostringstream stream;
            stream << "Invalid tool name, expected pipeline, got " << ( ( argc < 2 ) ? "nothing" : argv[1] ) << std::endl;
            throw std::runtime_error ( stream.str().c_str() );
        }
        for ( int i = 2; i < argc; ++i )
        {
            if ( argv[i][0] == '-' )
            {
                if ( argv[i][1] == '-' )
                {
                    if ( strncmp ( &argv[i][2], "in", sizeof ( "in" ) ) == 0 )
                    {
                        i++;
                        mInputFile = argv[i];
                    }
                    else if ( strncmp ( &argv[i][2], "out", sizeof ( "out" ) ) == 0 )
                    {
                        i++;
                        mOutputFile = argv[i];
                    }
                }
                else
                {
                    switch ( argv[i][1] )
                    {
                    case 'i':
                        i++;
                        mInputFile = argv[i];
                        break;
                    case 'o':
                        i++;
                        mOutputFile = argv[i];
                        break;
                    }
                }
            }
            else
            {
                mInputFile = argv[i];
            }
        }
        if ( mInputFile.empty() )
        {
            throw std::runtime_error ( "No Input file provided." );
        }
        else if ( mOutputFile.empty() )
        {
            mOutputFile = mInputFile;
        }
    }

    int PipelineTool::operator() ( int argc, char** argv )
    {
        ProcessArgs ( argc, argv );
        std::ifstream file;
        file.exceptions ( std::ifstream::failbit | std::ifstream::badbit );
        file.open ( mInputFile, std::ifstream::in | std::ifstream::binary );
        std::vector<uint8_t> buffer ( ( std::istreambuf_iterator<char> ( file ) ), ( std::istreambuf_iterator<char>() ) );
        file.close();
        assert ( 0 );
#if 0
        Pipeline pipeline ( buffer.data(), buffer.size() );
        {
            std::ofstream shader_file ( mOutputFile + ".vert", std::ifstream::out );
            shader_file << pipeline.GetVertexShaderSource() << std::endl;
            shader_file.close();
        }
        {
            std::ofstream shader_file ( mOutputFile + ".frag", std::ifstream::out );
            shader_file << pipeline.GetFragmentShaderSource() << std::endl;
            shader_file.close();
        }
#endif
        return 0;
    }
}


text:
package com.google.edwmigration.dumper.application.dumper.connector.hive;

import com.google.common.base.Preconditions;
import com.google.common.io.ByteSink;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsInput;
import com.google.edwmigration.dumper.application.dumper.connector.AbstractConnector;
import com.google.edwmigration.dumper.application.dumper.handle.AbstractHandle;
import com.google.edwmigration.dumper.application.dumper.handle.Handle;
import com.google.edwmigration.dumper.application.dumper.task.AbstractTask;
import com.google.edwmigration.dumper.application.dumper.task.TaskRunContext;
import com.google.edwmigration.dumper.ext.hive.metastore.HiveMetastoreThriftClient;
import com.google.edwmigration.dumper.plugin.ext.jdk.concurrent.ExecutorManager;
import com.google.errorprone.annotations.ForOverride;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.GuardedBy;
import javax.annotation.concurrent.ThreadSafe;
import org.apache.thrift.transport.TTransportException;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@RespectsInput(order = 100, arg = ConnectorArguments.OPT_HOST, description = "The hostname of the Hive metastore.", defaultValue = ConnectorArguments.OPT_HOST_DEFAULT)
@RespectsInput(order = 101, arg = ConnectorArguments.OPT_PORT, description = "The port of the Hive metastore.", defaultValue = ConnectorArguments.OPT_HIVE_METASTORE_PORT_DEFAULT)
@RespectsInput(order = 400, arg = ConnectorArguments.OPT_HIVE_METASTORE_VERSION, description = "The version of the Hive metastore.", defaultValue = ConnectorArguments.OPT_HIVE_METASTORE_VERSION_DEFAULT)
@RespectsInput(order = 401, arg = ConnectorArguments.OPT_HIVE_METASTORE_DUMP_PARTITION_METADATA, description = "Dump partition metadata; you may wish to disable this for production metastores with a significant number of partitions due to Thrift client performance implications.", defaultValue = ConnectorArguments.OPT_HIVE_METASTORE_DUMP_PARTITION_METADATA_DEFAULT)
@RespectsInput(order = 500, arg = ConnectorArguments.OPT_THREAD_POOL_SIZE, description = "The size of the thread pool to use when dumping table metadata.")
public abstract class AbstractHiveConnector extends AbstractConnector {

    @SuppressWarnings("UnusedVariable")
    private static final Logger LOG = LoggerFactory.getLogger(AbstractHiveConnector.class);

    /**
     * Each thread in the pool is lazily assigned a new Thrift client upon first use;
     * we don't need to replace them between task executions as the Thrift clients do not preserve state
     * between requests. The important point is that a single Thrift client cannot handle multiple
     * requests simultaneously, by keeping each client thread-local we avoid concurrent use.
     */
    @ThreadSafe
    public static class ThriftClientPool implements AutoCloseable {

        public interface ThriftClientConsumer {
            void accept(HiveMetastoreThriftClient thriftClient) throws Exception;
        }

        @Nonnull
        private final String name;
        @Nonnull
        private final ThreadLocal<? extends HiveMetastoreThriftClient> threadLocalThriftClient;
        @Nonnull
        private final ExecutorManager executorManager;
        @Nonnull
        private final ExecutorService executorService;
        @Nonnull
        private final Object lock = new Object();
        @GuardedBy("lock")
        @Nonnull
        private final List<@NonNull HiveMetastoreThriftClient> builtClients = new ArrayList<>();

        public ThriftClientPool(@Nonnull String name, @Nonnull HiveMetastoreThriftClient.Builder thriftClientBuilder, int threadPoolSize) {
            this.name = Preconditions.checkNotNull(name, "name was null.");
            this.executorService = ExecutorManager.newExecutorServiceWithBackpressure(name, threadPoolSize);
            this.executorManager = new ExecutorManager(executorService);
            this.threadLocalThriftClient = ThreadLocal.withInitial(() -> {
                String threadName = Thread.currentThread().getName();
                LOG.debug("Creating new thread-local Thrift client '{}' owned by pooled client '{}'.", threadName, name);
                try {
                    HiveMetastoreThriftClient client = new HiveMetastoreThriftClient.Builder(thriftClientBuilder).withName(threadName).build();
                    synchronized (lock) {
                        builtClients.add(client);
                    }
                    return client;
                } catch (TTransportException e) {
                    throw new RuntimeException("Unable to build Thrift client '" + threadName + "' owned by pooled client '" + name + "' due to transport exception.", e);
                }
            });
        }

        public void execute(ThriftClientConsumer consumer) {
            executorManager.execute(() -> {
                consumer.accept(getThreadLocalThriftClient().get());
                return null;
            });
       }

        @Nonnull
        private ThreadLocal<@NonNull ? extends HiveMetastoreThriftClient> getThreadLocalThriftClient() {
            return threadLocalThriftClient;
        }

        @Override
        public void close() throws Exception {
            LOG.debug("Shutting down thread pool backing pooled Thrift client '{}'", name);
            executorManager.close();
            MoreExecutors.shutdownAndAwaitTermination(executorService, 30, TimeUnit.SECONDS);
            synchronized (lock) {
                for (HiveMetastoreThriftClient client : builtClients) {
                    try {
                        LOG.debug("Closing thread-local Thrift client '{}' owned by pooled client '{}'.", client.getName(), name);
                        client.close();
                    } catch (Exception ioe) {
                        LOG.warn("Unable to close Thrift client '" + client.getName() + "' owned by pooled client '" + name + "'. " + client.getName(), ioe);
                    }
                }
            }
            LOG.debug("Pooled Thrift client '{}' is now closed.", name);
        }
    }

    protected static class ThriftClientHandle extends AbstractHandle {

        @Nonnull
        private final HiveMetastoreThriftClient.Builder thriftClientBuilder;
        @Nonnegative
        private final int threadPoolSize;

        public ThriftClientHandle(@Nonnull HiveMetastoreThriftClient.Builder thriftClientBuilder, @Nonnegative int threadPoolSize) {
            this.thriftClientBuilder = Preconditions.checkNotNull(thriftClientBuilder, "Thrift client builder was null.");
            this.threadPoolSize = threadPoolSize;
        }

        /** Returns a thread-unsafe Thrift client unsuitable for use in multi-threaded contexts. */
        @Nonnull
        public HiveMetastoreThriftClient newClient(@Nonnull String name) throws TTransportException {
            LOG.debug("Creating a new Thrift client named '{}'.", name);
            return new HiveMetastoreThriftClient.Builder(thriftClientBuilder).withName(name).build();
        }

        /** Returns a thread-safe Thrift client pool suitable for use in multi-threaded contexts. */
        @Nonnull
        public ThriftClientPool newMultiThreadedThriftClientPool(@Nonnull String name) {
            LOG.debug("Creating a new multi-threaded pooled Thrift client named '{}' backed by a thread pool of size {}.", name, threadPoolSize);
            return new ThriftClientPool(name, thriftClientBuilder, threadPoolSize);
        }
    }

    protected static abstract class AbstractHiveTask extends AbstractTask<Void> {

        public AbstractHiveTask(String targetPath) {
            super(targetPath);
        }

        @ForOverride
        protected abstract void run(@Nonnull Writer writer, @Nonnull ThriftClientHandle handle) throws Exception;

        @Override
        protected Void doRun(TaskRunContext context, ByteSink sink, @Nonnull Handle handle) throws Exception {
            ThriftClientHandle thriftClientHandle = (ThriftClientHandle) handle;

            LOG.info("Writing to " + getTargetPath() + " -> " + sink);

            try (Writer writer = sink.asCharSink(StandardCharsets.UTF_8).openBufferedStream()) {
                run(writer, thriftClientHandle);
            }

            return null;
        }

        @ForOverride
        protected abstract String toCallDescription();

        @Override
        public String toString() {
            return "Write " + getTargetPath() + " from " + toCallDescription();
        }
    }

    public AbstractHiveConnector(@Nonnull String name) {
        super(name);
    }

    @Nonnull
    @Override
    public Handle open(ConnectorArguments arguments) throws Exception {
        String requestedClientVersion = arguments.getHiveMetastoreVersion();
        HiveMetastoreThriftClient.Builder thriftClientBuilder = new HiveMetastoreThriftClient.Builder(requestedClientVersion)
                .withHost(arguments.getHost())
                .withPort(arguments.getPort(Integer.parseInt(ConnectorArguments.OPT_HIVE_METASTORE_PORT_DEFAULT)))
                .withUnavailableClientVersionBehavior(HiveMetastoreThriftClient.Builder.UnavailableClientVersionBehavior.FALLBACK);
        return new ThriftClientHandle(thriftClientBuilder, arguments.getThreadPoolSize());
    }
}


text:
package com.usermodule.dto;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import com.usermodule.entities.User;

/*dto: data transfer object*/
public class SignupForm {
	@NotNull
	@Size(min=3, max=255)
	@Pattern(regexp=User.EMAIL_PATTERN, message="{emailPatternError}")
	private String email;

	@NotNull
	@Size(min=3, max=50, message="{nameSizeError}")
	private String name;

	@NotNull
	@Size(min=6, max=20)
	private String password;

	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@Override
	public String toString() {
		return "SignupForm [email=" + email + ", name=" + name + ", password=" + password + "]";
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<ldswebml type="image" uri="/media-library/images/parenthood#family-scripture-study-283362" xml:lang="eng" locale="eng" status="publish">
  <search-meta>
      <uri-title its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">family-scripture-study-283362</uri-title>
      <source>family-scripture-study-283362</source>
      <publication-type its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">image</publication-type>
      <media-type its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">image</media-type>
      <publication value="ldsorg">LDS.org</publication>
      <publication-date value="2012-04-09">2012-04-09</publication-date>
      <title/>
      <description/>
      <collections>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">global-search</collection>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">media</collection>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">images</collection>
      </collections>
      <subjects>
          <subject>Families</subject>
          <subject>Fathers</subject>
          <subject>Mothers</subject>
          <subject>Children</subject>
          <subject>Scriptures</subject>
          <subject>Scripture Study</subject>
          <subject>Sitting</subject>
          <subject>Parents</subject>
          <subject>Parenthood</subject>
      </subjects>
  </search-meta>
  <no-search>
      <path>http://media.ldscdn.org/images/media-library/parenthood/family-scripture-study-283362-gallery.jpg</path>
      <images>
          http://media.ldscdn.org/images/media-library/parenthood/family-scripture-study-283362-thumbnail.jpg
      </images>
          <download-urls>
              <download-url>
                  Mobile
                  <size>154 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/parenthood/family-scripture-study-283362-mobile.jpg</path>
              </download-url>
              <download-url>
                  Tablet
                  <size>174 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/parenthood/family-scripture-study-283362-tablet.jpg</path>
              </download-url>
              <download-url>
                  Print
                  <size>379 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/parenthood/family-scripture-study-283362-print.jpg</path>
              </download-url>
              <download-url>
                  Wallpaper
                  <size>785 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/parenthood/family-scripture-study-283362-wallpaper.jpg</path>
              </download-url>
          </download-urls>
  </no-search>
<ldse-meta its:translate="no" xmlns="http://lds.org/code/lds-edit" xmlns:its="http://www.w3.org/2005/11/its"><document id="family-scripture-study-283362" locale="eng" uri="/media-library/images/parenthood#family-scripture-study-283362" status="publish" site="ldsorg" source="chq" words="125" tgp="0.4371"/><created username="lds-edit" userid=""/><last-modified date="2012-05-10T12:26:05.692556-06:00" username="lds-edit" userid=""/></ldse-meta></ldswebml>


text:
#ifndef _STRING
#define _STRING 1

#include <sys/cdefs.h>

#endif /* _STRING */


text:
package lejos.hardware.motor;

import lejos.hardware.port.Port;
import lejos.hardware.port.TachoMotorPort;
import lejos.hardware.sensor.EV3SensorConstants;

/**
 * Abstraction for a Mindsensors Glidewheel-M equipped PF motor.<br>
 * Note: These settings are for the "XL" motor.
 * TODO: Find some way to make this work with an I term for hold
 * TODO: Can probably be tuned better then this.
 *
 */
public class MindsensorsGlideWheelXLRegulatedMotor extends BaseRegulatedMotor
{
    static final float MOVE_P = 3.5f;
    static final float MOVE_I = 0.01f;
    static final float MOVE_D = 3f;
    static final float HOLD_P = 2.5f;
    static final float HOLD_I = 0f;
    static final float HOLD_D = 0f;
    static final int OFFSET = 0;

    private static final int MAX_SPEED = 220*360/60;

    /**
     * Use this constructor to assign a variable of type motor connected to a particular port.
     * @param port  to which this motor is connected
     */
    public MindsensorsGlideWheelXLRegulatedMotor(TachoMotorPort port)
    {
        super(port, null, EV3SensorConstants.TYPE_MINITACHO, MOVE_P, MOVE_I, MOVE_D,
                HOLD_P, HOLD_I, HOLD_D, OFFSET, MAX_SPEED);
    }

    /**
     * Use this constructor to assign a variable of type motor connected to a particular port.
     * @param port  to which this motor is connected
     */
    public MindsensorsGlideWheelXLRegulatedMotor(Port port)
    {
        super(port, null, EV3SensorConstants.TYPE_NEWTACHO, MOVE_P, MOVE_I, MOVE_D,
                HOLD_P, HOLD_I, HOLD_D, OFFSET, MAX_SPEED);
    }

}


text:
package com.google.cloud.video.livestream.v1.samples;

// [START livestream_v1_generated_LivestreamService_GetChannel_Channelname_sync]
import com.google.cloud.video.livestream.v1.Channel;
import com.google.cloud.video.livestream.v1.ChannelName;
import com.google.cloud.video.livestream.v1.LivestreamServiceClient;

public class SyncGetChannelChannelname {

  public static void main(String[] args) throws Exception {
    syncGetChannelChannelname();
  }

  public static void syncGetChannelChannelname() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (LivestreamServiceClient livestreamServiceClient = LivestreamServiceClient.create()) {
      ChannelName name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]");
      Channel response = livestreamServiceClient.getChannel(name);
    }
  }
}
// [END livestream_v1_generated_LivestreamService_GetChannel_Channelname_sync]


text:
package ca.ulaval.ift6002.sputnik.domain.core.observable;

import ca.ulaval.ift6002.sputnik.domain.core.mailbox.MailboxObserver;

public interface Observable {

    void addObserver(MailboxObserver mailboxObserver);

    void notifyObservers();
}


text:
/*!
 * Start Bootstrap - Freelancer Bootstrap Theme (http://startbootstrap.com)
 * Code licensed under the Apache License v2.0.
 * For details, see http://www.apache.org/licenses/LICENSE-2.0.
 */

body {
    overflow-x: hidden;
    font-size: 14pt;
}

p {
    font-size: 14pt;
}

p.small {
    font-size: 16px;
}

a,
a:focus,
a:active,
a.active {
    outline: 0;
    color: #{{ site.color.primary }};
    font-weight: 500;
}

blockquote {
    color: #{{ site.color.secondary-text }};
}

a:hover {
    color: #{{ site.color.accent }};
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-transform: uppercase;
    font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
    font-weight: 700;
}

.secondary-text {
    color: #{{site.color.secondary-text }};
}
.light-primary {
    color: #{{site.color.light-primary }};
}

hr.star-light,
hr.star-primary {
    margin: 25px auto 30px;
    padding: 0;
    max-width: 250px;
    border: 0;
    border-top: solid 5px;
    text-align: center;
}

hr.star-light:after,
hr.star-primary:after {
    content: "\f005";
    display: inline-block;
    position: relative;
    top: -.8em;
    padding: 0 .25em;
    font-family: FontAwesome;
    font-size: 2em;
}

hr.star-light {
    border-color: #fff;
}

hr.star-light:after {
    color: #fff;
    background-color: #{{ site.color.primary }};
}

hr.star-primary {
    border-color: #{{ site.color.accent }};
}

hr.star-primary:after {
    color: #{{ site.color.accent }};
    background-color: #fff;
}

.img-centered {
    margin: 0 auto;
}

header {
    text-align: center;
    color: #fff;
    background: #{{ site.color.primary }};
}

header .container {
    padding-top: 100px;
    padding-bottom: 20px;
}

header img {
    display: block;
    margin: 0 auto 20px;
}

header .intro-text .name {
    display: block;
    text-transform: uppercase;
    font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
    font-size: 2em;
    font-weight: 700;
}

header .intro-text .skills {
    font-size: 1.25em;
    font-weight: 300;
}

.navbar-brand a {
    color: #{{ site.color.text }};
}

.glyphicon {
    color: #{{ site.color.accent }};
}

@media(min-width:768px) {
    header .container {
        padding-top: 100px;
        padding-bottom: 50px;
    }

    header .intro-text .name {
        font-size: 4.75em;
    }

    header .intro-text .skills {
        font-size: 1.75em;
    }
    .navbar-brand a { content: 'G. Malecha'; }
}

@media(min-width:768px) {
    .navbar-fixed-top {
        padding: 25px 0;
        -webkit-transition: padding .3s;
        -moz-transition: padding .3s;
        transition: padding .3s;
    }

    .navbar-fixed-top .navbar-brand {
        font-size: 1.5em;
        -webkit-transition: all .3s;
        -moz-transition: all .3s;
        transition: all .3s;
    }

    .navbar-fixed-top.navbar-shrink {
        padding: 10px 0;
    }

    .navbar-fixed-top.navbar-shrink .navbar-brand {
        font-size: 1.5em;
    }
}

.navbar {
    text-transform: uppercase;
    font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
    font-weight: 700;
    background-color: #{{ site.color.dark-primary }} ;
}

.navbar a:focus {
    outline: 0;
}

.navbar .navbar-nav {
    letter-spacing: 0px;
}

.navbar .navbar-nav li a:focus {
    outline: 0;
}

.navbar-default,
.navbar-inverse {
    border: 0;
}

section {
    padding: 0pt 0 10pt;
}

section h2 {
    margin: 0;
    font-size: 2.25em;
    margin-bottom: 0.25em;
}

section.success {
    color: #fff;
    background: #{{ site.color.primary }};
}

@media(max-width:767px) {
    section {
        padding: 10pt 0pt 0pt 0pt;
    }

    section.first {
        padding-top: 75px;
    }
}

#projects .projects-item {
    right: 0;
    margin: 0 0 15px;
}

#projects .projects-item .projects-link {
    display: block;
    position: relative;
    margin: 0 auto;
    max-width: 400px;
}

#projects .projects-item .projects-link .caption {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    background: rgba({{ site.color.primary-rgb }},.9);
    -webkit-transition: all ease .5s;
    -moz-transition: all ease .5s;
    transition: all ease .5s;
}

#projects .projects-item .projects-link .caption:hover {
    opacity: 1;
}

#projects .projects-item .projects-link .caption .caption-content {
    position: absolute;
    top: 50%;
    width: 100%;
    height: 20px;
    margin-top: -12px;
    text-align: center;
    font-size: 20px;
    color: #fff;
}

#projects .projects-item .projects-link .caption .caption-content i {
    margin-top: -12px;
}

#projects .projects-item .projects-link .caption .caption-content h3,
#projects .projects-item .projects-link .caption .caption-content h4 {
    margin: 0;
}

#projects * {
    z-index: 2;
}

@media(min-width:767px) {
    #projects .projects-item {
        margin: 0 0 30px;
    }
}

.btn-outline {
    margin-top: 15px;
    border: solid 2px #fff;
    font-size: 20px;
    color: #fff;
    background: 0 0;
    transition: all .3s ease-in-out;
}

.btn-primary {
    background-color: #{{ site.color.accent }};
    color: #{{ site.color.text }};
}

.btn-outline:hover,
.btn-outline:focus,
.btn-outline:active,
.btn-outline.active {
    border: solid 2px #fff;
    color: #{{ site.color.primary }};
    background: #fff;
}

.floating-label-form-group {
    position: relative;
    margin-bottom: 0;
    padding-bottom: .5em;
    border-bottom: 1px solid #eee;
}

.floating-label-form-group input,
.floating-label-form-group textarea {
    z-index: 1;
    position: relative;
    padding-right: 0;
    padding-left: 0;
    border: 0;
    border-radius: 0;
    font-size: 1.5em;
    background: 0 0;
    box-shadow: none!important;
    resize: none;
}

.floating-label-form-group label {
    display: block;
    z-index: 0;
    position: relative;
    top: 2em;
    margin: 0;
    font-size: .85em;
    line-height: 1.764705882em;
    vertical-align: middle;
    vertical-align: baseline;
    opacity: 0;
    -webkit-transition: top .3s ease,opacity .3s ease;
    -moz-transition: top .3s ease,opacity .3s ease;
    -ms-transition: top .3s ease,opacity .3s ease;
    transition: top .3s ease,opacity .3s ease;
}

.floating-label-form-group::not(:first-child) {
    padding-left: 14px;
    border-left: 1px solid #eee;
}

.floating-label-form-group-with-value label {
    top: 0;
    opacity: 1;
}

.floating-label-form-group-with-focus label {
    color: #{{ site.color.primary }};
}

form .row:first-child .floating-label-form-group {
    border-top: 1px solid #eee;
}

footer {
    color: #fff;
}

footer h3 {
    margin-bottom: 30px;
}

footer .footer-above {
    background-color: #{{ site.color.secondary }};
}

footer .footer-col {
    margin-bottom: 50px;
}

footer .footer-below {
    padding: 25px 0;
    background-color: #{{ site.color.secondary-dark }};
}

.btn-social {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 2px solid #fff;
    border-radius: 100%;
    text-align: center;
    font-size: 20px;
    line-height: 45px;
}

.btn:focus,
.btn:active,
.btn.active {
    outline: 0;
}

.scroll-top {
    z-index: 1049;
    position: fixed;
    right: 2%;
    bottom: 2%;
    width: 50px;
    height: 50px;
}

.scroll-top .btn {
    width: 50px;
    height: 50px;
    border-radius: 100%;
    font-size: 20px;
    line-height: 28px;
}

.scroll-top .btn:focus {
    outline: 0;
}

.projects-modal .modal-content {
    padding: 100px 0;
    min-height: 100%;
    border: 0;
    border-radius: 0;
    text-align: center;
    background-clip: border-box;
    -webkit-box-shadow: none;
    box-shadow: none;
}

.projects-modal .modal-content h2 {
    margin: 0;
    font-size: 3em;
}

.projects-modal .modal-content img {
    margin-bottom: 30px;
}

.projects-modal .modal-content .item-details {
    margin: 30px 0;
}

.projects-modal .close-modal {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 75px;
    height: 75px;
    background-color: transparent;
    cursor: pointer;
}

.projects-modal .close-modal:hover {
    opacity: .3;
}

.projects-modal .close-modal .lr {
    z-index: 1051;
    width: 1px;
    height: 75px;
    margin-left: 35px;
    background-color: #{{ site.color.secondary }};
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}

.projects-modal .close-modal .lr .rl {
    z-index: 1052;
    width: 1px;
    height: 75px;
    background-color: #{{ site.color.secondary }};
    -webkit-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
    transform: rotate(90deg);
}

.navbar-nav>.active>a {
    background-color: #{{ site.color.secondary-dark }} !important;
}

.navbar-nav>.current>a {
    background-color: #{{ site.color.secondary-dark }} !important;
}

/* Fix modal mouse wheel issues */
/* https://github.com/twbs/bootstrap/issues/16297 */
.modal.fade.in {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

article.expand {
    margin-top: 70pt;
}

article {
    -webkit-transition: margin .3s;
    -moz-transition: margin .3s;
    transition: margin .3s;
    margin-top: 20pt;
}

img.logo {
  float:left;
  margin-right: 5pt;
  position: relative;
  display: none;
}

@media(min-width: 768px) {
img.logo {
  top: -15pt;
  height: 30pt;
}
}
@media(min-width: 992px) {
img.logo {
  float:left;
  margin-right: 5pt;
  top: -15pt;
  position: relative;
  height: 50pt;
  display: block;
}
}


text:
package fr.unice.spinefm.ActionModel.SystemActionModel.impl;

import org.apache.log4j.Logger;

import fr.unice.spinefm.ConfigurationModel.Configuration;
import fr.unice.spinefm.ConfigurationModel.ConfigurationModelFactory;
import fr.unice.spinefm.ProcessModel.ConfigurationProcessStep;

public class ActionCreateConfigurationImplDelegate extends ActionCreateConfigurationImpl {

	private static Logger log = Logger.getLogger(ActionCreateConfigurationImplDelegate.class);

	@Override
	public void apply() {
		log.debug("Apply action CreateConfig from step "+this.getStep());
		Configuration config = ConfigurationModelFactory.eINSTANCE.createConfiguration();
		config.setId(cps.getConfName());
		config.setCPSRef(cps);
		config.setDomainElement(cps.getDomainElement());
		config.setState(cps.getState());
		compconf.addConfiguration(config);
	}

	@Override
	public void undo() {
		log.debug("Undo action CreateConfig from step "+this.getStep());
		Configuration conf = this.cps.getConfiguration();
		this.cps.setConfiguration(null);
		conf.setCPSRef(null);
		this.compconf.getSubConfigurations().remove(conf);
	}

	public String toString() {
		return "Action CreateConfiguration ["+this.getCps().getDescription()+" | Type : "+this.getType()+"] "+this.getStep();
	}
}


text:
// Include GLEW
#include <GL/glew.h>

// Include GLFW
#include <GL/glfw.h>

// Include GLM
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtx/quaternion.hpp>
using namespace glm;

// Include AntTweakBar
#include <AntTweakBar.h>

#include <common/shader.hpp>
#include <common/texture.hpp>
#include <common/controls.hpp>
#include <common/objloader.hpp>
#include <common/vboindexer.hpp>

void ScreenPosToWorldRay(
	int mouseX, int mouseY,             // Mouse position, in pixels, from bottom-left corner of the window
	int screenWidth, int screenHeight,  // Window size, in pixels
	glm::mat4 ViewMatrix,               // Camera position and orientation
	glm::mat4 ProjectionMatrix,         // Camera parameters (ratio, field of view, near and far planes)
	glm::vec3& out_origin,              // Ouput : Origin of the ray. /!\ Starts at the near plane, so if you want the ray to start at the camera's position instead, ignore this.
	glm::vec3& out_direction            // Ouput : Direction, in world space, of the ray that goes "through" the mouse.
){

	// The ray Start and End positions, in Normalized Device Coordinates (Have you read Tutorial 4 ?)
	glm::vec4 lRayStart_NDC(
		((float)mouseX/(float)screenWidth  - 0.5f) * 2.0f, // [0,1024] -> [-1,1]
		((float)mouseY/(float)screenHeight - 0.5f) * 2.0f, // [0, 768] -> [-1,1]
		-1.0, // The near plane maps to Z=-1 in Normalized Device Coordinates
		1.0f
	);
	glm::vec4 lRayEnd_NDC(
		((float)mouseX/(float)screenWidth  - 0.5f) * 2.0f,
		((float)mouseY/(float)screenHeight - 0.5f) * 2.0f,
		0.0,
		1.0f
	);

	// The Projection matrix goes from Camera Space to NDC.
	// So inverse(ProjectionMatrix) goes from NDC to Camera Space.
	glm::mat4 InverseProjectionMatrix = glm::inverse(ProjectionMatrix);

	// The View Matrix goes from World Space to Camera Space.
	// So inverse(ViewMatrix) goes from Camera Space to World Space.
	glm::mat4 InverseViewMatrix = glm::inverse(ViewMatrix);

	glm::vec4 lRayStart_camera = InverseProjectionMatrix * lRayStart_NDC;    lRayStart_camera/=lRayStart_camera.w;
	glm::vec4 lRayStart_world  = InverseViewMatrix       * lRayStart_camera; lRayStart_world /=lRayStart_world .w;
	glm::vec4 lRayEnd_camera   = InverseProjectionMatrix * lRayEnd_NDC;      lRayEnd_camera  /=lRayEnd_camera  .w;
	glm::vec4 lRayEnd_world    = InverseViewMatrix       * lRayEnd_camera;   lRayEnd_world   /=lRayEnd_world   .w;

	// Faster way (just one inverse)
	//glm::mat4 M = glm::inverse(ProjectionMatrix * ViewMatrix);
	//glm::vec4 lRayStart_world = M * lRayStart_NDC; lRayStart_world/=lRayStart_world.w;
	//glm::vec4 lRayEnd_world   = M * lRayEnd_NDC  ; lRayEnd_world  /=lRayEnd_world.w;

	glm::vec3 lRayDir_world(lRayEnd_world - lRayStart_world);
	lRayDir_world = glm::normalize(lRayDir_world);

	out_origin = glm::vec3(lRayStart_world);
	out_direction = glm::normalize(lRayDir_world);
}

bool TestRayOBBIntersection(
	glm::vec3 ray_origin,        // Ray origin, in world space
	glm::vec3 ray_direction,     // Ray direction (NOT target position!), in world space. Must be normalize()'d.
	glm::vec3 aabb_min,          // Minimum X,Y,Z coords of the mesh when not transformed at all.
	glm::vec3 aabb_max,          // Maximum X,Y,Z coords. Often aabb_min*-1 if your mesh is centered, but it's not always the case.
	glm::mat4 ModelMatrix,       // Transformation applied to the mesh (which will thus be also applied to its bounding box)
	float& intersection_distance // Output : distance between ray_origin and the intersection with the OBB
){

	// Intersection method from Real-Time Rendering and Essential Mathematics for Games

	float tMin = 0.0f;
	float tMax = 100000.0f;

	glm::vec3 OBBposition_worldspace(ModelMatrix[3].x, ModelMatrix[3].y, ModelMatrix[3].z);

	glm::vec3 delta = OBBposition_worldspace - ray_origin;

	// Test intersection with the 2 planes perpendicular to the OBB's X axis
	{
		glm::vec3 xaxis(ModelMatrix[0].x, ModelMatrix[0].y, ModelMatrix[0].z);
		float e = glm::dot(xaxis, delta);
		float f = glm::dot(ray_direction, xaxis);

		if ( fabs(f) > 0.001f ){ // Standard case

			float t1 = (e+aabb_min.x)/f; // Intersection with the "left" plane
			float t2 = (e+aabb_max.x)/f; // Intersection with the "right" plane
			// t1 and t2 now contain distances betwen ray origin and ray-plane intersections

			// We want t1 to represent the nearest intersection,
			// so if it's not the case, invert t1 and t2
			if (t1>t2){
				float w=t1;t1=t2;t2=w; // swap t1 and t2
			}

			// tMax is the nearest "far" intersection (amongst the X,Y and Z planes pairs)
			if ( t2 < tMax )
				tMax = t2;
			// tMin is the farthest "near" intersection (amongst the X,Y and Z planes pairs)
			if ( t1 > tMin )
				tMin = t1;

			// And here's the trick :
			// If "far" is closer than "near", then there is NO intersection.
			// See the images in the tutorials for the visual explanation.
			if (tMax < tMin )
				return false;

		}else{ // Rare case : the ray is almost parallel to the planes, so they don't have any "intersection"
			if(-e+aabb_min.x > 0.0f || -e+aabb_max.x < 0.0f)
				return false;
		}
	}

	// Test intersection with the 2 planes perpendicular to the OBB's Y axis
	// Exactly the same thing than above.
	{
		glm::vec3 yaxis(ModelMatrix[1].x, ModelMatrix[1].y, ModelMatrix[1].z);
		float e = glm::dot(yaxis, delta);
		float f = glm::dot(ray_direction, yaxis);

		if ( fabs(f) > 0.001f ){

			float t1 = (e+aabb_min.y)/f;
			float t2 = (e+aabb_max.y)/f;

			if (t1>t2){float w=t1;t1=t2;t2=w;}

			if ( t2 < tMax )
				tMax = t2;
			if ( t1 > tMin )
				tMin = t1;
			if (tMin > tMax)
				return false;

		}else{
			if(-e+aabb_min.y > 0.0f || -e+aabb_max.y < 0.0f)
				return false;
		}
	}

	// Test intersection with the 2 planes perpendicular to the OBB's Z axis
	// Exactly the same thing than above.
	{
		glm::vec3 zaxis(ModelMatrix[2].x, ModelMatrix[2].y, ModelMatrix[2].z);
		float e = glm::dot(zaxis, delta);
		float f = glm::dot(ray_direction, zaxis);

		if ( fabs(f) > 0.001f ){

			float t1 = (e+aabb_min.z)/f;
			float t2 = (e+aabb_max.z)/f;

			if (t1>t2){float w=t1;t1=t2;t2=w;}

			if ( t2 < tMax )
				tMax = t2;
			if ( t1 > tMin )
				tMin = t1;
			if (tMin > tMax)
				return false;

		}else{
			if(-e+aabb_min.z > 0.0f || -e+aabb_max.z < 0.0f)
				return false;
		}
	}

	intersection_distance = tMin;
	return true;

}

int main( void )
{
	// Initialise GLFW
	if( !glfwInit() )
	{
		fprintf( stderr, "Failed to initialize GLFW\n" );
		return -1;
	}

	glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4);
	glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 2);
	glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 1);

	// Open a window and create its OpenGL context
	if( !glfwOpenWindow( 1024, 768, 0,0,0,0, 32,0, GLFW_WINDOW ) )
	{
		fprintf( stderr, "Failed to open GLFW window.\n" );
		glfwTerminate();
		return -1;
	}

	// Initialize GLEW
	if (glewInit() != GLEW_OK) {
		fprintf(stderr, "Failed to initialize GLEW\n");
		return -1;
	}

	// Initialize the GUI
	TwInit(TW_OPENGL, NULL);
	TwWindowSize(1024, 768);
	TwBar * GUI = TwNewBar("Picking");
	TwSetParam(GUI, NULL, "refresh", TW_PARAM_CSTRING, 1, "0.1");
	std::string message;
	TwAddVarRW(GUI, "Last picked object", TW_TYPE_STDSTRING, &message, NULL);

	glfwSetWindowTitle( "Misc 05 - version with custom Ray-OBB code" );

	// Ensure we can capture the escape key being pressed below
	glfwEnable( GLFW_STICKY_KEYS );
	glfwSetMousePos(1024/2, 768/2);

	// Dark blue background
	glClearColor(0.0f, 0.0f, 0.4f, 0.0f);

	// Enable depth test
	glEnable(GL_DEPTH_TEST);
	// Accept fragment if it closer to the camera than the former one
	glDepthFunc(GL_LESS);

	// Cull triangles which normal is not towards the camera
	glEnable(GL_CULL_FACE);

	// Create and compile our GLSL program from the shaders
	GLuint programID = LoadShaders( "StandardShading.vertexshader", "StandardShading.fragmentshader" );

	// Get a handle for our "MVP" uniform
	GLuint MatrixID = glGetUniformLocation(programID, "MVP");
	GLuint ViewMatrixID = glGetUniformLocation(programID, "V");
	GLuint ModelMatrixID = glGetUniformLocation(programID, "M");
	// Get a handle for our buffers
	GLuint vertexPosition_modelspaceID = glGetAttribLocation(programID, "vertexPosition_modelspace");
	GLuint vertexUVID = glGetAttribLocation(programID, "vertexUV");
	GLuint vertexNormal_modelspaceID = glGetAttribLocation(programID, "vertexNormal_modelspace");

	// Load the texture
	GLuint Texture = loadDDS("uvmap.DDS");

	// Get a handle for our "myTextureSampler" uniform
	GLuint TextureID  = glGetUniformLocation(programID, "myTextureSampler");

	// Read our .obj file
	std::vector<glm::vec3> vertices;
	std::vector<glm::vec2> uvs;
	std::vector<glm::vec3> normals;
	bool res = loadOBJ("suzanne.obj", vertices, uvs, normals);

	std::vector<unsigned short> indices;
	std::vector<glm::vec3> indexed_vertices;
	std::vector<glm::vec2> indexed_uvs;
	std::vector<glm::vec3> indexed_normals;
	indexVBO(vertices, uvs, normals, indices, indexed_vertices, indexed_uvs, indexed_normals);

	// Load it into a VBO

	GLuint vertexbuffer;
	glGenBuffers(1, &vertexbuffer);
	glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
	glBufferData(GL_ARRAY_BUFFER, indexed_vertices.size() * sizeof(glm::vec3), &indexed_vertices[0], GL_STATIC_DRAW);

	GLuint uvbuffer;
	glGenBuffers(1, &uvbuffer);
	glBindBuffer(GL_ARRAY_BUFFER, uvbuffer);
	glBufferData(GL_ARRAY_BUFFER, indexed_uvs.size() * sizeof(glm::vec2), &indexed_uvs[0], GL_STATIC_DRAW);

	GLuint normalbuffer;
	glGenBuffers(1, &normalbuffer);
	glBindBuffer(GL_ARRAY_BUFFER, normalbuffer);
	glBufferData(GL_ARRAY_BUFFER, indexed_normals.size() * sizeof(glm::vec3), &indexed_normals[0], GL_STATIC_DRAW);

	// Generate a buffer for the indices as well
	GLuint elementbuffer;
	glGenBuffers(1, &elementbuffer);
	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elementbuffer);
	glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(unsigned short), &indices[0] , GL_STATIC_DRAW);

	// Generate positions & rotations for 100 monkeys
	std::vector<glm::vec3> positions(100);
	std::vector<glm::quat> orientations(100);
	for(int i=0; i<100; i++){
		positions[i] = glm::vec3(rand()%20-10, rand()%20-10, rand()%20-10);
		orientations[i] = glm::quat(glm::vec3(rand()%360, rand()%360, rand()%360));
	}

	// Get a handle for our "LightPosition" uniform
	glUseProgram(programID);
	GLuint LightID = glGetUniformLocation(programID, "LightPosition_worldspace");

	// For speed computation
	double lastTime = glfwGetTime();
	int nbFrames = 0;

	do{

		// Measure speed
		double currentTime = glfwGetTime();
		nbFrames++;
		if ( currentTime - lastTime >= 1.0 ){ // If last prinf() was more than 1sec ago
			// printf and reset
			printf("%f ms/frame\n", 1000.0/double(nbFrames));
			nbFrames = 0;
			lastTime += 1.0;
		}

		// Compute the MVP matrix from keyboard and mouse input
		computeMatricesFromInputs();
		glm::mat4 ProjectionMatrix = getProjectionMatrix();
		glm::mat4 ViewMatrix = getViewMatrix();

		// PICKING IS DONE HERE
		// (Instead of picking each frame if the mouse button is down,
		// you should probably only check if the mouse button was just released)
		if (glfwGetMouseButton(GLFW_MOUSE_BUTTON_LEFT)){

			glm::vec3 ray_origin;
			glm::vec3 ray_direction;
			ScreenPosToWorldRay(
				1024/2, 768/2,
				1024, 768,
				ViewMatrix,
				ProjectionMatrix,
				ray_origin,
				ray_direction
			);

			//ray_direction = ray_direction*20.0f;

			message = "background";

			// Test each each Oriented Bounding Box (OBB).
			// A physics engine can be much smarter than this,
			// because it already has some spatial partitionning structure,
			// like Binary Space Partitionning Tree (BSP-Tree),
			// Bounding Volume Hierarchy (BVH) or other.
			for(int i=0; i<100; i++){

				float intersection_distance; // Output of TestRayOBBIntersection()
				glm::vec3 aabb_min(-1.0f, -1.0f, -1.0f);
				glm::vec3 aabb_max( 1.0f,  1.0f,  1.0f);

				// The ModelMatrix transforms :
				// - the mesh to its desired position and orientation
				// - but also the AABB (defined with aabb_min and aabb_max) into an OBB
				glm::mat4 RotationMatrix = glm::toMat4(orientations[i]);
				glm::mat4 TranslationMatrix = translate(mat4(), positions[i]);
				glm::mat4 ModelMatrix = TranslationMatrix * RotationMatrix;

				if ( TestRayOBBIntersection(
					ray_origin,
					ray_direction,
					aabb_min,
					aabb_max,
					ModelMatrix,
					intersection_distance)
				){
					std::ostringstream oss;
					oss << "mesh " << i;
					message = oss.str();
					break;
				}
			}

		}

		// Dark blue background
		glClearColor(0.0f, 0.0f, 0.4f, 0.0f);
		// Re-clear the screen for real rendering
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

		// Use our shader
		glUseProgram(programID);

		glEnableVertexAttribArray(vertexPosition_modelspaceID);
		glEnableVertexAttribArray(vertexUVID);
		glEnableVertexAttribArray(vertexNormal_modelspaceID);

		for(int i=0; i<100; i++){

			glm::mat4 RotationMatrix = glm::toMat4(orientations[i]);
			glm::mat4 TranslationMatrix = translate(mat4(), positions[i]);
			glm::mat4 ModelMatrix = TranslationMatrix * RotationMatrix;

			glm::mat4 MVP = ProjectionMatrix * ViewMatrix * ModelMatrix;

			// Send our transformation to the currently bound shader,
			// in the "MVP" uniform
			glUniformMatrix4fv(MatrixID, 1, GL_FALSE, &MVP[0][0]);
			glUniformMatrix4fv(ModelMatrixID, 1, GL_FALSE, &ModelMatrix[0][0]);
			glUniformMatrix4fv(ViewMatrixID, 1, GL_FALSE, &ViewMatrix[0][0]);

			glm::vec3 lightPos = glm::vec3(4,4,4);
			glUniform3f(LightID, lightPos.x, lightPos.y, lightPos.z);

			// Bind our texture in Texture Unit 0
			glActiveTexture(GL_TEXTURE0);
			glBindTexture(GL_TEXTURE_2D, Texture);
			// Set our "myTextureSampler" sampler to user Texture Unit 0
			glUniform1i(TextureID, 0);

			// 1rst attribute buffer : vertices
			glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
			glVertexAttribPointer(
				vertexPosition_modelspaceID,  // attribute
				3,                  // size
				GL_FLOAT,           // type
				GL_FALSE,           // normalized?
				0,                  // stride
				(void*)0            // array buffer offset
			);

			// 2nd attribute buffer : UVs
			glBindBuffer(GL_ARRAY_BUFFER, uvbuffer);
			glVertexAttribPointer(
				vertexUVID,                       // attribute
				2,                                // size
				GL_FLOAT,                         // type
				GL_FALSE,                         // normalized?
				0,                                // stride
				(void*)0                          // array buffer offset
			);

			// 3rd attribute buffer : normals
			glBindBuffer(GL_ARRAY_BUFFER, normalbuffer);
			glVertexAttribPointer(
				vertexNormal_modelspaceID,        // attribute
				3,                                // size
				GL_FLOAT,                         // type
				GL_FALSE,                         // normalized?
				0,                                // stride
				(void*)0                          // array buffer offset
			);

			// Index buffer
			glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elementbuffer);

			// Draw the triangles !
			glDrawElements(
				GL_TRIANGLES,      // mode
				indices.size(),    // count
				GL_UNSIGNED_SHORT,   // type
				(void*)0           // element array buffer offset
			);

		}

		glDisableVertexAttribArray(vertexPosition_modelspaceID);
		glDisableVertexAttribArray(vertexUVID);
		glDisableVertexAttribArray(vertexNormal_modelspaceID);

		// Draw GUI
		TwDraw();

		// Swap buffers
		glfwSwapBuffers();

	} // Check if the ESC key was pressed or the window was closed
	while( glfwGetKey( GLFW_KEY_ESC ) != GLFW_PRESS &&
		   glfwGetWindowParam( GLFW_OPENED ) );

	// Cleanup VBO and shader
	glDeleteBuffers(1, &vertexbuffer);
	glDeleteBuffers(1, &uvbuffer);
	glDeleteBuffers(1, &normalbuffer);
	glDeleteBuffers(1, &elementbuffer);
	glDeleteProgram(programID);
	glDeleteTextures(1, &Texture);

	// Close OpenGL window and terminate GLFW
	glfwTerminate();

	return 0;
}


text:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/news_list"
    android:name="com.skywomantechnology.app.guildviewer.NewsListFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginLeft="16dp"
    android:layout_marginRight="16dp"
    tools:context=".NewsListFragment"
    tools:layout="@android:layout/list_content" />


text:
t_size dsp_chunk_list_impl::get_count() const {return m_data.get_count();}

audio_chunk * dsp_chunk_list_impl::get_item(t_size n) const {return n<m_data.get_count() ? &*m_data[n] : 0;}

void dsp_chunk_list_impl::remove_by_idx(t_size idx)
{
	if (idx<m_data.get_count())
		m_recycled.add_item(m_data.remove_by_idx(idx));
}

void dsp_chunk_list_impl::remove_mask(const bit_array & mask)
{
	t_size n, m = m_data.get_count();
	for(n=0;n<m;n++)
		if (mask[m])
			m_recycled.add_item(m_data[n]);
	m_data.remove_mask(mask);
}

audio_chunk * dsp_chunk_list_impl::insert_item(t_size idx,t_size hint_size)
{
	t_size max = get_count();
	if (idx>max) idx = max;
	pfc::rcptr_t<audio_chunk> ret;
	if (m_recycled.get_count()>0)
	{
		t_size best;
		if (hint_size>0)
		{
			best = 0;
			t_size best_found = m_recycled[0]->get_data_size(), n, total = m_recycled.get_count();
			for(n=1;n<total;n++)
			{
				if (best_found==hint_size) break;
				t_size size = m_recycled[n]->get_data_size();
				int delta_old = abs((int)best_found - (int)hint_size), delta_new = abs((int)size - (int)hint_size);
				if (delta_new < delta_old)
				{
					best_found = size;
					best = n;
				}
			}
		}
		else best = m_recycled.get_count()-1;

		ret = m_recycled.remove_by_idx(best);
		ret->set_sample_count(0);
		ret->set_channels(0);
		ret->set_srate(0);
	}
	else ret = pfc::rcnew_t<audio_chunk_impl>();
	if (idx==max) m_data.add_item(ret);
	else m_data.insert_item(ret,idx);
	return &*ret;
}

void dsp_chunk_list::remove_bad_chunks()
{
	bool blah = false;
	t_size idx;
	for(idx=0;idx<get_count();)
	{
		audio_chunk * chunk = get_item(idx);
		if (!chunk->is_valid())
		{
			chunk->reset();
			remove_by_idx(idx);
			blah = true;
		}
		else idx++;
	}
	if (blah) console::info("one or more bad chunks removed from dsp chunk list");
}

bool dsp_entry::g_instantiate(service_ptr_t<dsp> & p_out,const dsp_preset & p_preset)
{
	service_ptr_t<dsp_entry> ptr;
	if (!g_get_interface(ptr,p_preset.get_owner())) return false;
	return ptr->instantiate(p_out,p_preset);
}

bool dsp_entry::g_instantiate_default(service_ptr_t<dsp> & p_out,const GUID & p_guid)
{
	service_ptr_t<dsp_entry> ptr;
	if (!g_get_interface(ptr,p_guid)) return false;
	dsp_preset_impl preset;
	if (!ptr->get_default_preset(preset)) return false;
	return ptr->instantiate(p_out,preset);
}

bool dsp_entry::g_name_from_guid(pfc::string_base & p_out,const GUID & p_guid)
{
	service_ptr_t<dsp_entry> ptr;
	if (!g_get_interface(ptr,p_guid)) return false;
	ptr->get_name(p_out);
	return true;
}

bool dsp_entry::g_dsp_exists(const GUID & p_guid)
{
	service_ptr_t<dsp_entry> blah;
	return g_get_interface(blah,p_guid);
}

bool dsp_entry::g_get_default_preset(dsp_preset & p_out,const GUID & p_guid)
{
	service_ptr_t<dsp_entry> ptr;
	if (!g_get_interface(ptr,p_guid)) return false;
	return ptr->get_default_preset(p_out);
}

void dsp_chain_config::contents_to_stream(stream_writer * p_stream,abort_callback & p_abort) const {
	t_size n, count = get_count();
	p_stream->write_lendian_t(count,p_abort);
	for(n=0;n<count;n++) {
		get_item(n).contents_to_stream(p_stream,p_abort);
	}
}

void dsp_chain_config::contents_from_stream(stream_reader * p_stream,abort_callback & p_abort) {
	t_uint32 n,count;

	remove_all();

	p_stream->read_lendian_t(count,p_abort);

	dsp_preset_impl temp;

	for(n=0;n<count;n++) {
		temp.contents_from_stream(p_stream,p_abort);
		add_item(temp);
	}
}

bool cfg_dsp_chain_config::get_data(dsp_chain_config & p_data) const {
	p_data.copy(m_data);
	return true;
}

void cfg_dsp_chain_config::set_data(const dsp_chain_config & p_data) {
	m_data.copy(p_data);
}

void cfg_dsp_chain_config::reset() {
	m_data.remove_all();
}

void cfg_dsp_chain_config::get_data_raw(stream_writer * p_stream,abort_callback & p_abort) {
	m_data.contents_to_stream(p_stream,p_abort);
}

void cfg_dsp_chain_config::set_data_raw(stream_reader * p_stream,t_size,abort_callback & p_abort) {
	m_data.contents_from_stream(p_stream,p_abort);
}

void dsp_chain_config::remove_item(t_size p_index)
{
	remove_mask(bit_array_one(p_index));
}

void dsp_chain_config::add_item(const dsp_preset & p_data)
{
	insert_item(p_data,get_count());
}

void dsp_chain_config::remove_all()
{
	remove_mask(bit_array_true());
}

void dsp_chain_config::instantiate(service_list_t<dsp> & p_out)
{
	p_out.remove_all();
	t_size n, m = get_count();
	for(n=0;n<m;n++)
	{
		service_ptr_t<dsp> temp;
		if (dsp_entry::g_instantiate(temp,get_item(n)))
			p_out.add_item(temp);
	}
}

t_size dsp_chain_config_impl::get_count() const
{
	return m_data.get_count();
}

const dsp_preset & dsp_chain_config_impl::get_item(t_size p_index) const
{
	return *m_data[p_index];
}

void dsp_chain_config_impl::replace_item(const dsp_preset & p_data,t_size p_index)
{
	*m_data[p_index] = p_data;
}

void dsp_chain_config_impl::insert_item(const dsp_preset & p_data,t_size p_index)
{
	m_data.insert_item(new dsp_preset_impl(p_data),p_index);
}

void dsp_chain_config_impl::remove_mask(const bit_array & p_mask)
{
	m_data.delete_mask(p_mask);
}

dsp_chain_config_impl::~dsp_chain_config_impl()
{
	m_data.delete_all();
}

void dsp_preset::contents_to_stream(stream_writer * p_stream,abort_callback & p_abort) const {
	t_size size = get_data_size();
	p_stream->write_lendian_t(get_owner(),p_abort);
	p_stream->write_lendian_t(size,p_abort);
	if (size > 0) {
		p_stream->write_object(get_data(),size,p_abort);
	}
}

void dsp_preset::contents_from_stream(stream_reader * p_stream,abort_callback & p_abort) {
	t_uint32 size;
	GUID guid;
	p_stream->read_lendian_t(guid,p_abort);
	set_owner(guid);
	p_stream->read_lendian_t(size,p_abort);
	if (size > 1024*1024*32) throw exception_io_data();
	set_data_from_stream(p_stream,size,p_abort);
}

void dsp_preset::g_contents_from_stream_skip(stream_reader * p_stream,abort_callback & p_abort) {
	t_uint32 size;
	GUID guid;
	p_stream->read_lendian_t(guid,p_abort);
	p_stream->read_lendian_t(size,p_abort);
	if (size > 1024*1024*32) throw exception_io_data();
	p_stream->skip_object(size,p_abort);
}

void dsp_preset_impl::set_data_from_stream(stream_reader * p_stream,t_size p_bytes,abort_callback & p_abort) {
	m_data.set_size(p_bytes);
	if (p_bytes > 0) p_stream->read_object(m_data.get_ptr(),p_bytes,p_abort);
}

void dsp_chain_config::copy(const dsp_chain_config & p_source) {
	remove_all();
	t_size n, m = p_source.get_count();
	for(n=0;n<m;n++)
		add_item(p_source.get_item(n));
}

bool dsp_entry::g_have_config_popup(const GUID & p_guid)
{
	service_ptr_t<dsp_entry> entry;
	if (!g_get_interface(entry,p_guid)) return false;
	return entry->have_config_popup();
}

bool dsp_entry::g_have_config_popup(const dsp_preset & p_preset)
{
	return g_have_config_popup(p_preset.get_owner());
}

bool dsp_entry::g_show_config_popup(dsp_preset & p_preset,HWND p_parent)
{
	service_ptr_t<dsp_entry> entry;
	if (!g_get_interface(entry,p_preset.get_owner())) return false;
	return entry->show_config_popup(p_preset,p_parent);
}

void dsp_entry::g_show_config_popup_v2(const dsp_preset & p_preset,HWND p_parent,dsp_preset_edit_callback & p_callback) {
	service_ptr_t<dsp_entry> entry;
	if (g_get_interface(entry,p_preset.get_owner())) {
		service_ptr_t<dsp_entry_v2> entry_v2;
		if (entry->service_query_t(entry_v2)) {
			entry_v2->show_config_popup_v2(p_preset,p_parent,p_callback);
		} else {
			dsp_preset_impl temp(p_preset);
			if (entry->show_config_popup(temp,p_parent)) p_callback.on_preset_changed(temp);
		}
	}
}

bool dsp_entry::g_get_interface(service_ptr_t<dsp_entry> & p_out,const GUID & p_guid)
{
	service_ptr_t<dsp_entry> ptr;
	service_enum_t<dsp_entry> e;
	e.reset();
	while(e.next(ptr))
	{
		if (ptr->get_guid() == p_guid)
		{
			p_out = ptr;
			return true;
		}
	}
	return false;
}

bool resampler_entry::g_get_interface(service_ptr_t<resampler_entry> & p_out,unsigned p_srate_from,unsigned p_srate_to)
{
	service_ptr_t<dsp_entry> ptr_dsp;
	service_ptr_t<resampler_entry> ptr_resampler;
	service_enum_t<dsp_entry> e;
	e.reset();
	float found_priority = 0;
	service_ptr_t<resampler_entry> found;
	while(e.next(ptr_dsp))
	{
		if (ptr_dsp->service_query_t(ptr_resampler))
		{
			if (p_srate_from == 0 || ptr_resampler->is_conversion_supported(p_srate_from,p_srate_to))
			{
				float priority = ptr_resampler->get_priority();
				if (found.is_empty() || priority > found_priority)
				{
					found = ptr_resampler;
					found_priority = priority;
				}
			}
		}
	}
	if (found.is_empty()) return false;
	p_out = found;
	return true;
}

bool resampler_entry::g_create_preset(dsp_preset & p_out,unsigned p_srate_from,unsigned p_srate_to,float p_qualityscale)
{
	service_ptr_t<resampler_entry> entry;
	if (!g_get_interface(entry,p_srate_from,p_srate_to)) return false;
	return entry->create_preset(p_out,p_srate_to,p_qualityscale);
}

bool resampler_entry::g_create(service_ptr_t<dsp> & p_out,unsigned p_srate_from,unsigned p_srate_to,float p_qualityscale)
{
	service_ptr_t<resampler_entry> entry;
	if (!g_get_interface(entry,p_srate_from,p_srate_to)) return false;
	dsp_preset_impl preset;
	if (!entry->create_preset(preset,p_srate_to,p_qualityscale)) return false;
	return entry->instantiate(p_out,preset);
}

bool dsp_chain_config::equals(dsp_chain_config const & v1, dsp_chain_config const & v2) {
	const t_size count = v1.get_count();
	if (count != v2.get_count()) return false;
	for(t_size walk = 0; walk < count; ++walk) {
		if (v1.get_item(walk) != v2.get_item(walk)) return false;
	}
	return true;
}
void dsp_chain_config::get_name_list(pfc::string_base & p_out) const
{
	const t_size count = get_count();
	bool added = false;
	for(unsigned n=0;n<count;n++)
	{
		service_ptr_t<dsp_entry> ptr;
		if (dsp_entry::g_get_interface(ptr,get_item(n).get_owner()))
		{
			if (added) p_out += ", ";
			added = true;

			pfc::string8 temp;
			ptr->get_name(temp);
			p_out += temp;
		}
	}
}

void dsp::run_abortable(dsp_chunk_list * p_chunk_list,const metadb_handle_ptr & p_cur_file,int p_flags,abort_callback & p_abort) {
	service_ptr_t<dsp_v2> this_v2;
	if (this->service_query_t(this_v2)) this_v2->run_v2(p_chunk_list,p_cur_file,p_flags,p_abort);
	else run(p_chunk_list,p_cur_file,p_flags);
}

namespace {
	class dsp_preset_edit_callback_impl : public dsp_preset_edit_callback {
	public:
		dsp_preset_edit_callback_impl(dsp_preset & p_data) : m_data(p_data) {}
		void on_preset_changed(const dsp_preset & p_data) {m_data = p_data;}
	private:
		dsp_preset & m_data;
	};
};

bool dsp_entry_v2::show_config_popup(dsp_preset & p_data,HWND p_parent) {
	PFC_ASSERT(p_data.get_owner() == get_guid());
	dsp_preset_impl temp(p_data);

    {
        dsp_preset_edit_callback_impl cb(temp);
        show_config_popup_v2(p_data,p_parent,cb);
    }
	PFC_ASSERT(temp.get_owner() == get_guid());
	if (temp == p_data) return false;
	p_data = temp;
	return true;
}


text:
package godep

import (
	"encoding/json"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"

	"github.com/golang/dep"
	"github.com/golang/dep/internal/gps"
	"github.com/golang/dep/internal/importers/base"
	"github.com/pkg/errors"
)

const godepPath = "Godeps" + string(os.PathSeparator) + "Godeps.json"

// Importer imports godep configuration into the dep configuration format.
type Importer struct {
	*base.Importer
	json godepJSON
}

// NewImporter for godep.
func NewImporter(logger *log.Logger, verbose bool, sm gps.SourceManager) *Importer {
	return &Importer{Importer: base.NewImporter(logger, verbose, sm)}
}

type godepJSON struct {
	Imports []godepPackage `json:"Deps"`
}

type godepPackage struct {
	ImportPath string `json:"ImportPath"`
	Rev        string `json:"Rev"`
	Comment    string `json:"Comment"`
}

// Name of the importer.
func (g *Importer) Name() string {
	return "godep"
}

// HasDepMetadata checks if a directory contains config that the importer can handle.
func (g *Importer) HasDepMetadata(dir string) bool {
	y := filepath.Join(dir, godepPath)
	if _, err := os.Stat(y); err != nil {
		return false
	}

	return true
}

// Import the config found in the directory.
func (g *Importer) Import(dir string, pr gps.ProjectRoot) (*dep.Manifest, *dep.Lock, error) {
	err := g.load(dir)
	if err != nil {
		return nil, nil, err
	}

	return g.convert(pr)
}

func (g *Importer) load(projectDir string) error {
	g.Logger.Println("Detected godep configuration files...")
	j := filepath.Join(projectDir, godepPath)
	if g.Verbose {
		g.Logger.Printf("  Loading %s", j)
	}
	jb, err := ioutil.ReadFile(j)
	if err != nil {
		return errors.Wrapf(err, "unable to read %s", j)
	}
	err = json.Unmarshal(jb, &g.json)
	if err != nil {
		return errors.Wrapf(err, "unable to parse %s", j)
	}

	return nil
}

func (g *Importer) convert(pr gps.ProjectRoot) (*dep.Manifest, *dep.Lock, error) {
	g.Logger.Println("Converting from Godeps.json ...")

	packages := make([]base.ImportedPackage, 0, len(g.json.Imports))
	for _, pkg := range g.json.Imports {
		// Validate
		if pkg.ImportPath == "" {
			err := errors.New("invalid godep configuration, ImportPath is required")
			return nil, nil, err
		}

		if pkg.Rev == "" {
			err := errors.New("invalid godep configuration, Rev is required")
			return nil, nil, err
		}

		ip := base.ImportedPackage{
			Name:           pkg.ImportPath,
			LockHint:       pkg.Rev,
			ConstraintHint: pkg.Comment,
		}
		packages = append(packages, ip)
	}

	err := g.ImportPackages(packages, true)
	if err != nil {
		return nil, nil, err
	}

	return g.Manifest, g.Lock, nil
}


text:
<?php

namespace app\controllers;

use Yii;
use app\models\EstudiosIps;
use app\models\Estudios;
use app\models\EstudiosIpsSearch;
use app\models\UsuariosIps;
use app\models\TiposServicio;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\helpers\ArrayHelper;

/**
 * EstudiosIpsController implements the CRUD actions for EstudiosIps model.
 */
class EstudiosIpsController extends Controller
{
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Lists all EstudiosIps models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new EstudiosIpsSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
            'lista_est' => ArrayHelper::map(Estudios::find()->all(), 'cod_cups', 'descripcion'),
            'lista_tipos' => ArrayHelper::map(TiposServicio::find()->where(['idips'=>UsuariosIps::find()->select(['idips'])->where(['idusuario'=>Yii::$app->user->id])])->all(), 'id', 'nombre'),
        ]);
    }

    /**
     * Displays a single EstudiosIps model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new EstudiosIps model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new EstudiosIps();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing EstudiosIps model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing EstudiosIps model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the EstudiosIps model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return EstudiosIps the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = EstudiosIps::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


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

import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.internal.processors.GridProcessor;
import org.apache.ignite.internal.processors.platform.cache.store.PlatformCacheStore;
import org.jetbrains.annotations.Nullable;

/**
 * Platform processor.
 */
@SuppressWarnings("UnusedDeclaration")
public interface PlatformProcessor extends GridProcessor {
    /**
     * Gets owning Ignite instance.
     *
     * @return Ignite instance.
     */
    public Ignite ignite();

    /**
     * Get environment pointer associated with this processor.
     *
     * @return Environment pointer.
     */
    public long environmentPointer();

    /**
     * Gets platform context.
     *
     * @return Platform context.
     */
    public PlatformContext context();

    /**
     * Notify processor that it is safe to use.
     */
    public void releaseStart();

    /**
     * Await until platform processor is safe to use (i.e. {@link #releaseStart() has been called}.
     *
     * @throws IgniteCheckedException If failed.
     */
    public void awaitStart() throws IgniteCheckedException;

    /**
     * Get cache.
     *
     * @param name Cache name.
     * @return Cache.
     * @throws IgniteCheckedException If failed.
     */
    public PlatformTarget cache(@Nullable String name) throws IgniteCheckedException;

    /**
     * Create cache.
     *
     * @param name Cache name.
     * @return Cache.
     * @throws IgniteCheckedException If failed.
     */
    public PlatformTarget createCache(@Nullable String name) throws IgniteCheckedException;

    /**
     * Get or create cache.
     *
     * @param name Cache name.
     * @return Cache.
     * @throws IgniteCheckedException If failed.
     */
    public PlatformTarget getOrCreateCache(@Nullable String name) throws IgniteCheckedException;

    /**
     * Get affinity.
     *
     * @param name Cache name.
     * @return Affinity.
     * @throws IgniteCheckedException If failed.
     */
    public PlatformTarget affinity(@Nullable String name) throws IgniteCheckedException;

    /**
     * Get data streamer.
     *
     * @param cacheName Cache name.
     * @param keepBinary Binary flag.
     * @return Data streamer.
     * @throws IgniteCheckedException If failed.
     */
    public PlatformTarget dataStreamer(@Nullable String cacheName, boolean keepBinary) throws IgniteCheckedException;

    /**
     * Get transactions.
     *
     * @return Transactions.
     */
    public PlatformTarget transactions();

    /**
     * Get projection.
     *
     * @return Projection.
     * @throws IgniteCheckedException If failed.
     */
    public PlatformTarget projection() throws IgniteCheckedException;

    /**
     * Create interop compute.
     *
     * @param grp Cluster group.
     * @return Compute instance.
     */
    public PlatformTarget compute(PlatformTarget grp);

    /**
     * Create interop messaging.
     *
     * @param grp Cluster group.
     * @return Messaging instance.
     */
    public PlatformTarget message(PlatformTarget grp);

    /**
     * Create interop events.
     *
     * @param grp Cluster group.
     * @return Events instance.
     */
    public PlatformTarget events(PlatformTarget grp);

    /**
     * Create interop services.
     *
     * @param grp Cluster group.
     * @return Services instance.
     */
    public PlatformTarget services(PlatformTarget grp);

    /**
     * Get platform extensions. Override this method to provide any additional targets and operations you need.
     *
     * @return Platform extensions.
     */
    public PlatformTarget extensions();

    /**
     * Register cache store.
     *
     * @param store Store.
     * @param convertBinary Convert binary flag.
     * @throws IgniteCheckedException If failed.
     */
    public void registerStore(PlatformCacheStore store, boolean convertBinary) throws IgniteCheckedException;

    /**
     * Get or create AtomicLong.
     * @param name Name.
     * @param initVal Initial value.
     * @param create Create flag.
     * @return Platform atomic long.
     * @throws IgniteException
     */
    public PlatformTarget atomicLong(String name, long initVal, boolean create) throws IgniteException;
}


text:
var btcstr2bignum, dumpScript, endian, errv, isEmpty, parseScript, readBuffer, readString, readVarInt, root, tx_parseBCI, u16, u32, u64, u8, uint;

root = typeof exports !== "undefined" && exports !== null ? exports : this;

root.TX = (function() {

  function TX(eckey) {
    this.inputs = [];
    this.outputs = [];
    this.eckey = eckey;
    this.balance = 0;
  }

  TX.prototype.addOutput = function(addr, fval) {
    return this.outputs.push({
      address: addr,
      value: fval
    });
  };

  TX.prototype.getBalance = function() {
    return this.balance;
  };

  TX.prototype.getAddress = function() {
    return this.eckey.getBitcoinAddress().toString();
  };

  TX.prototype.parseInputs = function(text, address) {
    var res;
    res = tx_parseBCI(text, address);
    console.log("here is parseInputs");
    this.balance = res.balance;
    return this.inputs = res.unspenttxs;
  };

  TX.prototype.construct = function() {
    var address, b64hash, connectedScript, fval, hash, hashType, i, index, pubKey, pubKeyHash, script, selectedOuts, sendTx, signature, txin, value;
    sendTx = new Bitcoin.Transaction();
    selectedOuts = [];
    for (hash in this.inputs) {
      if (!this.inputs.hasOwnProperty(hash)) {
        continue;
      }
      for (index in this.inputs[hash]) {
        if (!this.inputs[hash].hasOwnProperty(index)) {
          continue;
        }
        script = parseScript(this.inputs[hash][index].script);
        b64hash = Crypto.util.bytesToBase64(Crypto.util.hexToBytes(hash));
        txin = new Bitcoin.TransactionIn({
          outpoint: {
            hash: b64hash,
            index: index
          },
          script: script,
          sequence: 4294967295
        });
        selectedOuts.push(txin);
        sendTx.addInput(txin);
      }
    }
    for (i in this.outputs) {
      address = this.outputs[i].address;
      fval = this.outputs[i].value;
      value = new BigInteger("" + Math.round(fval * 1e8), 10);
      sendTx.addOutput(new Bitcoin.Address(address), value);
    }
    hashType = 1;
    i = 0;
    while (i < sendTx.ins.length) {
      connectedScript = selectedOuts[i].script;
      hash = sendTx.hashTransactionForSignature(connectedScript, i, hashType);
      pubKeyHash = connectedScript.simpleOutPubKeyHash();
      signature = this.eckey.sign(hash);
      signature.push(parseInt(hashType, 10));
      pubKey = this.eckey.getPub();
      script = new Bitcoin.Script();
      script.writeBytes(signature);
      script.writeBytes(pubKey);
      sendTx.ins[i].script = script;
      i++;
    }
    return sendTx;
  };

  TX.prototype.deserialize = function(bytes) {
    var f, i, lock_time, n, op, script, sendTx, seq, tx_ver, txin, txout, value, vin_sz, vout_sz;
    sendTx = new Bitcoin.Transaction();
    f = bytes.slice(0);
    tx_ver = u32(f);
    vin_sz = readVarInt(f);
    if (errv(vin_sz)) {
      return null;
    }
    i = 0;
    while (i < vin_sz) {
      op = readBuffer(f, 32);
      n = u32(f);
      script = readString(f);
      seq = u32(f);
      txin = new Bitcoin.TransactionIn({
        outpoint: {
          hash: Crypto.util.bytesToBase64(op),
          index: n
        },
        script: new Bitcoin.Script(script),
        sequence: seq
      });
      sendTx.addInput(txin);
      i++;
    }
    vout_sz = readVarInt(f);
    if (errv(vout_sz)) {
      return null;
    }
    i = 0;
    while (i < vout_sz) {
      value = u64(f);
      script = readString(f);
      txout = new Bitcoin.TransactionOut({
        value: value,
        script: new Bitcoin.Script(script)
      });
      sendTx.addOutput(txout);
      i++;
    }
    lock_time = u32(f);
    sendTx.lock_time = lock_time;
    return sendTx;
  };

  return TX;

})();

uint = function(f, size) {
  var b, bytes, i, n, pos;
  if (f.length < size) {
    return 0;
  }
  bytes = f.slice(0, size);
  pos = 1;
  n = 0;
  i = 0;
  while (i < size) {
    b = f.shift();
    n += b * pos;
    pos *= 256;
    i++;
  }
  if (size <= 4) {
    return n;
  } else {
    return bytes;
  }
};

u8 = function(f) {
  return uint(f, 1);
};

u16 = function(f) {
  return uint(f, 2);
};

u32 = function(f) {
  return uint(f, 4);
};

u64 = function(f) {
  return uint(f, 8);
};

errv = function(val) {
  return val instanceof BigInteger || val > 0xffff;
};

readBuffer = function(f, size) {
  var i, res;
  res = f.slice(0, size);
  i = 0;
  while (i < size) {
    f.shift();
    i++;
  }
  return res;
};

readString = function(f) {
  var len;
  len = readVarInt(f);
  if (errv(len)) {
    return [];
  }
  return readBuffer(f, len);
};

readVarInt = function(f) {
  var t;
  t = u8(f);
  if (t === 0xfd) {
    return u16(f);
  } else if (t === 0xfe) {
    return u32(f);
  } else if (t === 0xff) {
    return u64(f);
  } else {
    return t;
  }
};

dumpScript = function(script) {
  var chunk, i, op, out;
  out = [];
  i = 0;
  while (i < script.chunks.length) {
    chunk = script.chunks[i];
    op = new Bitcoin.Opcode(chunk);
    if (typeof chunk === "number") {
      out.push(op.toString());
    } else {
      out.push(Crypto.util.bytesToHex(chunk));
    }
    i++;
  }
  return out.join(" ");
};

tx_parseBCI = function(data, address) {
  var balance, i, lilendHash, o, r, script, txs, unspenttxs, value;
  r = JSON.parse(data);
  txs = r.unspent_outputs;
  if (!txs) {
    throw "Not a BCI format";
  }
  delete unspenttxs;
  unspenttxs = {};
  balance = BigInteger.ZERO;
  for (i in txs) {
    o = txs[i];
    lilendHash = o.tx_hash;
    script = dumpScript(new Bitcoin.Script(Crypto.util.hexToBytes(o.script)));
    value = new BigInteger("" + o.value, 10);
    if (!(lilendHash in unspenttxs)) {
      unspenttxs[lilendHash] = {};
    }
    unspenttxs[lilendHash][o.tx_output_n] = {
      amount: value,
      script: script
    };
    balance = balance.add(value);
  }
  return {
    balance: balance,
    unspenttxs: unspenttxs
  };
};

isEmpty = function(ob) {
  var i;
  for (i in ob) {
    if (ob.hasOwnProperty(i)) {
      return false;
    }
  }
  return true;
};

endian = function(string) {
  var i, out;
  out = [];
  i = string.length;
  while (i > 0) {
    out.push(string.substring(i - 2, i));
    i -= 2;
  }
  return out.join("");
};

btcstr2bignum = function(btc) {
  var diff, i, mul, value;
  i = btc.indexOf(".");
  value = new BigInteger(btc.replace(/\./, ""));
  diff = 9 - (btc.length - i);
  if (i === -1) {
    mul = "100000000";
  } else if (diff < 0) {
    return value.divide(new BigInteger(Math.pow(10, -1 * diff).toString()));
  } else {
    mul = Math.pow(10, diff).toString();
  }
  return value.multiply(new BigInteger(mul));
};

parseScript = function(script) {
  var i, newScript, s;
  newScript = new Bitcoin.Script();
  s = script.split(" ");
  for (i in s) {
    if (Bitcoin.Opcode.map.hasOwnProperty(s[i])) {
      newScript.writeOp(Bitcoin.Opcode.map[s[i]]);
    } else {
      newScript.writeBytes(Crypto.util.hexToBytes(s[i]));
    }
  }
  return newScript;
};


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package snowpine.pangu.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.DataSource;

/**
 *
 * @author Xuesong
 */
public class UserDAOJdbcImpl implements UserDAO {

    private static final String SQL_GET_USER = "select * from users where user_id=?";

    private final DataSource dataSource;

    public UserDAOJdbcImpl(DataSource ds) {
        this.dataSource = ds;
    }

    private User getUser(ResultSet rs) throws SQLException {
        User user = new User();
        user.setId(rs.getLong("user_id"));
        user.setBalance(rs.getLong("balance"));
        user.setSalt(rs.getString("salt"));
        user.setPasshash(rs.getString("passhash"));

        return user;
    }

    @Override
    public User findById(long id) throws DAOWrapperException {
        User user = null;

        try (Connection conn = dataSource.getConnection();
                PreparedStatement ps = conn.prepareStatement(SQL_GET_USER);) {

            ps.setLong(1, id);
            ResultSet rs = ps.executeQuery();
            if (rs != null && rs.next()) {
                user = getUser(rs);
            }

        } catch (SQLException sqle) {
            DAOWrapperException.printSQLException(sqle);
            throw new DAOWrapperException("SQLException", sqle);
        }

        return user;
    }
}


text:
Cassandra Matlab Driver
=======================

Usage
-----

- Download/clone; everything's included.
- Run ``setup.m``.
- See ``testSession.m`` for sample usage and ``testCluster.m`` for cluster usage.

Note: API is very raw, subject to change.


text:
import unittest
import checksieve

class TestExamples(unittest.TestCase):

	def test_example_1(self):
		sieve = '''
			require ["convert"];
			convert "image/tiff" "image/jpeg" ["pix-x=320","pix-y=240"];
		'''
		self.assertFalse(checksieve.parse_string(sieve, False))

	def test_example_2(self):
		sieve = '''
			require ["mime", "fileinto", "convert"];
		    if header :mime :anychild :contenttype
					 "Content-Type" "image/tiff"
		    {
				if (convert "image/tiff" "image/jpeg" ["pix-x=320","pix-y=240"]) {
				   fileinto "INBOX.pics";
				}
		    }
		 '''
		self.assertFalse(checksieve.parse_string(sieve, False))

	def test_example_3(self):
		sieve = '''
			require ["mime", "foreverypart", "fileinto", "convert"];
			   foreverypart
			   {
				 if header :mime :param "filename" :contains
						   "Content-Disposition" "inline"
				 {
				   if size :over "500K"
				   {
					convert "image/tiff" "image/jpeg" ["pix-x=640","pix-y=480"];
				   } else {
				   convert "image/tiff" "image/jpeg" ["pix-x=320","pix-y=240"];
					  }
					}
				  }
		 '''
		self.assertFalse(checksieve.parse_string(sieve, False))

	def test_example_4(self):
		sieve = '''
			require ["mime", "foreverypart",
			"fileinto", "redirect", "convert"];

		   # The first "if" block will convert all image/tiff body parts
		   # to 640x480 jpegs and will file the message
		   # into the "INBOX.pics" mailbox as converted at this point.
		   if header :mime :anychild :contenttype
					 "Content-Type" "image/tiff"
		   {
			 convert "image/tiff" "image/jpeg" ["pix-x=640","pix-y=480"];
			 fileinto "INBOX.pics";
		   }

		   # The second block, the "foreverypart" loop, will convert all
		   # inline jpegs to 320x240 resolution... including any tiff body
		   # parts that had been converted in the first block, above.
		   # Therefore, any tiff that had been converted to a 640x480 jpeg
		   # will be re-converted to a 320x240 jpeg here if its
		   # Content-Disposition is specified as "inline".
		   foreverypart
		   {
			 if header :mime :param "filename" :contains
					   "Content-Disposition" "inline"
			 {
			   convert "image/jpeg" "image/jpeg" ["pix-x=320","pix-y=240"];
			 }
		   }

		   # The third block will take any message that contains a header
		   # field called "Mobile-Link" and redirect it to the user's
		   # mobile address.  The redirected message will include both
		   # conversions above, from block one and block two.
		   if exists "Mobile-Link"
		   {
			 redirect "joe@mobile.example.com";
		   }

		   # The fourth block will file the message into "Tiff" if it
		  # contains any tiff body parts.  But because of the earlier
		  # conversion (in the first block), there will never be any
		  # tiff body parts, so this "fileinto" will never happen.
		  if header :mime :anychild :contenttype
					"Content-Type" "image/tiff"
		  {
			fileinto "Tiff";
		  }

		  # Now, at the end of the script processing, the Sieve
		  # processor will perform an implicit keep if none of
		  # the "fileinto" and "redirect" actions were taken.
		  # The kept message will include any conversions that
		  # were done (that is, any from the second block).
		 '''
		self.assertFalse(checksieve.parse_string(sieve, False))

if __name__ == '__main__':
	unittest.main()


text:
{% load url from future %}
{% if status_bar %}

{% for message in status_bar.messages %}

{{message}}

{% endfor %}
{% for error in status_bar.errors %}

{{error}}

{% endfor %}

{% endif %}


text:
namespace NetSparkleTestApp
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.btnTestLoop = new System.Windows.Forms.Button();
            this.btnStopLoop = new System.Windows.Forms.Button();
            this.btnCheck = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(46, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(170, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Close this dialog to exit NetSparkle";
            //
            // btnTestLoop
            //
            this.btnTestLoop.Location = new System.Drawing.Point(12, 59);
            this.btnTestLoop.Name = "btnTestLoop";
            this.btnTestLoop.Size = new System.Drawing.Size(75, 23);
            this.btnTestLoop.TabIndex = 1;
            this.btnTestLoop.Text = "Test Loop";
            this.btnTestLoop.UseVisualStyleBackColor = true;
            this.btnTestLoop.Click += new System.EventHandler(this.btnTestLoop_Click);
            //
            // btnStopLoop
            //
            this.btnStopLoop.Location = new System.Drawing.Point(93, 59);
            this.btnStopLoop.Name = "btnStopLoop";
            this.btnStopLoop.Size = new System.Drawing.Size(75, 23);
            this.btnStopLoop.TabIndex = 2;
            this.btnStopLoop.Text = "Stop Loop";
            this.btnStopLoop.UseVisualStyleBackColor = true;
            this.btnStopLoop.Click += new System.EventHandler(this.btnStopLoop_Click);
            //
            // btnCheck
            //
            this.btnCheck.Location = new System.Drawing.Point(174, 59);
            this.btnCheck.Name = "btnCheck";
            this.btnCheck.Size = new System.Drawing.Size(75, 23);
            this.btnCheck.TabIndex = 3;
            this.btnCheck.Text = "Check";
            this.btnCheck.UseVisualStyleBackColor = true;
            this.btnCheck.Click += new System.EventHandler(this.btnCheck_Click);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(263, 94);
            this.Controls.Add(this.btnCheck);
            this.Controls.Add(this.btnStopLoop);
            this.Controls.Add(this.btnTestLoop);
            this.Controls.Add(this.label1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Location = new System.Drawing.Point(10, 10);
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Form1";
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.Text = "Form1";
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnTestLoop;
        private System.Windows.Forms.Button btnStopLoop;
        private System.Windows.Forms.Button btnCheck;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Ploeh.AutoFixture.Kernel;

namespace SimpleDataGenerator.Core.Customization.Specimens
{
    public class ConstValueSpecimenBuilder : ISpecimenBuilder
    {
        private readonly PropertyInfo _selectedProperty;
        private readonly object _constValue;
        public ConstValueSpecimenBuilder(PropertyInfo propertyInfo, object constValue)
        {
            _selectedProperty = propertyInfo;
            _constValue = constValue;
        }

        public object Create(object request, ISpecimenContext context)
        {
            if (IsSelectedProperty(request))
            {
                return _constValue;
            }

            return new NoSpecimen();
        }

        private bool IsSelectedProperty(object request)
        {
            var property = request as PropertyInfo;
            return property != null && property.Equals(_selectedProperty);
        }
    }
}


text:
using ArtportalenApp.Interfaces;
using ArtportalenApp.ViewModels;
using Xamarin.Forms;

namespace ArtportalenApp.Views
{
    public partial class ChooseSingleTaxonPage : ContentPage, IPage<ChooseSingleTaxonViewModel>
    {
        public ChooseSingleTaxonPage()
        {
            InitializeComponent();
        }

        protected override void OnAppearing()
        {
            SearchBarElement.Focus();

            base.OnAppearing();
        }

        public ChooseSingleTaxonViewModel ViewModel { get; set; }
    }
}


text:
package com.commonsware.android.preso.fragment;

import android.content.Context;
import android.os.Bundle;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class SamplePresentationFragment extends WebPresentationFragment {
  private static final String ARG_URL="url";

  public static SamplePresentationFragment newInstance(Context ctxt,
                                                       Display display,
                                                       String url) {
    SamplePresentationFragment frag=new SamplePresentationFragment();

    frag.setDisplay(ctxt, display);

    Bundle b=new Bundle();

    b.putString(ARG_URL, url);
    frag.setArguments(b);

    return(frag);
  }

  @Override
  public View onCreateView(LayoutInflater inflater,
                           ViewGroup container,
                           Bundle savedInstanceState) {
    View result=
        super.onCreateView(inflater, container, savedInstanceState);

    getWebView().loadUrl(getArguments().getString(ARG_URL));

    return(result);
  }
}


text:
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Eq interface](#eq-interface)
- [Built-in primitive eqs](#built-in-primitive-eqs)
- [Combinators](#combinators)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Eq interface

```ts
export interface Eq<A> {
  readonly equals: (x: A, y: A) => boolean
}
```

The `Eq` type class represents types which support decidable equality.

Instances must satisfy the following laws:

1. Reflexivity: `E.equals(a, a) === true`
2. Symmetry: `E.equals(a, b) === E.equals(b, a)`
3. Transitivity: if `E.equals(a, b) === true` and `E.equals(b, c) === true`, then `E.equals(a, c) === true`

**Example**

```ts
import { Eq } from 'fp-ts/Eq'

export const string: Eq<string> = {
  equals: (x, y) => x === y
}
```

# Built-in primitive eqs

- `string: Eq<string>`
- `number: Eq<number>`
- `boolean: Eq<boolean>`
- `UnknownArray: Eq<Array<unknown>>`
- `UnknownRecord: Eq<Record<string, unknown>>`

# Combinators

- `literal`
- `nullable`
- `type`
- `partial`
- `record`
- `array`
- `tuple`
- `intersection`
- `sum`
- `lazy`

**Example**

```ts
import * as E from 'io-ts/Eq'

const Person = E.type({
  name: E.string,
  age: E.number
})

console.log(Person.equals({ name: 'a', age: 0 }, { name: 'a', age: 0 })) // => true
console.log(Person.equals({ name: 'a', age: 0 }, { name: '', age: 0 })) // => false
console.log(Person.equals({ name: 'a', age: 0 }, { name: 'a', age: 1 })) // => false
```