text:
import datetime
from cStringIO import StringIO

from django.test import TestCase
from django.core import mail
from django.conf import settings
from django.utils import timezone
from django.test.utils import override_settings

from funfactory.urlresolvers import reverse

import mock
from nose.tools import eq_, ok_

from airmozilla.manage.archiver import archive
from airmozilla.main.models import Event, Template, VidlySubmission

SAMPLE_XML = (
    '<?xml version="1.0"?>'
    '<Response><Message>Action successful.</Message>'
    '<MessageCode>4.1</MessageCode><Success><Task><UserID>1234</UserID>'
    '<MediaShortLink>abc123</MediaShortLink>'
    '<SourceFile>http://videos.mozilla.org/bla.f4v</SourceFile>'
    '<BatchID>35402</BatchID>'
    '<Status>Finished</Status>'
    '<Private>false</Private>'
    '<PrivateCDN>false</PrivateCDN><Created>2012-08-23 19:30:58</Created>'
    '<Updated>2012-08-23 20:44:22</Updated>'
    '<UserEmail>airmozilla@mozilla.com</UserEmail>'
    '</Task></Success></Response>'
)

SAMPLE_MEDIALIST_XML = (
    '<?xml version="1.0"?>'
    '<Response><Message>OK</Message><MessageCode>7.4</MessageCode><Success>'
    '<Media><MediaShortLink>abc123</MediaShortLink><VanityLink/>'
    '<Notify>vvm@spb-team.com</Notify><Created>2011-12-25 18:45:56</Created>'
    '<Updated>2012-11-28 14:05:07</Updated><Status>Finished</Status>'
    '<IsDeleted>false</IsDeleted><IsPrivate>false</IsPrivate>'
    '<IsPrivateCDN>false</IsPrivateCDN><CDN>AWS</CDN></Media>'
    '<Media><MediaShortLink>xyz987</MediaShortLink><VanityLink/>'
    '<Notify>vvm@spb-team.com</Notify><Created>2011-12-25 19:41:05</Created>'
    '<Updated>2012-11-28 14:04:57</Updated><Status>Error</Status>'
    '<IsDeleted>false</IsDeleted><IsPrivate>false</IsPrivate>'
    '<IsPrivateCDN>false</IsPrivateCDN><CDN>AWS</CDN></Media>'
    '</Success></Response>'
)

class ArchiverTestCase(TestCase):
    fixtures = ['airmozilla/manage/tests/main_testdata.json']

    def _age_event_created(self, event, save=True):
        extra_seconds = settings.PESTER_INTERVAL_DAYS * 24 * 60 * 60 + 1
        now = timezone.now()
        event.created = now - datetime.timedelta(seconds=extra_seconds)
        save and event.save()

    @mock.patch('airmozilla.manage.archiver.logging')
    def test_a_bad_event_parameter_1(self, mocked_logging):
        event = Event.objects.get(title='Test event')
        archive(event)
        mocked_logging.warn.assert_called_with(
            'Event %r not a Vid.ly event', 'Test event'
        )

    @mock.patch('airmozilla.manage.archiver.logging')
    def test_a_bad_event_parameter_2(self, mocked_logging):
        event = Event.objects.get(title='Test event')
        vidly_template = Template.objects.create(name='Vid.ly Test')
        event.template = vidly_template
        event.save()
        archive(event)
        mocked_logging.warn.assert_called_with(
            'Event %r does not have a Vid.ly tag', u'Test event'
        )

    @override_settings(ADMINS=(('F', 'foo@bar.com'), ('B', 'bar@foo.com')))
    @mock.patch('urllib2.urlopen')
    def test_still_not_found(self, p_urlopen):

        def mocked_urlopen(request):
            return StringIO(SAMPLE_MEDIALIST_XML.strip())

        p_urlopen.side_effect = mocked_urlopen

        event = Event.objects.get(title='Test event')
        vidly_template = Template.objects.create(name='Vid.ly Test')
        event.template = vidly_template
        event.template_environment = {'tag': 'NOTKNOWN'}
        event.save()
        archive(event)

        sent_email = mail.outbox[-1]
        eq_(sent_email.to, [x[1] for x in settings.ADMINS])
        ok_('NOTKNOWN' in sent_email.subject)
        ok_(reverse('manage:event_edit', args=(event.pk,)) in sent_email.body)

    @override_settings(ADMINS=(('F', 'foo@bar.com'), ('B', 'bar@foo.com')))
    @mock.patch('urllib2.urlopen')
    def test_errored(self, p_urlopen):

        def mocked_urlopen(request):
            xml = SAMPLE_XML.replace(
                '<Status>Finished</Status>',
                '<Status>Error</Status>',
            )
            return StringIO(xml.strip())

        p_urlopen.side_effect = mocked_urlopen

        event = Event.objects.get(title='Test event')
        vidly_template = Template.objects.create(name='Vid.ly Test')
        event.template = vidly_template
        event.template_environment = {'tag': 'abc123'}
        event.save()
        archive(event)

        sent_email = mail.outbox[-1]
        eq_(sent_email.to, [x[1] for x in settings.ADMINS])
        ok_('Unable to archive event' in sent_email.subject)
        ok_('abc123' in sent_email.subject)
        ok_(reverse('manage:event_edit', args=(event.pk,)) in sent_email.body)

    @override_settings(ADMINS=(('F', 'foo@bar.com'),))
    @mock.patch('urllib2.urlopen')
    def test_errored_updating_vidly_submission(self, p_urlopen):

        def mocked_urlopen(request):
            xml = SAMPLE_XML.replace(
                '<Status>Finished</Status>',
                '<Status>Error</Status>',
            )
            return StringIO(xml.strip())

        p_urlopen.side_effect = mocked_urlopen

        event = Event.objects.get(title='Test event')
        vidly_template = Template.objects.create(name='Vid.ly Test')
        event.template = vidly_template
        event.template_environment = {'tag': 'abc123'}
        event.save()
        vidly_submission = VidlySubmission.objects.create(
            event=event,
            url='https://example.com',
            tag='abc123'
        )
        archive(event)

        vidly_submission = VidlySubmission.objects.get(id=vidly_submission.id)
        ok_(vidly_submission.errored)
        ok_(not vidly_submission.finished)

    @mock.patch('urllib2.urlopen')
    def test_processing(self, p_urlopen):

        def mocked_urlopen(request):
            xml = SAMPLE_XML.replace(
                '<Status>Finished</Status>',
                '<Status>Processing</Status>',
            )
            return StringIO(xml.strip())

        p_urlopen.side_effect = mocked_urlopen

        event = Event.objects.get(title='Test event')
        vidly_template = Template.objects.create(name='Vid.ly Test')
        event.template = vidly_template
        event.template_environment = {'tag': 'abc123'}
        event.save()
        archive(event)

        eq_(len(mail.outbox), 0)

    @mock.patch('urllib2.urlopen')
    def test_finished(self, p_urlopen):

        def mocked_urlopen(request):
            return StringIO(SAMPLE_XML.strip())

        p_urlopen.side_effect = mocked_urlopen

        event = Event.objects.get(title='Test event')
        event.status = Event.STATUS_PENDING
        event.archive_time = None
        vidly_template = Template.objects.create(name='Vid.ly Test')
        event.template = vidly_template
        event.template_environment = {'tag': 'abc123'}
        event.save()
        archive(event)

        eq_(len(mail.outbox), 0)

        event = Event.objects.get(pk=event.pk)
        now = timezone.now()
        eq_(
            event.archive_time.strftime('%Y%m%d %H%M'),
            now.strftime('%Y%m%d %H%M'),
        )
        eq_(event.status, Event.STATUS_SCHEDULED)

    @mock.patch('urllib2.urlopen')
    def test_finished_updating_vidly_submission(self, p_urlopen):

        def mocked_urlopen(request):
            return StringIO(SAMPLE_XML.strip())

        p_urlopen.side_effect = mocked_urlopen

        event = Event.objects.get(title='Test event')
        event.status = Event.STATUS_PENDING
        event.archive_time = None
        vidly_template = Template.objects.create(name='Vid.ly Test')
        event.template = vidly_template
        event.template_environment = {'tag': 'abc123'}
        event.save()
        vidly_submission = VidlySubmission.objects.create(
            event=event,
            url='https://example.com',
            tag='abc123'
        )
        archive(event)

        vidly_submission = VidlySubmission.objects.get(id=vidly_submission.id)
        ok_(not vidly_submission.errored)
        ok_(vidly_submission.finished)


text:
using System.Web;
using System.Web.Mvc;
using Cake.Web.Core;
using Cake.Web.Core.Rendering;
using Cake.Web.Docs;
using Cake.Web.Docs.Reflection;
using Mono.Cecil;

namespace Cake.Web.Helpers.Api
{
    public static class TypeHelper
    {
        public static IHtmlString TypeUrl(this ApiServices context, DocumentedType type)
        {
            if (type != null)
            {
                return TypeUrl(context, type.Identity);
            }
            return MvcHtmlString.Create(string.Empty);
        }

        public static IHtmlString TypeUrl(this ApiServices context, string identity)
        {
            if (!string.IsNullOrWhiteSpace(identity))
            {
                var url = context.UrlResolver.GetUrl(identity);
                if (url != null)
                {
                    return MvcHtmlString.Create(url);
                }
            }
            return MvcHtmlString.Create(string.Empty);
        }

        public static IHtmlString TypeName(this ApiServices context, DocumentedType type)
        {
            if (type != null)
            {
                var signature = context.SignatureResolver.GetTypeSignature(type);
                return context.SignatureRenderer.Render(signature, TypeRenderOption.Name);
            }
            return MvcHtmlString.Empty;
        }

        public static IHtmlString TypeLink(this ApiServices context, DocumentedType type)
        {
            if (type != null)
            {
                var signature = context.SignatureResolver.GetTypeSignature(type);
                return context.SignatureRenderer.Render(signature, TypeRenderOption.Name | TypeRenderOption.Link);
            }
            return MvcHtmlString.Empty;
        }

        public static IHtmlString TypeLink(this ApiServices context, TypeReference type)
        {
            if (type != null)
            {
                var signature = context.SignatureResolver.GetTypeSignature(type);
                return context.SignatureRenderer.Render(signature, TypeRenderOption.Name | TypeRenderOption.Link);
            }
            return MvcHtmlString.Empty;
        }

        public static IHtmlString TypeClassificationName(this ApiServices context, DocumentedType type)
        {
            if (type != null)
            {
                switch (type.TypeClassification)
                {
                    case TypeClassification.Class:
                        return MvcHtmlString.Create("Class");
                    case TypeClassification.Enum:
                        return MvcHtmlString.Create("Enumeration");
                    case TypeClassification.Interface:
                        return MvcHtmlString.Create("Interface");
                    case TypeClassification.Struct:
                        return MvcHtmlString.Create("Struct");
                    default:
                        return MvcHtmlString.Create("Unknown");
                }
            }
            return MvcHtmlString.Create(string.Empty);
        }

