text:
namespace System.Activities.Runtime
{
    using System;
    using System.Diagnostics.CodeAnalysis;
    using System.Runtime;
    using System.Runtime.Serialization;
    using System.Security;
    using System.Threading;
    using System.Runtime.Diagnostics;

    [DataContract(Name = XD.Runtime.Scheduler, Namespace = XD.Runtime.Namespace)]
    class Scheduler
    {
        static ContinueAction continueAction = new ContinueAction();
        static YieldSilentlyAction yieldSilentlyAction = new YieldSilentlyAction();
        static AbortAction abortAction = new AbortAction();

        WorkItem firstWorkItem;

        static SendOrPostCallback onScheduledWorkCallback = Fx.ThunkCallback(new SendOrPostCallback(OnScheduledWork));

        SynchronizationContext synchronizationContext;

        bool isPausing;
        bool isRunning;

        bool resumeTraceRequired;

        Callbacks callbacks;

        Quack<WorkItem> workItemQueue;

        public Scheduler(Callbacks callbacks)
        {
            this.Initialize(callbacks);
        }

        public static RequestedAction Continue
        {
            get
            {
                return continueAction;
            }
        }

        public static RequestedAction YieldSilently
        {
            get
            {
                return yieldSilentlyAction;
            }
        }

        public static RequestedAction Abort
        {
            get
            {
                return abortAction;
            }
        }

        public bool IsRunning
        {
            get
            {
                return this.isRunning;
            }
        }

        public bool IsIdle
        {
            get
            {
                return this.firstWorkItem == null;
            }
        }

        [DataMember(EmitDefaultValue = false, Name = "firstWorkItem")]
        internal WorkItem SerializedFirstWorkItem
        {
            get { return this.firstWorkItem; }
            set { this.firstWorkItem = value; }
        }

        [DataMember(EmitDefaultValue = false)]
        [SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUncalledPrivateCode)]
        internal WorkItem[] SerializedWorkItemQueue
        {
            get
            {
                if (this.workItemQueue != null && this.workItemQueue.Count > 0)
                {
                    return this.workItemQueue.ToArray();
                }
                else
                {
                    return null;
                }
            }
            set
            {
                Fx.Assert(value != null, "EmitDefaultValue is false so we should never get null.");

                // this.firstWorkItem is serialized out separately, so don't use ScheduleWork() here
                this.workItemQueue = new Quack<WorkItem>(value);
            }
        }

        public void FillInstanceMap(ActivityInstanceMap instanceMap)
        {
            if (this.firstWorkItem != null)
            {
                ActivityInstanceMap.IActivityReference activityReference = this.firstWorkItem as ActivityInstanceMap.IActivityReference;
                if (activityReference != null)
                {
                    instanceMap.AddEntry(activityReference, true);
                }

                if (this.workItemQueue != null && this.workItemQueue.Count > 0)
                {
                    for (int i = 0; i < this.workItemQueue.Count; i++)
                    {
                        activityReference = this.workItemQueue[i] as ActivityInstanceMap.IActivityReference;
                        if (activityReference != null)
                        {
                            instanceMap.AddEntry(activityReference, true);
                        }
                    }
                }
            }
        }

        public static RequestedAction CreateNotifyUnhandledExceptionAction(Exception exception, ActivityInstance sourceInstance)
        {
            return new NotifyUnhandledExceptionAction(exception, sourceInstance);
        }

        public void ClearAllWorkItems(ActivityExecutor executor)
        {
            if (this.firstWorkItem != null)
            {
                this.firstWorkItem.Release(executor);
                this.firstWorkItem = null;

                if (this.workItemQueue != null)
                {
                    while (this.workItemQueue.Count > 0)
                    {
                        WorkItem item = this.workItemQueue.Dequeue();
                        item.Release(executor);
                    }
                }
            }

            Fx.Assert(this.workItemQueue == null || this.workItemQueue.Count == 0, "We either didn't have a first work item and therefore don't have anything in the queue, or we drained the queue.");

            // For consistency we set this to null even if it is empty
            this.workItemQueue = null;
        }

        public void OnDeserialized(Callbacks callbacks)
        {
            Initialize(callbacks);
            Fx.Assert(this.firstWorkItem != null || this.workItemQueue == null, "cannot have items in the queue unless we also have a firstWorkItem set");
        }

        // This method should only be called when we relinquished the thread but did not
        // complete the operation (silent yield is the current example)
        public void InternalResume(RequestedAction action)
        {
            Fx.Assert(this.isRunning, "We should still be processing work - we just don't have a thread");

            bool isTracingEnabled = FxTrace.ShouldTraceInformation;
            bool notifiedCompletion = false;
            bool isInstanceComplete = false;

            if (this.callbacks.IsAbortPending)
            {
                this.isPausing = false;
                this.isRunning = false;

                this.NotifyWorkCompletion();
                notifiedCompletion = true;

                if (isTracingEnabled)
                {
                    isInstanceComplete = this.callbacks.IsCompleted;
                }

                // After calling SchedulerIdle we no longer have the lock.  That means
                // that any subsequent processing in this method won't have the single
                // threaded guarantee.
                this.callbacks.SchedulerIdle();
            }
            else if (object.ReferenceEquals(action, continueAction))
            {
                ScheduleWork(false);
            }
            else
            {
                Fx.Assert(action is NotifyUnhandledExceptionAction, "This is the only other choice because we should never have YieldSilently here");

                NotifyUnhandledExceptionAction notifyAction = (NotifyUnhandledExceptionAction)action;

                // We only set isRunning back to false so that the host doesn't
                // have to treat this like a pause notification.  As an example,
                // a host could turn around and call run again in response to
                // UnhandledException without having to go through its operation
                // dispatch loop first (or request pause again).  If we reset
                // isPausing here then any outstanding operations wouldn't get
                // signaled with that type of host.
                this.isRunning = false;

                this.NotifyWorkCompletion();
                notifiedCompletion = true;

                if (isTracingEnabled)
                {
                    isInstanceComplete = this.callbacks.IsCompleted;
                }

                this.callbacks.NotifyUnhandledException(notifyAction.Exception, notifyAction.Source);
            }

            if (isTracingEnabled)
            {
                if (notifiedCompletion)
                {
                    Guid oldActivityId = Guid.Empty;
                    bool resetId = false;

                    if (isInstanceComplete)
                    {
                        if (TD.WorkflowActivityStopIsEnabled())
                        {
                            oldActivityId = DiagnosticTraceBase.ActivityId;
                            DiagnosticTraceBase.ActivityId = this.callbacks.WorkflowInstanceId;
                            resetId = true;

                            TD.WorkflowActivityStop(this.callbacks.WorkflowInstanceId);
                        }
                    }
                    else
                    {
                        if (TD.WorkflowActivitySuspendIsEnabled())
                        {
                            oldActivityId = DiagnosticTraceBase.ActivityId;
                            DiagnosticTraceBase.ActivityId = this.callbacks.WorkflowInstanceId;
                            resetId = true;

                            TD.WorkflowActivitySuspend(this.callbacks.WorkflowInstanceId);
                        }
                    }

                    if (resetId)
                    {
                        DiagnosticTraceBase.ActivityId = oldActivityId;
                    }
                }
            }
        }

        // called from ctor and OnDeserialized intialization paths
        void Initialize(Callbacks callbacks)
        {
            this.callbacks = callbacks;
        }

        public void Open(SynchronizationContext synchronizationContext)
        {
            Fx.Assert(this.synchronizationContext == null, "can only open when in the created state");
            if (synchronizationContext != null)
            {
                this.synchronizationContext = synchronizationContext;
            }
            else
            {
                this.synchronizationContext = SynchronizationContextHelper.GetDefaultSynchronizationContext();
            }
        }

        internal void Open(Scheduler oldScheduler)
        {
            Fx.Assert(this.synchronizationContext == null, "can only open when in the created state");
            this.synchronizationContext = SynchronizationContextHelper.CloneSynchronizationContext(oldScheduler.synchronizationContext);
        }

        void ScheduleWork(bool notifyStart)
        {
            if (notifyStart)
            {
                this.synchronizationContext.OperationStarted();
                this.resumeTraceRequired = true;
            }
            else
            {
                this.resumeTraceRequired = false;
            }
            this.synchronizationContext.Post(Scheduler.onScheduledWorkCallback, this);
        }

        void NotifyWorkCompletion()
        {
            this.synchronizationContext.OperationCompleted();
        }

        // signal the scheduler to stop processing work. If we are processing work
        // then we will catch this signal at our next iteration. Pause process completes
        // when idle is signalled. Can be called while we're processing work since
        // the worst thing that could happen in a ---- is that we pause one extra work item later
        public void Pause()
        {
            this.isPausing = true;
        }

        public void MarkRunning()
        {
            this.isRunning = true;
        }

        public void Resume()
        {
            Fx.Assert(this.isRunning, "This should only be called after we've been set to process work.");

            if (this.IsIdle || this.isPausing || this.callbacks.IsAbortPending)
            {
                this.isPausing = false;
                this.isRunning = false;
                this.callbacks.SchedulerIdle();
            }
            else
            {
                ScheduleWork(true);
            }
        }

        public void PushWork(WorkItem workItem)
        {
            if (this.firstWorkItem == null)
            {
                this.firstWorkItem = workItem;
            }
            else
            {
                if (this.workItemQueue == null)
                {
                    this.workItemQueue = new Quack<WorkItem>();
                }

                this.workItemQueue.PushFront(this.firstWorkItem);
                this.firstWorkItem = workItem;
            }

            // To avoid the virt call on EVERY work item we check
            // the Verbose flag.  All of our Schedule traces are
            // verbose.
            if (FxTrace.ShouldTraceVerboseToTraceSource)
            {
                workItem.TraceScheduled();
            }
        }

        public void EnqueueWork(WorkItem workItem)
        {
            if (this.firstWorkItem == null)
            {
                this.firstWorkItem = workItem;
            }
            else
            {
                if (this.workItemQueue == null)
                {
                    this.workItemQueue = new Quack<WorkItem>();
                }

                this.workItemQueue.Enqueue(workItem);
            }

            if (FxTrace.ShouldTraceVerboseToTraceSource)
            {
                workItem.TraceScheduled();
            }
        }

