text:
PEGASUS_USING_PEGASUS;
PEGASUS_USING_STD;

const Uint32 MY_CANCEL_TYPE=1000;

Boolean verbose = false;

// Fibonacci test parameter definition
class parmdef
{
public:
    parmdef()
    {
        th = NULL;
        cond_start = new Condition();
        mq = NULL;
    }

    ~parmdef()
    {
        delete cond_start;
    }

    int first;
    int second;
    int count;
    Thread * th;
    Condition * cond_start;
    MessageQueue * mq;
};

PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL fibonacci(void * parm)
{
    Thread* my_thread = (Thread *)parm;
    parmdef * Parm = (parmdef *)my_thread->get_parm();
    int first = Parm->first;
    int second = Parm->second;
    int count = Parm->count;
    Condition * condstart = Parm->cond_start;
    MessageQueue * mq = Parm->mq;

    condstart->signal(my_thread->self());

    int add_to_type = 0;
    if (count < 20)
        add_to_type = 100;

    for (int i=0; i < count; i++)
    {
        int sum = first + second;
        first = second;
        second = sum;
        Message * message = new Message(i+add_to_type, 0, sum);
        mq->enqueue(message);
    }

    if (!add_to_type)
        Parm->th->thread_switch();

    my_thread->exit_self(0);
    return NULL;
}

PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL deq(void * parm)
{
    Thread* my_thread = (Thread *)parm;

    parmdef * Parm = (parmdef *)my_thread->get_parm();
    Uint32 type, key;

    int first = Parm->first;
    int second = Parm->second;
    int count = Parm->count;
    Condition * condstart = Parm->cond_start;
    MessageQueue * mq = Parm->mq;

    condstart->signal(my_thread->self());

    Message * message;
    type = 0;
    key = 0;

    while (type != MY_CANCEL_TYPE)
    {
        message = mq->dequeue();
        while (!message) {
#if defined PEGASUS_OS_SOLARIS && defined SUNOS_5_6
	    pegasus_sleep(1);
#endif
            message = mq->dequeue();
        }

        key = message->getKey();
        type = message->getType();
        delete message;
        if (type == 19)
            assert(key == 10946);
    }

    if (verbose)
#if defined (PEGASUS_OS_VMS)
      //
      // pegasus_thread_self returns long-long-unsigned.
      //
      printf("Received Cancel Message, %llu about to end\n", pegasus_thread_self());
#else
        cout << "Received Cancel Message, " << pegasus_thread_self() <<
            " about to end\n";
#endif
    my_thread->exit_self(0);
    return NULL;
}

// Test Thread, MessageQueue, and Condition
int test01()
{
    MessageQueue * mq = new MessageQueue("testQueue", true);
    parmdef * parm[4];

    for (int i = 0; i < 4;i++)
    {
        parm[i] = new parmdef();
        parm[i]->mq = mq;
    }

    parm[0]->first = 0;
    parm[0]->second = 1;
    parm[0]->count = 20;

    parm[3]->first = 4;
    parm[3]->second = 6;
    parm[3]->count = 10;

    parm[0]->th = new Thread(fibonacci,parm[0],false);
    parm[1]->th = new Thread(deq,parm[1],false);
    parm[2]->th = new Thread(deq,parm[2],false);
    parm[3]->th = new Thread(fibonacci,parm[3],false);

    for (int i = 0; i < 4;i++)
    {
       parm[i]->cond_start->lock_object(pegasus_thread_self());
       parm[i]->th->run();
    }

    // Let the thread start and wait for Start Condition to be signaled
    for (int i = 0; i < 4;i++)
    {
        parm[i]->cond_start->unlocked_wait( pegasus_thread_self() );
        parm[i]->cond_start->unlock_object( );
    }

    // all fired up successfully

    // Finish the enqueueing tasks
    parm[0]->th->join();
    parm[3]->th->join();

    // Tell one of the dequeueing tasks to finish
    Message * message;
    message = new Message(MY_CANCEL_TYPE,0);
    mq->enqueue(message);

    // Tell the other dequeueing task to finish
    message = new Message(MY_CANCEL_TYPE,0);
    mq->enqueue(message);

    // Finish the dequeueing tasks
    parm[1]->th->join();
    parm[2]->th->join();

    // Clean up
    for (int i = 0; i < 4; i++)
    {
        delete parm[i]->th;
        delete parm[i];
    }

    delete mq;

    return 0;
}

PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL atomicIncrement(void * parm)
{
    Thread* my_thread  = (Thread *)parm;
    AtomicInt * atom = (AtomicInt *)my_thread->get_parm();

    (*atom)++;
    (*atom)+=4;
    (*atom)-=2;
    (*atom)--;
    Boolean zero = atom->DecAndTestIfZero();
    assert(zero == false);

    my_thread->exit_self(0);
    return 0;
}

// Test Thread and AtomicInt
void test02()
{
    const Uint32 numThreads = 64;
    AtomicInt * atom = new AtomicInt(0);
    Thread* threads[numThreads];

    (*atom)++;
    Boolean zero = atom->DecAndTestIfZero();
    assert(zero);

    for (Uint32 i=0; i<numThreads; i++)
    {
        threads[i] = new Thread(atomicIncrement, atom, false);
    }

    for (Uint32 i=0; i<numThreads; i++)
    {
        threads[i]->run();
    }

    for (Uint32 i=0; i<numThreads; i++)
    {
        threads[i]->join();
        delete threads[i];
    }

    assert(atom->value() == numThreads);
    delete atom;
}

int main(int argc, char** argv)
{
    verbose = (getenv("PEGASUS_TEST_VERBOSE")) ? true : false;

    for (Uint32 loop=0; loop<10; loop++)
    {
        test01();
    }
    if (verbose)
        cout << "+++++ passed test 1" << endl;

    for (Uint32 loop=0; loop<10; loop++)
    {
        test02();
    }
    if (verbose)
        cout << "+++++ passed test 2" << endl;

    cout << argv[0] << " +++++ passed all tests" << endl;

    return 0;
}