        public static IHtmlString TypeClassificationName(this HtmlHelper helper, TypeClassification classification)
        {
            switch (classification)
            {
                case TypeClassification.Class:
                    return MvcHtmlString.Create("Class");
                case TypeClassification.Enum:
                    return MvcHtmlString.Create("Enumeration");
                case TypeClassification.Interface:
                    return MvcHtmlString.Create("Interface");
                case TypeClassification.Struct:
                    return MvcHtmlString.Create("Struct");
                default:
                    return MvcHtmlString.Create("Unknown");
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
"""

  Knapsack problem in Google CP Solver.

  Simple knapsack problem.

  This model was created by Hakan Kjellerstrand (hakank@gmail.com)
  Also see my other Google CP Solver models:
  http://www.hakank.org/google_or_tools/
"""
from ortools.constraint_solver import pywrapcp

def knapsack(solver, values, weights, n):
  z = solver.IntVar(0, 10000)
  x = [solver.IntVar(0, 1, "x(%i)" % i) for i in range(len(values))]
  solver.Add(z >= 0)
  solver.Add(z == solver.ScalProd(x, values))
  solver.Add(solver.ScalProd(x, weights) <= n)

  return [x, z]

def main(values, weights, n):
  # Create the solver.
  solver = pywrapcp.Solver("knapsack_cp")

  #
  # data
  #
  print("values:", values)
  print("weights:", weights)
  print("n:", n)
  print()

  # declare variables

  #
  # constraints
  #
  [x, z] = knapsack(solver, values, weights, n)

  # objective
  objective = solver.Maximize(z, 1)

  #
  # solution and search
  #
  solution = solver.Assignment()
  solution.Add(x)
  solution.Add(z)

  # db: DecisionBuilder
  db = solver.Phase(x, solver.CHOOSE_FIRST_UNBOUND, solver.ASSIGN_MAX_VALUE)

  solver.NewSearch(db, [objective])
  num_solutions = 0
  while solver.NextSolution():
    print("x:", [x[i].Value() for i in range(len(values))])
    print("z:", z.Value())
    print()
    num_solutions += 1
  solver.EndSearch()

  print()
  print("num_solutions:", num_solutions)
  print("failures:", solver.Failures())
  print("branches:", solver.Branches())
  print("WallTime:", solver.WallTime())

values = [15, 100, 90, 60, 40, 15, 10, 1, 12, 12, 100]
weights = [2, 20, 20, 30, 40, 30, 60, 10, 21, 12, 2]
n = 102

if __name__ == "__main__":
  main(values, weights, n)


text:
<?php
/**
* Create a new file in the application root, and have it
* return your mandrill API key. It will be excluded from
* git.
*/
$mandrill_api_key = include 'mandrill.key.php';

return [
	/**
	* Administrator details, your name and email.
	*/
	'administrator' => [
		'email' => 'dustin.moorman@gmail.com',
		'name' => 'Dustin Moorman'
	],
	'hosts' => [],
	'mailer' => [
		'on' => true,
		'vendor' => [
			'name' => 'Mandrill',
			'implementation' => 'Dustinmoorman',
			/**
			* The 'from' information is for the automated
			* system that will be sending you notification
			* emails.
			*/
			'from' => [
				'name' => 'Network Heartbeat',
				'address' => 'neth@dustinmoorman.com',
				'reply' => 'dustin.moorman@gmail.com'
			],
			'apiKey' => $mandrill_api_key
		]
	],
	/**
	* Job configuration. Each job has its own
	* distinct variable scope. Any keys and values
	* made here will be available in each job
	* respectively.
	*/
	'job' => [
		'HostAvailable' => [
			'ping_count' => 3,
			'high_ping_threshold_ms' => 300,
			'acceptable_packet_loss_percent' => 1,
			/**
			 * Local machines you'd like to check availability,
			 * hostname / identifier => address.
			 */
			'hosts' => [
				'scotch' => '192.168.1.5'
			],
			'events' => [
				'JOB_EXCEPTION' => 'An exception has occurred with HostAvailable',
				'HOST_HIGH_PING' => 'Host registring high ping: ',
				'HOST_UNAVAILABLE' => 'Unable to reach host: ',
				'PACKET_LOSS_THRESHOLD' => 'Host registering high packet loss: '
			]
		],
		'NetworkAvailable' => [
			'wait_time_seconds' => 5,
			'events' => [
				'JOB_EXCEPTION' => 'An exception has occurred with NetworkAvailable'
			]
		],
		'HTTPResourceAvailable' => [
			'hosts' => [
				'taupe' => 'www.tau.pe',
				'dustinmoorman.com' => 'dustinmoorman.com'
			],
			'events' => [
				'HTTP_HOST_UNAVAILABLE' => 'Cannot reach Web Host: '
			]
		]
	],
];


text:
/**
 * TODO: document!
 */
public class A {

  public void methodOne(String s) {
    System.out.println("a1-one: " + s);
  }

  public void methodTwo(Object s) {
    System.out.println("a1-two: " + s);
  }

  private void accessLevelToChange() {
    System.out.println("not accessible...!");
  }

  public String staticIsNoise(String s, int i) {
    return "static";
  }
}


text:
#ifndef OS_TCB_H
#define OS_TCB_H

/* Types */
typedef char               S8;
typedef unsigned char      U8;
typedef short              S16;
typedef unsigned short     U16;
typedef int                S32;
typedef unsigned int       U32;
typedef long long          S64;
typedef unsigned long long U64;
typedef unsigned char      BIT;
typedef unsigned int       BOOL;
typedef void               (*FUNCP)(void);

typedef struct OS_TCB {
  /* General part: identical for all implementations.                        */
  U8     cb_type;                 /* Control Block Type                      */
  U8     state;                   /* Task state                              */
  U8     prio;                    /* Execution priority                      */
  U8     task_id;                 /* Task ID value for optimized TCB access  */
  struct OS_TCB *p_lnk;           /* Link pointer for ready/sem. wait list   */
  struct OS_TCB *p_rlnk;          /* Link pointer for sem./mbx lst backwards */
  struct OS_TCB *p_dlnk;          /* Link pointer for delay list             */
  struct OS_TCB *p_blnk;          /* Link pointer for delay list backwards   */
  U16    delta_time;              /* Time until time out                     */
  U16    interval_time;           /* Time interval for periodic waits        */
  U16    events;                  /* Event flags                             */
  U16    waits;                   /* Wait flags                              */
  void   **msg;                   /* Direct message passing when task waits  */

  /* Hardware dependant part: specific for CM processor                      */
  U8     stack_frame;             /* Stack frame: 0=Basic, 1=Extended        */
  U8     reserved;
  U16    priv_stack;              /* Private stack size in bytes             */
  U32    tsk_stack;               /* Current task Stack pointer (R13)        */
  U32    *stack;                  /* Pointer to Task Stack memory block      */

  /* Library dependant part                                                   */
#if defined (__CC_ARM) && !defined (__MICROLIB)
 /* A memory space for arm standard library. */
  U32 std_libspace[96/4];
#endif

  /* Task entry point used for uVision debugger                              */
  FUNCP  ptask;                   /* Task entry address                      */
} *P_TCB;

#endif


text:
package org.eclipse.rdf4j.sail.shacl.benchmark;

import java.util.List;
import java.util.concurrent.TimeUnit;

import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Statement;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.model.vocabulary.RDF;
import org.eclipse.rdf4j.model.vocabulary.RDFS;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.eclipse.rdf4j.sail.shacl.ShaclSail;
import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection;
import org.eclipse.rdf4j.sail.shacl.Utils;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;
import org.slf4j.LoggerFactory;

import ch.qos.logback.classic.Logger;

/**
 * @author Håvard Ottestad
 */
@State(Scope.Benchmark)
@Warmup(iterations = 5)
@BenchmarkMode({ Mode.AverageTime })
@Fork(value = 1, jvmArgs = { "-Xmx64M" })
@Measurement(iterations = 5)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public class NotMaxCountBenchmarkEmpty {

	private List<List<Statement>> allStatements;

	@Setup(Level.Trial)
	public void setUp() throws InterruptedException {
		Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName());
		root.setLevel(ch.qos.logback.classic.Level.INFO);

		SimpleValueFactory vf = SimpleValueFactory.getInstance();

		allStatements = BenchmarkConfigs.generateStatements(((statements, i, j) -> {
			IRI iri = vf.createIRI("http://example.com/" + i + "_" + j);
			statements.add(vf.createStatement(iri, RDF.TYPE, RDFS.RESOURCE));
			statements.add(vf.createStatement(iri, RDFS.LABEL, vf.createLiteral("label" + i)));
		}));

		System.gc();
		Thread.sleep(100);
	}

	@Benchmark
	public void shacl() throws Exception {

		SailRepository repository = new SailRepository(Utils.getInitializedShaclSail("shaclNotMaxCountBenchmark.trig"));

		try (SailRepositoryConnection connection = repository.getConnection()) {
			for (List<Statement> statements : allStatements) {
				connection.begin();
				connection.add(statements);
				connection.commit();
			}
		}
		repository.shutDown();

	}

	@Benchmark
	public void shaclBulk() throws Exception {

		SailRepository repository = new SailRepository(Utils.getInitializedShaclSail("shaclNotMaxCountBenchmark.trig"));

		try (SailRepositoryConnection connection = repository.getConnection()) {
			connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Bulk);
			for (List<Statement> statements : allStatements) {
				connection.add(statements);
			}
			connection.commit();
		}
		repository.shutDown();

	}

}


text:
<?php

namespace Phower\Config\Exception;

/**
 * Package exception interface.
 *
 * @author Pedro Ferreira <pedro@phower.com>
 */
interface ConfigExceptionInterface
{

}


text:
package com.intellij.refactoring.introduceField;

import com.intellij.codeInsight.TestFrameworks;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Ref;
import com.intellij.psi.*;
import com.intellij.psi.search.LocalSearchScope;
import com.intellij.psi.search.searches.ReferencesSearch;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
import com.intellij.refactoring.RefactoringBundle;
import com.intellij.refactoring.ui.TypeSelectorManager;
import com.intellij.ui.NonFocusableCheckBox;
import com.intellij.ui.StateRestoringCheckBox;
import com.intellij.util.ui.JBUI;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.TestOnly;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.HashSet;
import java.util.Set;

public abstract class IntroduceFieldCentralPanel {
   protected static final Logger LOG = Logger.getInstance("#com.intellij.refactoring.introduceField.IntroduceFieldDialog");

  private static final String INTRODUCE_FIELD_FINAL_CHECKBOX = "introduce.final.checkbox";
  public static boolean ourLastCbFinalState = PropertiesComponent.getInstance().getBoolean(INTRODUCE_FIELD_FINAL_CHECKBOX, true);

  protected final PsiClass myParentClass;
  protected final PsiExpression myInitializerExpression;
  protected final PsiLocalVariable myLocalVariable;
  protected final boolean myIsCurrentMethodConstructor;
  protected final boolean myIsInvokedOnDeclaration;
  protected final boolean myWillBeDeclaredStatic;
  protected final int myOccurrencesCount;
  protected final boolean myAllowInitInMethod;
  protected final boolean myAllowInitInMethodIfAll;
  protected final TypeSelectorManager myTypeSelectorManager;

  private JCheckBox myCbReplaceAll;
  private StateRestoringCheckBox myCbDeleteVariable;
  private StateRestoringCheckBox myCbFinal;
  private boolean myHasWriteAccess;

  public IntroduceFieldCentralPanel(PsiClass parentClass,
                                    PsiExpression initializerExpression,
                                    PsiLocalVariable localVariable,
                                    boolean isCurrentMethodConstructor, boolean isInvokedOnDeclaration, boolean willBeDeclaredStatic,
                                    PsiExpression[] occurrences, boolean allowInitInMethod, boolean allowInitInMethodIfAll,
                                    TypeSelectorManager typeSelectorManager) {
    myParentClass = parentClass;
    myInitializerExpression = initializerExpression;
    myLocalVariable = localVariable;
    myIsCurrentMethodConstructor = isCurrentMethodConstructor;
    myIsInvokedOnDeclaration = isInvokedOnDeclaration;
    myWillBeDeclaredStatic = willBeDeclaredStatic;
    myOccurrencesCount = occurrences.length;
    myHasWriteAccess = false;
    for (PsiExpression occurrence : occurrences) {
      if (PsiUtil.isAccessedForWriting(occurrence)) {
        myHasWriteAccess = true;
        break;
      }
    }
    myAllowInitInMethod = allowInitInMethod;
    myAllowInitInMethodIfAll = allowInitInMethodIfAll;
    myTypeSelectorManager = typeSelectorManager;
  }