        static void OnScheduledWork(object state)
        {
            Scheduler thisPtr = (Scheduler)state;

            // We snapshot these values here so that we can
            // use them after calling OnSchedulerIdle.
            bool isTracingEnabled = FxTrace.Trace.ShouldTraceToTraceSource(TraceEventLevel.Informational);
            Guid oldActivityId = Guid.Empty;
            Guid workflowInstanceId = Guid.Empty;

            if (isTracingEnabled)
            {
                oldActivityId = DiagnosticTraceBase.ActivityId;
                workflowInstanceId = thisPtr.callbacks.WorkflowInstanceId;
                FxTrace.Trace.SetAndTraceTransfer(workflowInstanceId, true);

                if (thisPtr.resumeTraceRequired)
                {
                    if (TD.WorkflowActivityResumeIsEnabled())
                    {
                        TD.WorkflowActivityResume(workflowInstanceId);
                    }
                }
            }

            thisPtr.callbacks.ThreadAcquired();

            RequestedAction nextAction = continueAction;
            bool idleOrPaused = false;

            while (object.ReferenceEquals(nextAction, continueAction))
            {
                if (thisPtr.IsIdle || thisPtr.isPausing)
                {
                    idleOrPaused = true;
                    break;
                }

                // cycle through (queue->thisPtr.firstWorkItem->currentWorkItem)
                WorkItem currentWorkItem = thisPtr.firstWorkItem;

                // promote an item out of our work queue if necessary
                if (thisPtr.workItemQueue != null && thisPtr.workItemQueue.Count > 0)
                {
                    thisPtr.firstWorkItem = thisPtr.workItemQueue.Dequeue();
                }
                else
                {
                    thisPtr.firstWorkItem = null;
                }

                if (TD.ExecuteWorkItemStartIsEnabled())
                {
                    TD.ExecuteWorkItemStart();
                }

                nextAction = thisPtr.callbacks.ExecuteWorkItem(currentWorkItem);

                if (TD.ExecuteWorkItemStopIsEnabled())
                {
                    TD.ExecuteWorkItemStop();
                }
            }

            bool notifiedCompletion = false;
            bool isInstanceComplete = false;

            if (idleOrPaused || object.ReferenceEquals(nextAction, abortAction))
            {
                thisPtr.isPausing = false;
                thisPtr.isRunning = false;

                thisPtr.NotifyWorkCompletion();
                notifiedCompletion = true;

                if (isTracingEnabled)
                {
                    isInstanceComplete = thisPtr.callbacks.IsCompleted;
                }

                // After calling SchedulerIdle we no longer have the lock.  That means
                // that any subsequent processing in this method won't have the single
                // threaded guarantee.
                thisPtr.callbacks.SchedulerIdle();
            }
            else if (!object.ReferenceEquals(nextAction, yieldSilentlyAction))
            {
                Fx.Assert(nextAction is NotifyUnhandledExceptionAction, "This is the only other option");

                NotifyUnhandledExceptionAction notifyAction = (NotifyUnhandledExceptionAction)nextAction;

                // We only set isRunning back to false so that the host doesn't
                // have to treat this like a pause notification.  As an example,
                // a host could turn around and call run again in response to
                // UnhandledException without having to go through its operation
                // dispatch loop first (or request pause again).  If we reset
                // isPausing here then any outstanding operations wouldn't get
                // signaled with that type of host.
                thisPtr.isRunning = false;

                thisPtr.NotifyWorkCompletion();
                notifiedCompletion = true;

                if (isTracingEnabled)
                {
                    isInstanceComplete = thisPtr.callbacks.IsCompleted;
                }

                thisPtr.callbacks.NotifyUnhandledException(notifyAction.Exception, notifyAction.Source);
            }

            if (isTracingEnabled)
            {
                if (notifiedCompletion)
                {
                    if (isInstanceComplete)
                    {
                        if (TD.WorkflowActivityStopIsEnabled())
                        {
                            TD.WorkflowActivityStop(workflowInstanceId);
                        }
                    }
                    else
                    {
                        if (TD.WorkflowActivitySuspendIsEnabled())
                        {
                            TD.WorkflowActivitySuspend(workflowInstanceId);
                        }
                    }
                }

                DiagnosticTraceBase.ActivityId = oldActivityId;
            }
        }

        public struct Callbacks
        {
            readonly ActivityExecutor activityExecutor;

            public Callbacks(ActivityExecutor activityExecutor)
            {
                this.activityExecutor = activityExecutor;
            }

            public Guid WorkflowInstanceId
            {
                get
                {
                    return this.activityExecutor.WorkflowInstanceId;
                }
            }

            public bool IsAbortPending
            {
                get
                {
                    return this.activityExecutor.IsAbortPending || this.activityExecutor.IsTerminatePending;
                }
            }

            public bool IsCompleted
            {
                get
                {
                    return ActivityUtilities.IsCompletedState(this.activityExecutor.State);
                }
            }

            public RequestedAction ExecuteWorkItem(WorkItem workItem)
            {
                Fx.Assert(this.activityExecutor != null, "ActivityExecutor null in ExecuteWorkItem.");

                // We check the Verbose flag to avoid the
                // virt call if possible
                if (FxTrace.ShouldTraceVerboseToTraceSource)
                {
                    workItem.TraceStarting();
                }

                RequestedAction action = this.activityExecutor.OnExecuteWorkItem(workItem);

                if (!object.ReferenceEquals(action, Scheduler.YieldSilently))
                {
                    if (this.activityExecutor.IsAbortPending || this.activityExecutor.IsTerminatePending)
                    {
                        action = Scheduler.Abort;
                    }

                    // if the caller yields, then the work item is still active and the callback
                    // is responsible for releasing it back to the pool
                    workItem.Dispose(this.activityExecutor);
                }

                return action;
            }

            public void SchedulerIdle()
            {
                Fx.Assert(this.activityExecutor != null, "ActivityExecutor null in SchedulerIdle.");
                this.activityExecutor.OnSchedulerIdle();
            }

            public void ThreadAcquired()
            {
                Fx.Assert(this.activityExecutor != null, "ActivityExecutor null in ThreadAcquired.");
                this.activityExecutor.OnSchedulerThreadAcquired();
            }

            public void NotifyUnhandledException(Exception exception, ActivityInstance source)
            {
                Fx.Assert(this.activityExecutor != null, "ActivityExecutor null in NotifyUnhandledException.");
                this.activityExecutor.NotifyUnhandledException(exception, source);
            }
        }

        internal abstract class RequestedAction
        {
            protected RequestedAction()
            {
            }
        }

        class ContinueAction : RequestedAction
        {
            public ContinueAction()
            {
            }
        }

        class YieldSilentlyAction : RequestedAction
        {
            public YieldSilentlyAction()
            {
            }
        }

        class AbortAction : RequestedAction
        {
            public AbortAction()
            {
            }
        }

        class NotifyUnhandledExceptionAction : RequestedAction
        {
            public NotifyUnhandledExceptionAction(Exception exception, ActivityInstance source)
            {
                this.Exception = exception;
                this.Source = source;
            }

            public Exception Exception
            {
                get;
                private set;
            }

            public ActivityInstance Source
            {
                get;
                private set;
            }
        }
    }
}


text:
package org.telegram.mtproto.transport;

/**
 * @author Ruben Bermudez
 * @version 1.0
 * @brief States of the connection
 * @date 06 of February of 2016
 */
enum ConnectionState {
    TcpConnectionStageSuspended,
    TcpConnectionStageIdle,
    TcpConnectionStageConnecting,
    TcpConnectionStageReconnecting,
    TcpConnectionStageConnected
}

redpajama_set_name: RedPajamaGithub


text:
using namespace std;

class Paciente {
private:
	string nombre;
	int prioridad;
	int turno;

public:
	Paciente() {}

	Paciente(string nombre1, int prioridad1, int turno1) {
		nombre = nombre1;
		prioridad = prioridad1;
		turno = turno1;
	}

	string getNombre() const {
		return nombre;
	}

	int getPrioridad() const {
		return prioridad;
	}

	int getTurno() const {
		return turno;
	}

	bool operator< (const Paciente &paciente) const {
		if (prioridad < paciente.getPrioridad()) {
			return true;
		}
		else if (prioridad == paciente.getPrioridad()) {
			return turno < paciente.getTurno();
		}
		return false;
	}
};

void resuelve(const int &n) {
	PriorityQueue <Paciente> cola;
	Paciente paciente;
	string nombre;
	int prioridad;
	char operacion;

	for (int i = 0; i < n; ++i) {
		cin >> operacion;
		if (operacion == 'I') {
			cin >> nombre;
			cin >> prioridad;
			paciente = Paciente(nombre, 0 - prioridad, i);
			cola.push(paciente);
		}
		else {
			if (!cola.empty()) {
				paciente = cola.top();
				cola.pop();
				cout << paciente.getNombre() << '\n';
			}
		}
	}
	cout << "----" << '\n';
}