text:
export default {
  methods: {
    genHeader () {
      return this.$createElement('div', {
        'class': 'picker--date__header'
      }, [
        this.genSelector()
      ])
    },
    genBtn (change, children) {
      return this.$createElement('v-btn', {
        props: {
          dark: this.dark,
          icon: true
        },
        nativeOn: {
          click: e => {
            e.stopPropagation()
            this.tableDate = new Date(this.tableYear, change)
          }
        }
      }, children)
    },
    genSelector () {
      const date = new Date(this.tableYear, this.tableMonth)
      const header = this.$createElement('div', {
        'class': 'picker--date__header-selector-date'
      }, [
        this.$createElement(this.computedTransition, [
          this.$createElement('strong', {
            key: this.tableMonth
          }, date.toLocaleString(this.locale, this.headerDateFormat))
        ])
      ])

      return this.$createElement('div', {
        'class': 'picker--date__header-selector'
      }, [
        this.genBtn(this.tableMonth - 1, [
          this.$createElement('v-icon', 'chevron_left')
        ]),
        header,
        this.genBtn(this.tableMonth + 1, [
          this.$createElement('v-icon', 'chevron_right')
        ])
      ])
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
package sorcer.service;

public class ConfigurationException extends Exception {

	public ConfigurationException() {
	}

	public ConfigurationException(Exception exception) {
		super(exception);
	}

	public ConfigurationException(String msg, Exception e) {
		super(msg, e);
	}

	public ConfigurationException(String msg) {
		super(msg);
	}

}


text:
package br.com.keyworks.generatordatatablereport.generation;

import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.logging.Logger;
import javax.servlet.http.HttpServletResponse;
import br.com.keyworks.generatordatatablereport.GeneratorDataTableReport;
import br.com.keyworks.generatordatatablereport.contracts.InfoReport;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.export.JRXlsExporter;

public final class ReportXlsWritable<T> implements ReportWritable {

	private static final Logger LOGGER = Logger
					.getLogger(ReportXlsWritable.class.getName());

	private final InfoReport infoReport;

	private final List<T> reportData;

	private final String fileName;

	public ReportXlsWritable(final InfoReport infoReport, final List<T> reportData,
					final String fileName) {
		Objects.requireNonNull(infoReport, "infoReport não deve ser null");
		Objects.requireNonNull(reportData, "reportData não deve ser null");
		Objects.requireNonNull(fileName, "fileName não deve ser null");
		this.infoReport = infoReport;
		this.reportData = reportData;
		this.fileName = fileName;
	}

	@Override
	public String getContentType() {
		return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
	}

	@Override
	public String getExtension() {
		return "xls";
	}

	@Override
	public String getFileName() {
		return fileName;
	}

	@Override
	public void writeReport(final HttpServletResponse response) {

		LOGGER.info(() -> "writeReport XLS");

		final Optional<JRXlsExporter> jrxlsExporterOp = new GeneratorDataTableReport<>(
						reportData, infoReport).getJrxlsExporter();

		if( jrxlsExporterOp.isPresent() ) {
			LOGGER.info(() -> "Report XLS generated");
			final JRXlsExporter jrXlsExporter = jrxlsExporterOp.get();
			jrXlsExporter.setExporterOutput(
							HttpServletResponseOututStreamExporter.of(response));
			try {
				jrXlsExporter.exportReport();
			} catch (JRException e) {
				LOGGER.warning(() -> "writeReport(): " + e);
			}
			LOGGER.info(() -> "Report XLS writed to Stream");
		}
	}
}


text:
Dummy::Application.config.middleware.swap(
  Rails::Rack::Logger, Distilled::DistilledLogger, :filtered_ips => ['127.0.0.1', '168.192.0.0']
)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity.ModelConfiguration;
using SocialGoal.Model.Models;

namespace SocialGoal.Data.Configuration
{
   public  class UserProfileConfiguration:EntityTypeConfiguration<UserProfile>
    {
       public UserProfileConfiguration()
       {
           Property(u => u.FirstName).HasMaxLength(100);
           Property(u => u.LastName).IsMaxLength();
           Property(u => u.DateEdited).IsRequired();
           Property(u => u.Email).IsMaxLength();
           Property(u => u.Address).IsMaxLength();
           Property(u => u.City).HasMaxLength(100);
           Property(u => u.Country).HasMaxLength(50);
           Property(u => u.State).HasMaxLength(50);
           Property(u => u.UserId).HasMaxLength(50);
       }
    }
}


text:
from pyflink.testing.test_case_utils import PyFlinkBatchTableTestCase

class BatchTableSortTests(PyFlinkBatchTableTestCase):

    def test_order_by_offset_fetch(self):
        t = self.t_env.from_elements([(1, "Hello")], ["a", "b"])
        result = t.order_by(t.a.desc).offset(2).fetch(2)

        query_operation = result._j_table.getQueryOperation()
        self.assertEqual(2, query_operation.getOffset())
        self.assertEqual(2, query_operation.getFetch())
        self.assertEqual('[desc(a)]',
                         query_operation.getOrder().toString())

    def test_limit(self):
        t = self.t_env.from_elements([(1, "Hello")], ["a", "b"])
        result = t.limit(1)

        query_operation = result._j_table.getQueryOperation()
        self.assertEqual(0, query_operation.getOffset())
        self.assertEqual(1, query_operation.getFetch())

    def test_limit_with_offset(self):
        t = self.t_env.from_elements([(1, "Hello")], ["a", "b"])
        result = t.limit(1, 2)

        query_operation = result._j_table.getQueryOperation()
        self.assertEqual(2, query_operation.getOffset())
        self.assertEqual(1, query_operation.getFetch())

if __name__ == '__main__':
    import unittest

    try:
        import xmlrunner
        testRunner = xmlrunner.XMLTestRunner(output='target/test-reports')
    except ImportError:
        testRunner = None
    unittest.main(testRunner=testRunner, verbosity=2)


text:
package org.apache.wicket.examples.resourcedecoration;

import org.apache.wicket.examples.resourcedecoration.GroupedAndOrderedResourceReference.ResourceGroup;

/**
 * @author jthomerson
 */
public class BasicGroupingKey implements Comparable<BasicGroupingKey>
{

	private final ResourceGroup group;
	private final int loadOrder;
	private final boolean css;

	/**
	 * Construct.
	 *
	 * @param group
	 * @param loadOrder
	 * @param css
	 */
	public BasicGroupingKey(ResourceGroup group, int loadOrder, boolean css)
	{
		this.group = group;
		this.loadOrder = loadOrder;
		this.css = css;
	}

	public ResourceGroup getGroup()
	{
		return group;
	}

	public int getLoadOrder()
	{
		return loadOrder;
	}

	public boolean isCss()
	{
		return css;
	}

	@Override
	public String toString()
	{
		return "BasicGroupingKey [group=" + group + ", loadOrder=" + loadOrder + ", css=" + css +
			"]";
	}

	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + (css ? 1231 : 1237);
		result = prime * result + ((group == null) ? 0 : group.hashCode());
		result = prime * result + loadOrder;
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BasicGroupingKey other = (BasicGroupingKey)obj;
		if (css != other.css)
			return false;
		if (group != other.group)
			return false;
		if (loadOrder != other.loadOrder)
			return false;
		return true;
	}

	public int compareTo(BasicGroupingKey o)
	{
		int comp = css == o.css ? 0 : (css ? 1 : -1);
		if (comp == 0)
		{
			comp = group.compareTo(o.group);
		}
		if (comp == 0)
		{
			comp = loadOrder < o.loadOrder ? -1 : (loadOrder == o.loadOrder ? 0 : 1);
		}
		return comp;
	}

}


text:
package gcemodel

import (
	"fmt"

	"k8s.io/kops/pkg/apis/kops"
	"k8s.io/kops/upup/pkg/fi"
	"k8s.io/kops/upup/pkg/fi/cloudup/gcetasks"
	"k8s.io/kops/upup/pkg/fi/fitasks"
)

// APILoadBalancerBuilder builds a LoadBalancer for accessing the API
type APILoadBalancerBuilder struct {
	*GCEModelContext
	Lifecycle *fi.Lifecycle
}

var _ fi.ModelBuilder = &APILoadBalancerBuilder{}

func (b *APILoadBalancerBuilder) Build(c *fi.ModelBuilderContext) error {
	if !b.UseLoadBalancerForAPI() {
		return nil
	}

	lbSpec := b.Cluster.Spec.API.LoadBalancer
	if lbSpec == nil {
		// Skipping API LB creation; not requested in Spec
		return nil
	}

	switch lbSpec.Type {
	case kops.LoadBalancerTypePublic:
	// OK

	case kops.LoadBalancerTypeInternal:
		return fmt.Errorf("internal LoadBalancers are not yet supported by kops on GCE")

	default:
		return fmt.Errorf("unhandled LoadBalancer type %q", lbSpec.Type)
	}

	targetPool := &gcetasks.TargetPool{
		Name: s(b.NameForTargetPool("api")),
	}
	c.AddTask(targetPool)

	ipAddress := &gcetasks.Address{
		Name: s(b.NameForIPAddress("api")),
	}
	c.AddTask(ipAddress)

	forwardingRule := &gcetasks.ForwardingRule{
		Name:       s(b.NameForForwardingRule("api")),
		Lifecycle:  b.Lifecycle,
		PortRange:  "443-443",
		TargetPool: targetPool,
		IPAddress:  ipAddress,
		IPProtocol: "TCP",
	}
	// TODO: Health check
	c.AddTask(forwardingRule)

	{
		// Ensure the IP address is included in our certificate
		// TODO: I don't love this technique for finding the task by name & modifying it
		masterKeypairTask, found := c.Tasks["Keypair/master"]
		if !found {
			return fmt.Errorf("keypair/master task not found")
		}
		masterKeypair := masterKeypairTask.(*fitasks.Keypair)
		masterKeypair.AlternateNameTasks = append(masterKeypair.AlternateNameTasks, ipAddress)
	}

	// Allow traffic into the API (port 443) from KubernetesAPIAccess CIDRs
	{
		t := &gcetasks.FirewallRule{
			Name:         s(b.NameForFirewallRule("https-api")),
			Lifecycle:    b.Lifecycle,
			Network:      b.LinkToNetwork(),
			SourceRanges: b.Cluster.Spec.KubernetesAPIAccess,
			TargetTags:   []string{b.GCETagForRole(kops.InstanceGroupRoleMaster)},
			Allowed:      []string{"tcp:443"},
		}
		c.AddTask(t)
	}
	return nil

}


text:
{-# LANGUAGE DataKinds #-}

module Ivory.Serialize.Struct (
  labelPackRep,
  PackLabel, packLabel, packLabel',
  packStruct
) where

import Ivory.Language
import Ivory.Serialize.Atoms
import Ivory.Serialize.PackRep

labelPackRep :: Packable t => Label sym t -> PackRep t
labelPackRep _ = packRep

newtype PackLabel sym = PackLabel (PackRep ('Struct sym))

packLabel :: (IvoryStruct sym, IvoryArea t, Packable t) => Label sym t -> PackLabel sym
packLabel label = packLabel' label $ labelPackRep label

packLabel' :: (IvoryStruct sym, IvoryArea t) => Label sym t -> PackRep t -> PackLabel sym
packLabel' label rep = PackLabel $ PackRep
  { packGetLE = \ buf offs str -> packGetLE rep buf offs (str ~> label)
  , packGetBE = \ buf offs str -> packGetBE rep buf offs (str ~> label)
  , packSetLE = \ buf offs str -> packSetLE rep buf offs (str ~> label)
  , packSetBE = \ buf offs str -> packSetBE rep buf offs (str ~> label)
  , packSize = packSize rep
  }

packStruct :: [PackLabel sym] -> PackRep ('Struct sym)
packStruct labels = PackRep
  { packGetLE = foldPackLabels packGetLE labels
  , packGetBE = foldPackLabels packGetBE labels
  , packSetLE = foldPackLabels packSetLE labels
  , packSetBE = foldPackLabels packSetBE labels
  , packSize = sum $ map (\ (PackLabel rep) -> packSize rep) labels
  }

foldPackLabels :: Monad m
               => (PackRep ('Struct str) -> buf -> Uint32 -> strref -> m ())
               -> [PackLabel str] -> buf -> Uint32 -> strref
               -> m ()
foldPackLabels f labels buf base str = foldl once (return 0) labels >> return ()
  where
  once m (PackLabel rep) = do
    offs <- m
    f rep buf (base + fromInteger offs) str
    return $! offs + packSize rep


text:
namespace chromeos {

namespace secure_channel {

class FakeNearbyConnectionManager : public NearbyConnectionManager {
 public:
  FakeNearbyConnectionManager();
  FakeNearbyConnectionManager(const FakeNearbyConnectionManager&) = delete;
  FakeNearbyConnectionManager& operator=(const FakeNearbyConnectionManager&) =
      delete;
  ~FakeNearbyConnectionManager() override;

  using NearbyConnectionManager::DoesAttemptExist;
  using NearbyConnectionManager::GetDeviceIdPairsForRemoteDevice;
  using NearbyConnectionManager::NotifyNearbyInitiatorConnectionSuccess;
  using NearbyConnectionManager::NotifyNearbyInitiatorFailure;

 private:
  // NearbyConnectionManager:
  void PerformAttemptNearbyInitiatorConnection(
      const DeviceIdPair& device_id_pair) override;
  void PerformCancelNearbyInitiatorConnectionAttempt(
      const DeviceIdPair& device_id_pair) override;
};

}  // namespace secure_channel

}  // namespace chromeos

#endif  // CHROMEOS_SERVICES_SECURE_CHANNEL_FAKE_NEARBY_CONNECTION_MANAGER_H_


text:
/* -*-  mode: c++; indent-tabs-mode: nil -*- */

/*
  ATS

  Constant viscosity EOS, defaults to reasonable values for water.

  http://software.lanl.gov/ats/trac

  Authors: Ethan Coon (ecoon@lanl.gov)
*/

#include "viscosity_constant.hh"

namespace Amanzi {
namespace Relations {

ViscosityConstant::ViscosityConstant(Teuchos::ParameterList& visc_plist) :
    visc_plist_(visc_plist) {
  InitializeFromPlist_();
};

void ViscosityConstant::InitializeFromPlist_() {
  // defaults to water
  visc_ = visc_plist_.get<double>("viscosity [kg/m-s]", 8.9e-4);
};

} // namespace
} // namespace


text:
:: Purpose:       Sub-script containing all commands for Tron's Stage 7: Wrap-up stage. Called by tron.bat and returns control when finished
:: Requirements:  Administrator access
:: Author:        vocatus on reddit.com/r/TronScript ( vocatus.gate at gmail ) // PGP key: 0x07d1490f82a211a2
:: Version:       1.0.4 - Remove post-run restore point creation, since there's really no point in creating it
::                1.0.3 / Change REMOVE_MALWAREBYTES switch to PRESERVE_MALWAREBYTES (-pmb) as the new default behavior is to remove it at the end of the run
::                1.0.2 + Add REMOVE_MALWAREBYTES (-rmb) switch to have Tron automatically remove Malwarebytes at the end of the run
::                      / Change the display output from disk space reclaimed calculation to assume GB's instead of MB's
::                1.0.1 ! Apply u/Paul_NZ's disk space calculation fix from prerun_checks_and_tasks.bat
::                1.0.0 + Initial break-out of code from tron.bat into discrete subscript
@echo off

:::::::::::::::::::::
:: PREP AND CHECKS ::
:::::::::::::::::::::
set STAGE_7_SCRIPT_VERSION=1.0.4
set STAGE_7_SCRIPT_DATE=2020-05-25

:: Check for standalone vs. Tron execution and build the environment if running in standalone mode
if /i "%LOGFILE%"=="" (
	pushd "%~dp0"
	pushd ..

	:: Load the settings file
	call functions\tron_settings.bat

	:: Initialize the runtime environment
	call functions\initialize_environment.bat
)

:::::::::::::::::::::::
:: STAGE 7: Wrap-up  :: // Begin jobs
:::::::::::::::::::::::
call functions\log_with_date.bat "  stage_7_wrap-up begin..."

:: JOB: Reset power settings to Windows defaults
title Tron v%TRON_VERSION% [stage_7_wrap-up] [Reset power settings]
if %PRESERVE_POWER_SCHEME%==yes (
	call functions\log_with_date.bat "!  PRESERVE_POWER_SCHEME (-p) set to "%PRESERVE_POWER_SCHEME%", skipping power settings reset."
) else (
	call functions\log_with_date.bat "   Resetting Windows power settings to defaults and re-enabling screensaver..."
	if %DRY_RUN%==no (
		REM Check for Windows XP/2k3
		if %WIN_VER_NUM% lss 6.0 %WINDIR%\system32\powercfg.exe /RestoreDefaultPolicies >NUL 2>&1
		REM Run commands for all other versions of Windows
		%WINDIR%\system32\powercfg.exe -restoredefaultschemes >NUL 2>&1
)
call functions\log_with_date.bat "   Done."
)

:: JOB: Get post-Tron system state (installed programs, complete file list) and generate the summary logs
title Tron v%TRON_VERSION% [stage_7_wrap-up] [Generate Summary Logs]
call functions\log_with_date.bat "   Calculating post-run results for summary logs..."
if /i %DRY_RUN%==no (
	:: Get list of installed programs
	stage_0_prep\log_tools\siv\siv32x.exe -save=[software]="%RAW_LOGS%\installed-programs-after.txt"
	:: Get list of all files
	stage_0_prep\log_tools\everything\everything.exe -create-filelist %RAW_LOGS%\filelist-after.txt %SystemDrive%

		REM Parse everything

		REM Step 1: Find FILES that were deleted and dump them to summary logs
		stage_0_prep\log_tools\comm\diff.exe --changed-group-format='%%^<' --unchanged-group-format='' %RAW_LOGS%\filelist-before.txt %RAW_LOGS%\filelist-after.txt | %FIND% /i /v "$RECYCLE" | %FIND% /i /v "AppData\" | %FIND% /i /v "ntuser.dat" | %find% /i /v "Filename,Size" | %find% /i /v "'''" > "%TEMP%\tron_diff_temp.txt"

		REM Strip out random one-apostrophe lines
		findstr /v /r "^'" "%TEMP%\tron_diff_temp.txt" > %SUMMARY_LOGS%\tron_removed_files.txt

		REM Step 2: Find PROGRAMS that were removed. This is super ugly and complicated, but lets us avoid bundling another external utility
		REM Compact the files by removing blank lines, stripping top 4 lines off file, then last two lines, then output to the final text file for comparison
		copy /y %RAW_LOGS%\installed-programs-before.txt %RAW_LOGS%\before.txt >NUL
		for /f "delims=" %%a in (%RAW_LOGS%\before.txt) do echo %%a>> %RAW_LOGS%\before1.txt
		more +3 %RAW_LOGS%\before1.txt >> %RAW_LOGS%\before2.txt
		%FINDSTR% /v /i "[==" %RAW_LOGS%\before2.txt > %RAW_LOGS%\installed-programs-before.txt

		REM AFTER: Compact the files by removing blank lines, stripping top 4 lines off file, then last two lines, then output to the final text file for comparison
		copy /y %RAW_LOGS%\installed-programs-after.txt %RAW_LOGS%\after.txt >NUL
		for /f "delims=" %%a in (%RAW_LOGS%\after.txt) do echo %%a>> %RAW_LOGS%\after1.txt
		more +3 %RAW_LOGS%\after1.txt >> %RAW_LOGS%\after2.txt
		%FINDSTR% /v /i "[==" %RAW_LOGS%\after2.txt > %RAW_LOGS%\installed-programs-after.txt

		REM Calculate differences, using GnuWin32 coreutil's comm.exe
		stage_0_prep\log_tools\comm\comm.exe -23 %RAW_LOGS%\installed-programs-before.txt %RAW_LOGS%\installed-programs-after.txt > %SUMMARY_LOGS%\tron_removed_programs.txt

		REM If the parsed file is the same as the original, we can assume nothing was removed, so just echo that into the file
		fc /b %RAW_LOGS%\installed-programs-before.txt %RAW_LOGS%\installed-programs-after.txt >NUL
		if %ERRORLEVEL%==0 echo No programs were removed.> %SUMMARY_LOGS%\tron_removed_programs.txt

		REM Cleanup
		del /f /q "%TEMP%\tron_diff_temp.txt" 2>NUL
		del /f /q %RAW_LOGS%\before*txt 2>NUL
		del /f /q %RAW_LOGS%\after*txt 2>NUL
	)
call functions\log_with_date.bat "   Done. Summary logs are at "%SUMMARY_LOGS%\""

:: JOB: Collect misc logs and deposit them in the log folder
title Tron v%TRON_VERSION% [stage_7_wrap-up] [Collect logs]
call functions\log_with_date.bat "   Saving misc logs to "%RAW_LOGS%\"..."
if /i %DRY_RUN%==no (
	if exist "%ProgramData%\Sophos\Sophos Virus Removal Tool\logs" copy /Y "%ProgramData%\Sophos\Sophos Virus Removal Tool\logs\*.l*" "%RAW_LOGS%\" >NUL
	if exist "%ProgramData%\Malwarebytes\Malwarebytes Anti-Malware\logs" copy /Y "%ProgramData%\Malwarebytes\Malwarebytes Anti-Malware\logs\*.xml" "%RAW_LOGS%\" >NUL
	if exist "%LOGPATH%\mbam-log*" move /y "%LOGPATH%\mbam-log*" "%RAW_LOGS%\"
	if exist "%LOGPATH%\Sophos*" move /y "%LOGPATH%\Sophos*" "%RAW_LOGS%\"
	if exist "%LOGPATH%\protection-log*" move /y "%LOGPATH%\protection-log*" "%RAW_LOGS%\"
	if exist "%LOGPATH%\jre*" move /y "%LOGPATH%\jre*" "%RAW_LOGS%\"
)
call functions\log_with_date.bat "   Done."

:: JOB: Skip removal of Malwarebytes if requested
title Tron v%TRON_VERSION% [stage_7_wrap-up] [Remove Malwarebytes]
if %PRESERVE_MALWAREBYTES%==yes (
	call functions\log_with_date.bat "!  PRESERVE_MALWAREBYTES (-pmb) set to "%PRESERVE_MALWAREBYTES%", skipping removal."
) else (
	call functions\log_with_date.bat "   Uninstalling Malwarebytes..."
	if %DRY_RUN%==no (
		if exist "%ProgramFiles%\Malwarebytes\Anti-Malware\unins000.exe" "%ProgramFiles%\Malwarebytes\Anti-Malware\unins000.exe" /verysilent /suppressmsgboxes /norestart >> "%LOGPATH%\%LOGFILE%" 2>&1
		if exist "%ProgramFiles(x86)%\Malwarebytes\Anti-Malware\unins000.exe" "%ProgramFiles(x86)%\Malwarebytes\Anti-Malware\unins000.exe" /verysilent /suppressmsgboxes /norestart >> "%LOGPATH%\%LOGFILE%" 2>&1
		if exist "%ProgramFiles%\Malwarebytes Anti-Malware\" rmdir "%ProgramFiles%\Malwarebytes Anti-Malware\" /s /q >> "%LOGPATH%\%LOGFILE%" 2>&1
		if exist "%ProgramFiles(x86)%\Malwarebytes Anti-Malware\" rmdir "%ProgramFiles(x86)%\Malwarebytes Anti-Malware\" /s /q >> "%LOGPATH%\%LOGFILE%" 2>&1
	)
call functions\log_with_date.bat "   Done."
)

:: JOB: Calculate saved disk space
title Tron v%TRON_VERSION% [stage_7_wrap-up] [Calculate saved disk space]
for /f "tokens=2 delims=:(" %%a in ('fsutil volume diskfree %SystemDrive%') do set bytes=%%a
set bytes=%bytes: =%

:: Old method (broken in Win10 build 17763 (1809) and up)
:: for /F "tokens=2 delims=:" %%a in ('fsutil volume diskfree %SystemDrive% ^| %FIND% /i "avail free"') do set bytes=%%a

:: GB version of the calculation
set /A FREE_SPACE_AFTER=%bytes:~0,-3%/1024*1000/1024/1024

:: MB version of the calculation
::set /a FREE_SPACE_AFTER=%bytes:~0,-3%/1024*1000/1024

:: Set the space for display
set /a FREE_SPACE_SAVED=%FREE_SPACE_AFTER% - %FREE_SPACE_BEFORE%

:: Stage complete
call functions\log_with_date.bat "  stage_7_wrap-up complete."


text: Personal site for Michael Medellin


text:
#ifndef BOOST_POLYGON_POLYGON_DATA_HPP
#define BOOST_POLYGON_POLYGON_DATA_HPP
namespace boost { namespace polygon{
struct polygon_concept;
template <typename T>
class polygon_data {
public:
  typedef polygon_concept geometry_type;
  typedef T coordinate_type;
  typedef typename std::vector<point_data<coordinate_type> >::const_iterator iterator_type;
  typedef typename coordinate_traits<T>::coordinate_distance area_type;
  typedef point_data<T> point_type;

  inline polygon_data() : coords_() {} //do nothing default constructor

  template<class iT>
  inline polygon_data(iT input_begin, iT input_end) : coords_(input_begin, input_end) {}

  template<class iT>
  inline polygon_data& set(iT input_begin, iT input_end) {
    coords_.clear();  //just in case there was some old data there
    coords_.insert(coords_.end(), input_begin, input_end);
    return *this;
  }

  // copy constructor (since we have dynamic memory)
  inline polygon_data(const polygon_data& that) : coords_(that.coords_) {}

  // assignment operator (since we have dynamic memory do a deep copy)
  inline polygon_data& operator=(const polygon_data& that) {
    coords_ = that.coords_;
    return *this;
  }

  template <typename T2>
  inline polygon_data& operator=(const T2& rvalue);

  inline bool operator==(const polygon_data& that) const {
    if(coords_.size() != that.coords_.size()) return false;
    for(std::size_t i = 0; i < coords_.size(); ++i) {
      if(coords_[i] != that.coords_[i]) return false;
    }
    return true;
  }

  inline bool operator!=(const polygon_data& that) const { return !((*this) == that); }

  // get begin iterator, returns a pointer to a const Unit
  inline iterator_type begin() const { return coords_.begin(); }

  // get end iterator, returns a pointer to a const Unit
  inline iterator_type end() const { return coords_.end(); }

  inline std::size_t size() const { return coords_.size(); }

public:
  std::vector<point_data<coordinate_type> > coords_;
};

}
}
#endif


text:
<template name="progressBar">

      {{progress}}% Complete

</template>


text:
package org.kie.workbench.common.stunner.core.client.canvas.command;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.kie.workbench.common.stunner.core.graph.Edge;
import org.kie.workbench.common.stunner.core.graph.Node;
import org.kie.workbench.common.stunner.core.graph.content.view.Connection;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.when;

@RunWith(MockitoJUnitRunner.class)
public class AddConnectorCommandTest extends AbstractCanvasCommandTest {

    private static final String EDGE_ID = "e1";
    private static final String SOURCE_ID = "s1";

    @Mock
    private Edge candidate;
    @Mock
    private Node source;
    @Mock
    private Connection connection;

    private AddConnectorCommand tested;

    @Before
    public void setUp() throws Exception {
        super.setUp();
        when(candidate.getUUID()).thenReturn(EDGE_ID);
        when(source.getUUID()).thenReturn(SOURCE_ID);
        when(candidate.getSourceNode()).thenReturn(source);
        this.tested = new AddConnectorCommand(source,
                                              candidate,
                                              connection,
                                              SHAPE_SET_ID);
    }

    @Test
    public void testGetGraphCommand() {
        final org.kie.workbench.common.stunner.core.graph.command.impl.AddConnectorCommand graphCommand =
                (org.kie.workbench.common.stunner.core.graph.command.impl.AddConnectorCommand) tested.newGraphCommand(canvasHandler);
        assertNotNull(graphCommand);
        assertEquals(candidate,
                     graphCommand.getEdge());
        assertEquals(source,
                     graphCommand.getSourceNode());
        assertEquals(connection,
                     graphCommand.getConnection());
    }

    @Test
    public void testGetCanvasCommand() {
        final AddCanvasConnectorCommand canvasCommand =
                (AddCanvasConnectorCommand) tested.newCanvasCommand(canvasHandler);
        assertNotNull(canvasCommand);
        assertEquals(candidate,
                     canvasCommand.getCandidate());
        assertEquals(SHAPE_SET_ID,
                     canvasCommand.getShapeSetId());
    }
}


text:
namespace zapi
{
using zapi::kernel::StreamBuffer;

void assert_x(const char *where, const char *what, const char *file, int line) ZAPI_DECL_NOEXCEPT
{
   std::cerr <<  "ASSERT failure in " << where << ": \"" << what
              << "\", file " << file << ", line "<< line << std::endl;
}

StreamBuffer bufferOut(0);
StreamBuffer bufferError(E_ERROR);
StreamBuffer bufferWarning(E_WARNING);
StreamBuffer bufferNotice(E_NOTICE);
StreamBuffer bufferDeprecated(E_DEPRECATED);

std::ostream out(&bufferOut);
std::ostream error(&bufferError);
std::ostream warning(&bufferWarning);
std::ostream notice(&bufferNotice);
std::ostream deprecated(&bufferDeprecated);

} // zapi


text:
package com.designdemo.uaha;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.NavigationView;
import android.support.design.widget.Snackbar;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.telephony.PhoneNumberFormattingTextWatcher;
import android.telephony.PhoneNumberUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.bumptech.glide.Glide;
import com.support.android.designlibdemo.R;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

import de.hdodenhof.circleimageview.CircleImageView;

public class UserActivity extends AppCompatActivity {
    private static final String TAG = "UserActivity";
    private Activity mActivity;

    private DrawerLayout drawerLayout;
    private EditText nameEnterField;
    private EditText phoneEnterField;
    private FloatingActionButton fab;
    private Button picButton;

    private CircleImageView profileImageView;

    private AlertDialog photoDialog;

    public static final int TAKE_PICTURE_CODE = 23423;
    public static final int CHOOSE_PICTURE_CODE = 453;
    private String mCurrentPhotoPath;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user);
        mActivity = this;

        final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        final ActionBar ab = getSupportActionBar();
        ab.setHomeAsUpIndicator(R.drawable.ic_menu);
        ab.setDisplayHomeAsUpEnabled(true);

        setupViews();

        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
        if (navigationView != null) {
            setupDrawerContent(navigationView);
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.toolbar_actions, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                drawerLayout.openDrawer(GravityCompat.START);
                return true;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        Log.d(TAG, "Request Code = " + requestCode);

        if(resultCode == RESULT_OK){
            if(requestCode == TAKE_PICTURE_CODE){
                photoDialog.dismiss();

                // We've created this photo path when we launched the camera intent
                Uri selectedImage = Uri.parse(mCurrentPhotoPath);
                Glide.with(this).load(selectedImage).into(profileImageView);
                PrefsUtil.saveProfilePic(this, selectedImage);

            }else if (requestCode == CHOOSE_PICTURE_CODE){
                photoDialog.dismiss();

                // Uri comes back from the Gallery
                Uri selectedImage = data.getData();
                Glide.with(this).load(selectedImage).into(profileImageView);
                PrefsUtil.saveProfilePic(this, selectedImage);
            }
        }
    }

    private void setupViews() {
        drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
        nameEnterField = (EditText) findViewById(R.id.name_edit);
        phoneEnterField = (EditText) findViewById(R.id.phone_edit);

        profileImageView = (CircleImageView)findViewById(R.id.profile_image_view);

        Uri imageUri = PrefsUtil.getProfilePic(this);
        if(imageUri != null){
            Glide.with(this).load(imageUri).centerCrop().into(profileImageView);
        }else {
            Glide.with(this).load(R.drawable.ic_account_lg).centerCrop().into(profileImageView);
        }

        //Format phone number as user is typing
        phoneEnterField.addTextChangedListener(new PhoneNumberFormattingTextWatcher());

        picButton = (Button) findViewById(R.id.profile_pic_button);
        picButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setPictureDialog();
            }
        });

        fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                //Validate values
                int nameLen = nameEnterField.getText().length();
                View mainView = (View) findViewById(R.id.main_content);

                if (nameLen < 4) {
                    nameEnterField.setError("At least 4 characters");
                    Snackbar.make(mainView, "Name input error", Snackbar.LENGTH_SHORT)
                            .show();
                }

                int phoneLen = phoneEnterField.getText().length();
                if (phoneLen != 14) {
                    phoneEnterField.setError("Invalid Phone");

                    Snackbar.make(mainView, "Phone input error",
                            Snackbar.LENGTH_SHORT)
                            .show();

                }

                //Validation successful, save values and message user

                // Save original Values before sending, in-case user changes their mind
                final String beforeName = PrefsUtil.getName(mActivity.getApplicationContext());
                final long beforePhone = PrefsUtil.getPhone(mActivity.getApplicationContext());

                // Store new values
                final String nameToSet = nameEnterField.getText().toString();
                String formattedNum = PhoneNumberUtils.stripSeparators(phoneEnterField.getText().toString());
                final long phoneToSet = Long.valueOf(formattedNum);

                PrefsUtil.setProfile(mActivity.getApplicationContext(), nameToSet, phoneToSet);

                Snackbar.make(mainView, R.string.favorite_confirm, Snackbar.LENGTH_LONG)
                        .setAction("Undo", new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                // Reset to original
                                boolean complete = PrefsUtil.setProfile(mActivity.getApplicationContext(), beforeName, beforePhone);
                                if (complete) {
                                    setPhoneNameValues();
                                }
                            }
                        })
                        .show();
            }
        });

        // Set initial values from Prefs
        setPhoneNameValues();
    }

    private void setPhoneNameValues() {
        String name = PrefsUtil.getName(this);
        if (!name.equals(PrefsUtil.PREFS_NAME_UNSET)) {
            nameEnterField.setText(name);
        }

        final long phone = PrefsUtil.getPhone(this);
        if (phone != 0) {
            phoneEnterField.setText(phone + "");
        }
    }

    private void setPictureDialog() {

        AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
        LayoutInflater inflater = mActivity.getLayoutInflater();
        final View dialogView = inflater.inflate(R.layout.dialog_picture, null);

        dialogView.findViewById(R.id.buttonTakePic).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dispatchTakePictureIntent();
            }
        });

        dialogView.findViewById(R.id.buttonChoosePic).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
                photoPickerIntent.setType("image/*");
                startActivityForResult(photoPickerIntent, CHOOSE_PICTURE_CODE);
            }
        });

        builder.setView(dialogView);
        builder.setTitle(mActivity.getString(R.string.picture_dialog_title));
        builder.setCancelable(true);
        builder.setPositiveButton(mActivity.getString(R.string.picture_dialog_button), new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                // Send the phone number to get validated
                Log.d("Dialog", "The positive button was pressed");
            }
        });

        photoDialog = builder.create();
        photoDialog.show();
    }

    // https://developer.android.com/training/camera/photobasics.html
    private File createImageFile() throws IOException {
        // Create an image file name
        String timeStamp = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        String imageFileName = "JPEG_" + timeStamp + "_";
        File storageDir = Environment.getExternalStoragePublicDirectory(
                Environment.DIRECTORY_PICTURES);
        File image = File.createTempFile(
                imageFileName,  /* prefix */
                ".jpg",         /* suffix */
                storageDir      /* directory */
        );

        // Save a file: path for use with ACTION_VIEW intents
        mCurrentPhotoPath = "file:" + image.getAbsolutePath();
        return image;
    }

    // https://developer.android.com/training/camera/photobasics.html
    private void dispatchTakePictureIntent() {
        Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        // Ensure that there's a camera activity to handle the intent
        if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
            // Create the File where the photo should go
            File photoFile = null;
            try {
                photoFile = createImageFile();
            } catch (IOException ex) {
                Log.e(TAG, "Error: "+ex.getMessage());
            }
            // Continue only if the File was successfully created
            if (photoFile != null) {
                takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
                        Uri.fromFile(photoFile));
                startActivityForResult(takePictureIntent, TAKE_PICTURE_CODE);
            }
        }
    }

    private void setupDrawerContent(final NavigationView navigationView) {
        navigationView.setNavigationItemSelectedListener(
                new NavigationView.OnNavigationItemSelectedListener() {
                    @Override
                    public boolean onNavigationItemSelected(MenuItem menuItem) {
                        menuItem.setChecked(true);
                        switch (menuItem.getItemId()) {
                            case R.id.nav_home:
                                Intent osIntent = new Intent(getApplicationContext(), MainActivity.class);
                                osIntent.putExtra(MainActivity.EXTRA_FRAG_TYPE, MainActivity.OS_FRAG);
                                startActivity(osIntent);
                                return true;
                            case R.id.nav_devices:
                                Intent deviceIntent = new Intent(getApplicationContext(), MainActivity.class);
                                deviceIntent.putExtra(MainActivity.EXTRA_FRAG_TYPE, MainActivity.DEVICE_FRAG);
                                startActivity(deviceIntent);
                                return true;
                            case R.id.nav_favorites:
                                Intent favIntent = new Intent(getApplicationContext(), MainActivity.class);
                                favIntent.putExtra(MainActivity.EXTRA_FRAG_TYPE, MainActivity.FAV_FRAG);
                                startActivity(favIntent);
                                return true;
                            case R.id.nav_userinfo:
                                drawerLayout.closeDrawers();
                                return true;
                            case R.id.nav_link1:
                                Intent browser1 = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.android.com/"));
                                startActivity(browser1);
                                return true;
                            case R.id.nav_link2:
                                Intent browser2 = new Intent(Intent.ACTION_VIEW, Uri.parse("http://developer.android.com/"));
                                startActivity(browser2);
                                return true;
                            default:
                                return true;
                        }
                    }
                });
    }
}


text:
import os
from flask import Flask, Response, request, url_for
import plivoxml
from utils import joke_from_reddit
# This file will be played when a caller presses 2.
PLIVO_SONG = "https://s3.amazonaws.com/plivocloud/music.mp3"
# This is the message that Plivo reads when the caller dials in
IVR_MESSAGE = "Welcome to the Plivo IVR Demo App. Press 1 to hear a random joke. Press 2 to listen to a song."
# This is the message that Plivo reads when the caller does nothing at all
NO_INPUT_MESSAGE = "Sorry, I didn't catch that. Please hangup and try again later."
# This is the message that Plivo reads when the caller inputs a wrong number.
WRONG_INPUT_MESSAGE = "Sorry, it's wrong input."
app = Flask(__name__)
@app.route('/response/ivr/', methods=['GET', 'POST'])
def ivr():
    response = plivoxml.Response()
    if request.method == 'GET':
        # Go to http://plivo.com/docs/xml/getdigits/ for more details on GetDigits xml
        getdigits_action_url = url_for('ivr', _external=True)
        getDigits = plivoxml.GetDigits(action=getdigits_action_url, method='POST',
        timeout=7, numDigits=1, retries=1)
        getDigits.addSpeak(IVR_MESSAGE)
        response.add(getDigits)
        response.addSpeak(NO_INPUT_MESSAGE)

        return Response(str(response), mimetype='text/xml')
    elif request.method == 'POST':
        digit = request.form.get('Digits')

        if digit == "1":
            # Fetch a random joke using the Reddit API.
            joke = joke_from_reddit()
            response.addSpeak(joke)
        elif digit == "2":
            # Listen to a song
            response.addPlay(PLIVO_SONG)
        else:
            response.addSpeak(WRONG_INPUT_MESSAGE)

        return Response(str(response), mimetype='text/xml')

if __name__ == '__main__':
    port = int(os.environ.get('PORT', 5000))

    if port == 5000:
        app.debug = True
    app.run(host='0.0.0.0', port=port)


text:
require 'minitest_helper'

class TableTest < Minitest::Test

  def setup
    @list = [2, 3, 5, 7]
    @table = PrimeNumbers::Table.new(@list)
  end

  def test_attribute_primes
    assert_equal @list, @table.primes
  end

  def test_attribute_size
    assert_equal @list.length, @table.size
  end

  def test_attribute_columns
    assert_instance_of Array, @table.columns
    assert_instance_of PrimeNumbers::Column, @table.columns[0]

    assert_equal @list.length, @table.columns.length
    assert_equal @list.length, @table.columns[0].products.size
  end

end


text:
package bootstrap.liftweb

import java.util.Locale

import net.liftweb.common.{Box,Empty,Full,Logger}
import net.liftweb.util.{LoanWrapper}
import net.liftweb.http._
import net.liftweb.http.provider._
import net.liftweb.sitemap._
import net.liftweb.sitemap.Loc._
import org.wso2.as.model._
import S.?

/**
  * A class that's instantiated early and run.  It allows the application
  * to modify lift's environment
  */
class Boot {
  def boot {

    // where to search snippet
    LiftRules.addToPackages("org.wso2.as")

    // Set up a site map
    val entries = SiteMap(
      Menu(Loc("Home", "index" :: Nil , ?("Home"))),
      Menu(Loc("Authors", "authors" :: "list" :: Nil, ?("Author List"))),
			Menu(Loc("Add Author", "authors" :: "add" :: Nil, ?("Add Author"), Hidden)),
			Menu(Loc("Books", "books" :: "list" :: Nil, ?("Book List"))),
			Menu(Loc("Add Book", "books" :: "add" :: Nil, ?("Add Book"), Hidden)),
			Menu(Loc("BookSearch", "books" :: "search" :: Nil, ?("Book Search"))))

    LiftRules.setSiteMap(entries)

    // And now, for a little fun :)
    val swedishChef = new Locale("chef")

    object swedishOn extends SessionVar(false)

    def localeCalculator (request : Box[HTTPRequest]) : Locale =
      request.flatMap(_.param("swedish") match {
        case Nil if swedishOn.is == true => Full(swedishChef)
        case Nil => Full(LiftRules.defaultLocaleCalculator(request))
        case "true" :: _ => { swedishOn(true); Full(swedishChef) }
        case "false" :: _ => { swedishOn(false); Full(LiftRules.defaultLocaleCalculator(request)) }
      }).openOr(Locale.getDefault())

    LiftRules.localeCalculator = localeCalculator _
  }
}


text:
'use strict';

var AssetRegistry = require('AssetRegistry');
var PixelRatio = require('PixelRatio');
var Platform = require('Platform');
var SourceCode = require('NativeModules').SourceCode;

var _serverURL;

function getDevServerURL() {
  if (!__DEV__) {
    // In prod we want assets to be loaded from the archive
    return null;
  }
  if (_serverURL === undefined) {
    var scriptURL = SourceCode.scriptURL;
    var match = scriptURL && scriptURL.match(/^https?:\/\/.*?\//);
    if (match) {
      // Bundle was loaded from network
      _serverURL = match[0];
    } else {
      // Bundle was loaded from file
      _serverURL = null;
    }
  }

  return _serverURL;
}

/**
 * Returns the path at which the asset can be found in the archive
 */
function getPathInArchive(asset) {
  if (Platform.OS === 'android') {
    var assetDir = getBasePath(asset);
    // E.g. 'assets_awesomemodule_icon'
    // The Android resource system picks the correct scale.
    return (assetDir + '/' + asset.name)
      .toLowerCase()
      .replace(/\//g, '_')           // Encode folder structure in file name
      .replace(/([^a-z0-9_])/g, '')  // Remove illegal chars
      .replace(/^assets_/, '');      // Remove "assets_" prefix
  } else {
    // E.g. 'assets/AwesomeModule/icon@2x.png'
    return getScaledAssetPath(asset);
  }
}

/**
 * Returns an absolute URL which can be used to fetch the asset
 * from the devserver
 */
function getPathOnDevserver(devServerUrl, asset) {
  return devServerUrl + getScaledAssetPath(asset) + '?hash=' + asset.hash;
}

/**
 * Returns a path like 'assets/AwesomeModule'
 */
function getBasePath(asset) {
  // TODO(frantic): currently httpServerLocation is used both as
  // path in http URL and path within IPA. Should we have zipArchiveLocation?
  var path = asset.httpServerLocation;
  if (path[0] === '/') {
    path = path.substr(1);
  }
  return path;
}

/**
 * Returns a path like 'assets/AwesomeModule/icon@2x.png'
 */
function getScaledAssetPath(asset) {
  var scale = pickScale(asset.scales, PixelRatio.get());
  var scaleSuffix = scale === 1 ? '' : '@' + scale + 'x';
  var assetDir = getBasePath(asset);
  return assetDir + '/' + asset.name + scaleSuffix + '.' + asset.type;
}

function pickScale(scales, deviceScale) {
  // Packager guarantees that `scales` array is sorted
  for (var i = 0; i < scales.length; i++) {
    if (scales[i] >= deviceScale) {
      return scales[i];
    }
  }

  // If nothing matches, device scale is larger than any available
  // scales, so we return the biggest one. Unless the array is empty,
  // in which case we default to 1
  return scales[scales.length - 1] || 1;
}

function resolveAssetSource(source) {
  if (typeof source === 'object') {
    return source;
  }

  var asset = AssetRegistry.getAssetByID(source);
  if (asset) {
    return assetToImageSource(asset);
  }

  return null;
}

function assetToImageSource(asset) {
  var devServerURL = getDevServerURL();
  if (devServerURL) {
    return {
      width: asset.width,
      height: asset.height,
      uri: getPathOnDevserver(devServerURL, asset),
      isStatic: false,
    };
  } else {
    return {
      width: asset.width,
      height: asset.height,
      uri: getPathInArchive(asset),
      isStatic: true,
    };
  }
}

module.exports = resolveAssetSource;
module.exports.pickScale = pickScale;


text:
using Foundation.Utilities;

namespace Foundation.Metadata.Annotations
{
    public class RelationalEntityAnnotations : IRelationalEntityAnnotations
    {
        public RelationalEntityAnnotations(Entity entity)
        {
            Check.NotNull(entity, nameof(entity));

            Entity = entity;
        }

        protected virtual Entity Entity { get; }

        protected virtual Annotable Metadata => Entity.Root();

        public virtual string TableName
        {
            get { return (string)Metadata[RelationalAnnotationNames.TableName] ?? Entity.Name; }
            set { Metadata[RelationalAnnotationNames.TableName] = Check.NullButNotEmpty(value, nameof(value)); }
        }

        public virtual string OldTableName
        {
            get { return (string)Metadata[RelationalAnnotationNames.OldTableName] ?? Entity.Name; }
            set { Metadata[RelationalAnnotationNames.OldTableName] = Check.NullButNotEmpty(value, nameof(value)); }
        }

        public virtual string Schema
        {
            get { return (string)Metadata[RelationalAnnotationNames.Schema] ?? new RelationalModelAnnotations(Entity.Model).DefaultSchema; }
            set { Metadata[RelationalAnnotationNames.Schema] = Check.NullButNotEmpty(value, nameof(value)); }
        }

        public virtual Property DiscriminatorProperty { get; set; }

        public virtual object DiscriminatorValue { get; set; }
    }
}


text:
import {Component} from 'angular2/core';
import {CORE_DIRECTIVES, FORM_DIRECTIVES} from 'angular2/common';
import {AngularFire, FirebaseObservable} from 'angularfire2';

@Component({
  selector: 'about',
  providers: [],
  moduleId: module.id,
  templateUrl: './about.html',
  directives: [FORM_DIRECTIVES, CORE_DIRECTIVES]
})
export class AboutCmp {
  newName: string;
  names: FirebaseObservable<string[]>;
  constructor(af:AngularFire) {
    this.names = af.list('/scientists');
  }
 /*
 * @param newname  any text as input.
 * @returns return false to prevent default form submit behavior to refresh the page.
 */
  addName(): boolean {
    this.names.add(this.newName);
    this.newName = '';
    return false;
  }
}


text:
<?php

namespace Tkcns\Hydrator;

use Tkcns\Hydrator\Strategy\DateTimeStrategy;
use Tkcns\Hydrator\Strategy\DateStrategy;

/**
 * Class FinancialHydrator
 *
 * @package Tkcns\Hydrator
 */
class FinancialHydrator extends TkcnsBaseHydrator
{
    protected $map = [
        'id'                    => 'id',
        'description'           => 'description',
        'amount_net'            => 'netAmount',
        'notes'                 => 'notes',
        'field'                 => 'field',
        'orderid'               => 'orderId',
        'lastmodified'          => 'lastModified',
        'followup_reminder'     => 'followUpReminder',
        'followup_reason'       => 'followUpReason',
        'followup_until'        => 'followUpUntil',
        'daterec'               => 'dateRecorded',
        'amount_vat'            => 'vatAmount',
        'amount_total'          => 'totalAmount',
        'entrytypeid'           => 'entryTypeId',
        'lastmodifiedby'        => 'lastModifiedById',
        'variationagainstid'    => 'variationAgainstId',
        'rate_vat'              => 'vatRate',
    ];

    public function __construct()
    {
        parent::__construct();

        $dateTimeStrategy = new DateTimeStrategy();
        $dateStrategy = new DateStrategy();

        $this->addStrategy('lastModified', $dateTimeStrategy);
        $this->addStrategy('followUpUntil', $dateTimeStrategy);
        $this->addStrategy('dateRecorded', $dateStrategy);
    }
}


text:
Every Ember.js application has one instance of `Ember.Application`.
This object is located at `./app/app.js` inside your project.

What does creating an `Ember.Application` instance get you?

1. It adds event listeners to the document and is responsible for
   delegating events to your components.
1. It automatically renders the [application
   template](../templates/the-application-template).
1. It automatically creates a router and begins routing, choosing which
   template and model to display based on the current URL.


text:
typedef void (^CDUnknownBlockType)(void); // return type and parameters are unknown

#pragma mark Named Structures

struct _NSRange {
    unsigned long long location;
    unsigned long long length;
};

#pragma mark -

//
// File: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/DataAccessExpress.framework/DataAccessExpress
// UUID: 2233D188-C88F-32A6-9A36-58D9CD582B21
//
//                           Arch: x86_64
//                Current version: 1.0.0
//          Compatibility version: 1.0.0
//                 Source version: 1390.0.0.0.0
//            Minimum iOS version: 8.0.0
//                    SDK version: 8.0.0
//
// Objective-C Garbage Collection: Unsupported
//

@protocol NSCoding
- (id)initWithCoder:(NSCoder *)arg1;
- (void)encodeWithCoder:(NSCoder *)arg1;
@end

@protocol NSCopying
- (id)copyWithZone:(struct _NSZone *)arg1;
@end

@protocol NSSecureCoding <NSCoding>
+ (_Bool)supportsSecureCoding;
@end

@interface DABehaviorOptions : NSObject
{
}

+ (void)removeDAManagedDefaults:(id)arg1;
+ (_Bool)addDAManagedDefaults:(id)arg1;
+ (id)DAManagedDefaultForKey:(id)arg1;
+ (_Bool)setDAManagedDefaults:(id)arg1;
+ (id)DAManagedDefaults;
+ (id)_daManagedDefaultsPath;
+ (_Bool)orphanCheckEnabled;
+ (_Bool)isEASParsingLogEnabled;
+ (int)numForgivable401s;
+ (_Bool)isAppleInternalInstall;
+ (_Bool)isCustomerInstall;
+ (double)holidayCalendarRefreshInterval;
+ (id)holidayCalendarURL;
+ (_Bool)earlyPingEnabled;
+ (_Bool)alwaysUseCalendarHomeSync;
+ (_Bool)babysitterEnabled;
+ (_Bool)isInHoldingPattern;
+ (_Bool)sendMeCardEverywhere;
+ (_Bool)writeOutBrokenCancelationRequests;
+ (_Bool)completelyIgnoreNotes;
+ (_Bool)allIMAPServersSupportNotesSearch;
+ (id)APSEnv;
+ (_Bool)CFNetworkLogging;
+ (_Bool)perfLogging;
+ (_Bool)useThunderhillBetaServers;
+ (_Bool)compressRequests;
+ (_Bool)promptForAllCerts;
+ (_Bool)calDAVRemindersForAll;
+ (_Bool)cookiesEnabled;
+ (_Bool)_shouldForceCookies:(_Bool *)arg1;
+ (id)whitelistedEASProtocols;
+ (double)defaultDAVProbeTimeout;
+ (double)defaultEASTaskTimeoutOutWasFound:(_Bool *)arg1;
+ (_Bool)ignoreBadLDAPCerts;
+ (int)refreshThrottleTime;
+ (_Bool)ignoreSupportedCommands;
+ (void)initialize;
+ (void)_startListeningForNotifications;

@end

@interface DAContactSearchResultElement : NSObject <NSSecureCoding>
{
    NSString *_displayName;
    NSString *_firstName;
    NSString *_lastName;
    NSString *_emailAddress;
    NSString *_workPhone;
    NSString *_mobilePhone;
    NSString *_company;
    NSString *_title;
    NSString *_homePhone;
    NSString *_alias;
    NSString *_office;
    NSString *_serverSource;
    NSString *_recordName;
    NSString *_faxPhone;
    NSString *_department;
    NSString *_street;
    NSString *_city;
    NSString *_state;
    NSString *_zip;
    NSString *_country;
    NSData *_jpegPhoto;
    NSString *_imService;
    NSString *_imUsername;
    NSString *_uri;
    NSString *_buildingName;
    NSString *_appleFloor;
    NSString *_pagerNumber;
    NSString *_postalAddress;
    NSString *_homePostalAddress;
    NSString *_principalPath;
    NSString *_preferredUserAddress;
    NSArray *_cuAddresses;
    NSString *_iPhone;
    NSString *_mainPhone;
    NSString *_workFaxPhone;
    NSString *_identifierOnServer;
}

+ (_Bool)supportsSecureCoding;
@property(retain, nonatomic) NSString *identifierOnServer; // @synthesize identifierOnServer=_identifierOnServer;
@property(copy, nonatomic) NSString *workFaxPhone; // @synthesize workFaxPhone=_workFaxPhone;
@property(copy, nonatomic) NSString *mainPhone; // @synthesize mainPhone=_mainPhone;
@property(copy, nonatomic) NSString *iPhone; // @synthesize iPhone=_iPhone;
@property(copy, nonatomic) NSArray *cuAddresses; // @synthesize cuAddresses=_cuAddresses;
@property(copy, nonatomic) NSString *preferredUserAddress; // @synthesize preferredUserAddress=_preferredUserAddress;
@property(copy, nonatomic) NSString *principalPath; // @synthesize principalPath=_principalPath;
@property(copy, nonatomic) NSString *homePostalAddress; // @synthesize homePostalAddress=_homePostalAddress;
@property(copy, nonatomic) NSString *postalAddress; // @synthesize postalAddress=_postalAddress;
@property(copy, nonatomic) NSString *pagerNumber; // @synthesize pagerNumber=_pagerNumber;
@property(copy, nonatomic) NSString *appleFloor; // @synthesize appleFloor=_appleFloor;
@property(copy, nonatomic) NSString *buildingName; // @synthesize buildingName=_buildingName;
@property(copy, nonatomic) NSString *uri; // @synthesize uri=_uri;
@property(copy, nonatomic) NSString *imUsername; // @synthesize imUsername=_imUsername;
@property(copy, nonatomic) NSString *imService; // @synthesize imService=_imService;
@property(copy, nonatomic) NSData *jpegPhoto; // @synthesize jpegPhoto=_jpegPhoto;
@property(copy, nonatomic) NSString *country; // @synthesize country=_country;
@property(copy, nonatomic) NSString *zip; // @synthesize zip=_zip;
@property(copy, nonatomic) NSString *state; // @synthesize state=_state;
@property(copy, nonatomic) NSString *city; // @synthesize city=_city;
@property(copy, nonatomic) NSString *street; // @synthesize street=_street;
@property(copy, nonatomic) NSString *department; // @synthesize department=_department;
@property(copy, nonatomic) NSString *faxPhone; // @synthesize faxPhone=_faxPhone;
@property(copy, nonatomic) NSString *recordName; // @synthesize recordName=_recordName;
@property(copy, nonatomic) NSString *serverSource; // @synthesize serverSource=_serverSource;
@property(copy, nonatomic) NSString *office; // @synthesize office=_office;
@property(copy, nonatomic) NSString *alias; // @synthesize alias=_alias;
@property(copy, nonatomic) NSString *homePhone; // @synthesize homePhone=_homePhone;
@property(copy, nonatomic) NSString *title; // @synthesize title=_title;
@property(copy, nonatomic) NSString *company; // @synthesize company=_company;
@property(copy, nonatomic) NSString *mobilePhone; // @synthesize mobilePhone=_mobilePhone;
@property(copy, nonatomic) NSString *workPhone; // @synthesize workPhone=_workPhone;
@property(copy, nonatomic) NSString *emailAddress; // @synthesize emailAddress=_emailAddress;
@property(copy, nonatomic) NSString *lastName; // @synthesize lastName=_lastName;
@property(copy, nonatomic) NSString *firstName; // @synthesize firstName=_firstName;
@property(copy, nonatomic) NSString *displayName; // @synthesize displayName=_displayName;
- (void).cxx_destruct;
- (id)initWithCoder:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (_Bool)isEqual:(id)arg1;
- (_Bool)isEqualToDAContactSearchResultElement:(id)arg1;
- (id)description;

@end

@interface DASearchQuery : NSObject
{
    int _timeLimit;
    int _state;
    NSString *_searchString;
    id <DASearchQueryConsumer> _consumer;
    NSString *_searchID;
    struct _NSRange _range;
}

+ (id)searchQueryWithSearchString:(id)arg1 consumer:(id)arg2;
@property(nonatomic) int state; // @synthesize state=_state;
@property(copy, nonatomic) NSString *searchID; // @synthesize searchID=_searchID;
@property(nonatomic) __weak id <DASearchQueryConsumer> consumer; // @synthesize consumer=_consumer;
@property(nonatomic) int timeLimit; // @synthesize timeLimit=_timeLimit;
@property(nonatomic) struct _NSRange range; // @synthesize range=_range;
@property(copy, nonatomic) NSString *searchString; // @synthesize searchString=_searchString;
- (void).cxx_destruct;
@property(nonatomic) unsigned int maxResults;
- (id)dictionaryRepresentation;
- (void)sendFinishedToConsumerWithError:(id)arg1;
- (void)sendResultsToConsumer:(id)arg1;
- (_Bool)isQueryRunning;
- (id)initWithDictionaryRepresentation:(id)arg1 consumer:(id)arg2;
- (id)description;
- (id)initWithSearchString:(id)arg1 consumer:(id)arg2;

@end

@interface DAContactsSearchQuery : DASearchQuery
{
    _Bool _includePhotos;
    NSString *_searchBase;
    NSString *_searchScope;
}

+ (id)contactsSearchQueryWithSearchString:(id)arg1 searchBase:(id)arg2 searchScope:(id)arg3 consumer:(id)arg4;
@property(nonatomic) _Bool includePhotos; // @synthesize includePhotos=_includePhotos;
@property(copy, nonatomic) NSString *searchScope; // @synthesize searchScope=_searchScope;
@property(copy, nonatomic) NSString *searchBase; // @synthesize searchBase=_searchBase;
- (void).cxx_destruct;
- (id)dictionaryRepresentation;
- (id)initWithDictionaryRepresentation:(id)arg1 consumer:(id)arg2;
- (id)initWithSearchString:(id)arg1 searchBase:(id)arg2 searchScope:(id)arg3 consumer:(id)arg4;

@end

@interface DADAMContainerIDCacheKey : NSObject <NSCopying>
{
    NSString *_accountID;
    long long _dataclass;
}

@property(readonly, nonatomic) long long dataclass; // @synthesize dataclass=_dataclass;
@property(readonly, nonatomic) NSString *accountID; // @synthesize accountID=_accountID;
- (void).cxx_destruct;
- (id)description;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (unsigned long long)hash;
- (_Bool)isEqual:(id)arg1;
- (id)initWithAccountID:(id)arg1 andDataclass:(long long)arg2;

@end

@interface DADConnection : NSObject
{
    NSObject<OS_xpc_object> *_conn;
    NSObject<OS_dispatch_queue> *_muckingWithConn;
    NSObject<OS_dispatch_queue> *_muckingWithInFlightCollections;
    NSMutableSet *_accountIdsWithAlreadyResetCerts;
    NSMutableSet *_accountIdsWithAlreadyResetThrottleTimers;
    CDUnknownBlockType _statusReportBlock;
    NSMutableDictionary *_inFlightSearchQueries;
    NSMutableDictionary *_inFlightFolderChanges;
    NSMutableDictionary *_inFlightAttachmentDownloads;
    NSMutableDictionary *_inFlightCalendarAvailabilityRequests;
    NSMutableDictionary *_inFlightCalendarDirectorySearches;
    NSMutableDictionary *_inFlightShareRequests;
    NSMutableDictionary *_inFlightOofSettingsRequests;
}

+ (void)setShouldIgnoreAccountChanges;
+ (id)sharedConnectionIfServerIsRunning;
+ (id)sharedConnection;
- (void).cxx_destruct;
- (void)_dispatchMessage:(id)arg1;
- (void)_registerForAppResumedNotification;
- (void)resetTimersAndWarnings;
- (void)_resetThrottleTimersForAccountId:(id)arg1;
- (void)_resetCertWarningsForAccountId:(id)arg1 andDataclasses:(long long)arg2 isUserRequested:(_Bool)arg3;
- (void)dealloc;
- (id)_init;
- (id)init;
- (void)externalIdentificationForAccountID:(id)arg1 resultsBlock:(CDUnknownBlockType)arg2;
- (void)_calendarDirectorySearchFinished:(id)arg1;
- (void)_calendarDirectorySearchReturnedResults:(id)arg1;
- (void)cancelCalendarDirectorySearchWithID:(id)arg1;
- (id)performCalendarDirectorySearchWithAccountID:(id)arg1 terms:(id)arg2 recordTypes:(id)arg3 resultLimit:(unsigned long long)arg4 resultsBlock:(CDUnknownBlockType)arg5 completionBlock:(CDUnknownBlockType)arg6;
- (void)_calendarAvailabilityRequestFinished:(id)arg1;
- (void)_calendarAvailabilityRequestReturnedResults:(id)arg1;
- (void)cancelCalendarAvailabilityRequestWithID:(id)arg1;
- (id)requestCalendarAvailabilityWithAccountID:(id)arg1 startDate:(id)arg2 endDate:(id)arg3 ignoredEventID:(id)arg4 addresses:(id)arg5 resultsBlock:(CDUnknownBlockType)arg6 completionBlock:(CDUnknownBlockType)arg7;
- (_Bool)isOofSettingsSupportedForAccountWithID:(id)arg1;
- (_Bool)updateOofSettingsRequest:(id)arg1 forAccountWithID:(id)arg2;
- (_Bool)retrieveOofSettingsRequest:(id)arg1 forAccountWithID:(id)arg2;
- (_Bool)_performOofSettingsRequest:(id)arg1 forAccountWithID:(id)arg2 forUpdate:(_Bool)arg3;
- (id)activeSyncDeviceIdentifier;
- (void)fillOutCurrentEASTimeZoneInfo;
- (_Bool)registerForInterrogationWithBlock:(CDUnknownBlockType)arg1;
- (void)_reallyRegisterForInterrogation;
- (id)statusReports;
- (_Bool)processFolderChange:(id)arg1 forAccountWithID:(id)arg2;
- (void)respondToSharedCalendarInvite:(long long)arg1 forCalendarWithID:(id)arg2 accountID:(id)arg3 queue:(id)arg4 completionBlock:(CDUnknownBlockType)arg5;
- (void)cancelDownloadingAttachmentWithDownloadID:(id)arg1 error:(id)arg2;
- (void)_cancelDownloadsWithIDs:(id)arg1 error:(id)arg2;
- (id)beginDownloadingAttachmentWithUUID:(id)arg1 accountID:(id)arg2 queue:(id)arg3 progressBlock:(CDUnknownBlockType)arg4 completionBlock:(CDUnknownBlockType)arg5;
- (void)_sendSynchronousXPCMessageWithParameters:(id)arg1 handlerBlock:(CDUnknownBlockType)arg2;
- (void)handleURL:(id)arg1;
- (void)reportFolderItemsSyncSuccess:(_Bool)arg1 forFolderWithID:(id)arg2 withItemsCount:(unsigned long long)arg3 andAccountWithID:(id)arg4;
- (_Bool)setFolderIdsThatExternalClientsCareAboutAdded:(id)arg1 deleted:(id)arg2 foldersTag:(id)arg3 forAccountID:(id)arg4;
- (_Bool)processMeetingRequests:(id)arg1 deliveryIdsToClear:(id)arg2 deliveryIdsToSoftClear:(id)arg3 inFolderWithId:(id)arg4 forAccountWithId:(id)arg5;
- (void)cancelServerContactsSearch:(id)arg1;
- (_Bool)performServerContactsSearch:(id)arg1 forAccountWithID:(id)arg2;
- (_Bool)updateContentsOfAllFoldersForAccountID:(id)arg1 andDataclass:(long long)arg2;
- (_Bool)updateContentsOfFoldersWithKeys:(id)arg1 forAccountID:(id)arg2 andDataclass:(long long)arg3;
- (_Bool)updateFolderListForAccountID:(id)arg1 andDataclasses:(long long)arg2;
- (_Bool)updateContentsOfAllFoldersForAccountID:(id)arg1 andDataclass:(long long)arg2 isUserRequested:(_Bool)arg3;
- (_Bool)updateContentsOfAllFoldersForAccountID:(id)arg1 andDataclasses:(long long)arg2 isUserRequested:(_Bool)arg3;
- (_Bool)updateContentsOfFoldersWithKeys:(id)arg1 forAccountID:(id)arg2 andDataclass:(long long)arg3 isUserRequested:(_Bool)arg4;
- (_Bool)updateContentsOfFoldersWithKeys:(id)arg1 forAccountID:(id)arg2 andDataclasses:(long long)arg3 isUserRequested:(_Bool)arg4;
- (_Bool)updateFolderListForAccountID:(id)arg1 andDataclasses:(long long)arg2 isUserRequested:(_Bool)arg3;
- (_Bool)updateFolderListForAccountID:(id)arg1 andDataclasses:(long long)arg2 requireChangedFolders:(_Bool)arg3 isUserRequested:(_Bool)arg4;
- (void)requestDaemonShutdown;
- (void)removeStoresForAccountWithID:(id)arg1;
- (void)_requestDaemonStopMonitoringAgents_Sync;
- (void)requestDaemonStartMonitoringAgents_Sync;
- (void)requestDaemonStopMonitoringAgents;
- (void)requestDaemonStartMonitoringAgents;
- (void)_requestDaemonChangeAgentMonitoringStatus:(_Bool)arg1 waitForReply:(_Bool)arg2;
- (id)currentPolicyKeyForAccountID:(id)arg1;
- (_Bool)requestPolicyUpdateForAccountID:(id)arg1;
- (_Bool)stopWatchingFoldersWithKeys:(id)arg1 forAccountID:(id)arg2;
- (_Bool)suspendWatchingFoldersWithKeys:(id)arg1 forAccountID:(id)arg2;
- (_Bool)resumeWatchingFoldersWithKeys:(id)arg1 forAccountID:(id)arg2;
- (_Bool)watchFoldersWithKeys:(id)arg1 forAccountID:(id)arg2;
- (void)_oofSettingsRequestsFinished:(id)arg1;
- (void)_shareResponseFinished:(id)arg1;
- (void)_downloadFinished:(id)arg1;
- (void)_downloadProgress:(id)arg1;
- (void)_getStatusReportsFromClient:(id)arg1;
- (void)_folderChangeFinished:(id)arg1;
- (void)_serverContactsSearchQueryFinished:(id)arg1;
- (void)_logDataAccessStatus:(id)arg1;
- (void)_foldersUpdated:(id)arg1;
- (void)_policyKeyChanged:(id)arg1;
- (id)decodedErrorFromData:(id)arg1;
- (id)_createReplyToRequest:(id)arg1 withProperties:(id)arg2;
- (id)_connection;
- (void)_serverDiedWithReason:(id)arg1;
- (void)_tearDownInFlightObjects;

@end

@interface DADisableableObject : NSObject
{
    _Bool _isDisabled;
}

@property(nonatomic) _Bool isDisabled; // @synthesize isDisabled=_isDisabled;
- (void)disable;

@end

@interface DADownloadContext : NSObject
{
    NSString *_attachmentUUID;
    NSString *_accountID;
    NSObject<OS_dispatch_queue> *_queue;
    CDUnknownBlockType _progressBlock;
    CDUnknownBlockType _completionBlock;
}

@property(readonly, copy, nonatomic) CDUnknownBlockType completionBlock; // @synthesize completionBlock=_completionBlock;
@property(readonly, copy, nonatomic) CDUnknownBlockType progressBlock; // @synthesize progressBlock=_progressBlock;
@property(readonly, nonatomic) NSObject<OS_dispatch_queue> *queue; // @synthesize queue=_queue;
@property(readonly, nonatomic) NSString *accountID; // @synthesize accountID=_accountID;
@property(readonly, nonatomic) NSString *attachmentUUID; // @synthesize attachmentUUID=_attachmentUUID;
- (void).cxx_destruct;
- (void)finishedWithError:(id)arg1;
- (void)updateProgressDownloadedByteCount:(long long)arg1 totalByteCount:(long long)arg2;
- (id)initWithAttachmentUUID:(id)arg1 accountID:(id)arg2 queue:(id)arg3 downloadProgressBlock:(CDUnknownBlockType)arg4 completionBlock:(CDUnknownBlockType)arg5;

@end

@interface DAECalendarAvailabilityContext : NSObject
{
    CDUnknownBlockType _resultsBlock;
    CDUnknownBlockType _completionBlock;
}

- (void).cxx_destruct;
- (void)finishedWithError:(id)arg1;
- (void)resultsReturned:(id)arg1;
- (id)initWithResultsBlock:(CDUnknownBlockType)arg1 completionBlock:(CDUnknownBlockType)arg2;

@end

@interface DAECalendarAvailabilitySpan : NSObject <NSSecureCoding>
{
    long long _type;
    NSDate *_startDate;
    NSDate *_endDate;
}

+ (_Bool)supportsSecureCoding;
@property(readonly, nonatomic) NSDate *endDate; // @synthesize endDate=_endDate;
@property(readonly, nonatomic) NSDate *startDate; // @synthesize startDate=_startDate;
@property(readonly, nonatomic) long long type; // @synthesize type=_type;
- (void).cxx_destruct;
- (void)encodeWithCoder:(id)arg1;
- (id)initWithCoder:(id)arg1;
- (id)description;
- (id)initWithStartDate:(id)arg1 endDate:(id)arg2 type:(long long)arg3;
- (id)init;

@end

@interface DAECalendarDirectorySearchContext : NSObject
{
    CDUnknownBlockType _resultsBlock;
    CDUnknownBlockType _completionBlock;
}

- (void).cxx_destruct;
- (void)finishedWithError:(id)arg1 exceededResultLimit:(_Bool)arg2;
- (void)resultsReturned:(id)arg1;
- (id)initWithResultsBlock:(CDUnknownBlockType)arg1 completionBlock:(CDUnknownBlockType)arg2;

@end

@interface DAECalendarDirectorySearchResult : NSObject <NSSecureCoding>
{
    NSString *_displayName;
    NSString *_preferredAddress;
}

+ (_Bool)supportsSecureCoding;
@property(retain, nonatomic) NSString *preferredAddress; // @synthesize preferredAddress=_preferredAddress;
@property(retain, nonatomic) NSString *displayName; // @synthesize displayName=_displayName;
- (void).cxx_destruct;
- (void)encodeWithCoder:(id)arg1;
- (id)initWithCoder:(id)arg1;
- (id)description;

@end

@interface DAFolderChange : NSObject <NSSecureCoding>
{
    _Bool _renameOnCollision;
    unsigned int _taskId;
    long long _changeType;
    NSString *_folderId;
    NSString *_parentFolderId;
    NSString *_displayName;
    long long _dataclass;
    id <DAFolderChangeConsumer> _consumer;
}

+ (_Bool)supportsSecureCoding;
@property(nonatomic) __weak id <DAFolderChangeConsumer> consumer; // @synthesize consumer=_consumer;
@property(nonatomic) _Bool renameOnCollision; // @synthesize renameOnCollision=_renameOnCollision;
@property(nonatomic) unsigned int taskId; // @synthesize taskId=_taskId;
@property(nonatomic) long long dataclass; // @synthesize dataclass=_dataclass;
@property(retain, nonatomic) NSString *displayName; // @synthesize displayName=_displayName;
@property(retain, nonatomic) NSString *parentFolderId; // @synthesize parentFolderId=_parentFolderId;
@property(retain, nonatomic) NSString *folderId; // @synthesize folderId=_folderId;
@property(nonatomic) long long changeType; // @synthesize changeType=_changeType;
- (void).cxx_destruct;
- (void)encodeWithCoder:(id)arg1;
- (id)initWithCoder:(id)arg1;
- (id)description;
- (id)initFolderChangeWithChangeType:(long long)arg1 folderId:(id)arg2 parentFolderId:(id)arg3 displayName:(id)arg4 dataclass:(long long)arg5 consumer:(id)arg6;

@end

@interface DAMailboxSearchQuery : DASearchQuery
{
    _Bool _allOrNone;
    _Bool _deepTraversal;
    _Bool _rebuildResults;
    int _bodyType;
    int _MIMESupport;
    NSString *_collectionID;
    long long _truncationSize;
    NSDate *_priorToDate;
}

+ (id)mailboxSearchQueryWithSearchString:(id)arg1 consumer:(id)arg2;
@property(nonatomic) _Bool rebuildResults; // @synthesize rebuildResults=_rebuildResults;
@property(nonatomic) _Bool deepTraversal; // @synthesize deepTraversal=_deepTraversal;
@property(nonatomic) int MIMESupport; // @synthesize MIMESupport=_MIMESupport;
@property(retain, nonatomic) NSDate *priorToDate; // @synthesize priorToDate=_priorToDate;
@property(nonatomic) _Bool allOrNone; // @synthesize allOrNone=_allOrNone;
@property(nonatomic) long long truncationSize; // @synthesize truncationSize=_truncationSize;
@property(nonatomic) int bodyType; // @synthesize bodyType=_bodyType;
@property(retain, nonatomic) NSString *collectionID; // @synthesize collectionID=_collectionID;
- (void).cxx_destruct;
- (id)dictionaryRepresentation;
- (id)initWithDictionaryRepresentation:(id)arg1 consumer:(id)arg2;
- (id)initWithSearchString:(id)arg1 consumer:(id)arg2;

@end

@interface DAOofParams : NSObject
{
    int _oofState;
    int _externalState;
    NSDate *_startTime;
    NSDate *_endTime;
    NSString *_message;
    NSString *_externalMessage;
}

@property(retain, nonatomic) NSString *externalMessage; // @synthesize externalMessage=_externalMessage;
@property(nonatomic) int externalState; // @synthesize externalState=_externalState;
@property(retain, nonatomic) NSString *message; // @synthesize message=_message;
@property(retain, nonatomic) NSDate *endTime; // @synthesize endTime=_endTime;
@property(retain, nonatomic) NSDate *startTime; // @synthesize startTime=_startTime;
@property(nonatomic) int oofState; // @synthesize oofState=_oofState;
- (void).cxx_destruct;
- (void)enableOof:(_Bool)arg1 From:(id)arg2 to:(id)arg3 withMessage:(id)arg4;
- (_Bool)isEnabled;
- (id)dictionaryRepresentationForASSettingTask;
- (id)dictionaryRepresentation;
- (id)initWithDictionary:(id)arg1;
- (id)description;

@end

@interface DAOofSettingsInfo : DAOofParams
{
    NSString *_requestID;
    id <DAOofResponseDelegate> _consumer;
}

@property(nonatomic) __weak id <DAOofResponseDelegate> consumer; // @synthesize consumer=_consumer;
@property(retain, nonatomic) NSString *requestID; // @synthesize requestID=_requestID;
- (void).cxx_destruct;

@end

@interface DASharedCalendarContext : NSObject
{
    _Bool _shouldSyncCalendar;
    NSString *_calendarID;
    NSString *_accountID;
    NSObject<OS_dispatch_queue> *_queue;
    CDUnknownBlockType _completionBlock;
}

@property(nonatomic) _Bool shouldSyncCalendar; // @synthesize shouldSyncCalendar=_shouldSyncCalendar;
@property(readonly, copy, nonatomic) CDUnknownBlockType completionBlock; // @synthesize completionBlock=_completionBlock;
@property(readonly, nonatomic) NSObject<OS_dispatch_queue> *queue; // @synthesize queue=_queue;
@property(readonly, nonatomic) NSString *accountID; // @synthesize accountID=_accountID;
@property(readonly, nonatomic) NSString *calendarID; // @synthesize calendarID=_calendarID;
- (void).cxx_destruct;
- (void)finishedWithError:(id)arg1;
- (id)initWithCalendarID:(id)arg1 accountID:(id)arg2 queue:(id)arg3 completionBlock:(CDUnknownBlockType)arg4;

@end

@interface DAStatusReport : NSObject
{
    _Bool _syncingAllowed;
    int _numHBIDataPoints;
    NSString *_persistentUUID;
    NSString *_displayName;
    NSString *_accountType;
    NSNumber *_timeSpan;
    NSNumber *_timeInNetworking;
    NSNumber *_averageHBI;
    NSNumber *_successfulRequests;
    NSNumber *_failedNetworkRequests;
    NSNumber *_failedProtocolRequests;
    NSNumber *_downloadedElements;
    NSNumber *_uploadedElements;
    NSNumber *_falseMoreAvailableCount;
    NSString *_protocolVersion;
    NSDate *_creationDate;
}

@property(nonatomic) int numHBIDataPoints; // @synthesize numHBIDataPoints=_numHBIDataPoints;
@property(retain, nonatomic) NSDate *creationDate; // @synthesize creationDate=_creationDate;
@property(nonatomic) _Bool syncingAllowed; // @synthesize syncingAllowed=_syncingAllowed;
@property(retain, nonatomic) NSString *protocolVersion; // @synthesize protocolVersion=_protocolVersion;
@property(retain, nonatomic) NSNumber *falseMoreAvailableCount; // @synthesize falseMoreAvailableCount=_falseMoreAvailableCount;
@property(retain, nonatomic) NSNumber *uploadedElements; // @synthesize uploadedElements=_uploadedElements;
@property(retain, nonatomic) NSNumber *downloadedElements; // @synthesize downloadedElements=_downloadedElements;
@property(retain, nonatomic) NSNumber *failedProtocolRequests; // @synthesize failedProtocolRequests=_failedProtocolRequests;
@property(retain, nonatomic) NSNumber *failedNetworkRequests; // @synthesize failedNetworkRequests=_failedNetworkRequests;
@property(retain, nonatomic) NSNumber *successfulRequests; // @synthesize successfulRequests=_successfulRequests;
@property(retain, nonatomic) NSNumber *averageHBI; // @synthesize averageHBI=_averageHBI;
@property(retain, nonatomic) NSNumber *timeInNetworking; // @synthesize timeInNetworking=_timeInNetworking;
@property(retain, nonatomic) NSNumber *timeSpan; // @synthesize timeSpan=_timeSpan;
@property(retain, nonatomic) NSString *accountType; // @synthesize accountType=_accountType;
@property(retain, nonatomic) NSString *displayName; // @synthesize displayName=_displayName;
@property(retain, nonatomic) NSString *persistentUUID; // @synthesize persistentUUID=_persistentUUID;
- (void).cxx_destruct;
- (void)noteFalseMoreAvailableResponse;
- (void)noteTimeSpentInNetworking:(double)arg1;
- (void)noteNewHBIDataPoint:(int)arg1;
- (void)noteFailedProtocolRequest;
- (void)noteFailedNetworkRequest;
- (void)noteSuccessfulRequestWithNumDownloadedElements:(int)arg1;
- (void)noteSuccessfulRequestWithNumDownloadedElements:(int)arg1 numUploadedElements:(int)arg2;
- (id)description;
- (void)mergeStatusReport:(id)arg1;
- (id)dictionaryRepresentation;
- (id)initWithDictionaryRepresentation:(id)arg1;
- (id)init;

@end


text:
<?xml version="1.0"?>
<tool id="hyphy_relax" name="HyPhy-RELAX" version="@VERSION@+galaxy0" profile="19.09">
    <description>Detect relaxed selection in a codon-based
    phylogenetic framework</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <command detect_errors="exit_code"><![CDATA[
        ln -s '$input_file' relax_input.fa &&
        ln -s '$input_nhx' relax_input.nhx &&
        hyphy relax
            --alignment ./relax_input.fa
            --tree ./relax_input.nhx
            --models '$analysisType'
            #if $treeAnnotations == "2":
                --test TEST
                --reference REFERENCE
            #else:
                --test TEST
            #end if
            > '$relax_log'
    ]]></command>
    <inputs>
        <expand macro="inputs"/>
        <expand macro="gencode"/>
        <param argument="--model" name="analysisType" type="select" label="Analysis Type" >
            <option value="All">All</option>
            <option value="Minimal">Minimal</option>
        </param>
        <param name="treeAnnotations" type="select" label="Tree Annotations" help = "Is there one or two sets of annotated branches in the Newick file?">
            <option value="1">TEST only</option>
            <option value="2">TEST and REFERENCE</option>
        </param>
    </inputs>
    <outputs>
        <data name="relax_log" format="txt"/>
        <data name="relax_output" format="hyphy_results.json" from_work_dir="relax_input.fa.RELAX.json"/>
    </outputs>
    <tests>
        <test>
            <param name="input_file" ftype="fasta" value="relax-in1.fa"/>
            <param name="input_nhx" ftype="nhx" value="relax-in1.nhx"/>
            <output name="relax_output" file="relax-out1.json" compare="sim_size"/>
        </test>
    </tests>
    <help><![CDATA[
RELAX: a test for selection differences
=======================================

What question does this method answer?
--------------------------------------

Is there ev- idence the strength of selection has been relaxed (or conversely intensified) on a specified group of lineages (TEST)
relative to a set of reference lineages (RELAX)? Importantly, RELAX is not designed to detect diversifying selection specifically.
We note that the RELAX framework can perform both this specific hypothesis test as well as fit a suite of descriptive models which address,
or example, overall rate differences between test and reference branches or lineage-specific inferences of selection relaxation.

Recommended Applications
------------------------

1. Testing for a systematic shift (relaxation / intensification) in the distribution of selection pressure associated with major biological transitions such as hosting switching in viruses, lifestyle evolution in bacteria (i.e. transition from free-living to endosymbiotic lifestyle
2. Comparing selective regimes between two subsets of branches in the tree, e.g. to investigate selective differences due an environmental/phenotypic changes.

Brief description
-----------------

RELAX (a random effects test of selection relaxation) uses a random
effects branch-site model framework to test whether a set of 'Test'
branches evolves under relaxed selection relative to a set of
'Reference' branches (R), as measured by the relaxation parameter (K).

Input
-----

    1. A *FASTA* sequence alignment.
    2. A phylogenetic tree in the *Newick* format that is further partitioned into one or two groups (_TEST_ or _TEST_ and _REFERENCE_). See http://hyphy.org/tutorials/phylotree/

Note: the names of sequences in the alignment must match the names of the sequences in the tree.

Output
------

A JSON file with analysis results (http://hyphy.org/resources/json-fields.pdf).

A custom visualization module for viewing these results is available (see http://vision.hyphy.org/RELAX for an example)

Further reading
---------------

http://hyphy.org/methods/selection-methods/#RELAX

Tool options
------------
::

    --code             Which genetic code to use

    --model            Which type of test to run
                            All : fit 4 different models [default]
                            Minimal: only perform a 2-model test of relaxation/intensification  [faster]

    ]]></help>
    <expand macro="citations">
        <citation type="doi">10.1093/molbev/msu400</citation>
    </expand>
</tool>


text:
using System.Diagnostics;
using Xamarin.Forms;

namespace NavigationEventSequence.Views
{
    public partial class ViewA : ContentPage
    {
        public ViewA()
        {
            Debug.WriteLine("ViewA#Constructor()");
            InitializeComponent();
            Appearing += (sender, args) => Debug.WriteLine("ViewA#Appearing");
            Disappearing += (sender, args) => Debug.WriteLine("ViewA#Disappearing");
        }
    }
}


text:
#include "tensorflow/core/framework/tracking_allocator.h"

#include <unordered_map>

#include "tensorflow/core/framework/allocator.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/mem.h"
#include "tensorflow/core/platform/test.h"

namespace tensorflow {

class TestableSizeTrackingAllocator : public Allocator {
 public:
  string Name() override { return "test"; }
  void* AllocateRaw(size_t /*alignment*/, size_t num_bytes) override {
    void* ptr = port::Malloc(num_bytes);
    size_map_[ptr] = num_bytes;
    return ptr;
  }
  void DeallocateRaw(void* ptr) override {
    const auto& iter = size_map_.find(ptr);
    EXPECT_NE(size_map_.end(), iter);
    size_map_.erase(iter);
    port::Free(ptr);
  }
  bool TracksAllocationSizes() override { return true; }
  size_t RequestedSize(void* ptr) override {
    const auto& iter = size_map_.find(ptr);
    EXPECT_NE(size_map_.end(), iter);
    return iter->second;
  }
  void GetStats(AllocatorStats* stats) override { stats->Clear(); }

 private:
  std::unordered_map<void*, size_t> size_map_;
};

class NoMemoryAllocator : public Allocator {
 public:
  string Name() override { return "test"; }
  void* AllocateRaw(size_t /*alignment*/, size_t num_bytes) override {
    return nullptr;
  }
  void DeallocateRaw(void* ptr) override {}
  bool TracksAllocationSizes() override { return true; }
  void GetStats(AllocatorStats* stats) override { stats->Clear(); }
};

TEST(TrackingAllocatorTest, SimpleNoTracking) {
  Allocator* a = cpu_allocator();

  EXPECT_FALSE(a->TracksAllocationSizes());

  // Don't enable the tracking inside the tracking allocator. Since
  // the cpu_allocator doesn't track allocations itself the tracking
  // will be partial
  TrackingAllocator* ta = new TrackingAllocator(a, false);

  void* p1 = ta->AllocateRaw(4, 4);
  ta->DeallocateRaw(p1);
  void* p2 = ta->AllocateRaw(4, 12);

  std::tuple<size_t, size_t, size_t> sizes = ta->GetSizesAndUnRef();

  EXPECT_EQ(16, std::get<0>(sizes));
  EXPECT_EQ(0, std::get<1>(sizes));
  EXPECT_EQ(0, std::get<2>(sizes));

  ta->DeallocateRaw(p2);

  // This time enable the tracking inside the tracking allocator
  ta = new TrackingAllocator(a, true);
  p1 = ta->AllocateRaw(4, 4);
  EXPECT_EQ(4, ta->RequestedSize(p1));
  EXPECT_LE(4, ta->AllocatedSize(p1));
  EXPECT_EQ(1, ta->AllocationId(p1));

  ta->DeallocateRaw(p1);
  p2 = ta->AllocateRaw(4, 12);
  EXPECT_EQ(12, ta->RequestedSize(p2));
  EXPECT_LE(12, ta->AllocatedSize(p2));
  EXPECT_EQ(2, ta->AllocationId(p2));

  sizes = ta->GetSizesAndUnRef();

  EXPECT_LE(16, std::get<0>(sizes));
  EXPECT_LE(12, std::get<1>(sizes));
  EXPECT_LE(12, std::get<2>(sizes));

  ta->DeallocateRaw(p2);
}

TEST(TrackingAllocatorTest, SimpleTracking) {
  TestableSizeTrackingAllocator a = TestableSizeTrackingAllocator();

  EXPECT_TRUE(a.TracksAllocationSizes());

  TrackingAllocator* ta = new TrackingAllocator(&a, false);

  void* p1 = ta->AllocateRaw(4, 12);
  ta->DeallocateRaw(p1);
  void* p2 = ta->AllocateRaw(4, 4);

  std::tuple<size_t, size_t, size_t> sizes = ta->GetSizesAndUnRef();

  EXPECT_EQ(16, std::get<0>(sizes));
  EXPECT_EQ(12, std::get<1>(sizes));
  EXPECT_EQ(4, std::get<2>(sizes));

  ta->DeallocateRaw(p2);
}

TEST(TrackingAllocatorTest, OutOfMemory) {
  NoMemoryAllocator a;

  EXPECT_TRUE(a.TracksAllocationSizes());

  TrackingAllocator* ta = new TrackingAllocator(&a, false);

  void* p1 = ta->AllocateRaw(4, 12);
  EXPECT_EQ(nullptr, p1);

  std::tuple<size_t, size_t, size_t> sizes = ta->GetSizesAndUnRef();

  EXPECT_EQ(0, std::get<0>(sizes));
  EXPECT_EQ(0, std::get<1>(sizes));
  EXPECT_EQ(0, std::get<2>(sizes));
}

TEST(TrackingAllocatorTest, FreeNullPtr) {
  NoMemoryAllocator a;

  EXPECT_TRUE(a.TracksAllocationSizes());

  TrackingAllocator* ta = new TrackingAllocator(&a, false);

  ta->DeallocateRaw(nullptr);

  std::tuple<size_t, size_t, size_t> sizes = ta->GetSizesAndUnRef();

  EXPECT_EQ(0, std::get<0>(sizes));
  EXPECT_EQ(0, std::get<1>(sizes));
  EXPECT_EQ(0, std::get<2>(sizes));
}

}  // namespace tensorflow


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="eu.long1.spacetablayoutdemo.FragmentB">

    <!-- TODO: Update blank fragment layout -->
    <ImageView
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:src="@drawable/ic_keyboard_capslock_black_24dp" />

</RelativeLayout>


text:
import React, {PropTypes, Component} from 'react';

export default class StackedBar extends Component {

  static propTypes = {
    width: PropTypes.number,
    height: PropTypes.number,
    x: PropTypes.number,
    y: PropTypes.number
  }

  static defaultProps = {
    width: 0,
    height: 0,
    x: 0,
    y: 0
  }

  constructor(props) {
    super(props);
  }

  render() {
    return (
      <rect fill={this.props.color}
        width={this.props.width} height={this.props.height}
        x={this.props.x} y={this.props.y} />
    );
  }
}


text:
from django.db.backends import BaseDatabaseIntrospection

# This light wrapper "fakes" a dictionary interface, because some SQLite data
# types include variables in them -- e.g. "varchar(30)" -- and can't be matched
# as a simple dictionary lookup.
class FlexibleFieldLookupDict:
    # Maps SQL types to Django Field types. Some of the SQL types have multiple
    # entries here because SQLite allows for anything and doesn't normalize the
    # field type; it uses whatever was given.
    base_data_types_reverse = {
        'bool': 'BooleanField',
        'boolean': 'BooleanField',
        'smallint': 'SmallIntegerField',
        'smallint unsigned': 'PositiveSmallIntegerField',
        'smallinteger': 'SmallIntegerField',
        'int': 'IntegerField',
        'integer': 'IntegerField',
        'integer unsigned': 'PositiveIntegerField',
        'decimal': 'DecimalField',
        'real': 'FloatField',
        'text': 'TextField',
        'char': 'CharField',
        'date': 'DateField',
        'datetime': 'DateTimeField',
        'time': 'TimeField',
    }

    def __getitem__(self, key):
        key = key.lower()
        try:
            return self.base_data_types_reverse[key]
        except KeyError:
            import re
            m = re.search(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$', key)
            if m:
                return ('CharField', {'max_length': int(m.group(1))})
            raise KeyError

class DatabaseIntrospection(BaseDatabaseIntrospection):
    data_types_reverse = FlexibleFieldLookupDict()

    def get_table_list(self, cursor):
        "Returns a list of table names in the current database."
        # Skip the sqlite_sequence system table used for autoincrement key
        # generation.
        cursor.execute("""
            SELECT name FROM sqlite_master
            WHERE type='table' AND NOT name='sqlite_sequence'
            ORDER BY name""")
        return [row[0] for row in cursor.fetchall()]

    def get_table_description(self, cursor, table_name):
        "Returns a description of the table, with the DB-API cursor.description interface."
        return [(info['name'], info['type'], None, None, None, None,
                 info['null_ok']) for info in self._table_info(cursor, table_name)]

    def get_relations(self, cursor, table_name):
        raise NotImplementedError

    def get_indexes(self, cursor, table_name):
        """
        Returns a dictionary of fieldname -> infodict for the given table,
        where each infodict is in the format:
            {'primary_key': boolean representing whether it's the primary key,
             'unique': boolean representing whether it's a unique index}
        """
        indexes = {}
        for info in self._table_info(cursor, table_name):
            indexes[info['name']] = {'primary_key': info['pk'] != 0,
                                     'unique': False}
        cursor.execute('PRAGMA index_list(%s)' % self.connection.ops.quote_name(table_name))
        # seq, name, unique
        for index, unique in [(field[1], field[2]) for field in cursor.fetchall()]:
            if not unique:
                continue
            cursor.execute('PRAGMA index_info(%s)' % self.connection.ops.quote_name(index))
            info = cursor.fetchall()
            # Skip indexes across multiple fields
            if len(info) != 1:
                continue
            name = info[0][2] # seqno, cid, name
            indexes[name]['unique'] = True
        return indexes

    def _table_info(self, cursor, name):
        cursor.execute('PRAGMA table_info(%s)' % self.connection.ops.quote_name(name))
        # cid, name, type, notnull, dflt_value, pk
        return [{'name': field[1],
                 'type': field[2],
                 'null_ok': not field[3],
                 'pk': field[5]     # undocumented
                 } for field in cursor.fetchall()]


text:
import { computed } from "@ember/object";
import attr from "ember-data/attr";
import Model from "ember-data/model";

// noinspection JSValidateTypes
export default Model.extend( /** @class TwitchTeam */ {
	// Avoid defining hasMany relationships:
	// We want to query the Twitch{Stream,User} data ourselves in the Team{Index,Members}Route,
	// so we can query the API in chunks via the infinite scroll mechanism.
	// The TwitchTeamSerializer will turn the "users" payload property into a list of user IDs.
	/** @type {string[]} */
	users: attr(),

	/** @type {string} */
	background_image_url: attr( "string" ),
	/** @type {string} */
	banner: attr( "string" ),
	/** @type {Date} */
	created_at: attr( "date" ),
	/** @type {Date} */
	updated_at: attr( "date" ),
	/** @type {string} */
	info: attr( "string" ),
	/** @type {string} */
	thumbnail_url: attr( "string" ),
	/** @type {string} */
	team_name: attr( "string" ),
	/** @type {string} */
	team_display_name: attr( "string" ),

	/** @type {string} */
	title: computed(
		"team_name",
		"team_display_name",
		/** @this {TwitchTeam} */
		function() {
			return this.team_display_name || this.team_name;
		}
	)

}).reopenClass({
	toString() { return "helix/teams"; }
});


text:
@interface NGGameUtil : NSObject

+ (UIImage *)screenshot:(UIView*)view;

@end


text:
const projectRoot = process.cwd();
const sourceRoot = `${projectRoot}/src`;

module.exports = {
  verbose: false,

  routes: sourceRoot + '/views/routes.js',

  apiRoutes: sourceRoot + '/api/routes',

  hapiExtensions: sourceRoot + '/api/extensions',

  html: {
    head: sourceRoot + '/views/_app/Head.js'
  }
};


text:
		is_null($id) and Response::redirect('<?php echo $uri ?>');

		if ( ! $data['<?php echo $singular_name ?>'] = Model_<?php echo $model_name ?>::find($id))
		{
			Session::set_flash('error', 'Could not find <?php echo $singular_name; ?> #'.$id);
			Response::redirect('<?php echo $uri ?>');
		}

		$this->template->title = "<?php echo ucfirst($singular_name) ?>";
		$this->template->content = View::forge('<?php echo $view_path ?>/view', $data);


text:
- http listener / flask ?
- log
- config

# pg schedule

- report
- IAM
- influxdb to pg?
- pg to influxdb

# python schedule
 redis / job executor

- label printing

# python RPC

## 模拟工位信号触发。