  protected boolean setEnabledInitializationPlaces(@NotNull final PsiElement initializer) {
    final Set<PsiField> fields = new HashSet<>();
    final Ref<Boolean> refsLocal = new Ref<>(false);
    initializer.accept(new JavaRecursiveElementWalkingVisitor() {
      @Override
      public void visitReferenceExpression(PsiReferenceExpression expression) {
        super.visitReferenceExpression(expression);
        if (expression.getQualifierExpression() == null) {
          final PsiElement resolve = expression.resolve();
          if (resolve == null ||
              resolve instanceof PsiVariable && !PsiTreeUtil.isAncestor(initializer, resolve, true)) {
            if (resolve instanceof PsiField) {
              if (!((PsiField)resolve).hasInitializer()) {
                fields.add((PsiField)resolve);
              }
            }
            else {
              refsLocal.set(true);
              stopWalking();
            }
          }
        }
      }
    });

    final boolean locals = refsLocal.get();
    if (!locals && fields.isEmpty()) {
      return true;
    }
    return updateInitializationPlaceModel(!locals && initializedInSetUp(fields),
                                          !locals && initializedInConstructor(fields));
  }

  private static boolean initializedInConstructor(Set<PsiField> fields) {
    for (PsiField field : fields) {
      if (!field.hasModifierProperty(PsiModifier.FINAL)) {
        return false;
      }
    }
    return true;
  }

  private boolean initializedInSetUp(Set<PsiField> fields) {
    if (hasSetUpChoice()) {
      nextField:
      for (PsiField field : fields) {
        if (field.hasModifierProperty(PsiModifier.FINAL)) continue;
        final PsiMethod setUpMethod = TestFrameworks.getInstance().findSetUpMethod((field).getContainingClass());
        if (setUpMethod != null) {
          for (PsiReference reference: ReferencesSearch.search(field, new LocalSearchScope(setUpMethod))) {
            PsiElement element = reference.getElement();
            if (element instanceof PsiExpression && !PsiUtil.isAccessedForWriting((PsiExpression)element)) {
              continue nextField;
            }
          }
          return false;
        }
      }
      return true;
    }
    return false;
  }

  public abstract BaseExpressionToFieldHandler.InitializationPlace getInitializerPlace();
  protected abstract void initializeInitializerPlace(PsiExpression initializerExpression,
                                                     BaseExpressionToFieldHandler.InitializationPlace ourLastInitializerPlace);
  protected abstract JComponent createInitializerPlacePanel(ItemListener itemListener, ItemListener finalUpdater);
  public abstract void setInitializeInFieldDeclaration();

  public abstract void setVisibility(String visibility);
  public abstract String getFieldVisibility();

  protected void initializeControls(PsiExpression initializerExpression,
                                    BaseExpressionToFieldHandler.InitializationPlace ourLastInitializerPlace) {
    myCbFinal.setSelected(myCbFinal.isEnabled() && ourLastCbFinalState);
  }

  public boolean isReplaceAllOccurrences() {
    if (myIsInvokedOnDeclaration) return true;
    if (myOccurrencesCount <= 1) return false;
    return myCbReplaceAll.isSelected();
  }

  public boolean isDeleteVariable() {
    if (myIsInvokedOnDeclaration) return true;
    if (myCbDeleteVariable == null) return false;
    return myCbDeleteVariable.isSelected();
  }

  public boolean isDeclareFinal() {
    return myCbFinal.isSelected();
  }

  protected JComponent createCenterPanel() {

    ItemListener itemListener = new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (myCbReplaceAll != null && myAllowInitInMethod) {
          updateInitializerSelection();
        }
        if (shouldUpdateTypeSelector()) {
          updateTypeSelector();
        }
      }
    };
    ItemListener finalUpdater = new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        updateCbFinal();
      }
    };
    final JComponent initializerPlacePanel = createInitializerPlacePanel(itemListener, finalUpdater);
    final JPanel checkboxes = appendCheckboxes(itemListener);
    JPanel panel = composeWholePanel(initializerPlacePanel, checkboxes);

    updateTypeSelector();
    updateCbFinal();
    return panel;
  }

  protected abstract JPanel composeWholePanel(JComponent initializerPlacePanel, JPanel checkboxPanel);

  protected void updateInitializerSelection() {
  }

  protected boolean shouldUpdateTypeSelector() {
    return true;
  }

  protected JPanel appendCheckboxes(ItemListener itemListener) {
    GridBagConstraints gbConstraints = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                                                              JBUI.emptyInsets(), 0, 0);
    JPanel panel = new JPanel(new GridBagLayout());
    myCbFinal = new StateRestoringCheckBox();
    myCbFinal.setFocusable(false);
    myCbFinal.setText(RefactoringBundle.message("declare.final"));
    myCbFinal.addItemListener(itemListener);
    gbConstraints.gridy++;
    panel.add(myCbFinal, gbConstraints);
    appendOccurrences(itemListener, gbConstraints, panel);

    if (myLocalVariable != null) {
      gbConstraints.gridy++;
      if (myCbReplaceAll != null) {
        gbConstraints.insets = JBUI.insetsLeft(8);
      }
      myCbDeleteVariable = new StateRestoringCheckBox();
      myCbDeleteVariable.setText(RefactoringBundle.message("delete.variable.declaration"));
      panel.add(myCbDeleteVariable, gbConstraints);
      if (myIsInvokedOnDeclaration) {
        myCbDeleteVariable.setEnabled(false);
        myCbDeleteVariable.setSelected(true);
      } else if (myCbReplaceAll != null) {
        updateCbDeleteVariable();
        myCbReplaceAll.addItemListener(
                new ItemListener() {
                  public void itemStateChanged(ItemEvent e) {
                    updateCbDeleteVariable();
                  }
                }
        );
      }
    }
    return panel;
  }

  public void appendOccurrences(ItemListener itemListener, GridBagConstraints gbConstraints, JPanel panel) {
    if (myOccurrencesCount > 1) {
      myCbReplaceAll = new NonFocusableCheckBox();
      myCbReplaceAll.setText(RefactoringBundle.message("replace.all.occurrences.of.expression.0.occurrences", myOccurrencesCount));
      gbConstraints.gridy++;
      panel.add(myCbReplaceAll, gbConstraints);
      myCbReplaceAll.addItemListener(itemListener);
      if (myIsInvokedOnDeclaration) {
        myCbReplaceAll.setEnabled(false);
        myCbReplaceAll.setSelected(true);
      }
    }
  }

  private void updateTypeSelector() {
    if (myCbReplaceAll != null) {
      myTypeSelectorManager.setAllOccurrences(myCbReplaceAll.isSelected());
    } else {
      myTypeSelectorManager.setAllOccurrences(false);
    }
  }

  private void updateCbDeleteVariable() {
    if (!myCbReplaceAll.isSelected()) {
      myCbDeleteVariable.makeUnselectable(false);
    } else {
      myCbDeleteVariable.makeSelectable();
    }
  }

  protected void updateCbFinal() {
    if (!allowFinal()) {
      myCbFinal.makeUnselectable(false);
    } else {
      myCbFinal.makeSelectable();
    }
  }

  protected boolean allowFinal() {
    if (myHasWriteAccess && isReplaceAllOccurrences()) return false;
    return true;
  }

  public void addOccurrenceListener(ItemListener itemListener) {
    if (myCbReplaceAll != null) {
      myCbReplaceAll.addItemListener(itemListener);
    }
  }

  public void setReplaceAllOccurrences(boolean replaceAllOccurrences) {
    if (myCbReplaceAll != null) {
      myCbReplaceAll.setSelected(replaceAllOccurrences);
    }
  }

  @TestOnly
  public void setCreateFinal(boolean createFinal) {
    myCbFinal.setSelected(createFinal);
    myCbFinal.setEnabled(true);
  }

  protected void enableFinal(boolean enable){
    myCbFinal.setEnabled(enable);
  }

  public void saveFinalState() {
    if (myCbFinal != null && myCbFinal.isEnabled()) {
      ourLastCbFinalState = myCbFinal.isSelected();
      PropertiesComponent.getInstance().setValue(INTRODUCE_FIELD_FINAL_CHECKBOX, ourLastCbFinalState, true);
    }
  }

  protected abstract boolean updateInitializationPlaceModel(boolean initializedInsetup, boolean initializedInConstructor);

  protected abstract boolean hasSetUpChoice();
}


text:
'use strict';

module.exports = {
  objectToQueryString
};

const reduce = require('lodash/reduce');
const isNull = require('lodash/isNull');
const isUndefined = require('lodash/isUndefined');
const isArray = require('lodash/isArray');

// adapted from https://gist.github.com/TravelingTechGuy/32454b95a50d296912b9
function objectToQueryString (obj) {
    let qs = reduce(obj, (result, value, key) => {
        if (!isNull(value) && !isUndefined(value)) {
            if (isArray(value)) {
                result += reduce(value, (result1, value1) => {
                    if (!isNull(value1) && !isUndefined(value1)) {
                        result1 += key + '=' + value1 + '&';
                        return result1
                    } else {
                        return result1;
                    }
                }, '')
            } else {
                result += key + '=' + value + '&';
            }
            return result;
        } else {
            return result
        }
    }, '').slice(0, -1);
    return qs;
};


text:
package org.thymeleaf.processor.element;

import org.thymeleaf.context.ITemplateProcessingContext;
import org.thymeleaf.engine.AttributeNames;
import org.thymeleaf.engine.ElementNames;
import org.thymeleaf.engine.IElementStructureHandler;
import org.thymeleaf.exceptions.TemplateProcessingException;
import org.thymeleaf.model.IProcessableElementTag;
import org.thymeleaf.processor.AbstractProcessor;
import org.thymeleaf.templatemode.TemplateMode;

/**
 *
 * @author Daniel Fernández
 *
 * @since 3.0.0
 *
 */
public abstract class AbstractElementTagProcessor
        extends AbstractProcessor implements IElementTagProcessor {

    private final String dialectPrefix;
    private final String elementName;
    private final String attributeName;
    private final MatchingElementName matchingElementName;
    private final MatchingAttributeName matchingAttributeName;

    public AbstractElementTagProcessor(
            final TemplateMode templateMode, final String dialectPrefix,
            final String elementName, final boolean prefixElementName,
            final String attributeName, final boolean prefixAttributeName,
            final int precedence) {

        super(templateMode, precedence);

        this.dialectPrefix = dialectPrefix;

        this.elementName = elementName;
        this.attributeName = attributeName;

        this.matchingElementName =
                (this.elementName == null?
                    null :
                    MatchingElementName.forElementName(
                            templateMode, ElementNames.forName(templateMode, (prefixElementName? this.dialectPrefix : null), this.elementName)));
        this.matchingAttributeName =
                (this.attributeName == null?
                    null :
                    MatchingAttributeName.forAttributeName(
                            templateMode, AttributeNames.forName(templateMode, (prefixAttributeName? this.dialectPrefix : null), this.attributeName)));

    }

    public final MatchingElementName getMatchingElementName() {
        return this.matchingElementName;
    }

    public final MatchingAttributeName getMatchingAttributeName() {
        return this.matchingAttributeName;
    }

    public final void process(
            final ITemplateProcessingContext processingContext,
            final IProcessableElementTag tag,
            final IElementStructureHandler structureHandler) {

        try {

            doProcess(processingContext, tag, structureHandler);

        } catch (final TemplateProcessingException e) {
            // This is a nice moment to check whether the execution raised an error and, if so, add location information
            if (!e.hasTemplateName()) {
                e.setTemplateName(tag.getTemplateName());
            }
            if (!e.hasLineAndCol()) {
                e.setLineAndCol(tag.getLine(), tag.getCol());
            }
            throw e;
        } catch (final Exception e) {
            throw new TemplateProcessingException(
                    "Error during execution of processor '" + this.getClass().getName() + "'",
                    tag.getTemplateName(), tag.getLine(), tag.getCol(), e);
        }

    }

    protected abstract void doProcess(
            final ITemplateProcessingContext processingContext,
            final IProcessableElementTag tag,
            final IElementStructureHandler structureHandler);

}


text:
package net.spals.appbuilder.app.examples.finatra.cors

import net.spals.appbuilder.app.finatra.FinatraWebApp
import net.spals.appbuilder.config.service.ServiceScan

/**
  * A [[FinatraWebApp]] which registers CORS.
  *
  * @author tkral
  */