int main() {
	// ajustes para que cin extraiga directamente de un fichero
#ifndef DOMJUDGE
	std::ifstream in("casos.txt");
	auto cinbuf = std::cin.rdbuf(in.rdbuf());
#endif
	int numCasos;
	std::cin >> numCasos;
	while (numCasos != 0) {
		resuelve(numCasos);
		std::cin >> numCasos;
	}
	// para dejar todo como estaba al principio
#ifndef DOMJUDGE
	std::cin.rdbuf(cinbuf);
	system("PAUSE");
#endif
	return 0;
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.zcsj</groupId>
  <artifactId>cofigserver</artifactId>
  <packaging>war</packaging>

  <version>0.0.1-SNAPSHOT</version>
  <name>cofigserver Maven Webapp</name>
  <url>http://maven.apache.org</url>

  <parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>1.5.2.RELEASE</version>
	<relativePath/> <!-- lookup parent from repository -->
  </parent>

  <properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	<java.version>1.8</java.version>
  </properties>

  <dependencies>
  	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>
  	<dependency>
  		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-config-server</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
  </dependencies>

  <build>
    <finalName>cofigserver</finalName>
  </build>

</project>


text:
layout: slides
title: About
lightbackground: 1
---

{% include slides/tophead-3coltext.html
  id="why"
  header="Why we're here"
  classes="fade-8"
  details="We believe the current generation of cloud applications are fundamentally insecure."
  col1="When we think about what we might want to build next: kick-ass cloud CRM, ERP, health EMR, digital markets or financial management, we know that the first thing we need to build is an exceptionally strong foundation for security."
  col2="This foundation needs to be far stronger than current practices and much more than just network-based [perimeter protection][perimsec].  Confidential paper documents aren't just left out for anyone to stumble upon.  The digital world needs equivalent and equally usable security for digital data."
  col3="[90% of security incidents][worseningsecurity] are due to application vulnerabilities. The application typically has full access to all users' data, so a hacker exploiting the app leads to disastrous results. **We're here to change that equation.**"
  background="/img/about/space.jpg"
%}

{% include slides/tophead-bottom2iconboxes.html
  id="what"
  classes="fade-8"
  header="What we do"
  box1head="Foundation for the future"
  box1body="We're building a better foundation for the next generation of enterprise cloud applications. IronCore is focused on highly usable interfaces that get out of the way and scale to massive numbers of users and large amounts of data. We're building access controls and identities that don't rely on shared secrets and trusted servers, or even trusted applications. **This is the future of digital data.**"
  box2head="Modern, Solid Engineering"
  box2body="We're very opinionated about what constitutes _good software_. We're craftspeople building solid and reliable software using [functional programming][funcprog] paradigms that use principles of math to make software more testable, understandable, and less prone to unforeseen and unhandled errors. Contrast this to the [outdated software][shoddysoftware] underlying many existing security libraries. **We build for security and reliability.**"
  background="/img/about/rock-climbing.jpg"
  backgroundTop="1"
%}

{% comment %}

Second sentence too wordy.

{% endcomment %}

{% include slides/slideStart.html id="future" header="Where we're going" classes="fade-8" %}

## Where we're going

Our goal is to eliminate the daily breaches seen in the news. If sensitive data is well protected, then [breaches are non-events][breachdisclosure] and public disclosure isn't required. Strong data security will bring us to a world with stronger national security, better privacy, and safer intellectual property. Our mission is to make the world a safer place to do digital business.

{% include slides/slideEnd.html background="/img/about/trains.jpg" %}

{% include slides/slideStart.html id="press" header="Press Releases" classes="fade-8" %}

## Press Releases

* [IronCore Finds Major Drop in Application Security]({{ site.baseurl }}/press/ironcore-finds-major-drop-in-app-security/), July 1, 2016
* [IronCore Labs wins "Pitch Fest" for High-Tech Start-Up Companies]({{ site.baseurl }}/press/ironcore-wins-montana-pitchfest/), September 23, 2016
* [IronCore Labs Joins Techstars Boulder '17]({{ site.baseurl }}/press/ironcore-joins-techstars-family/), January 23, 2017
* [IronCore Labs Raises $1.5m in Seed Round Funding Led by Next Frontier Capital]({{ site.baseurl }}/press/ironcore-raises-seed-round/), May 18, 2017

{% include slides/slideEnd.html background="/img/about/writing.jpg" %}

{% comment %}

Really ugly.

{% endcomment %}

{% include slides/slideStart.html id="tweets" header="Recent Tweets" classes="fade-8" %}

Recent Tweets

  All Tweets

{% include slides/slideEnd.html background="/img/about/birds.jpg" %}

{% include slides/slideStart.html id="techstarscompany" header="Techstars" classes="fade-8" %}

## Techstars

IronCore Labs is proud to be [a Techstars company](http://techstars.com).

{% include slides/slideEnd.html background="https://cdn.brandisty.com/img?id=56ce5a0a1ea45c503900002f&format=png&w=1200&h=900" %}

{% include slides/slideStart.html id="contact" header="Contact Us" classes="fade-8" %}

## Contact us

You can find us across social media, on github, phone and via email.

      Twitter
      @{{ site.follow-us.twitter }}

      LinkedIn
    /company/{{ site.follow-us.linkedin }}

    Facebook
    {{ site.follow-us.facebook }}

    Github
    {{ site.follow-us.github }}

    Email
    info

    Phone
    52-48-55-46-61-51-62-42-49-63-58-60

{% include slides/slideEnd.html background="/img/about/using-mobile-phone.jpg" %}

[perimsec]: https://blog.ironcorelabs.com/the-inevitable-demise-of-perimeter-security-9863ef372294
[worseningsecurity]: https://blog.ironcorelabs.com/the-worsening-state-of-application-security-c50a49f00652
[funcprog]: https://en.wikipedia.org/wiki/Functional_programming
[breachdisclosure]: https://blog.ironcorelabs.com/breach-disclosure-laws-and-consequences-f7e14edca29e
[shoddysoftware]: http://queue.acm.org/detail.cfm?id=2602816


text:
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;

namespace LanguageExt.Tests
{
    public class RecordTests
    {
        /// <summary>
        /// Cons type - singly linked list
        /// </summary>
        public class Cons<A> : Record<Cons<A>>
        {
            public readonly A Head;
            public readonly Cons<A> Tail;

            public Cons(A head, Cons<A> tail)
            {
                Head = head;
                Tail = tail;
            }
        }

        [Fact]
        public void ConsTests()
        {
            var listA = new Cons<int>(1, new Cons<int>(2, new Cons<int>(3, new Cons<int>(4, null))));
            var listB = new Cons<int>(1, new Cons<int>(2, new Cons<int>(3, new Cons<int>(4, null))));
            var listC = new Cons<int>(1, new Cons<int>(2, new Cons<int>(3, null)));

            Assert.True(listA == listB);
            Assert.True(listB != listC);
            Assert.True(listA != listC);
        }

        /// <summary>
        /// Binary tree
        /// </summary>
        public class Tree<A> : Record<Tree<A>>
        {
            public readonly A Value;
            public readonly Tree<A> Left;
            public readonly Tree<A> Right;

            public Tree(A value, Tree<A> left, Tree<A> right)
            {
                Value = value;
                Left = left;
                Right = right;
            }
        }

        [Fact]
        public void TreeTests()
        {
            var treeA = new Tree<int>(5, new Tree<int>(3, null, null), new Tree<int>(7, null, new Tree<int>(9, null, null)));
            var treeB = new Tree<int>(5, new Tree<int>(3, null, null), new Tree<int>(7, null, new Tree<int>(9, null, null)));
            var treeC = new Tree<int>(5, new Tree<int>(3, null, null), new Tree<int>(7, null, null));

            Assert.True(treeA == treeB);
            Assert.True(treeB != treeC);
            Assert.True(treeA != treeC);

            var str = treeA.ToString();
        }

        class Disorder : Record<Disorder>
        {
            public string Present = "Here";
            public string Absent = null;
        }

        [Fact]
        public void NullMemberEqualityTest()
        {
            var a = new Disorder();
            var b = new Disorder();

            Assert.True(a == b);
            Assert.True(a.GetHashCode() == b.GetHashCode());
            Assert.False(a != b);
            Assert.False(a.GetHashCode() != b.GetHashCode());
        }

        [Fact]
        public void NullMemberOrderingTest()
        {
            var a = new Disorder();
            var b = new Disorder();

            Assert.True(a.CompareTo(b) == 0);
            Assert.True(b.CompareTo(a) == 0);
        }
    }
}


text:
.. _vmodl.DynamicData: ../../../vmodl/DynamicData.rst

vim.vm.customization.IpGenerator
================================
  Base type for the various IP specification possibilities.
:extends: vmodl.DynamicData_

Attributes:


text:
<?php

namespace NilPortugues\Tests\BackslashFixer\Fixer\Resources;

/**
 * @param string $string
 * @return int
 */
function countStringLength($string) {
    return strlen($string);
}

/**
 * @param $haystack
 * @param $value
 * @return bool|int
 */
function strpos($haystack, $value) {
    return strpos($haystack, $value)+1;
}


text:
/*jshint globalstrict:false, strict:false */
/*global assertEqual, assertTrue, assertEqual, assertTypeOf, assertNotEqual, fail */

////////////////////////////////////////////////////////////////////////////////
/// @brief test the collection interface
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2010-2012 triagens GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
///     http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is triAGENS GmbH, Cologne, Germany
///
/// @author Dr. Frank Celler
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////

var jsunity = require("jsunity");
var arangodb = require("org/arangodb");
var ArangoCollection = arangodb.ArangoCollection;
var testHelper = require("org/arangodb/test-helper").Helper;
var db = arangodb.db;
var ERRORS = arangodb.errors;

// -----------------------------------------------------------------------------
// --SECTION--                                                collection methods
// -----------------------------------------------------------------------------

////////////////////////////////////////////////////////////////////////////////
/// @brief test suite: collection
////////////////////////////////////////////////////////////////////////////////

function CollectionSuite () {
  'use strict';
  return {

////////////////////////////////////////////////////////////////////////////////
/// @brief rotate
////////////////////////////////////////////////////////////////////////////////

    testRotate : function () {
      var cn = "example";

      db._drop(cn);
      var c1 = db._create(cn);

      c1.save({ _key: "test1" });
      var f = c1.figures();
      assertEqual(0, f.datafiles.count);

      testHelper.rotate(c1);

      f = c1.figures();
      assertEqual(1, f.datafiles.count);

      c1.save({ _key: "test2" });
      testHelper.rotate(c1);

      f = c1.figures();
      // we may have one or two datafiles, depending on the compaction
      assertTrue(f.datafiles.count >= 1);

      c1.unload();

      db._drop(cn);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief rotate w/o journal
////////////////////////////////////////////////////////////////////////////////

    testRotateNoJournal : function () {
      var cn = "example";

      db._drop(cn);
      var c1 = db._create(cn);

      try {
        testHelper.rotate(c1);
        fail();
      }
      catch (err) {
        assertEqual(ERRORS.ERROR_ARANGO_NO_JOURNAL.code, err.errorNum);
      }

      db._drop(cn);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief rename loaded collection
////////////////////////////////////////////////////////////////////////////////

    testRenameLoaded : function () {
      var cn = "example";
      var nn = "example2";

      db._drop(cn);
      db._drop(nn);
      var c1 = db._create(cn);

      c1.save({ a : 1 });

      assertTypeOf("string", c1._id);
      assertEqual(cn, c1.name());
      assertTypeOf("number", c1.status());
      assertEqual(ArangoCollection.TYPE_DOCUMENT, c1.type());
      assertTypeOf("number", c1.type());

      var id = c1._id;

      c1.rename(nn);

      assertEqual(id, c1._id);
      assertEqual(nn, c1.name());
      assertTypeOf("number", c1.status());
      assertEqual(ArangoCollection.TYPE_DOCUMENT, c1.type());
      assertTypeOf("number", c1.type());

      var c2 = db._collection(cn);

      assertEqual(null, c2);

      db._drop(nn);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief rename unloaded collection
////////////////////////////////////////////////////////////////////////////////

    testRenameUnloaded : function () {
      var cn = "example";
      var nn = "example2";

      db._drop(cn);
      db._drop(nn);
      var c1 = db._create(cn);

      c1.save({ a : 1 });
      c1.unload();

      assertTypeOf("string", c1._id);
      assertEqual(cn, c1.name());
      assertTypeOf("number", c1.status());
      assertEqual(ArangoCollection.TYPE_DOCUMENT, c1.type());
      assertTypeOf("number", c1.type());

      var id = c1._id;

      c1.rename(nn);

      assertEqual(id, c1._id);
      assertEqual(nn, c1.name());
      assertTypeOf("number", c1.status());
      assertEqual(ArangoCollection.TYPE_DOCUMENT, c1.type());
      assertTypeOf("number", c1.type());

      var c2 = db._collection(cn);

      assertEqual(null, c2);

      db._drop(nn);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief rename a collection to an already existing collection
////////////////////////////////////////////////////////////////////////////////

    testRenameExisting : function () {
      var cn1 = "example";
      var cn2 = "example2";

      db._drop(cn1);
      db._drop(cn2);
      var c1 = db._create(cn1);
      db._create(cn2);

      try {
        c1.rename(cn2);
      }
      catch (err) {
        assertEqual(ERRORS.ERROR_ARANGO_DUPLICATE_NAME.code, err.errorNum);
      }
      db._drop(cn1);
      db._drop(cn2);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief test checksum
////////////////////////////////////////////////////////////////////////////////

    testChecksum : function () {
      var cn = "example";

      db._drop(cn);
      var c1 = db._create(cn);

      // empty collection, checksum should be 0
      var r1 = c1.checksum(true);
      assertTypeOf("string", r1.revision);
      assertTrue(r1.revision !== "");
      assertTrue(r1.revision.match(/^[0-9]+$/));
      assertTypeOf("number", r1.checksum);
      assertEqual(0, r1.checksum);

      // inserting a doc, checksum should change
      c1.save({ a : 1 });
      var r2 = c1.checksum(true);
      assertNotEqual(r1.revision, r2.revision);
      assertTypeOf("string", r2.revision);
      assertTrue(r2.revision !== "");
      assertTrue(r2.revision.match(/^[0-9]+$/));
      assertTypeOf("number", r2.checksum);
      assertNotEqual(0, r2.checksum);

      // inserting another doc, checksum should change
      c1.save({ a : 2 });
      var r3 = c1.checksum(true);
      assertNotEqual(r1.revision, r3.revision);
      assertNotEqual(r2.revision, r3.revision);
      assertTypeOf("string", r3.revision);
      assertTrue(r3.revision !== "");
      assertTrue(r3.revision.match(/^[0-9]+$/));
      assertTypeOf("number", r3.checksum);
      assertNotEqual(0, r3.checksum);
      assertNotEqual(r2.checksum, r3.checksum);

      // test after unloading
      c1.unload();
      var r4 = c1.checksum(true);
      assertTypeOf("string", r4.revision);
      assertEqual(r3.revision, r4.revision);
      assertTypeOf("number", r4.checksum);
      assertNotEqual(0, r4.checksum);
      assertEqual(r3.checksum, r4.checksum);

      // test withData
      var r5 = c1.checksum(true, true);
      assertTypeOf("string", r5.revision);
      assertEqual(r4.revision, r5.revision);
      assertTypeOf("number", r5.checksum);
      assertNotEqual(0, r5.checksum);
      assertNotEqual(r4.checksum, r5.checksum);

      // test after truncation
      c1.truncate();
      var r6 = c1.checksum(true);
      assertTypeOf("string", r6.revision);
      assertNotEqual(r4.revision, r6.revision);
      assertNotEqual(r5.revision, r6.revision);
      assertTypeOf("number", r6.checksum);
      assertEqual(0, r6.checksum);

      db._drop(cn);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief test checksum
////////////////////////////////////////////////////////////////////////////////

    testChecksumEdge : function () {
      var cn = "example";
      var vn = "example2";

      db._drop(cn);
      db._drop(vn);
      db._create(vn);
      var c1 = db._createEdgeCollection(cn);

      var r1 = c1.checksum(true);
      assertTypeOf("string", r1.revision);
      assertTrue(r1.revision !== "");
      assertTrue(r1.revision.match(/^[0-9]+$/));
      assertTypeOf("number", r1.checksum);
      assertEqual(0, r1.checksum);

      c1.save(vn + "/1", vn + "/2", { a : 1 });
      var r2 = c1.checksum(true);
      assertNotEqual(r1.revision, r2.revision);
      assertTypeOf("string", r2.revision);
      assertTrue(r2.revision !== "");
      assertTrue(r2.revision.match(/^[0-9]+$/));
      assertTypeOf("number", r2.checksum);
      assertNotEqual(0, r2.checksum);

      c1.save(vn + "/1", vn + "/2", { a : 2 });
      var r3 = c1.checksum(true);
      assertNotEqual(r1.revision, r3.revision);
      assertNotEqual(r2.revision, r3.revision);
      assertTypeOf("string", r3.revision);
      assertTrue(r3.revision !== "");
      assertTrue(r3.revision.match(/^[0-9]+$/));
      assertTypeOf("number", r3.checksum);
      assertNotEqual(0, r3.checksum);
      assertNotEqual(r2.checksum, r3.checksum);

      c1.unload();
      var r4 = c1.checksum(true);
      assertTypeOf("string", r4.revision);
      assertEqual(r3.revision, r4.revision);
      assertTypeOf("number", r4.checksum);
      assertEqual(r3.checksum, r4.checksum);

      // test withData
      var r5 = c1.checksum(true, true);
      assertTypeOf("string", r5.revision);
      assertEqual(r4.revision, r5.revision);
      assertTypeOf("number", r5.checksum);
      assertNotEqual(0, r5.checksum);
      assertNotEqual(r4.checksum, r5.checksum);

      // test after truncation
      c1.truncate();
      var r6 = c1.checksum(true);
      assertTypeOf("string", r6.revision);
      assertNotEqual(r4.revision, r6.revision);
      assertNotEqual(r5.revision, r6.revision);
      assertTypeOf("number", r6.checksum);
      assertEqual(0, r6.checksum);

      db._drop(cn);
      db._drop(vn);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief test checksum two different collections
////////////////////////////////////////////////////////////////////////////////

    testChecksumDifferent : function () {
      var cn1 = "example";
      var cn2 = "example2";

      db._drop(cn1);
      db._drop(cn2);
      var c1 = db._create(cn1);
      var c2 = db._create(cn2);

      // collections are empty, checksums are identical
      var cs1 = c1.checksum().checksum;
      var cs2 = c2.checksum().checksum;

      assertEqual(cs1, cs2);

      c1.save({ _key: "foobar", value: 123 });
      c2.save({ _key: "foobar", value: 123 });

      // keys are the same
      cs1 = c1.checksum().checksum;
      cs2 = c2.checksum().checksum;

      assertEqual(cs1, cs2);

      // data is the same
      cs1 = c1.checksum(false, true).checksum;
      cs2 = c2.checksum(false, true).checksum;

      assertEqual(cs1, cs2);

      // revisions are different
      cs1 = c1.checksum(true, false).checksum;
      cs2 = c2.checksum(true, false).checksum;

      assertNotEqual(cs1, cs2);

      // revisions are still different
      cs1 = c1.checksum(true, true).checksum;
      cs2 = c2.checksum(true, true).checksum;

      assertNotEqual(cs1, cs2);

      // update document in c1, keep data
      c1.replace("foobar", { value: 123 });

      // keys are still the same
      cs1 = c1.checksum().checksum;
      cs2 = c2.checksum().checksum;

      assertEqual(cs1, cs2);

      // data is still the same
      cs1 = c1.checksum(false, true).checksum;
      cs2 = c2.checksum(false, true).checksum;

      assertEqual(cs1, cs2);

      // revisions are still different
      cs1 = c1.checksum(true, false).checksum;
      cs2 = c2.checksum(true, false).checksum;

      // update document in c1, changing data
      c1.replace("foobar", { value: 124 });

      // keys are still the same
      cs1 = c1.checksum().checksum;
      cs2 = c2.checksum().checksum;

      assertEqual(cs1, cs2);

      // data is not the same
      cs1 = c1.checksum(false, true).checksum;
      cs2 = c2.checksum(false, true).checksum;

      assertNotEqual(cs1, cs2);

      // revisions are still different
      cs1 = c1.checksum(true, false).checksum;
      cs2 = c2.checksum(true, false).checksum;

      db._drop(cn1);
      db._drop(cn2);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief test system collection dropping / renaming / unloading
////////////////////////////////////////////////////////////////////////////////

    testSystemSpecial : function () {
      var cn = "_users";
      var c = db._collection(cn);

      // drop
      try {
        c.drop();
        fail();
      }
      catch (err1) {
        assertEqual(ERRORS.ERROR_FORBIDDEN.code, err1.errorNum);
      }

      // rename
      var cn1 = "example";
      db._drop(cn1);

      try {
        c.rename(cn1);
        fail();
      }
      catch (err2) {
        assertEqual(ERRORS.ERROR_FORBIDDEN.code, err2.errorNum);
      }

      // unload is allowed
      c.unload();
    }

  };
}

// -----------------------------------------------------------------------------
// --SECTION--                                                              main
// -----------------------------------------------------------------------------

////////////////////////////////////////////////////////////////////////////////
/// @brief executes the test suites
////////////////////////////////////////////////////////////////////////////////

jsunity.run(CollectionSuite);

return jsunity.done();

// Local Variables:
// mode: outline-minor
// outline-regexp: "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\|/// @page\\|/// @}\\)"
// End:


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _4
{
    class Program
    {
        static void Main(string[] args)
        {
            var x = int.Parse(Console.ReadLine());
            var y = int.Parse(Console.ReadLine());

            if (x>=4&x<=10&&y<=3&&y>=-5)
                Console.WriteLine("in");
            else if (x>=2&&x<4&&y>=-3&&y<=1)
                Console.WriteLine("in");
            else if(x >= 10 && x <=12 && y >= -3 && y <= 1)
                Console.WriteLine("in");
            else Console.WriteLine("out");
        }

    }
}


text:
<?php

namespace Drupal\Core\Asset\Exception;

/**
 * Defines an exception if the library file could not be parsed.
 */
class InvalidLibraryFileException extends \RunTimeException {

}


text:
package uk.ac.ebi.gxa.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import uk.ac.ebi.gxa.annotator.annotationsrc.CompositeAnnotationSourceManager;

/**
 * User: nsklyar
 * Date: 27/03/2012
 */
@Controller
public class AnnotationSourceListController {

    @Autowired
    private CompositeAnnotationSourceManager annotationSourceManager;

    @RequestMapping(value = "/annSrcList")
    public String getAnnotationSourceList(Model model) {
       model.addAttribute("annSrcList", annotationSourceManager.getLatestAnnotationSourcesAsText());
       return "annsrclist/annsrc-list";
    }

}


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

<!--+
    |
    |  Acre Build File
    |
    +-->

<project name="acre" default="compile" basedir=".">

    <property environment="env"/>

    <defaultexcludes add="**/.git"/>
    <defaultexcludes add="**/.git/**"/>

    <condition property="version" value="trunk">
        <not><isset property="version"/></not>
    </condition>

    <condition property="revision" value="rXXXX">
        <not><isset property="revision"/></not>
    </condition>

    <condition property="revision" value="appengine">
        <not><isset property="config.file"/></not>
    </condition>

    <property name="name" value="acre" />
    <property name="fullname" value="${name}-${version}-${revision}" />

    <property name="build.dir" value="_build" />
    <property name="dist.dir" value="_dist" />
    <property name="data.dir" value="_data" />
    <property name="logs.dir" value="_logs" />

    <property name="config.dir" value="${basedir}/config" />
    <property name="tests.dir" value="${basedir}/tests" />

    <property name="library.dir" value="${basedir}/library"/>
    <property name="library.src.dir" value="${library.dir}/src" />
    <property name="library.lib.dir" value="${library.dir}/lib" />
    <property name="library.classes.dir" value="${library.dir}/classes" />

    <property name="server.dir" value="${basedir}/server"/>
    <property name="server.src.dir" value="${server.dir}/src" />
    <property name="server.lib.dir" value="${server.dir}/lib" />
    <property name="server.classes.dir" value="${server.dir}/classes" />

    <property name="webapp.dir" value="${basedir}/webapp"/>
    <property name="webapp.config.dir" value="${webapp.dir}/META-INF"/>
    <property name="webapp.web-inf" value="${webapp.dir}/WEB-INF"/>
    <property name="webapp.src.dir" value="${webapp.web-inf}/src" />
    <property name="webapp.lib.dir" value="${webapp.web-inf}/lib" />
    <property name="webapp.classes.dir" value="${webapp.web-inf}/classes" />

    <property name="appengine.dir" value="${basedir}/appengine"/>
    <property name="appengine.src.dir" value="${appengine.dir}/src" />
    <property name="appengine.lib.dir" value="${appengine.dir}/lib" />
    <property name="appengine.classes.dir" value="${appengine.dir}/classes" />

    <condition property="war.dir" value="${build.dir}/war">
        <not><isset property="war.dir"/></not>
    </condition>

    <property name="war.config.dir" value="${war.dir}/META-INF"/>
    <property name="war.web-inf" value="${war.dir}/WEB-INF"/>
    <property name="war.lib.dir" value="${war.web-inf}/lib" />
    <property name="war.classes.dir" value="${war.web-inf}/classes" />

    <available file="${webapp.web-inf}/web.xml" property="web.xml.present"/>

    <!-- ======================================================================== -->

    <path id="server.class.path">
        <fileset dir="${server.lib.dir}">
            <include name="**/*.jar" />
        </fileset>
        <pathelement location="${library.classes.dir}"/>
    </path>

    <path id="webapp.class.path">
        <path refid="server.class.path"/>
        <fileset dir="${webapp.lib.dir}">
            <include name="**/*.jar" />
        </fileset>
        <pathelement location="${library.classes.dir}"/>
    </path>

    <path id="appengine.class.path">
        <path refid="webapp.class.path"/>
        <fileset dir="${sdk.dir}/lib/user">
            <include name="**/*.jar" />
        </fileset>
        <fileset dir="${sdk.dir}/lib">
            <include name="**/appengine-remote-api.jar" />
        </fileset>
        <pathelement location="${webapp.classes.dir}"/>
    </path>

    <!-- ======================================================================== -->

    <target name="compile-library" description="Compile the library">
        <mkdir dir="${library.classes.dir}" />
        <javac srcdir="${library.src.dir}" destdir="${library.classes.dir}" includeantruntime="false" debug="true">
            <classpath refid="server.class.path" />
        </javac>
    </target>

    <target name="compile-server" description="Compile the server">
        <mkdir dir="${server.classes.dir}" />
        <javac srcdir="${server.src.dir}" destdir="${server.classes.dir}" includeantruntime="false" debug="true">
            <classpath refid="server.class.path" />
        </javac>
    </target>

    <target name="create-web-xml" description="Move the default web.xml file in place if it's missing" unless="${web.xml.present}">
        <copy file="${webapp.web-inf}/web.default.xml.in" tofile="${webapp.web-inf}/web.xml" overwrite="true"/>
    </target>

    <target name="compile-webapp" description="Compile the webapp" depends="create-web-xml">
        <mkdir dir="${webapp.classes.dir}" />
        <javac sourcepath="" srcdir="${webapp.src.dir}" destdir="${webapp.classes.dir}" includeantruntime="false" debug="true">
            <classpath refid="webapp.class.path" />
            <exclude name="**/appengine/**/*.java"/>
            <include name="**/*.java"/>
        </javac>
    </target>

    <target name="compile-webapp-appengine" description="Compile the Google AppEngine specific parts of the webapp">
        <javac sourcepath="" srcdir="${webapp.src.dir}" destdir="${webapp.classes.dir}" includeantruntime="false" debug="true">
            <classpath refid="appengine.class.path" />
            <include name="**/appengine/**/*.java"/>
        </javac>
    </target>

    <target name="compile" depends="compile-library, compile-server, compile-webapp" description="Compile Standard Acre" />

    <target name="compile-appengine" depends="compile-library, compile-webapp, compile-webapp-appengine" description="Compile Appengine Acre">
        <copy todir="${webapp.lib.dir}">
          <fileset dir="${server.lib.dir}">
            <include name="log4j-*.jar"/>
            <include name="jcl-*.jar"/>
            <include name="slf4j-*.jar"/>
          </fileset>
        </copy>

        <copy todir="${webapp.classes.dir}">
          <fileset dir="${library.classes.dir}">
            <include name="**/*.class"/>
          </fileset>
        </copy>

        <copy todir="${webapp.lib.dir}" flatten="true">
          <fileset dir="${sdk.dir}/lib/user">
            <include name="appengine-api-*.jar" />
          </fileset>
          <fileset dir="${sdk.dir}/lib">
            <include name="appengine-remote-api.jar" />
          </fileset>
        </copy>

        <iterate target="copy-appengine-modules">
          <dirset dir="${webapp.dir}">
            <include name="*" />
            <exclude name="META-INF/"/>
            <exclude name="WEB-INF/"/>
            <exclude name=".**"/>
          </dirset>
        </iterate>

    </target>

    <target name="copy-appengine-modules">

      <copy todir="${webapp.dir}/${module}/WEB-INF/classes">
        <fileset dir="${webapp.classes.dir}">
          <include name="**/*.class"/>
        </fileset>
        <fileset dir="${library.classes.dir}">
          <include name="**/*.class"/>
        </fileset>
      </copy>

      <copy todir="${webapp.dir}/${module}/WEB-INF/lib" flatten="true">
        <fileset dir="${webapp.lib.dir}">
          <include name="**/*.jar" />
        </fileset>
        <fileset dir="${server.lib.dir}">
          <include name="log4j-*.jar" />
          <include name="slf4j-*.jar" />
          <include name="jcl-*.jar" />
        </fileset>
      </copy>

      <copy todir="${webapp.dir}/${module}/WEB-INF/js">
        <fileset dir="${webapp.dir}/WEB-INF/js">
          <include name="**/*.js" />
          <exclude name="mjt/examples/**"/>
          <exclude name="mjt/doc/**"/>
          <exclude name="mjt/test/**"/>
        </fileset>
      </copy>

      <copy todir="${webapp.dir}/${module}/WEB-INF/scripts">
        <fileset dir="${webapp.dir}/WEB-INF/scripts">
          <include name="**/*" />
          <exclude name="freebase/**"/>
          <exclude name="googlecode/**"/>
          <exclude name="qa/**"/>
          <exclude name="test/tests/**"/>
          <exclude name="test/writetests/**"/>
        </fileset>
      </copy>

      <copy todir="${webapp.dir}/${module}/WEB-INF/global_static">
        <fileset dir="${webapp.dir}/WEB-INF/global_static">
          <include name="**/*" />
        </fileset>
      </copy>

      <copy todir="${webapp.dir}/${module}/META-INF">
        <fileset dir="${webapp.config.dir}">
          <include name="**/*.properties"/>
          <include name="**/*.conf"/>
        </fileset>
      </copy>
    </target>

    <!-- ======================================================================== -->

    <target name="war" depends="compile-library, compile-webapp" description="Build a webapp">

      <mkdir dir="${war.dir}" />
      <mkdir dir="${war.config.dir}" />
      <mkdir dir="${war.lib.dir}" />
      <mkdir dir="${war.classes.dir}" />

      <!-- Copy modules if available -->
      <copy todir="${war.dir}">
        <fileset dir="${webapp.dir}">
          <exclude name="META-INF/**"/>
          <exclude name="WEB-INF/**"/>
          <exclude name=".**/**"/>
        </fileset>
      </copy>
      <copy todir="${war.config.dir}">
        <fileset dir="${webapp.config.dir}">
          <include name="appengine-application.xml" />
          <include name="application.xml" />
        </fileset>
      </copy>

      <copy todir="${war.config.dir}">
        <fileset dir="${webapp.config.dir}">
          <include name="**/*.properties"/>
          <include name="**/*.conf"/>
        </fileset>
      </copy>

      <copy file="${webapp.web-inf}/web.xml" tofile="${war.web-inf}/web.xml" />

      <copy todir="${war.classes.dir}">
        <fileset dir="${webapp.classes.dir}">
          <include name="**/*.class"/>
        </fileset>
        <fileset dir="${library.classes.dir}">
          <include name="**/*.class"/>
        </fileset>
      </copy>

      <copy todir="${war.lib.dir}" flatten="true">
        <fileset dir="${webapp.lib.dir}">
          <include name="**/*.jar" />
        </fileset>
        <fileset dir="${server.lib.dir}">
          <include name="log4j-*.jar" />
          <include name="slf4j-*.jar" />
          <include name="jcl-*.jar" />
        </fileset>
      </copy>

      <copy todir="${war.dir}/WEB-INF/js">
        <fileset dir="${webapp.dir}/WEB-INF/js">
          <include name="**/*.js" />
          <exclude name="mjt/examples/**"/>
          <exclude name="mjt/doc/**"/>
          <exclude name="mjt/test/**"/>
        </fileset>
      </copy>

      <copy todir="${war.dir}/WEB-INF/scripts">
        <fileset dir="${webapp.dir}/WEB-INF/scripts">
          <include name="**/*" />
          <exclude name="freebase/**"/>
          <exclude name="googlecode/**"/>
          <exclude name="qa/**"/>
          <exclude name="test/tests/**"/>
          <exclude name="test/writetests/**"/>
        </fileset>
      </copy>

      <copy todir="${war.dir}/WEB-INF/global_static">
        <fileset dir="${webapp.dir}/WEB-INF/global_static">
          <include name="**/*" />
        </fileset>
      </copy>
    </target>

    <target name="appengine-war" depends="compile-appengine, war">
      <delete>
        <fileset dir="${war.lib.dir}" includes="**/mysql*"/>
        <fileset dir="${war.classes.dir}" includes="**/MySQL*"/>
      </delete>

      <jar destfile="${war.lib.dir}/acre-appengine.jar">
          <fileset dir="${war.classes.dir}"/>
      </jar>

      <delete dir="${war.classes.dir}"/>

      <copy todir="${war.config.dir}" overwrite="true">
        <fileset dir="${webapp.config.dir}">
          <include name="**/*.properties"/>
          <include name="**/*.conf"/>
        </fileset>
      </copy>

      <copy todir="${war.web-inf}" overwrite="true">
        <fileset dir="${webapp.web-inf}">
          <include name="*.xml"/>
        </fileset>
      </copy>
    </target>

    <!-- ======================================================================== -->

    <target name="dist" description="Build the acre distribution" depends="compile">
        <mkdir dir="${build.dir}" />

        <delete file="${build.dir}/${name}-${version}/${config.dir}/project.local.conf" />

        <copy todir="${build.dir}/${name}-${version}">
            <fileset dir=".">
                <include name="**/*"/>
                <exclude name="${data.dir}/**"/>
                <exclude name="${logs.dir}/**"/>
                <exclude name="${build.dir}/**"/>
                <exclude name="${dist.dir}/**"/>
                <exclude name="${data.dir}/**"/>
                <exclude name="${webapp.config.dir}/*.properties"/>
                <exclude name="${webapp.config.dir}/*.conf"/>
                <exclude name="**/mysql-connector-java*"/>
            </fileset>
        </copy>

        <delete dir="${build.dir}/${name}-${version}/${webapp.web-inf}/static" />

        <echo file="${build.dir}/${name}-${version}/${config.dir}/project.local.conf" append="true">ACRE_VERSION=${version}</echo>

        <tar longfile="gnu" compression="gzip" destfile="${dist.dir}/${fullname}.tar.gz">
           <tarfileset dir="${build.dir}" filemode="755">
               <include name="${name}-${version}/${name}"/>
               <include name="${name}-${version}/bin/**"/>
           </tarfileset>
           <tarfileset dir="${build.dir}">
               <include name="${name}-${version}/**"/>
               <exclude name="${name}-${version}/${name}"/>
               <exclude name="${name}-${version}/bin/**"/>
           </tarfileset>
        </tar>
    </target>

    <!-- ======================================================================== -->

    <target name="clean" description="Remove all compiled classes">
        <delete dir="${library.classes.dir}" />
        <delete dir="${server.classes.dir}" />
        <delete dir="${webapp.classes.dir}" />
        <delete dir="${appengine.classes.dir}" />

        <delete file="${webapp.web-inf}/appengine-web.xml"/>
        <delete file="${webapp.web-inf}/web.xml"/>
        <delete file="${webapp.web-inf}/cron.xml"/>
        <delete file="${webapp.web-inf}/datastore-indexes.xml"/>
        <delete file="${webapp.web-inf}/queue.xml"/>
        <delete file="${webapp.web-inf}/backends.xml"/>
        <delete file="${webapp.web-inf}/dispatch.xml"/>

        <delete file="${webapp.web-inf}/appengine-web.xml.in"/>
        <delete file="${webapp.web-inf}/web.xml.in"/>
        <delete file="${webapp.web-inf}/cron.xml.in"/>
        <delete file="${webapp.web-inf}/datastore-indexes.xml.in"/>
        <delete file="${webapp.web-inf}/queue.xml.in"/>
        <delete file="${webapp.web-inf}/backends.xml.in"/>
        <delete file="${webapp.web-inf}/dispatch.xml.in"/>

        <delete>
            <fileset dir="${webapp.dir}/META-INF">
                <include name="*.conf"/>
                <include name="*.properties"/>
                <include name="ots.other.conf.in"/>
                <include name="appengine-application.xml.in"/>
                <include name="appengine-application.xml"/>
                <include name="application.xml.in"/>
                <include name="application.xml"/>
            </fileset>
            <fileset dir="${webapp.lib.dir}">
                <include name="appengine-*.jar" />
            </fileset>
        </delete>

        <delete>
          <fileset dir="${webapp.dir}">
            <include name="*/WEB-INF/**"/>
          </fileset>
          <dirset dir="${webapp.dir}">
            <include name="*/WEB-INF/**"/>
          </dirset>
        </delete>

        <delete>
          <dirset dir="${webapp.dir}">
            <include name="*" />
            <exclude name="META-INF/"/>
            <exclude name="WEB-INF/"/>
            <exclude name=".**"/>
          </dirset>
        </delete>

        <delete dir="${war.dir}" />
        <delete dir="${build.dir}" />

    </target>

    <target name="distclean" description="Remove all files not in version control" depends="clean">
        <delete dir="${dist.dir}" />
        <delete dir="${data.dir}" />
        <delete dir="${logs.dir}" />
    </target>

    <scriptdef name="iterate" language="javascript">
    <element name="dirset" type="dirset"/>
    <attribute name="target"/>
    <![CDATA[
      dirsets = elements.get("dirset"); // Can have multiple dirsets
      target = attributes.get("target");

      for (var i = 0; i < dirsets.size(); ++i) {
        dirset = dirsets.get(i);

        var it = dirset.iterator();
        while(it.hasNext()) {
          var key = it.next();
          println("Executing task for " + key.getName());

          var callTask = project.createTask("antcall");
          callTask.setTarget(target);

          // Configure the parameters for the "antcall" task - module name
          var param = callTask.createParam();
          param.setName("module");
          param.setValue(key.getName());

          callTask.execute();
        }
      }

    ]]>
    </scriptdef>

</project>


text:
option(ITK_USE_SYSTEM_KWIML "Use an outside build of KWIML." OFF)
mark_as_advanced(ITK_USE_SYSTEM_KWIML)

if(ITK_USE_SYSTEM_KWIML)
  find_package(KWIML 1.0 REQUIRED)
endif()


text:
package io.zrz.graphql.zulu.engine;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

import io.zrz.graphql.zulu.executable.ExecutableInput;

/**
 * internal per-execution state container which keeps track of the position of execution.
 */

class ExecutionState<RootT> implements ZuluSelectionVisitor.ConsumerVisitor<Object>, ZuluExecutionResult, ZuluRequestContext {

  private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(ExecutionState.class);

  /**
   *
   */
  private final ZuluExecutionScope scope;
  private final ZuluResultReceiver receiver;
  private ArrayList<ZuluWarning> notes = null;
  private final ZuluRequest req;

  public ExecutionState(final ZuluExecutionScope scope, final ZuluRequest req, final ZuluResultReceiver receiver) {
    this.scope = scope;
    this.receiver = receiver;
    this.req = req;
  }

  void note(final ZuluWarning note, final ZuluSelection selection) {
    if (this.notes == null) {
      this.notes = new ArrayList<>();
    }
    this.notes.add(note);
  }

  @Override
  public void accept(final ZuluLeafSelection leaf, final Object value) {

    Object result;

    try {

      result = leaf.invoke(this, value);

      if ((result == null) && leaf.typeCritera().isPresent()) {
        // FIXME: this should actually check if the type matches or not.
        return;
      }

      if (leaf.isList()) {

        this.receiver.startList(leaf, this.receiver);

        try {
          if (result != null) {
            for (final Object element : (Object[]) result) {
              if (element == null) {
                this.receiver.write(leaf);
              }
              else {
                this.receiver.write(leaf, element);
              }
            }
          }
        }
        finally {

          this.receiver.endList(leaf, this.receiver);

        }

      }
      else {

        if (result == null) {
          // TODO: if the value is non-null, then propagate exception up.
          this.receiver.write(leaf);
        }
        else {
          this.receiver.write(leaf, result);
        }

      }

    }
    catch (final Exception ex) {
      log.warn("Execution Error", ex);
      this.note(new ZuluWarning.ExecutionError(leaf, ex, value), leaf);
      return;
    }
  }

  @Override
  public void accept(final ZuluContainerSelection container, final Object value) {
    try {

      Objects.requireNonNull(this.receiver);
      final Object context = container.invoke(this, value);

      if (context != null) {

        this.receiver.push(container, context);

        try {

          if (container.isList()) {

            this.receiver.startList(container, context);

            try {

              for (final Object element : (Object[]) context) {

                this.receiver.next(element);

                this.receiver.startStruct(container, null);
                try {

                  container.selections().forEach(sub -> {

                    sub.apply(this, element);

                  });

                }
                finally {

                  this.receiver.endStruct(container, null);

                }

              }

            }
            finally {
              this.receiver.endList(container, context);
            }

          }
          else {
            this.receiver.startStruct(container, null);
            try {
              container.selections().forEach(sub -> sub.apply(this, context));
            }
            finally {
              this.receiver.endStruct(container, null);
            }
          }

        }
        finally {
          this.receiver.pop(container, context);
        }

      }
      else {

        if (container.typeCritera().isPresent()) {
          // FIXME: this should actually check if the type matches or not.
          return;
        }

        // TODO: if it's a non-null return in the model, propogate up to parent.
        this.receiver.write(container);

      }
    }
    catch (final Exception ex) {
      log.warn("Execution Error", ex);
      this.note(new ZuluWarning.ExecutionError(container, ex, value), container);
      return;
    }
  }

  @Override
  public List<ZuluWarning> notes() {
    if (this.notes == null) {
      return Collections.emptyList();
    }
    return this.notes;
  }

  @Override
  public Object parameter(final String parameterName, final ExecutableInput targetType) {
    final Object value = this.req.parameter(parameterName, targetType);
    return value;
  }

  /**
   * provide the context parameter.
   *
   * TODO: move to method handle model for early binding.
   *
   */

  @Override
  public Object context(final Type type) {
    return this.scope.context(type);
  }

}


text:
<?php

namespace phpManufaktur\TemplateTools\Data\Setup;

use Silex\Application;

class Update
{
    protected $app = null;

    /**
     * Execute the Update for the TemplateTools
     *
     * @param Application $app
     */
    public function exec(Application $app)
    {
        $this->app = $app;

        // initialize the SETUP
        $Setup = new Setup($app);

        // proceed CMS bugfixes
        $Setup->cms_bugfix();

        // Create the Locale Table
        $Setup->createLocaleTable();

        // install the templates
        $Setup->install_templates();

        return $app['translator']->trans('Successfull updated the extension %extension%.',
            array('%extension%' => 'TemplateTools'));
    }
}


text:
package jetbrains.exodus.tree.patricia;

import jetbrains.exodus.tree.LongIterator;
import jetbrains.exodus.tree.TreeTraverser;
import org.jetbrains.annotations.NotNull;

public class AddressIterator implements LongIterator {

    @NotNull
    private final TreeTraverser traverser;

    private boolean finished;

    /*
     * Used for trees with returning rootAddress
     */
    public AddressIterator(@NotNull TreeTraverser traverser) {
        this.traverser = traverser;
        finished = false;
        this.traverser.init(true);
    }

    @Override
    public boolean hasNext() {
        return !finished;
    }

    @Override
    public long next() {
        long result = traverser.getCurrentAddress();
        if (traverser.canMoveDown()) { // System.out.println("d");
            traverser.moveDown();
            return result;
        }
        if (traverser.canMoveRight()) {
            traverser.moveRight();
            traverser.moveDown(); // System.out.println("0rd");
            return result;
        }
        while (true) {
            if (traverser.canMoveUp()) {
                if (traverser.canMoveRight()) {
                    traverser.moveRight();
                    traverser.moveDown(); // System.out.println("1rd");
                    return result;
                } else { // System.out.println("u");
                    traverser.moveUp();
                }
            } else if (traverser.canMoveRight()) {
                traverser.moveRight();
                traverser.moveDown(); // System.out.println("2rd");
                return result;
            } else {
                finished = true;
                break;
            }
        }
        return result;
    }

    @NotNull
    public TreeTraverser getTraverser() {
        return traverser;
    }

    public void skipSubTree() {
        //TODO: implement (for Reflect utility only)
    }

}


text:
int sock_getifhwaddr(const char *ifname, uint8_t * hwaddr, uint8_t * addrlen)
{
	struct sockaddr_storage sa;
	uint8_t *src;

#ifdef AF_PACKET
	if (!sock_getifaddr(ifname,AF_PACKET,0,(struct sockaddr*)&sa))
		return 0;
	*addrlen = ((struct sockaddr_ll*)&sa)->sll_halen;
	src = ((struct sockaddr_ll*)&sa)->sll_addr;
#endif

#ifdef AF_LINK
	if (!sock_getifaddr(ifname,AF_LINK,0,(struct sockaddr*)&sa))
		return 0;
	struct sockaddr_dl *sdl = ((struct sockaddr_dl*)&sa);
	*addrlen = sdl->sdl_alen;
	src = ((uint8_t*)sdl->sdl_data)+sdl->sdl_nlen;
#endif

	memcpy(hwaddr,src,*addrlen);
	return 1;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="oval">
            <solid android:color="@color/bg_shadow"/>
            <size
                android:width="36dip"
                android:height="36dip"/>
        </shape>
    </item>
    <item android:state_pressed="true">
        <shape
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="oval">
            <solid android:color="@color/bg_shadow_press"/>
            <size
                android:width="36dip"
                android:height="36dip"/>
        </shape>
    </item>

</selector>


text:
'use strict';
var async = require('async');
var Bitlash = require('bitlash-js');
var util = require('util');

/*
  port open serialport object
  troop object with troopId, scoutId and token
  returns error
*/
function configureScout(port, options, done){

  async.series([

    function(cbStep){
      var cmd = {
        timeout: 10000,
        cmd: 'hq.settoken("' + options.token + '")'
      };

      Bitlash.send(port, cmd, cbStep);

    },
    function(cbStep){
      var cmd = {
        timeout: 10000,
        cmd: 'mesh.config(' + options.scoutId + ', ' + options.troopId + ', 20)'
      };

      Bitlash.send(port, cmd, cbStep);

    },
    function(cbStep){
      var cmd = {
        timeout: 10000,
        cmd: 'mesh.setkey("' + options.token.substring(0, 16) + '")'
      };

      Bitlash.send(port, cmd, cbStep);

    }
  ], function(err){

    done(err);
  });

}

/*
  port open serialport object
  options serialport options object
  returns error, open serialport object
*/
function sync(port, done){
  Bitlash.send(port, function(err){
    if(err){
      return done(err);
    }
    done();
  });
}

/*
  port open serialport object
  cmds command object, or array of command objects to send
  timeout time between sending commands, can help when pinoccio stutters and loses characters while processing last command
  returns error, array of strings, including an empty array if the command has no response
*/
function send(port, cmds, timeout, done){
  if (cmds && cmds.constructor !== Array){
    cmds = [cmds];
  }

  var cmd;
  var results = [];

  async.whilst (
    function() {
      //shift undefined value if empty?
      cmd = cmds.shift();
      return (typeof cmd === 'object');
    },
    function(cbStep) {
      Bitlash.send(port, cmd, function(err, data){
        if(err){
          return done(err);
        }

        if(!data){
          data = [];
        }
        results.push(data);

        //found that multitasking of collecting user input can be flaky
        //as it processes the last command so 1 second delay before sending next command
        setTimeout(cbStep, timeout);
      });
    },
    function(err) {

      //check why it failed
      //some types of errors mean need to invalidate connection
      //any serial errors
      //timeout probably
      //do I have a way to check the type of error or do you just check string equality?
      // if(something){
      //   port.close();
      //   serialPorts.splice(connectionId, 1);
      // }

      //but not
      //invalid command
      //Prompt not at end
      done(err, results);
    });
}

/*
  port open serialport object
  timeout Number of milliseconds to attempt scan
  returns error, array of strings enumerating wifi access points
*/
function findWifi(port, timeout, done){

  var timedout = false;
  var list;

  var opt = {
    timeout: (timeout < 20000 ? timeout : 20000),
    cmd: 'wifi.list'
  };

  var intervalId = setTimeout(function() { timedout = true; }, timeout);

  async.whilst (
    function() {
      return (!list || timedout);
    },
    function(cbStep) {
      Bitlash.send(port, opt, function(err, results){
        if (err) {
          return cbStep(err);
        }

        if(typeof results === 'object' && results.length > 1 && results[0] !== 'Error: Scan failed')
        {
          list = results;
        }

        cbStep();

      });
    },
    function(err) {
      clearTimeout(intervalId);
      done(err, list);
    });
}

/*
  port open serialport object
  ssid string wifi ssid
  pass string of password
  timeout Numer of milliseconds to wait for connect to return successful
  returns error
*/
function programWifi(port, ssid, pass, timeout, done){

  async.series([
    function(cbStep){
      var opt = {
        timeout: 10000,
        cmd: util.format('wifi.config("%s", "%s")', ssid, pass)
      };

      Bitlash.send(port, opt, cbStep);
    },
    function(cbStep){
      var opt = {
        timeout: 2000,
        cmd: 'wifi.reassociate'
      };

      Bitlash.send(port, opt, cbStep);
    },
    function(cbStep){
      waitWifi(port, timeout, cbStep);
    },
  ],
  function(err) {
      done(err);
    });
}

/*
  port open serialport object
  timeout Number of milliseconds to wait for connect to return successful
  returns error
*/
function waitWifi(port, timeout, done){
  var timedout = false;
  var connected = false;

  var opt = {
    timeout: 2000,
    cmd: 'wifi.report'
  };

  setTimeout(function() { timedout = true; }, timeout);

  async.whilst (
    function() {
      return !(connected || timedout);
    },
    function(cbStep) {
      Bitlash.send(port, opt, function(err, results){
        if (err) {
          return cbStep(err);
        }

        // console.log(results[0]);
        if(results[0].indexOf('"connected":true') > 0){
          connected = true;
        }

        cbStep();
      });
    },
    function(err) {
      if(err){
        return done(err);
      }

      if(timedout){
        return done(new Error('timed out'));
      }

      done();
    });
}

module.exports = {
  sync: sync,
  send: send,
  findWifi: findWifi,
  programWifi: programWifi,
  configureScout: configureScout
};


text:
/* module that allows mangling of the arp payload */
#include <linux/module.h>
#include <linux/netfilter_arp/arpt_mangle.h>
#include <net/sock.h>

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>");
MODULE_DESCRIPTION("arptables arp payload mangle target");

static unsigned int
target(struct sk_buff **pskb,
       const struct net_device *in, const struct net_device *out,
       unsigned int hooknum, const struct xt_target *target,
       const void *targinfo)
{
	const struct arpt_mangle *mangle = targinfo;
	struct arphdr *arp;
	unsigned char *arpptr;
	int pln, hln;

	if (skb_shared(*pskb) || skb_cloned(*pskb)) {
		struct sk_buff *nskb;

		nskb = skb_copy(*pskb, GFP_ATOMIC);
		if (!nskb)
			return NF_DROP;
		if ((*pskb)->sk)
			skb_set_owner_w(nskb, (*pskb)->sk);
		kfree_skb(*pskb);
		*pskb = nskb;
	}

	arp = (*pskb)->nh.arph;
	arpptr = (*pskb)->nh.raw + sizeof(*arp);
	pln = arp->ar_pln;
	hln = arp->ar_hln;
	/* We assume that pln and hln were checked in the match */
	if (mangle->flags & ARPT_MANGLE_SDEV) {
		if (ARPT_DEV_ADDR_LEN_MAX < hln ||
		   (arpptr + hln > (**pskb).tail))
			return NF_DROP;
		memcpy(arpptr, mangle->src_devaddr, hln);
	}
	arpptr += hln;
	if (mangle->flags & ARPT_MANGLE_SIP) {
		if (ARPT_MANGLE_ADDR_LEN_MAX < pln ||
		   (arpptr + pln > (**pskb).tail))
			return NF_DROP;
		memcpy(arpptr, &mangle->u_s.src_ip, pln);
	}
	arpptr += pln;
	if (mangle->flags & ARPT_MANGLE_TDEV) {
		if (ARPT_DEV_ADDR_LEN_MAX < hln ||
		   (arpptr + hln > (**pskb).tail))
			return NF_DROP;
		memcpy(arpptr, mangle->tgt_devaddr, hln);
	}
	arpptr += hln;
	if (mangle->flags & ARPT_MANGLE_TIP) {
		if (ARPT_MANGLE_ADDR_LEN_MAX < pln ||
		   (arpptr + pln > (**pskb).tail))
			return NF_DROP;
		memcpy(arpptr, &mangle->u_t.tgt_ip, pln);
	}
	return mangle->target;
}

static int
checkentry(const char *tablename, const void *e, const struct xt_target *target,
	   void *targinfo, unsigned int hook_mask)
{
	const struct arpt_mangle *mangle = targinfo;

	if (mangle->flags & ~ARPT_MANGLE_MASK ||
	    !(mangle->flags & ARPT_MANGLE_MASK))
		return 0;

	if (mangle->target != NF_DROP && mangle->target != NF_ACCEPT &&
	   mangle->target != ARPT_CONTINUE)
		return 0;
	return 1;
}

static struct arpt_target arpt_mangle_reg = {
	.name		= "mangle",
	.target		= target,
	.targetsize	= sizeof(struct arpt_mangle),
	.checkentry	= checkentry,
	.me		= THIS_MODULE,
};

static int __init arpt_mangle_init(void)
{
	if (arpt_register_target(&arpt_mangle_reg))
		return -EINVAL;

	return 0;
}

static void __exit arpt_mangle_fini(void)
{
	arpt_unregister_target(&arpt_mangle_reg);
}

module_init(arpt_mangle_init);
module_exit(arpt_mangle_fini);


text:
package com.palantir.atlasdb.transaction.service;

import java.util.Map;

import com.palantir.atlasdb.keyvalue.api.KeyAlreadyExistsException;
import com.palantir.atlasdb.keyvalue.api.KeyValueService;

public class KVSBasedTransactionService implements TransactionService {
    private final TransactionKVSWrapper kvsWrapper;

    public KVSBasedTransactionService(KeyValueService keyValueService) {
        this.kvsWrapper = new TransactionKVSWrapper(keyValueService);
    }

    @Override
    public Long get(long startTimestamp) {
        return kvsWrapper.get(startTimestamp);
    }

    @Override
    public Map<Long, Long> get(Iterable<Long> startTimestamps) {
        return kvsWrapper.get(startTimestamps);
    }

    @Override
    public void putUnlessExists(long startTimestamp, long commitTimestamp) throws KeyAlreadyExistsException {
        kvsWrapper.putUnlessExists(startTimestamp, commitTimestamp);
    }
}


text:
chmod 755 *
cd thirdparty
rm -rf gatb-core
git clone https://github.com/GATB/gatb-core.git
cd ..

#Making a build directory. This is where the executable will be stored
rm -rf build
mkdir build

cd build

#Running the cmake command from the build directory
cmake ..

#Running the make command
make -j 1

cd ..

mkdir -p "${PREFIX}/bin"
mv build/bin/ORNA "$PREFIX/bin/"


text:
<?php namespace System\Session;

use System\Arr;
use System\Config;
use System\Cookie;

class Cargo {

	/**
	 * Instance of the session driver
	 *
	 * @var array
	 */
	public $driver;

	/**
	 * Session ID
	 *
	 * @var int
	 */
	public $id;

	/**
	 * Session data array
	 *
	 * @var array
	 */
	public $data = array();

	/**
	 * Create a new instance of the cargo session container
	 *
	 * @param object
	 */
	public function __construct($driver) {
		$this->driver = $driver;
	}

	/**
	 * Implementation of the read method, imports the current
	 * session if found and populates the data array
	 */
	public function read() {
		extract($this->driver->config);

		// read session ID from cookie
		$this->id = Cookie::read($cookie, 0);

		// make sure we have some data, if not lets start again
		if($data = $this->driver->read($this->id)) {
			// set the data to an empty array
			$this->data = $data;
		}
		else {
			// Cargo has expired lets create a new ID to prevent session fixation
			// @see https://www.owasp.org/index.php/Session_fixation
			$this->id = noise(32);
		}
	}

	/**
	 * Implementation of the write method, commits the session
	 * data using the storage driver
	 */
	public function write() {
		extract($this->driver->config);

		// if the session is set to never expire
		// we will set it to 1 year
		if($lifetime == 0) {
			$lifetime = (3600 * 24 * 365);
		}

		// save session ID
		Cookie::write($cookie, $this->id, ($expire_on_close ? 0 : $lifetime));

		// rotate flash data
		$this->put('_out', $this->get('_in', array()));
		$this->put('_in', array());

		// write payload to storage driver
		$this->driver->write($this->id, $this->data);
	}

	/**
	 * Get a item from the session
	 *
	 * @param string
	 * @param mixed
	 */
	public function get($key, $fallback = null) {
		return Arr::get($this->data, $key, $fallback);
	}

	/**
	 * Store a item in the session
	 *
	 * @param string
	 * @param mixed
	 */
	public function put($key, $value) {
		Arr::set($this->data, $key, $value);
	}

	/**
	 * Remove a item in the session
	 *
	 * @param string
	 * @param mixed
	 */
	public function erase($key) {
		Arr::erase($this->data, $key);
	}

	/**
	 * Gets and sets flash data which is only available for one request
	 *
	 * @param array|null
	 * @return mixed
	 */
	public function flash($data = null) {
		if(is_null($data)) {
			return $this->get('_out', array());
		}

		$this->put('_in', $data);
	}

}


text:
package cz.metacentrum.perun.engine.scheduling.impl;

import cz.metacentrum.perun.taskslib.exceptions.TaskStoreException;
import cz.metacentrum.perun.engine.jms.JMSQueueManager;
import cz.metacentrum.perun.engine.scheduling.PropagationMaintainer;
import cz.metacentrum.perun.engine.scheduling.SchedulingPool;
import cz.metacentrum.perun.taskslib.model.SendTask;
import cz.metacentrum.perun.taskslib.model.SendTask.SendTaskStatus;
import cz.metacentrum.perun.taskslib.model.Task;
import cz.metacentrum.perun.taskslib.model.Task.TaskStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import javax.jms.JMSException;
import java.util.Date;
import java.util.concurrent.Future;

@org.springframework.stereotype.Service(value = "propagationMaintainer")
public class PropagationMaintainerImpl implements PropagationMaintainer {
	private final static Logger log = LoggerFactory
			.getLogger(PropagationMaintainerImpl.class);

	@Autowired
	private SchedulingPool schedulingPool;
	@Autowired
	private JMSQueueManager jmsQueueManager;

	private void logJmsError(JMSException e, Object o) {
		log.warn("Error occured trying to send {} to Dispatcher", o, e);
	}

	public void endStuckTasks() {
		//TODO: where and how to get this
		long stuckTimeLimit = 10000L;
		long now = new Date(System.currentTimeMillis()).getTime();

		for (Task task : schedulingPool.getGeneratingTasksBlockingMap().values()) {
			if ((task.getStartTime().getTime() - now) > stuckTimeLimit) {
				task.setStatus(TaskStatus.GENERROR);
				Task removed = null;
				try {
					removed = schedulingPool.removeTask(task);
				} catch (TaskStoreException e) {
					log.error("Failed during removal of Task {} from SchedulingPool", task);
				}
				if (removed != null) {
					log.error("Stale Task {} was not removed.", task);
				}
				try {
					jmsQueueManager.reportTaskStatus(task.getId(), task.getStatus(), System.currentTimeMillis());
				} catch (JMSException e) {
					logJmsError(e, task);
				}
			}
		}

		for (SendTask sendTask : schedulingPool.getSendingSendTasksBlockingMap().values()) {
			if ((sendTask.getStartTime().getTime() - now) > stuckTimeLimit) {
				sendTask.setStatus(SendTaskStatus.ERROR);
				Future<SendTask> sendTaskFuture = null;
				try {
					sendTaskFuture = schedulingPool.removeSendTaskFuture(
							sendTask.getId().getLeft(), sendTask.getId().getRight());
				} catch (TaskStoreException e) {
					log.error("Failed during removal of SendTaskFuture {} from SchedulingPool", sendTaskFuture);
				}
				if (sendTaskFuture == null) {
					log.error("Stale SendTask {} was not removed.", sendTask);
				}
				try {
					jmsQueueManager.reportTaskResult(schedulingPool.createTaskResult(sendTask.getId().getLeft(),
							sendTask.getDestination().getId(), sendTask.getStderr(), sendTask.getStdout(),
							sendTask.getReturnCode(), sendTask.getTask().getExecService().getService()));
				} catch (JMSException e) {
					logJmsError(e, sendTask);
				}

			}
		}
	}

	public JMSQueueManager getJmsQueueManager() {
		return jmsQueueManager;
	}

	public void setJmsQueueManager(JMSQueueManager jmsQueueManager) {
		this.jmsQueueManager = jmsQueueManager;
	}

}


text:
package net.avantica.xinef.dapp.mapper;

import android.content.Context;

import net.avantica.xinef.dapp.R;
import net.avantica.xinef.dapp.di.PerActivity;
import net.avantica.xinef.dapp.model.ItemPublicInvestmentProjectDetailModel;
import net.avantica.xinef.dapp.model.PublicInvestmentProjectModel;
import net.avantica.xinef.dapp.util.Constant;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.inject.Inject;

@PerActivity
public class PublicInvestmentProjectDetailModelDataMapper {

    @Inject
    public PublicInvestmentProjectDetailModelDataMapper() {
    }

    public List<ItemPublicInvestmentProjectDetailModel> transform(Context context, Collection<PublicInvestmentProjectModel> publicInvestmentProject) {
        if (publicInvestmentProject == null) {
            throw new IllegalArgumentException("Cannot transform a null value");
        }
        List<ItemPublicInvestmentProjectDetailModel> itemPublicInvestmentProjectDetailModels = new ArrayList<>();
        PublicInvestmentProjectModel publicInvestmentProjectModel = (PublicInvestmentProjectModel) publicInvestmentProject.toArray()[0];

        final StringBuilder populatedCenterString = new StringBuilder();
        String delim = "";

        for (PublicInvestmentProjectModel model : publicInvestmentProject) {
            populatedCenterString.append(delim).append(model.getPopulatedCenter());
            delim = ", ";
        }

        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(Constant.EMPTY_STRING, publicInvestmentProjectModel.getName()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.costo), String.format(context.getString(R.string.currency_x), publicInvestmentProjectModel.getCost())));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.centro_poblado), populatedCenterString.toString()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.unidad_formuladora), publicInvestmentProjectModel.getFormulatingUnit()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.sector), publicInvestmentProjectModel.getSector()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.pliego), publicInvestmentProjectModel.getFolder()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.ejecutora), publicInvestmentProjectModel.getExecutor()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.codigo_snip), publicInvestmentProjectModel.getSnipCode()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.codigo_unico), publicInvestmentProjectModel.getUniqueCode()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.funcion), publicInvestmentProjectModel.getFunction()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.programa), publicInvestmentProjectModel.getProgram()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.sub_programa), publicInvestmentProjectModel.getSubprogram()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.fuente_financiamiento), publicInvestmentProjectModel.getFundingSource()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.fecha_registro), publicInvestmentProjectModel.getRegistrationDate()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.situacion), publicInvestmentProjectModel.getState()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.situacion), publicInvestmentProjectModel.getSituation()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.closed), publicInvestmentProjectModel.getClosed()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.fecha_viab), publicInvestmentProjectModel.getViabDate()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.monto_viable), publicInvestmentProjectModel.getViableAmount()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.beneficiario), publicInvestmentProjectModel.getBeneficiary()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.objetivo), publicInvestmentProjectModel.getObjective()));
        itemPublicInvestmentProjectDetailModels.add(new ItemPublicInvestmentProjectDetailModel(context.getString(R.string.alternativa), publicInvestmentProjectModel.getAlternative()));

        return itemPublicInvestmentProjectDetailModels;
    }
}