object CorsFinatraWebAppMain extends CorsFinatraWebApp

class CorsFinatraWebApp extends FinatraWebApp {

  enableCors()
  setServiceScan(new ServiceScan.Builder()
    .addServicePackages("net.spals.appbuilder.app.finatra.cors")
    .build())
  build()

}


text:
template '/etc/init/consul-server.conf' do
  source 'consul-server.conf.erb'
  variables data: '/var/lib/consul'
end

service 'consul-server' do
  action [:enable, :start]
end


text:
using System.Threading.Tasks;
using XIOTCore.Contract.Enum;
using XIOTCore.Contract.Interface.Basics;
using XIOTCore.Portable.Components.I2C.ADC;
using XIOTCore.Universal.RaspberryPi.ExplorerHATPro.Enum;
using XIOTCore.Universal.RaspberryPi.Interface;

namespace XIOTCore.Universal.RaspberryPi.ExplorerHATPro.Components
{
    public class ExplorerHat_ADS1015 : ADS1015, IExplorerHat_ADS1015
    {
        private readonly ExplorerHat_ADS1015_Channel _channel;
        private readonly XGain _xGain;
        private readonly XSamplesPerSecond _xSamples;

        public ExplorerHat_ADS1015(IXI2CDevice i2cDevice, ExplorerHat_ADS1015_Channel channel, XGain gain = XGain.Volt5,
            XSamplesPerSecond samples = XSamplesPerSecond.SPS1600) : base(i2cDevice, 0x48)
        {
            _channel = channel;
            _xGain = gain;
            _xSamples = samples;
        }
        public async Task<double> Measure()
        {
            return await GetMillivolts((ushort)_channel, _xGain.ForADS1015(), _xSamples.ForADS1015());
        }

        public async Task<double> MeasurePercentage()
        {
            var mv = await GetMillivolts((ushort)_channel, _xGain.ForADS1015(), _xSamples.ForADS1015());

            var volts = _xGain.ToElectricPotenital();

            return (volts.Millivolts - mv) / volts.Millivolts * 100d;
        }
    }
}


text:
<?php
	session_start("login_ml");
	include("conexao.php");
?>
<?php
  if(!isset($_SESSION["psn"]) || !isset($_SESSION["senha"]))
  {
    header("Location: login.php");
    exit; //encerra as funções da página
  }
  else
  {
    //echo "Você está logado.";
	$psn = $_SESSION["psn"];
	//echo $psn;

	if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 1800))
	{
		// last request was more than 30 minutes ago
		session_unset();     // unset $_SESSION variable for the run-time
		session_destroy();   // destroy session data in storage
		header("Location: logout.php");
		exit; //encerra as funções da página
	}

	$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
  }
?>

        <title>Master League - CR Galáticos</title>

        <meta charset="utf-8"/>
        <meta name="author" content="CR Galaticos">
        <meta name="description" content="Organization of CR Galaticos Master League">

        <link rel="stylesheet" type="text/css" href="../static/css/base.css">
        <link rel="stylesheet" type="text/css" href="../static/css/Teste_tabela_css.css">
		<link rel="stylesheet" href="../static/css/estilo2.css"/>

      <?php
      	include("cabecalho.php");
      ?>

					Aperte abaixo para o sorteio!

         <?php
      	include("footer.php");
      ?>


text:
package okra.exception;

public class InvalidOkraConfigurationException extends RuntimeException {
    public InvalidOkraConfigurationException() {
        super("MongoScheduler.InvalidConfiguration");
    }
}


text:
//  See http://www.boost.org/libs/config for the most recent version.//
//  Revision $Id$
//

// Test file for macro BOOST_NO_CXX14_GENERIC_LAMBDAS
// This file should compile, if it does not then
// BOOST_NO_CXX14_GENERIC_LAMBDAS should be defined.
// See file boost_no_cxx14_generic_lambda.ipp for details

// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
#  undef BOOST_ASSERT_CONFIG
#endif

#include <boost/config.hpp>
#include "test.hpp"

#ifndef BOOST_NO_CXX14_GENERIC_LAMBDAS
#include "boost_no_cxx14_generic_lambda.ipp"
#else
namespace boost_no_cxx14_generic_lambdas = empty_boost;
#endif

int main( int, char *[] )
{
   return boost_no_cxx14_generic_lambdas::test();
}


text:
define(['marionette',
	'./contextMenuTestTemplate.hbs',
	'rup.contextMenu','rup.button'], function(Marionette, ContextMenuTestTemplate){

	var ContextMenuTestView = Marionette.LayoutView.extend({
		template: ContextMenuTestTemplate,
		ui:{
			contextMenu: '#contextMenu',
			contextMenuLeft: '.contextMenu-left',
			contextMenuHover: '#contextMenu-hover',
			contextMenuOther: '.contextMenu-other',
			btnActivateMenu: '#activate-menu'
		},
		events:{
			'click @ui.btnActivateMenu': fncActivateMenu
		},
		onAttach: fncOnAttach

	});

	function fncOnAttach(){

		this.ui.contextMenu.rup_contextMenu({
			callback: function(key) {
				alert('clicked: ' + key);
			},
			items: {
				'edit': {name: 'Clickable', icon: 'edit', disabled: false},
				'cut': {name: 'Disabled', icon: 'cut', disabled: true}
			}
		});

		this.ui.contextMenuLeft.rup_contextMenu({
			trigger: 'left',
			callback: function(key) {
				alert('clicked: ' + key);
			},
			items: {
				'edit': {name: 'Edit', icon: 'edit', accesskey: 'e'},
				'cut': {name: 'Cut', icon: 'cut', accesskey: 'c'},
				// first unused character is taken (here: o)
				'copy': {name: 'Copy', icon: 'copy', accesskey: 'c o p y'},
				// words are truncated to their first letter (here: p)
				'paste': {name: 'Paste', icon: 'paste', accesskey: 'cool paste'},
				'delete': {name: 'Delete', icon: 'delete'},
				'sep1': '---------',
				'quit': {name: 'Quit', icon: 'quit'}
			}
		});

		this.ui.contextMenuHover.rup_contextMenu({
			trigger: 'hover',
			callback: function(key) {
				alert('clicked: ' + key);
			},
			items: {
				'edit': {'name': 'Edit', 'icon': 'edit'},
				'cut': {'name': 'Cut', 'icon': 'cut'},
				'sep1': '---------',
				'quit': {'name': 'Quit', 'icon': 'quit'},
				'sep2': '---------',
				'fold1': {
					'name': 'Sub group',
					'items': {
						'foo bar': {'name': 'Foo bar'},
						'fold2': {
							'name': 'Sub group 2',
							'items': {
								'alpha': {'name': 'alpha'},
								'bravo': {'name': 'bravo'},
								'charlie': {'name': 'charlie'}
							}
						},
						'delta': {'name': 'delta'}
					}
				},
				'fold1a': {
					'name': 'Other group',
					'items': {
						'echo': {'name': 'echo'},
						'foxtrot': {'name': 'foxtrot'},
						'golf': {'name': 'golf'}
					}
				}
			}
		});

		this.ui.contextMenuOther.rup_contextMenu({
			trigger: 'none',
			build: function() {
				return {
					callback: function(key) {
						alert('clicked: ' + key);
					},
					items: {
						'edit': {name: 'Edit', icon: 'edit'},
						'cut': {name: 'Cut', icon: 'cut'},
						'copy': {name: 'Copy', icon: 'copy'},
						'paste': {name: 'Paste', icon: 'paste'},
						'delete': {name: 'Delete', icon: 'delete'},
						'sep1': '---------',
						'quit': {name: 'Quit', icon: 'quit'}
					}
				};
			}
		});
	}

	function fncActivateMenu(){
		this.ui.contextMenuOther.rup_contextMenu('show');
	}

	return ContextMenuTestView;
});


text:
$ErrorActionPreference = "Stop"

$currentPath = Split-Path -Parent $MyInvocation.MyCommand.Path
import-module $currentPath\..\..\xSqlServerAlwaysOnUtil.psm1 -ErrorAction Stop

function Get-TargetResource
{
    [CmdletBinding()]
    [OutputType([System.Collections.Hashtable])]
    param
    (
        [parameter(Mandatory = $true)]
        [System.String]
        $InstanceName,

        [parameter(Mandatory = $true)]
        [System.String]
        $NodeName,

        [parameter(Mandatory = $true)]
        [System.String]
        $Name
    )

    Write-Verbose "Getting state of endpoint $Name"

    try {
        $endpoint = Get-SQLAlwaysOnEndpoint -Name $Name -NodeName $NodeName -InstanceName $InstanceName -Verbose:$VerbosePreference

        if( $null -ne $endpoint ) {
            $State = $endpoint.EndpointState
        } else {
            throw "Endpoint $Name does not exist"
        }
    } catch {
        throw "Unexpected result when trying to verify existance of endpoint $Name. Error: $($_.Exception.Message)"
    }

    $returnValue = @{
        InstanceName = [System.String]$InstanceName
        NodeName = [System.String]$NodeName
        Name = [System.String]$Name
        State = [System.String]$State
    }

    return $returnValue
}

function Set-TargetResource
{
    [CmdletBinding(SupportsShouldProcess)]
    param
    (
        [parameter(Mandatory = $true)]
        [System.String]
        $InstanceName,

        [parameter(Mandatory = $true)]
        [System.String]
        $NodeName,

        [parameter(Mandatory = $true)]
        [System.String]
        $Name,

        [ValidateSet("Started","Stopped","Disabled")]
        [System.String]
        $State
    )

    $parameters = @{
        InstanceName = [System.String]$InstanceName
        NodeName = [System.String]$NodeName
        Name = [System.String]$Name
    }

    $endPointState = Get-TargetResource @parameters
    if( $null -ne $endPointState ) {
        if( $endPointState.State -ne $State ) {
            if( ( $PSCmdlet.ShouldProcess( $Name, "Changing state of Endpoint" ) ) ) {
                $endpoint = Get-SQLAlwaysOnEndpoint -Name $Name -NodeName $NodeName -InstanceName $InstanceName -Verbose:$VerbosePreference
                $InstanceName = Get-SQLInstanceName -InstanceName $InstanceName

                $setEndPointParams = @{
                    Path = "SQLSERVER:\SQL\$NodeName\$InstanceName\Endpoints\$Name"
                    Port = $endpoint.Protocol.Tcp.ListenerPort
                    IpAddress = $endpoint.Protocol.Tcp.ListenerIPAddress.IPAddressToString
                    State = $State
                }

                Set-SqlHADREndpoint @setEndPointParams -Verbose:$False | Out-Null # Suppressing Verbose because it prints the entire T-SQL statement otherwise
            }
        } else {
            Write-Verbose "Endpoint configuration is already correct."
        }
    } else {
        throw "Got unexpected result from Get-TargetResource. No change is made."
    }

    #Include this line if the resource requires a system reboot.
    #$global:DSCMachineStatus = 1
}

function Test-TargetResource
{
    [CmdletBinding()]
    [OutputType([System.Boolean])]
    param
    (
        [parameter(Mandatory = $true)]
        [System.String]
        $InstanceName,

        [parameter(Mandatory = $true)]
        [System.String]
        $NodeName,

        [parameter(Mandatory = $true)]
        [System.String]
        $Name,

        [ValidateSet("Started","Stopped","Disabled")]
        [System.String]
        $State
    )

    $parameters = @{
        InstanceName = [System.String]$InstanceName
        NodeName = [System.String]$NodeName
        Name = [System.String]$Name
    }

    Write-Verbose "Testing state $State on endpoint $Name"

    $endPointState = Get-TargetResource @parameters
    if( $null -ne $endPointState ) {
        if( $endPointState.State -eq $State ) {
            [System.Boolean]$result = $True
        } else {
            [System.Boolean]$result = $False
        }
    } else {
        throw "Got unexpected result from Get-TargetResource. No change is made."
    }

    return $result
}

Export-ModuleMember -Function *-TargetResource


text:
/*!
 * ImageUtils
 *
 * @version 0.9
 * @license MIT License
 * @author mach3
 * @require jQuery 1.7+
 */
(function($, undefined){

	var ImageUtils = ({
		type : "ImageUtils",
		browser : {
			msie : false,
			version : null
		},
		regex : {
			extension : /\.(png|jpg|jpeg|gif)$/i
		},
		/**
		 * initialize ImageUtils
		 */
		init : function(){
			var m = navigator.userAgent.match(/MSIE\s([\d\.]+?);/i);
			this.browser.msie = m !== null;
			if( this.browser.msie ){
				this.browser.version = parseInt(m[1], 10);
			}
			return this;
		},
		_replace : function(str, vars){
			return str.replace(
				/\{\{(\w+?)\}\}/g,
				function(a,b){ return vars[b] || ""; }
			);
		},
		_hasSize : function(ele){
			var $ele = $(ele);
			return Boolean($ele.width() && $ele.height());
		},
		_getType : function(ele){
			var type = null;
			switch(true){
				case /AlphaImageLoader/i.test($(ele).css("filter")) : type = "ail"; break;
				case ele.tagName.toLowerCase() === "img" : type = "img"; break;
				default : type = "block"; break;
			}
			return type;
		},
		_getImage : function(ele){
			var o, r;
			o = $(ele);
			r = null;
			switch(this._getType(ele)){
				case "ail" : r = o.css("filter").match(/src=([^,\)]+)/)[1]; break;
				case "img" : r = o.prop("src"); break;
				default : r = o.css("background-image").match(/url\("?(.+?)"?\)/)[1]; break;
			}
			return r;
		},
		_getHoverImage : function(ele, postfix){
			return this._getImage(ele).replace(this.regex.extension, function(a){
				return postfix + a;
			});
		},
		/**
		 * Set AlphaImageLoader to element
		 * @param jQueryObject $eles
		 * @param Object config
		 * @return jQueryObject
		 *
		 * @example
		 *   ImageUtils.alphaImage($(ele), {
		 *     method : "image", // "image" || "crop" || "scale", sizingMethod for AlphaImageLoader
		 *     blankImage : "./blank.gif", // The path to the transparent GIF image
		 *   });
		 */
		alphaImage : function($eles, config){
			var my = {};
			if(! this.browser.msie){ return ; }
			my.self = this;
			my.opt = $.extend({
				method : "image",
				blankImage : "./blank.gif"
			}, config);
			my.ail = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod={{method}}, src={{path}});";
			my.setFilter = function(){
				var o, my, path;
				o = $(this);
				my = o.data("alpha-image");
				if(this.tagName.toLowerCase() === "img"){
					path = o.prop("src");
					o.css({
						"width" : o.width(),
						"height" : o.height()
					});
					o.prop("src", my.opt.blankImage);
				} else {
					path = o.css("background-image").match(/url\("?(.+?)"?\)/)[1];
					o.css("background-image", "none");
					o.append($("<span>").css({
						"position" : "absolute",
						"display" : "block",
						"background-color" : "#fff",
						"width" : o.width(),
						"height" : o.height(),
						"opacity" : 0
					}));
				}
				o.css({
					"filter" : my.self._replace(my.ail, {
						method : my.opt.method,
						path : path
					})
				});
			};
			$eles.each(function(){
				var o = $(this);
				o.data("alpha-image", my);
				if(my.self._hasSize(this)){
					my.setFilter.call(this);
				} else {
					$(this).on("load", my.setFilter);
				}
			});
			return $eles;
		},
		/**
		 * Swap image on hover
		 * @param jQueryObject $eles
		 * @param Object config
		 * @return jQueryObject
		 *
		 * @example
		 *   ImageUtils.swapImage($(ele), {
		 *     hoverPostfix : "-hover", // Postfix for hover image
		 *     ignoreClass : "active", // if the element has this class, swap is ignored.
		 *   });
		 */
		swapImage : function($eles, config){
			var my = {};
			my.self = this;
			my.opt = $.extend({
				hoverPostfix : "-hover",
				ignoreClass : "active"
			}, config);
			my.swap = function(e){
				var o, my, enter, src, utils;
				o = $(this);
				my = o.data("swap-image");
				if(o.hasClass(my.opt.ignoreClass)){ return; }
				enter = e.type.toLowerCase() === "mouseenter";
				src = enter ? o.data("hover-image") : o.data("default-image");
				switch( my.self._getType(this) ){
					case "ail" :
						o.css("filter", o.css("filter").replace(
							/src=([^,\)\s]+)/,
							function(){ return "src=" + src; }
						));
						break;
					case "img" : o.attr("src", src); break;
					default : o.css("background-image", "url(" + src + ")"); break;
				}
			};
			$eles.each(function(){
				var o = $(this);
				o.data("default-image", my.self._getImage(this));
				o.data("hover-image", my.self._getHoverImage(this, my.opt.hoverPostfix));
				o.data("swap-image", my);
				$("<img>").on("load", function(){
					o.hover(my.swap, my.swap);
				}).attr("src", o.data("hover-image"));
			});
			return $eles;
		},
		/**
		 * Add blend effect to element on hover
		 * @param jQueryObject $eles
		 * @param Object config
		 * @return jQueryObject
		 *
		 * @example
		 *   ImageUtils.blendImage($(ele), {
		 *     hoverPostfix : "-hover",
		 *     ignoreClass : "active",
		 *     durationEnter : 100,
		 *     durationLeave : 500
		 *   });
		 */
		blendImage : function($eles, config){
			var my = {};
			my.self = this;
			my.opt = $.extend({
				hoverPostfix : "-hover",
				ignoreClass : "active",
				durationEnter : 100,
				durationLeave : 500
			}, config);
			my.init = function(){
				var o, my, src, hover;
				o = $(this);
				my = o.data("blend-image");
				src = my.self._getHoverImage(this, my.opt.hoverPostfix);
				hover = $("<span>")
					.css({
						"position" : "absolute",
						"display" : "block",
						"width" : o.width(),
						"height" : o.height(),
						"background-image" : "url(" + src + ")"
					});
				if(my.self.browser.msie){
					my.self.alphaImage(hover);
					hover.css("background-image", "none");
				}
				hover.css("opacity", 0);
				if(this.tagName.toLowerCase() === "img"){
					hover.insertBefore(o);
				} else {
					o.append(hover);
				}
				hover.data("blend-image", my);
				hover.hover(my.blend, my.blend);
			};
			my.blend = function(e){
				var my, enter, opacity, duration;
				my = $(this).data("blend-image");
				enter = e.type === "mouseenter";
				opacity = enter ? 1 : 0;
				duration = my.opt["duration" + (enter ? "Enter" : "Leave")];
				$(this).stop().fadeTo(duration, opacity);
			};
			$eles.each(function(){
				$(this).data("blend-image", my);
				if(my.self._hasSize(this)){
					my.init.call(this);
				} else {
					$(this).on("load", my.init);
				}
			});
			return $eles;
		}
	}).init();

	$.fn.extend({
		/**
		 * Set AlphaImageLoader to elements
		 * This call ImageUtils.alphaImage()
		 * @param Object config
		 */
		alphaImage : function(config){
			ImageUtils.alphaImage(this, config);
			return this;
		},
		/**
		 * Swap image on hover
		 * This call ImageUtils.swapImage()
		 * @param Object config
		 */
		swapImage : function(config){
			ImageUtils.swapImage(this, config);
			return this;
		},
		/**
		 * Add blend effect to element on hover
		 * This call ImageUtils.blendImage()
		 * @param Object config
		 */
		blendImage : function(config){
			ImageUtils.blendImage(this, config);
			return this;
		}
	});

}(jQuery));


text: print(input("Enter string to be reversed: ")[::-1])


text:
::Chef::DSL::Recipe.send(:include, Visualstudio::Helper)

# Create list of unique VS versions that have updates
versions_with_updates = versions.reject { |v| node['visualstudio'][v]['update'].nil? }

# Install updates for each VS version
versions_with_updates.each do |version|
  url = source_download_url(version, 'update')
  visualstudio_update "visualstudio_#{version}_update" do
    install_dir node['visualstudio'][version]['install_dir']
    source url
    package_name node['visualstudio'][version]['update']['package_name']
    checksum node['visualstudio'][version]['update']['checksum']
    preserve_extracted_files node['visualstudio']['preserve_extracted_files']
  end
end


text:
template <int ArraySize>
int *end(int(&array)[(ArraySize)])    // deliberately using grouping parens
{
  // confirm we deduced '2' as the size
  int blah[ArraySize==2? 1 : -1];
  return ArraySize;
}

void f()
{
  int dummy[2];
  end(dummy);
}

// slightly funky variation: the instantiation is triggered by its own
// definition
template <int ArraySize>
int *zend(int(&array)[ArraySize])
{
  int dummy[2];
  zend(dummy);
}

// EOF


text:
require 'spec_helper'

describe LitmusReseller::EmailTest do
  after { restore_default_config }

  describe "when configuration (username and password) is set" do
    before do
      LitmusReseller.configure do |config|
        config.username = 'username'
        config.password = 'password'
      end
    end

    context "without params" do
      it "should return the email address InboxGuid@emailtests.com" do
        response = LitmusReseller::EmailTest.create()
        expect(response["InboxGuid"]).to eq("test12345")
      end
    end

    context "with applications" do
      it "should return the email address InboxGuid@emailtests.com" do
        response = LitmusReseller::EmailTest.create(['ol2010'])
        expect(response["InboxGuid"]).to eq("test12345")
      end
    end

    context "with guid" do
      it "should return the email address InboxGuid@emailtests.com" do
        response = LitmusReseller::EmailTest.create([], "custom-guid")
        expect(response["InboxGuid"]).to eq("custom-guid")
      end
    end
  end

  describe "when configuration (username and password) is not set" do
    context "username missing" do
      before do
        LitmusReseller.configure do |config|
          config.password = 'password'
        end
      end

      it "should raise an error" do
        expect { LitmusReseller::EmailTest.create() }.to raise_error(RuntimeError, "Missing configuration")
      end
    end

    context "password missing" do
      LitmusReseller.configure do |config|
        config.username = 'damienbrz'
      end

      it "should raise an error" do
        expect { LitmusReseller::EmailTest.create() }.to raise_error(RuntimeError, "Missing configuration")
      end
    end
  end
end


text:
#ifndef BOOST_NUMERIC_ODEINT_UTIL_STATE_WRAPPER_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_UTIL_STATE_WRAPPER_HPP_INCLUDED

#include <boost/type_traits/integral_constant.hpp>

#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resize.hpp>
#include <boost/numeric/odeint/util/same_size.hpp>

namespace boost {
namespace numeric {
namespace odeint {

template< class V , class Enabler = void >
struct state_wrapper
{
    typedef state_wrapper< V > state_wrapper_type;

    V m_v;
};

}
}
}

#endif // BOOST_NUMERIC_ODEINT_UTIL_STATE_WRAPPER_HPP_INCLUDED


text:
import { autoinject } from 'aurelia-framework';
import { Router } from 'aurelia-router';
import {
    Validator,
    ValidationController,
    ValidationControllerFactory,
    ValidationRules,
    validateTrigger,
} from 'aurelia-validation';

import { Todo } from '../models/todo';
import { Storage } from '../services/storage';

@autoinject
export class Add {
    public todo: Todo;
    public canSave: Boolean;
    private controller: ValidationController;

    constructor(private router: Router, private storage: Storage, private validator: Validator, controllerFactory: ValidationControllerFactory) {
        this.controller = controllerFactory.createForCurrentScope(validator);
        this.controller.validateTrigger = validateTrigger.changeOrBlur;
        this.controller.subscribe(event => this.validateWhole());
    }

    private validateWhole() {
        this.validator.validateObject(this.todo)
            .then(results => this.canSave = results.every(result => result.valid));
    }

    public activate(params) {
        if (params.id) {
            this.todo = this.storage.getTodo(params.id);
        } else {
            this.todo = new Todo();
        }

        this.setupValidation();
    }