text:
package com.guoxiaoxing.music.lastfmapi.models;

/**
 * Created by christoph on 17.07.16.
 */
public class ScrobbleInfo {
}


text:
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
var serverUtils = require('./serverUtils.js');

app.set('view engine', 'html');
app.use('/', express.static('./public'));

// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }));
// parse application/json
app.use(bodyParser.json());

//Insert or update user information in database
app.post('/data/user', serverUtils.upsertUser);

app.post('/data/activities', serverUtils.addActivity);

app.get('/data/activities', serverUtils.retrieveActivityFeed);

app.post('/data/join', serverUtils.joinActivity);

app.post('/data/leave', serverUtils.leaveActivity);

app.get('/data/userActivities', serverUtils.ownerActivities);

app.get('/data/participatingActivities', serverUtils.participatingActivities);

app.get('/data/closedActivities', serverUtils.closedActivities);

app.post('/data/toggle', serverUtils.toggleActivityStatus);

module.exports = app;


text:
package io.j99.idea.vue.component;

import com.intellij.psi.xml.XmlTag;
import com.intellij.xml.XmlAttributeDescriptor;
import com.intellij.xml.XmlAttributeDescriptorsProvider;
import org.jetbrains.annotations.Nullable;

/**
 * Created by apple on 16/2/25.
 */
public class VueAttributeDescriptorProvider implements XmlAttributeDescriptorsProvider {
    private VueComponent vueComponent;
    @Override
    public XmlAttributeDescriptor[] getAttributeDescriptors(XmlTag xmlTag) {
        if (xmlTag == null) {
            return XmlAttributeDescriptor.EMPTY;
        }
        if (vueComponent == null) {
            vueComponent = VueComponent.getInstance(xmlTag.getProject());
        }
        return vueComponent.getAttrArray();
    }

    @Nullable
    @Override
    public XmlAttributeDescriptor getAttributeDescriptor(String attrName, XmlTag tag) {
        if (tag != null && attrName != null) {
            if (vueComponent == null) {
                vueComponent = VueComponent.getInstance(tag.getProject());
            }
            return vueComponent.getAttrLookup().get(attrName);
        }
        return null;
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>The tensors application</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">

Modules

tensors_app

tensors_block

tensors_file

tensors_get_stream

tensors_io

tensors_put_stream

tensors_sup

tensors_tree

tensors_tree_utils