    public setupValidation() {
        ValidationRules
            .ensure('title').required().minLength(3).withMessage('Title must at least be 3 chars long.')
            .ensure('description').required().minLength(3).withMessage('Description must at least be 3 chars long.')
            .on(this.todo);
    }

    public save() {
        if (!this.canSave) {
            return;
        }

        this.storage.saveTodo(this.todo);
        this.router.navigateToRoute('list');
    }

    public cancel() {
        this.router.navigateToRoute('list');
    }
}


text:
package studentcapture.lti;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import studentcapture.model.Grade;
import studentcapture.submission.Submission;

/**
 * Will test the LTICommunicator
 * @author ltiChapter
 */
public class LTICommunicatorTest {

    Submission submission;
    @Before
    public void setUp() throws Exception {
        submission = new Submission();
        submission.setGrade(new Grade("VG", 1));
        submission.setFeedback("Dåligt");
        submission.setAssignmentID(100);
        submission.setCourseID(2000);
        submission.setStudentID(12);
    }

    @After
    public void tearDown() throws Exception {
        submission = null;
    }

    @Test
    public void setGrade() throws Exception {

    }
}


text:
package ua.p2psafety;

import android.app.Activity;
import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;

import com.facebook.Session;
import com.facebook.SessionState;
import com.facebook.UiLifecycleHelper;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

import ua.p2psafety.adapters.StableArrayAdapter;
import ua.p2psafety.data.Prefs;
import ua.p2psafety.fragments.PassiveSosFragment;
import ua.p2psafety.fragments.SendMessageFragment;
import ua.p2psafety.json.Event;
import ua.p2psafety.services.LocationService;
import ua.p2psafety.services.PassiveSosService;
import ua.p2psafety.services.PowerButtonService;
import ua.p2psafety.services.XmppService;
import ua.p2psafety.util.EventManager;
import ua.p2psafety.util.GmailOAuth2Sender;
import ua.p2psafety.util.Logs;
import ua.p2psafety.util.NetworkManager;
import ua.p2psafety.util.Utils;

/**
 * Created by ihorpysmennyi on 12/14/13.
 */
public class SosActivity extends ActionBarActivity {
    public static final String FRAGMENT_KEY = "fragmentKey";
    private final static int CONNECTION_FAILURE_RESOLUTION_REQUEST = 9000;
    private static final String ACTION_SYNCHRONIZE = "ua.p2psafety.action.SYNCHRONIZE";
    public static final String ACTION_SET_LOADING = "ua.p2psafety.action.SET_LOADING";
    public static final String ACTION_UNSET_LOADING = "ua.p2psafety.action.UNSET_LOADING";

    private UiLifecycleHelper mUiHelper;
    public static Logs mLogs;
    private EventManager mEventManager;
    private boolean mStartedFromHistory = false;
    private boolean mIsWantToUnsetLoading = false;
    private boolean mIsUnsetCameEarlierThenSet = false;

    private IntentFilter mIntentFilter;
    private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
        @Override
        public synchronized void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            mLogs.info("SosActivity. Got action from NetworkStateChangedReceiver: " + action);
            if (action.equals(ACTION_SET_LOADING))
            {
                if (!mIsUnsetCameEarlierThenSet)
                {
                    Utils.setLoading(SosActivity.this, true);
                    mIsWantToUnsetLoading = true;
                }
            }
            else if (action.equals(ACTION_UNSET_LOADING))
            {
                if (mIsWantToUnsetLoading)
                {
                    Utils.setLoading(SosActivity.this, false);
                    mIsWantToUnsetLoading = false;
                    mIsUnsetCameEarlierThenSet = false;
                }
                else
                {
                    mIsUnsetCameEarlierThenSet = true;
                }
            }
        }
    };

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_sosmain);

        mLogs = new Logs(this);
        mLogs.info("\n\n\n==========================\n==============================");
        mLogs.info("SosActivity. onCreate()");

        String appId = Prefs.getFbAppId(this);
        if (appId == null)
        {
            appId = getString(R.string.app_id);
        }
        Session session = new Session.Builder(getBaseContext()).setApplicationId(appId).build();
        Session.setActiveSession(session);

        mUiHelper = new UiLifecycleHelper(this, null);
        mUiHelper.onCreate(savedInstanceState);

        mEventManager = EventManager.getInstance(this);

        if (Prefs.getSelectedServer(this) == null && Utils.isServerAuthenticated(this))
        {
            Utils.logout(this);
        }

        mLogs.info("SosActivity. onCreate. Initiating NetworkManager");
        NetworkManager.init(this);
        mLogs.info("SosActivity. onCreate. Starting PowerButtonService");
        startService(new Intent(this, PowerButtonService.class));
        if (!Utils.isServiceRunning(this, XmppService.class) &&
            Utils.isServerAuthenticated(this) &&
            !mEventManager.isEventActive())
        {
            startService(new Intent(this, XmppService.class));
        }
        Prefs.setProgramRunning(true, this);
        mIntentFilter = new IntentFilter(ACTION_SET_LOADING);
        mIntentFilter.addAction(ACTION_UNSET_LOADING);
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);

        Intent intent = new Intent();
        intent.setAction(ACTION_SYNCHRONIZE);
        sendBroadcast(intent);
        mLogs.info("SosActivity. onPostCreate(). Action SYNCHRONIZE was sent");
    }

    @Override
    public void onResume() {
        super.onResume();
        mUiHelper.onResume();
        registerReceiver(mBroadcastReceiver, mIntentFilter);

        mStartedFromHistory = (getIntent().getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY)
                == Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY;

        int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
        if (result != ConnectionResult.SUCCESS) {
            showErrorDialog(result);
        }

        if (!(mEventManager.isEventActive() || mEventManager.isSosStarted() ||
                mEventManager.isPassiveSosStarted()) &&
            !Utils.isServiceRunning(this, LocationService.class))
        {
            startService(new Intent(this, LocationService.class));
        }

        Fragment fragment;

        // normal start
        mLogs.info("SosActiviy. onCreate. Normal start. Opening SendMessageFragment");
        fragment = new SendMessageFragment();

        FragmentManager fragmentManager = getSupportFragmentManager();
        if (!Utils.isFragmentAdded(fragment, fragmentManager))
        {
            fragmentManager.beginTransaction().addToBackStack(fragment.getClass().getName())
                    .replace(R.id.content_frame, fragment).commit();
        }

        String fragmentClass = getIntent().getStringExtra(FRAGMENT_KEY);
        if (fragmentClass != null && !mStartedFromHistory) {
            // activity started from outside
            // and requested to show specific fragment
            mLogs.info("SosActiviy. onCreate. Activity requested to open " + fragmentClass);
            fragment = Fragment.instantiate(this, fragmentClass);
            fragment.setArguments(getIntent().getExtras());

            if (!Utils.isFragmentAdded(fragment, fragmentManager))
            {
                fragmentManager.beginTransaction().addToBackStack(fragment.getClass().getName())
                        .replace(R.id.content_frame, fragment).commit();
            }
            else if (fragmentClass.equals(PassiveSosFragment.class.getName()))
            {
                sendBroadcast(new Intent(PassiveSosService.PASSIVE_SOS_PASSWORD));
            }

            setIntent(new Intent(this, SosActivity.class));
        }

        if (Utils.getEmail(this) != null && Utils.isNetworkConnected(this, mLogs) && Prefs.getGmailToken(this) == null)
        {
            mLogs.info("SosActiviy. onCreate. Getting new GmailOAuth token");
            GmailOAuth2Sender sender = new GmailOAuth2Sender(this);
            sender.initToken();
        }
        mLogs.info("SosActiviy. onCreate. Checking for location services");
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        Log.i("onNewIntent", "NEW INTENT!");
        setIntent(intent);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        mLogs.info("SosActiviy.onActivityResult()");
        mUiHelper.onActivityResult(requestCode, resultCode, data);
        Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
    }

    @Override
    public void onPause() {
        super.onPause();
        mLogs.info("SosActiviy.onPause");
        mUiHelper.onPause();
        unregisterReceiver(mBroadcastReceiver);

        if (!(mEventManager.isEventActive() || mEventManager.isSosStarted() ||
                mEventManager.isPassiveSosStarted())
            && Utils.isServiceRunning(this, LocationService.class))
        {
            stopService(new Intent(this, LocationService.class));
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        mLogs.info("SosActiviy.onDestroy()");
        mLogs.info("\n\n\n==========================\n==============================");
        mUiHelper.onDestroy();
        mLogs.close();
        Prefs.setProgramRunning(false, this);
    }

    @Override
    public void onBackPressed() {
        mLogs.info("SosActivity.onBackPressed()");
        Session currentSession = Session.getActiveSession();
        if (currentSession == null || currentSession.getState() != SessionState.OPENING) {
            super.onBackPressed();

            FragmentManager fm = getSupportFragmentManager();
            if (fm.getBackStackEntryCount() == 0) {
                finish();
            }
        } else {
            mLogs.info("SosActivity. onBackPressed. Ignoring");
        }
    }

    @Override
    protected void onStop() {
        super.onStop();

        if (!(mEventManager.isEventActive() || mEventManager.isSosStarted() ||
                mEventManager.isPassiveSosStarted())
            && Utils.isServiceRunning(this, LocationService.class))
        {
            stopService(new Intent(this, LocationService.class));
        }
    }

    @Override
    protected void onStart() {
        super.onStart();

        if (!((mEventManager.isEventActive() || mEventManager.isSosStarted()
                || mEventManager.isPassiveSosStarted())) &&
            !Utils.isServiceRunning(this, LocationService.class))
        {
            startService(new Intent(this, LocationService.class));
        }
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        mLogs.info("SosActivity.onSaveInstanceState()");
        mUiHelper.onSaveInstanceState(outState);
        mLogs.info("SosActivity. onSaveInstanceState. Saving session");
        Session session = Session.getActiveSession();
        Session.saveSession(session, outState);
    }

    private void showErrorDialog(int result) {
        Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(result,
                this, CONNECTION_FAILURE_RESOLUTION_REQUEST);
        if (errorDialog != null)
            errorDialog.show();
    }

    public void loginToFacebook(Activity activity, Session.StatusCallback callback) {
        mLogs.info("SosActivity. loginToFacebook()");
        if (!Utils.isNetworkConnected(activity, mLogs)) {
            mLogs.info("SosActivity. loginToFacebook. No network");
            Utils.errorDialog(activity, Utils.DIALOG_NO_CONNECTION);
            return;
        }
        String appId = Prefs.getFbAppId(this);
        if (appId == null)
        {
            //get main app id, if appId is null
            appId = getString(R.string.app_id);
        }
        Session session = new Session.Builder(getBaseContext()).setApplicationId(appId).build();
        Session.setActiveSession(session);
        session = Session.getActiveSession();
        if (session == null) {
            mLogs.info("SosActivity. No FB session. Opening a new one");
            Session.openActiveSession(activity, true, callback);
        }
        else if (!session.getState().isOpened() && !session.getState().isClosed()) {
            mLogs.info("SosActivity. loginToFacebook. FB session not opened AND not closed. Opening for read");
            session.openForRead(new Session.OpenRequest(activity)
                    //.setPermissions(Const.FB_PERMISSIONS_READ)
                    .setCallback(callback));
        } else {
            mLogs.info("SosActivity. loginToFacebook. FB session opened or closed. Opening a new one");
            Session.openActiveSession(activity, true, callback);
        }
    }
}


text:
require 'omniauth-oauth'

module OmniAuth
  module Strategies
    class MapMyFitness < OmniAuth::Strategies::OAuth
      # Give your strategy a name.
      option :name, "mapmyfitness"

      # This is where you pass the options you would pass when
      # initializing your consumer from the OAuth gem.
      option :client_options, {:site => "https://api.mapmyfitness.com",
                               :authorize_path => "/3.1/oauth/authorize",
                               :request_token_path => '/3.1/oauth/request_token',
                               :access_token_path => '/3.1/oauth/access_token',
                               :scheme => :query_string,
                               :http_method => :get}

      # These are called after authentication has succeeded. If
      # possible, you should try to set the UID without making
      # additional calls (if the user id is returned with the token
      # or as a URI parameter). This may not be possible with all
      # providers.
      uid {
        raw_info['user_id']
      }

      info do
        {
          :name => "#{raw_info['first_name']} #{raw_info['last_name']}",
          :email => raw_info['email'],
          :nickname => raw_info['username'],
          :first_name => raw_info['first_name'],
          :last_name => raw_info['last_name'],
          :location => [raw_info['start_city'], raw_info['start_state'], raw_info['start_country']].join(', '),
          :image => "http://api.mapmyfitness.com/3.1/users/get_avatar?uid=#{raw_info['user_id']}",
          :urls => {:mapmyfitness => "http://www.mapmyfitness.com/profile/#{raw_info['username']}"}
        }
      end

      extra do
        {
          'raw_info' => raw_info
        }
      end

      def raw_info
        @raw_info ||= MultiJson.decode(access_token.get('/3.1/users/get_user').body)['result']['output']['user']
      end
    end
  end
end

OmniAuth.config.add_camelization 'mapmyfitness', 'MapMyFitness'


text:
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/accessibility/accessibility_labels_service_factory.h"

#include "build/chromeos_buildflags.h"
#include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/profiles/profile.h"

// static
AccessibilityLabelsService* AccessibilityLabelsServiceFactory::GetForProfile(
    Profile* profile) {
  return static_cast<AccessibilityLabelsService*>(
      GetInstance()->GetServiceForBrowserContext(profile, true));
}

// static
AccessibilityLabelsService*
AccessibilityLabelsServiceFactory::GetForProfileIfExists(Profile* profile) {
  return static_cast<AccessibilityLabelsService*>(
      GetInstance()->GetServiceForBrowserContext(profile, /*create=*/false));
}

// static
AccessibilityLabelsServiceFactory*
AccessibilityLabelsServiceFactory::GetInstance() {
  return base::Singleton<AccessibilityLabelsServiceFactory>::get();
}

AccessibilityLabelsServiceFactory::AccessibilityLabelsServiceFactory()
    : ProfileKeyedServiceFactory(
          "AccessibilityLabelsService",
          ProfileSelections::Builder()
              .WithRegular(ProfileSelection::kRedirectedToOriginal)
              // Use OTR profile for Guest Session.
              .WithGuest(ProfileSelection::kOffTheRecordOnly)
              // No service for system profile.
              .WithSystem(ProfileSelection::kNone)
              // ChromeOS creates various profiles (login, lock screen...) that
              // do not display web content and thus do not need the
              // accessibility labels service.
              .WithAshInternals(ProfileSelection::kNone)
              .Build()) {}

AccessibilityLabelsServiceFactory::~AccessibilityLabelsServiceFactory() {}

KeyedService* AccessibilityLabelsServiceFactory::BuildServiceInstanceFor(
    content::BrowserContext* context) const {
  return new AccessibilityLabelsService(Profile::FromBrowserContext(context));
}


text:
<?php

namespace PHPExiftool\Driver\Tag\DICOM;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class PredictorConstants extends AbstractTag
{

    protected $Id = '0028,0082';

    protected $Name = 'PredictorConstants';

    protected $FullName = 'DICOM::Main';

    protected $GroupName = 'DICOM';

    protected $g0 = 'DICOM';

    protected $g1 = 'DICOM';

    protected $g2 = 'Image';

    protected $Type = '?';

    protected $Writable = false;

    protected $Description = 'Predictor Constants';
}


text:
package de.hshannover.f4.trust.irondetect.policy.publisher.model.identifier;

import static de.hshannover.f4.trust.irondetect.policy.publisher.model.identifier.exception.PolicyIdentifierException.MSG_EXPRESSION_NOT_PRESENT;
import static de.hshannover.f4.trust.irondetect.policy.publisher.model.identifier.exception.PolicyIdentifierException.MSG_INDEX_TOO_BIG_FOR_EXPRESSIONS;

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

import de.hshannover.f4.trust.ifmapj.identifier.IdentifierWithAd;
import de.hshannover.f4.trust.ifmapj.identifier.Identity;
import de.hshannover.f4.trust.irondetect.policy.publisher.model.identifier.exception.ConditionException;
import de.hshannover.f4.trust.irondetect.policy.publisher.util.Check;

/**
 * An {@link Condition} is an extended identifier. It is represented by an {@link Identity} identifier with IdentityType
 * = other
 * ,other-type = extended and with an administrative domain.
 *
 * @author Marcel Reichenbach
 */
public class Condition extends IdentifierWithAd implements ExtendedIdentifier {

	private String mID;

	private List<String> mExpressions;

	/**
	 * The {@link Condition} constructor. Checks the parameter, if null throws {@link NullPointerException}.
	 *
	 * @param id The {@link Condition}-ID
	 * @param expressions All expressions for the {@link Condition}
	 * @param admDom The administrative domain for {@link Condition}
	 */
	public Condition(String id, List<String> expressions, String admDom) {
		super(admDom);

		Check.ifNull(id, String.format(Check.MSG_PARAMETER_IS_NULL, "id"));
		Check.ifNull(expressions, String.format(Check.MSG_PARAMETER_IS_NULL, "expressions"));
		Check.ifNull(admDom, String.format(Check.MSG_PARAMETER_IS_NULL, "admDom"));

		setId(id);
		mExpressions = expressions;
	}

	/**
	 * The {@link Condition} constructor. Checks the parameter, if null throws {@link NullPointerException}.
	 * Initializes with an empty expression- and context-collection.
	 *
	 * @param id The {@link Condition}-ID
	 * @param admDom The administrative domain for {@link Condition}
	 */
	public Condition(String id, String admDom) {
		super(admDom);

		Check.ifNull(id, String.format(Check.MSG_PARAMETER_IS_NULL, "id"));
		Check.ifNull(admDom, String.format(Check.MSG_PARAMETER_IS_NULL, "admDom"));

		mExpressions = new ArrayList<String>();

		setId(id);
	}

	/**
	 *
	 * @return {@link Condition}-ID
	 */
	public String getID() {
		return mID;
	}

	/**
	 * Set the {@link Condition}-ID.
	 * Checks the parameter id, if null throws {@link NullPointerException}.
	 *
	 * @param id {@link Condition}-ID
	 */
	public void setId(String id) {
		Check.ifNull(id, String.format(Check.MSG_PARAMETER_IS_NULL, "id"));

		mID = id;
	}

	/**
	 *
	 * @return A expressions copy
	 */
	public List<String> getExpressions() {
		return new ArrayList<String>(mExpressions);
	}

	/**
	 * Add a new expression.
	 * Checks the parameter expression, if null throws {@link NullPointerException}.
	 *
	 * @param expression The expression String
	 */
	public void addFeatureExpression(String expression) {
		Check.ifNull(expression, String.format(Check.MSG_PARAMETER_IS_NULL, "expression"));

		mExpressions.add(expression);
	}

	/**
	 * Checks the parameter index, if index < 0 throws {@link IndexOutOfBoundsException}.
	 *
	 * @param index
	 * @throws ConditionException If the index is too big for expression list-size.
	 */
	public void removeExpression(int index) throws ConditionException {
		Check.indexNumber(index, String.format(Check.MSG_IS_LESS_THAN_ZERO, index));

		if (index < mExpressions.size()) {
			mExpressions.remove(index);
		} else {
			throw new ConditionException(MSG_INDEX_TOO_BIG_FOR_EXPRESSIONS, String.valueOf(index));
		}
	}

	/**
	 * Checks the parameter, if null throws {@link NullPointerException}.
	 *
	 * @param expression
	 * @throws ConditionException If the expression is not found
	 */
	public void removeExpression(String expression) throws ConditionException {
		Check.ifNull(expression, String.format(Check.MSG_PARAMETER_IS_NULL, "expression"));

		if (mExpressions.contains(expression)) {
			mExpressions.remove(expression);
		} else {
			throw new ConditionException(MSG_EXPRESSION_NOT_PRESENT, expression);
		}
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();

		sb.append(getClass().getSimpleName());
		sb.append('(');
		sb.append(getID());
		sb.append(' ');
		sb.append(':');

		for (String s : getExpressions()) {
			sb.append(' ');
			sb.append(s);
		}

		sb.append(')');

		return sb.toString();
	}

	@Override
	public int hashCode() {
		int prime = 31;
		int result = 1;
		result = prime * result + getID().hashCode();
		result = prime * result + getAdministrativeDomain().hashCode();
		return result;
	}

	@Override
	public boolean equals(Object other) {
		if (other == null) {
			return false;
		}
		if (other == this) {
			return true;
		}
		if (!(other instanceof Condition)) {
			return false;
		}

		Condition otherItem = (Condition) other;

		if (!getID().equals(otherItem.getID())) {
			return false;
		}

		return super.equals(otherItem);
	}

}


text:
package java.io;

public class ObjectOutputStream
  extends OutputStream  implements ObjectOutput, ObjectStreamConstants
{
  // Classes

  @com.francetelecom.rd.stubs.annotation.Real(value = "com.francetelecom.rd.fakeandroid.ObjectOutputStreamPutFieldImplem", superClass = "")
  public abstract static class PutField
  {
    // Constructors

    public PutField(){
    }
    // Methods

    public abstract void put(java.lang.String arg1, boolean arg2);
    public abstract void put(java.lang.String arg1, char arg2);
    public abstract void put(java.lang.String arg1, byte arg2);
    public abstract void put(java.lang.String arg1, short arg2);
    public abstract void put(java.lang.String arg1, int arg2);
    public abstract void put(java.lang.String arg1, long arg2);
    public abstract void put(java.lang.String arg1, float arg2);
    public abstract void put(java.lang.String arg1, double arg2);
    public abstract void put(java.lang.String arg1, java.lang.Object arg2);
    public abstract void write(ObjectOutput arg1) throws IOException;
  }
  // Constructors

  protected ObjectOutputStream() throws IOException{
    super();
  }
  public ObjectOutputStream(OutputStream arg1) throws IOException{
    super();
  }
  // Methods

  public void write(byte [] arg1, int arg2, int arg3) throws IOException{
  }
  public void write(int arg1) throws IOException{
  }
  public final void writeObject(java.lang.Object arg1) throws IOException{
  }
  public void defaultWriteObject() throws IOException{
  }
  public void close() throws IOException{
  }
  public void flush() throws IOException{
  }
  public void writeInt(int arg1) throws IOException{
  }
  public ObjectOutputStream.PutField putFields() throws IOException{
    return (ObjectOutputStream.PutField) null;
  }
  public void writeFields() throws IOException{
  }
  public void reset() throws IOException{
  }
  public void writeChar(int arg1) throws IOException{
  }
  public void writeBytes(java.lang.String arg1) throws IOException{
  }
  public void writeUTF(java.lang.String arg1) throws IOException{
  }
  public void writeByte(int arg1) throws IOException{
  }
  public void writeLong(long arg1) throws IOException{
  }
  public void writeShort(int arg1) throws IOException{
  }
  public void writeFloat(float arg1) throws IOException{
  }
  public void writeBoolean(boolean arg1) throws IOException{
  }
  public void writeChars(java.lang.String arg1) throws IOException{
  }
  public void writeDouble(double arg1) throws IOException{
  }
  protected void drain() throws IOException{
  }
  protected void annotateClass(java.lang.Class<?> arg1) throws IOException{
  }
  protected void annotateProxyClass(java.lang.Class<?> arg1) throws IOException{
  }
  protected boolean enableReplaceObject(boolean arg1){
    return false;
  }
  protected java.lang.Object replaceObject(java.lang.Object arg1) throws IOException{
    return (java.lang.Object) null;
  }
  public void useProtocolVersion(int arg1) throws IOException{
  }
  protected void writeClassDescriptor(ObjectStreamClass arg1) throws IOException{
  }
  public void writeUnshared(java.lang.Object arg1) throws IOException{
  }
  protected void writeObjectOverride(java.lang.Object arg1) throws IOException{
  }
  protected void writeStreamHeader() throws IOException{
  }
}


text:
<?php
/* Smarty version 3.1.30, created on 2017-06-03 12:51:08
  from "C:\Ampps\www\diamond\app\design\frontend\default\views\head.tpl" */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.30',
  'unifunc' => 'content_5932e8fc636fd2_13973843',
  'has_nocache_code' => false,
  'file_dependency' =>
  array (
    '9fb3956ad4ab9a8f0090f30c9f5b858f3a0676d4' =>
    array (
      0 => 'C:\\Ampps\\www\\diamond\\app\\design\\frontend\\default\\views\\head.tpl',
      1 => 1481151338,
      2 => 'file',
    ),
    '401a0135214c462ddf5e1ebbf6430a6e4e81f919' =>
    array (
      0 => 'C:\\Ampps\\www\\diamond\\app\\design\\frontend\\default\\views\\layout.tpl',
      1 => 1496260292,
      2 => 'file',
    ),
    '108740fe4c339159531884db4dbb3ff7d10b7f06' =>
    array (
      0 => 'C:\\Ampps\\www\\diamond\\app\\design\\frontend\\default\\views\\nav_visitor.tpl',
      1 => 1480653291,
      2 => 'file',
    ),
    '7e5de10d2dcb09de39145b2c2c3a65a768527d5f' =>
    array (
      0 => 'C:\\Ampps\\www\\diamond\\app\\design\\frontend\\default\\views\\footer.tpl',
      1 => 1481151338,
      2 => 'file',
    ),
  ),
  'cache_lifetime' => 3600,
),true)) {
function content_5932e8fc636fd2_13973843 (Smarty_Internal_Template $_smarty_tpl) {
?>
<!DOCTYPE html>

		<title>MVC Framework for PHP 7</title>

	<meta charset="utf-8">
	<meta name="description" content="DiamondPHP MVC Framework for PHP 7">
	<meta name="author" content="Andrew Rout <andrew@diamondphp.com>">

	<meta name="viewport" content="width=device-width, initial-scale=1.0">

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

	<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700,300&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
	<link href='http://fonts.googleapis.com/css?family=PT+Serif' rel='stylesheet' type='text/css'>

	<link href="http://localhost/diamond/media/default/bootstrap/css/bootstrap.css" rel="stylesheet">

	<link href="http://localhost/diamond/media/default/fonts/font-awesome/css/font-awesome.css" rel="stylesheet">

	<link href="http://localhost/diamond/media/default/fonts/fontello/css/fontello.css" rel="stylesheet">

	<link href="http://localhost/diamond/media/default/plugins/rs-plugin/css/settings.css" media="screen" rel="stylesheet">
	<link href="http://localhost/diamond/media/default/plugins/rs-plugin/css/extralayers.css" media="screen" rel="stylesheet">
	<link href="http://localhost/diamond/media/default/plugins/magnific-popup/magnific-popup.css" rel="stylesheet">
	<link href="http://localhost/diamond/media/default/css/animations.css" rel="stylesheet">
	<link href="http://localhost/diamond/media/default/plugins/owl-carousel/owl.carousel.css" rel="stylesheet">

	<link href="http://localhost/diamond/media/default/css/style.css" rel="stylesheet">

	<link href="http://localhost/diamond/media/default/css/skins/red.css" rel="stylesheet">

	<link href="http://localhost/diamond/media/default/css/custom.css" rel="stylesheet">

										<button type="button" class="btn dropdown-toggle" data-toggle="dropdown"></button>

										<button type="button" class="btn dropdown-toggle" data-toggle="dropdown"> Search</button>

												<form role="search" class="search-box" method="post" action="http://localhost/diamond/search/results">

														<input type="text" class="form-control" name="search-query" placeholder="Search">

												</form>

										<button type="button" class="btn dropdown-toggle" data-toggle="dropdown"> Support</button>

													  Community Support Forums

													  Contact Tech Support

									MVC Framework for PHP 7

												<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1">
													Toggle navigation

												</button>

Documentation

Download

                            Community

Online Support

Visit the member forums

Community and Support

Forums

FAQ

Support

Page generated in 0.0040 secs
						| 4.01 milliseconds

            Memory Usage: 964.67 kb

								<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-2">
									Toggle navigation

								</button>

Home

View on GitHub

License

FAQ

Support

Report a Bug

<link rel="stylesheet" href="http://localhost/diamond/app/code/module/datepicker/public/css/default.css" type="text/css">

<link rel="stylesheet" href="http://localhost/diamond/app/code/module/form-validation/dist/css/bootstrapValidator.css"/>

<?php }
}


text:
#if !GOOGLE_CUDA
#error This file must only be included when building with Cuda support
#endif

#ifndef TENSORFLOW_KERNELS_CWISE_OPS_GPU_COMMON_CU_H_
#define TENSORFLOW_KERNELS_CWISE_OPS_GPU_COMMON_CU_H_

#define EIGEN_USE_GPU

#include <complex>

#include "tensorflow/core/framework/tensor_types.h"
#include "tensorflow/core/kernels/cwise_ops.h"
#include "tensorflow/core/platform/types.h"

#include "tensorflow/core/platform/logging.h"
namespace tensorflow {
namespace functor {

typedef Eigen::GpuDevice GPUDevice;
typedef std::complex<float> complex64;
typedef std::complex<double> complex128;

// Partial specialization of UnaryFunctor<Device=GPUDevice, Functor>.
template <typename Functor>
struct UnaryFunctor<GPUDevice, Functor> {
  void operator()(const GPUDevice& d, typename Functor::tout_type out,
                  typename Functor::tin_type in) {
    To32Bit(out).device(d) = To32Bit(in).unaryExpr(typename Functor::func());
  }
};

// Partial specialization of BinaryFunctor<Device=GPUDevice, Functor>.
template <typename Functor, int NDIMS, bool has_errors>
struct BinaryFunctor<GPUDevice, Functor, NDIMS, has_errors> {
  void operator()(const GPUDevice& d, typename Functor::tout_type out,
                  typename Functor::tin_type in0,
                  typename Functor::tin_type in1, bool* error) {
    To32Bit(out).device(d) =
        To32Bit(in0).binaryExpr(in1, typename Functor::func());
  }

  void Left(const GPUDevice& d, typename Functor::tout_type out,
            typename Functor::tscalar_type scalar,
            typename Functor::tin_type in, bool* error) {
    typedef typename Functor::out_type Tout;
    typedef typename Functor::in_type Tin;
    typedef typename Functor::func Binary;
    typedef typename Eigen::internal::scalar_left<Tout, Tin, Binary> Unary;
    To32Bit(out).device(d) = To32Bit(in).unaryExpr(Unary(scalar.data()));
  }

  void Right(const GPUDevice& d, typename Functor::tout_type out,
             typename Functor::tin_type in,
             typename Functor::tscalar_type scalar, bool* error) {
    typedef typename Functor::out_type Tout;
    typedef typename Functor::in_type Tin;
    typedef typename Functor::func Binary;
    typedef typename Eigen::internal::scalar_right<Tout, Tin, Binary> Unary;
    To32Bit(out).device(d) = To32Bit(in).unaryExpr(Unary(scalar.data()));
  }

  void BCast(const GPUDevice& d,
             typename TTypes<typename Functor::out_type, NDIMS>::Tensor out,
             typename TTypes<typename Functor::in_type, NDIMS>::ConstTensor in0,
             typename Eigen::array<Eigen::DenseIndex, NDIMS> bcast0,
             typename TTypes<typename Functor::in_type, NDIMS>::ConstTensor in1,
             typename Eigen::array<Eigen::DenseIndex, NDIMS> bcast1,
             bool* error) {
    typedef typename Functor::in_type T;
    typename Functor::func func;
    if ((NDIMS == 2) && Functor::use_bcast_optimization &&
        use_bcast_optimization<T>::value) {
      const bool bcast0_all_one = AllOne<NDIMS>(bcast0);
      const bool bcast1_all_one = AllOne<NDIMS>(bcast1);
      if (bcast0_all_one && !bcast1_all_one) {
        To32Bit(out).device(d) =
            To32Bit(in0).binaryExpr(To32Bit(in1).broadcast(bcast1), func);
        return;
      }
      if (!bcast0_all_one && bcast1_all_one) {
        To32Bit(out).device(d) =
            To32Bit(in0).broadcast(bcast0).binaryExpr(To32Bit(in1), func);
        return;
      }
    }
    To32Bit(out).device(d) = To32Bit(in0).broadcast(bcast0).binaryExpr(
        To32Bit(in1).broadcast(bcast1), func);
  }
};

// Macros to explicitly instantiate kernels on GPU for multiple types
// (T0, T1, etc.) for UnaryFunctor (e.g., functor::sqrt).
#define DEFINE_UNARY1(F, T) template struct UnaryFunctor<GPUDevice, F<T> >
#define DEFINE_UNARY2(F, T0, T1) \
  DEFINE_UNARY1(F, T0);          \
  DEFINE_UNARY1(F, T1)
#define DEFINE_UNARY3(F, T0, T1, T2) \
  DEFINE_UNARY2(F, T0, T1);          \
  DEFINE_UNARY1(F, T2)
#define DEFINE_UNARY4(F, T0, T1, T2, T3) \
  DEFINE_UNARY2(F, T0, T1);              \
  DEFINE_UNARY2(F, T2, T3)
#define DEFINE_UNARY5(F, T0, T1, T2, T3, T4) \
  DEFINE_UNARY2(F, T0, T1);                  \
  DEFINE_UNARY3(F, T2, T3, T4)

// Macros to explicitly instantiate kernels on GPU for multiple types
// (T0, T1, etc.) for BinaryFunctor.
#define DEFINE_BINARY1(F, T)                         \
  template struct BinaryFunctor<GPUDevice, F<T>, 1>; \
  template struct BinaryFunctor<GPUDevice, F<T>, 2>; \
  template struct BinaryFunctor<GPUDevice, F<T>, 3>
#define DEFINE_BINARY2(F, T0, T1) \
  DEFINE_BINARY1(F, T0);          \
  DEFINE_BINARY1(F, T1)
#define DEFINE_BINARY3(F, T0, T1, T2) \
  DEFINE_BINARY2(F, T0, T1);          \
  DEFINE_BINARY1(F, T2)
#define DEFINE_BINARY4(F, T0, T1, T2, T3) \
  DEFINE_BINARY2(F, T0, T1);              \
  DEFINE_BINARY2(F, T2, T3)
#define DEFINE_BINARY5(F, T0, T1, T2, T3, T4) \
  DEFINE_BINARY2(F, T0, T1);                  \
  DEFINE_BINARY3(F, T2, T3, T4)
#define DEFINE_BINARY6(F, T0, T1, T2, T3, T4, T5) \
  DEFINE_BINARY3(F, T0, T1, T2);                  \
  DEFINE_BINARY3(F, T3, T4, T5)
#define DEFINE_BINARY7(F, T0, T1, T2, T3, T4, T5, T6) \
  DEFINE_BINARY3(F, T0, T1, T2);                      \
  DEFINE_BINARY4(F, T3, T4, T5, T6)
#define DEFINE_BINARY8(F, T0, T1, T2, T3, T4, T5, T6, T7) \
  DEFINE_BINARY4(F, T0, T1, T2, T3);                      \
  DEFINE_BINARY4(F, T4, T5, T6, T7)
#define DEFINE_BINARY9(F, T0, T1, T2, T3, T4, T5, T6, T7, T8) \
  DEFINE_BINARY4(F, T0, T1, T2, T3);                          \
  DEFINE_BINARY5(F, T4, T5, T6, T7, T8)
#define DEFINE_BINARY10(F, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) \
  DEFINE_BINARY5(F, T0, T1, T2, T3, T4);                           \
  DEFINE_BINARY5(F, T5, T6, T7, T8, T9)

}  // end namespace functor
}  // end namespace tensorflow

#endif  // TENSORFLOW_KERNELS_CWISE_OPS_GPU_COMMON_CU_H_