text:
package com.android.server;

/**
 * An exception that indicates there was a timeout with a
 * {@link NativeDaemonConnector} operation.
 */
public class NativeDaemonTimeoutException extends NativeDaemonConnectorException {
    public NativeDaemonTimeoutException(String command, NativeDaemonEvent event) {
        super(command, event);
    }
}


text:
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
 *
 *  (C) 2001 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */

#include "mpiimpl.h"

MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING;

redpajama_set_name: RedPajamaGithub


text:
import os
import uuid
import time

from pycompss.api.task import task
from pycompss.api.parameter import *

# Constant values
NUM_FILES = 10
TEST_PATH = "/tmp/file_stream_python/"
BASE_FILE_NAME = "file"

# Task definitions

@task(fds=STREAM_OUT, sleep=IN)
def write_files(fds, sleep):
    for i in range(NUM_FILES):
        # Build file name
        file_name = BASE_FILE_NAME + str(uuid.uuid4())
        file_path = os.path.join(TEST_PATH, file_name)

        # Write file
        print("Writing file: " + str(file_path))
        with open(file_path, 'w') as f:
            f.write("Test " + str(i))

        # Sleep between generated files
        time.sleep(sleep)

    # Mark the stream for closure
    fds.close()

@task(fds=STREAM_IN, sleep=IN, returns=int)
def read_files(fds, sleep):
    num_total = 0
    while not fds.is_closed():
        # Poll new files
        print("Polling files")
        new_files = fds.poll()

        # Process files
        for nf in new_files:
            print("RECEIVED FILE: " + str(nf))
            with open(nf, 'r') as f:
                print (f.read())

        # Accumulate read files
        num_total = num_total + len(new_files)

        # Sleep between requests
        time.sleep(sleep)

    # Return the number of processed files
    return num_total

@task(file_path=FILE_IN, returns=int)
def process_file(file_path):
    print("RECEIVED FILE: " + str(file_path))
    with open(file_path, 'r') as f:
        print (f.read())

    return 1


text:
package com.hazelcast.collection.impl.set;

import com.hazelcast.collection.impl.collection.CollectionContainer;
import com.hazelcast.collection.impl.collection.CollectionService;
import com.hazelcast.collection.impl.set.operations.SetReplicationOperation;
import com.hazelcast.collection.impl.txnset.TransactionalSetProxy;
import com.hazelcast.config.SetConfig;
import com.hazelcast.core.DistributedObject;
import com.hazelcast.spi.NodeEngine;
import com.hazelcast.spi.Operation;
import com.hazelcast.spi.PartitionReplicationEvent;
import com.hazelcast.transaction.impl.Transaction;
import com.hazelcast.util.ConstructorFunction;
import com.hazelcast.util.ContextMutexFactory;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import static com.hazelcast.util.ConcurrencyUtil.getOrPutSynchronized;

public class SetService extends CollectionService {

    public static final String SERVICE_NAME = "hz:impl:setService";

    private static final Object NULL_OBJECT = new Object();

    private final ConcurrentMap<String, SetContainer> containerMap = new ConcurrentHashMap<String, SetContainer>();

    private final ConcurrentMap<String, Object> quorumConfigCache = new ConcurrentHashMap<String, Object>();
    private final ContextMutexFactory quorumConfigCacheMutexFactory = new ContextMutexFactory();
    private final ConstructorFunction<String, Object> quorumConfigConstructor = new ConstructorFunction<String, Object>() {
        @Override
        public Object createNew(String name) {
            SetConfig lockConfig = nodeEngine.getConfig().findSetConfig(name);
            String quorumName = lockConfig.getQuorumName();
            return quorumName == null ? NULL_OBJECT : quorumName;
        }
    };

    public SetService(NodeEngine nodeEngine) {
        super(nodeEngine);
    }

    @Override
    public SetContainer getOrCreateContainer(String name, boolean backup) {
        SetContainer container = containerMap.get(name);
        if (container == null) {
            container = new SetContainer(name, nodeEngine);
            final SetContainer current = containerMap.putIfAbsent(name, container);
            if (current != null) {
                container = current;
            }
        }
        return container;
    }

    @Override
    public ConcurrentMap<String, ? extends CollectionContainer> getContainerMap() {
        return containerMap;
    }

    @Override
    public String getServiceName() {
        return SERVICE_NAME;
    }

    @Override
    public DistributedObject createDistributedObject(String objectId) {
        return new SetProxyImpl(objectId, nodeEngine, this);
    }

    @Override
    public void destroyDistributedObject(String name) {
        super.destroyDistributedObject(name);
        quorumConfigCache.remove(name);
    }

    @Override
    public TransactionalSetProxy createTransactionalObject(String name, Transaction transaction) {
        return new TransactionalSetProxy(name, transaction, nodeEngine, this);
    }

    @Override
    public Operation prepareReplicationOperation(PartitionReplicationEvent event) {
        final Map<String, CollectionContainer> migrationData = getMigrationData(event);
        return migrationData.isEmpty()
                ? null
                : new SetReplicationOperation(migrationData, event.getPartitionId(), event.getReplicaIndex());
    }

    @Override
    public String getQuorumName(final String name) {
        Object quorumName = getOrPutSynchronized(quorumConfigCache, name, quorumConfigCacheMutexFactory,
                quorumConfigConstructor);
        return quorumName == NULL_OBJECT ? null : (String) quorumName;
    }
}


text:
<?php
namespace Swoole\Network;
class EventUDP extends \Swoole\Server\Base implements \Swoole\UDP_Server_Driver
{
    /**
     * Server Socket
     * @var unknown_type
     */
	public $server_sock;
	//最大连接数
	public $max_connect=1000;

    //客户端socket列表
	public $client_sock = array();
	//客户端数量
	public $client_num = 0;
	public $buffer_size = 1028;
	public $flags = STREAM_OOB;

	function __construct($host,$port,$timeout=30)
	{
		parent::__construct($host,$port,$timeout=30);
	}
    /**
     * 运行服务器程序
     * @return unknown_type
     */
	function run()
	{
	    //初始化事件系统
		$this->init();
		//建立服务器端Socket
		$this->server_sock = $this->create("udp://{$this->host}:{$this->port}");

		//设置事件监听,监听到服务器端socket可读,则有连接请求
		event_set($this->server_event,$this->server_sock, EV_READ | EV_PERSIST, "sw_server_handle_recvfrom",$this);
		event_base_set($this->server_event,$this->base_event);
		event_add($this->server_event);
		$this->protocol->onStart();
		event_base_loop($this->base_event);
	}
	/**
	 * 关闭服务器程序
	 * @return unknown_type
	 */
	function shutdown()
	{
	    //关闭服务器端
	    sw_socket_close($this->server_sock,$this->server_event);
	    //关闭事件循环
        event_base_loopexit($this->base_event);
        $this->protocol->onShutdown();
	}
}

function sw_server_handle_recvfrom($server_socket,$events,$server)
{
    $data = stream_socket_recvfrom($server_socket,$server->buffer_size,$server->flags, $peer);
    if($data !== false && $data !='')
	{
		$server->protocol->onData($peer,$data);
	}
}


text:
void WaterRenderer::add(const ChunkMesh &mesh)
{
    m_chunks.push_back(&mesh.getModel().getRenderInfo());
}

void WaterRenderer::render(const Camera &camera)
{
    if (m_chunks.empty()) {
        return;
    }

    glEnable(GL_BLEND);
    glDisable(GL_CULL_FACE);
    m_shader.useProgram();

    m_shader.loadProjectionViewMatrix(camera.getProjectionViewMatrix());
    m_shader.loadTime(g_timeElapsed);

    for (auto mesh : m_chunks) {
        GL::bindVAO(mesh->vao);
        GL::drawElements(mesh->indicesCount);
    }

    m_chunks.clear();
}


text:
from django.conf import settings
from django.db import models

from bulbs.content.models import Content
from bulbs.liveblog.utils import get_liveblog_author_model_name

class AbstractLiveBlog(models.Model):
    """Base mixin inherited by each property's concrete LiveBlog implementation (along with base
    content class).
    """

    pinned_content = models.ForeignKey(Content, blank=True, null=True,
                                       related_name='liveblog_pinned')
    recirc_content = models.ManyToManyField(Content, related_name='liveblog_recirc')

    class Meta:
        abstract = True

    def get_absolute_url(self):
        return '/liveblog/{}-{}'.format(self.slug, self.pk)

class LiveBlogEntry(models.Model):

    liveblog = models.ForeignKey(settings.BULBS_LIVEBLOG_MODEL, related_name='entries')

    published = models.DateTimeField(blank=True, null=True)
    authors = models.ManyToManyField(get_liveblog_author_model_name())
    headline = models.CharField(max_length=255, null=True, blank=True)
    body = models.TextField(blank=True)

    recirc_content = models.ManyToManyField(Content, related_name='liveblog_entry_recirc')

    def get_absolute_url(self):
        return '{}?entry={}'.format(self.liveblog.get_absolute_url(), self.pk)

class LiveBlogResponse(models.Model):

    entry = models.ForeignKey(LiveBlogEntry, related_name='responses')
    ordering = models.IntegerField(blank=True, null=True, default=None)

    internal_name = models.CharField(max_length=255, blank=True, null=True)
    author = models.ForeignKey(get_liveblog_author_model_name(), blank=True, null=True)
    body = models.TextField(blank=True)

    class Meta:
        ordering = ['ordering']


text:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

//EventID values
typedef enum {
   EventIDNotificationAdded     = 0,
   EventIDNotificationModified  = 1,
   EventIDNotificationRemoved   = 2,
   //Reserved EventID values = 3–255
} esp_EventID;

//EventFlags
typedef enum {
   EventFlagSilent              = (1 << 0),
   EventFlagImportant           = (1 << 1),
   EventFlagPreExisting         = (1 << 2),
   EventFlagPositiveAction      = (1 << 3),
   EventFlagNegativeAction      = (1 << 4),
   //Reserved EventFlags   = (1 << 5)–(1 << 7
}esp_EventFlags;

// CategoryID values
typedef enum {
   CategoryIDOther              = 0,
   CategoryIDIncomingCall       = 1,
   CategoryIDMissedCall         = 2,
   CategoryIDVoicemail          = 3,
   CategoryIDSocial             = 4,
   CategoryIDSchedule           = 5,
   CategoryIDEmail              = 6,
   CategoryIDNews               = 7,
   CategoryIDHealthAndFitness   = 8,
   CategoryIDBusinessAndFinance = 9,
   CategoryIDLocation           = 10,
   CategoryIDEntertainment      = 11,
   //Reserved CategoryID values   = 12–255
} esp_CategoryID;

//CommandID values
typedef enum {
   CommandIDGetNotificationAttributes = 0,
   CommandIDGetAppAttributes          = 1,
   CommandIDPerformNotificationAction = 2,
   //Reserved CommandID values = 3–255
} esp_CommandID;

//NotificationAttributeID
typedef enum {
   NotificationAttributeIDAppIdentifier       = 0,
   NotificationAttributeIDTitle               = 1, //(Needs to be followed by a 2-bytes max length parameter)
   NotificationAttributeIDSubtitle            = 2, //(Needs to be followed by a 2-bytes max length parameter)
   NotificationAttributeIDMessage             = 3, //(Needs to be followed by a 2-bytes max length parameter)
   NotificationAttributeIDMessageSize         = 4,
   NotificationAttributeIDDate                = 5,
   NotificationAttributeIDPositiveActionLabel = 6,
   NotificationAttributeIDNegativeActionLabel = 7,
   //Reserved NotificationAttributeID values = 8–255
} esp_NotificationAttributeID;

/*
Note: The format of the NotificationAttributeIDMessageSize constant is a string that represents the integral value
of the message size. The format of the NotificationAttributeIDDate constant is a string that uses the Unicode Technical
Standard (UTS) #35 date format pattern yyyyMMdd'T'HHmmSS. The format of all the other constants in Table 3-5 are UTF-8
strings.
*/

//ActionID values
typedef enum {
   ActionIDPositive = 0,
   ActionIDNegative = 1,
   //Reserved ActionID values = 2–255
} esp_ActionID;

//AppAttributeID Values
typedef enum {
   AppAttributeIDDisplayName = 0,
   //Reserved AppAttributeID values = 1–255
} esp_AppAttributeID;

typedef struct {
    uint8_t                            noti_attribute_id;
    uint16_t                           attribute_len;
} esp_noti_attr_list_t;

typedef enum {
   Unknown_command   = (0xA0), //The commandID was not recognized by the NP.
   Invalid_command   = (0xA1), //The command was improperly formatted.
   Invalid_parameter = (0xA2), // One of the parameters (for example, the NotificationUID) does not refer to an existing object on the NP.
   Action_failed     = (0xA3), //The action was not performed
} esp_error_code;

typedef enum {
   attr_appidentifier_index   = 0, //The commandID was not recognized by the NP.
   attr_title_index,
   attr_subtitle_index,
   attr_message_index,
   attr_messagesize_index,
   attr_date_index,
   attr_positiveactionlabel_index,
   attr_negativeactionlabel_index,
} esp_attr_index;

#define ESP_NOTIFICATIONUID_LEN   4

char *EventID_to_String(uint8_t EventID);
char *CategoryID_to_String(uint8_t CategoryID);
void esp_receive_apple_notification_source(uint8_t *message, uint16_t message_len);
void esp_receive_apple_data_source(uint8_t *message, uint16_t message_len);
char *Errcode_to_String(uint16_t status);


text:
using System;
using System.Windows;
using NLog;

[assembly: CLSCompliant(false)]
namespace Feedling
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App
    {
        static Logger Log;
        public App()
        {
            Log = LogManager.GetCurrentClassLogger();

#if DEBUG
            LogManager.GlobalThreshold = LogLevel.Trace;
#else
            LogManager.GlobalThreshold = LogLevel.Info;
#endif
            Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
        }

        static void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            Log = LogManager.GetCurrentClassLogger();
            Log.Error("Exception thrown by application", e.Exception);
        }

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            if (e.Args.Length > 0 && e.Args[0] == "-D")
            {
                LogManager.GlobalThreshold = LogLevel.Trace;
            }
        }
    }
}


text:
package com.experiments.core.presentation.models;

/**
 * Author : Krupal Shah
 * Date : 25-Apr-16
 * <p>
 * base class for all responses from apis
 */
public abstract class BaseResponse {

    private int statusCode;
    private String status;

    public BaseResponse() {
        status = "";
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "{\"BaseResponse\":{"
                + "\"statusCode\":\"" + statusCode + "\""
                + ", \"status\":\"" + status + "\""
                + "}}";
    }
}


text:
package com.intellij.util.containers;

import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Conditions;
import com.intellij.util.Function;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collections;
import java.util.Iterator;
import java.util.List;

public abstract class FilteredTraverserBase<T, Self extends FilteredTraverserBase<T, Self>> implements Iterable<T> {

  protected final Meta<T> meta;
  protected final Function<T, ? extends Iterable<? extends T>> tree;

  protected FilteredTraverserBase(@Nullable Meta<T> meta, Function<T, ? extends Iterable<? extends T>> tree) {
    this.tree = tree;
    this.meta = meta == null ? Meta.<T>empty() : meta;
  }

  @NotNull
  public T getRoot() {
    return meta.roots.iterator().next();
  }

  @NotNull
  public Iterable<? extends T> getRoots() {
    return meta.roots;
  }

  @Override
  public Iterator<T> iterator() {
    return traverse().iterator();
  }

  @NotNull
  protected abstract Self newInstance(Meta<T> meta);

  @NotNull
  public JBIterable<T> traverse(TreeTraversal traversal) {
    Function<T, Iterable<? extends T>> adjusted = new Function<T, Iterable<? extends T>>() {
      @Override
      public Iterable<? extends T> fun(T t) {
        return children(t);
      }
    };
    return traversal.traversal(getRoots(), adjusted).filter(meta.resultFilter);
  }

  @NotNull
  public JBIterable<T> traverse() {
    return meta.skipExpanded ? leavesOnlyDfsTraversal() : preOrderDfsTraversal();
  }

  @NotNull
  public final JBIterable<T> preOrderDfsTraversal() {
    return traverse(TreeTraversal.PRE_ORDER_DFS);
  }

  @NotNull
  public final JBIterable<T> postOrderDfsTraversal() {
    return traverse(TreeTraversal.POST_ORDER_DFS);
  }

  @NotNull
  public final JBIterable<T> leavesOnlyDfsTraversal() {
    return traverse(TreeTraversal.LEAVES_ONLY_DFS);
  }

  @NotNull
  public final JBIterable<T> bfsTraversal() {
    return traverse(TreeTraversal.PLAIN_BFS);
  }

  @NotNull
  public final JBIterable<T> tracingBfsTraversal() {
    return traverse(TreeTraversal.TRACING_BFS);
  }

  @NotNull
  public final JBIterable<T> leavesOnlyBfsTraversal() {
    return traverse(TreeTraversal.LEAVES_ONLY_BFS);
  }

  @NotNull
  public Self reset() {
    return newInstance(Meta.<T>empty().exclude(meta.excludeFilter).withRoots(meta.roots));
  }

  @NotNull
  public Self withRoot(@NotNull T root) {
    return newInstance(meta.withRoots(Collections.singleton(root)));
  }

  @NotNull
  public Self withRoots(@NotNull Iterable<? extends T> roots) {
    return newInstance(meta.withRoots(roots));
  }

  @NotNull
  public Self leavesOnly(boolean flag) {
    return newInstance(meta.skipExpanded(flag));
  }

  @NotNull
  public Self expand(@NotNull Condition<? super T> filter) {
    return newInstance(meta.expand(filter));
  }

  @NotNull
  public Self expandAndFilter(Condition<? super T> filter) {
    return newInstance(meta.expand(filter).filter(filter));
  }

  @NotNull
  public Self expandAndSkip(Condition<? super T> filter) {
    return newInstance(meta.expand(filter).filter(Conditions.not(filter)));
  }

  @NotNull
  public Self children(@NotNull Condition<? super T> filter) {
    return newInstance(meta.children(filter));
  }

  @NotNull
  public Self filter(@NotNull Condition<? super T> filter) {
    return newInstance(meta.filter(filter));
  }

  @NotNull
  public <C> JBIterable<C> filter(@NotNull Class<C> type) {
    return traverse().filter(type);
  }

  @NotNull
  public Self exclude(@NotNull Condition<? super T> filter) {
    return newInstance(meta.exclude(filter));
  }

  @NotNull
  public JBIterable<T> children(@NotNull T node) {
    if (isAlwaysLeaf(node)) return JBIterable.empty();
    JBIterable<T> children = JBIterable.from(tree.fun(node));
    if (meta.childFilter == Conditions.TRUE) return children.filter(Conditions.not(meta.excludeFilter));
    // traverse subtree to select accepted children
    return newInstance(meta.forChildren(children)).traverse();
  }

  protected boolean isAlwaysLeaf(@NotNull T node) {
    return !meta.expandFilter.value(node);
  }

  @NotNull
  public List<T> toList() {
    return traverse().toList();
  }

  @Override
  public String toString() {
    return traverse().toString();
  }

  protected static class Meta<T> {
    final Iterable<? extends T> roots;
    final boolean skipExpanded;
    final Condition<? super T> expandFilter;
    final Condition<? super T> childFilter;
    final Condition<? super T> resultFilter;
    final Condition<? super T> excludeFilter;

    public Meta(@NotNull Iterable<? extends T> roots,
                boolean skipExpanded,
                @NotNull Condition<? super T> expandFilter,
                @NotNull Condition<? super T> childFilter,
                @NotNull Condition<? super T> resultFilter,
                @NotNull Condition<? super T> excludeFilter) {
      this.roots = roots;
      this.skipExpanded = skipExpanded;
      this.expandFilter = expandFilter;
      this.childFilter = childFilter;
      this.resultFilter = resultFilter;
      this.excludeFilter = excludeFilter;
    }

    public Meta<T> withRoots(@NotNull Iterable<? extends T> roots) {
      return new Meta<T>(roots, skipExpanded, expandFilter, childFilter, resultFilter, excludeFilter);
    }

    public Meta<T> skipExpanded(boolean flag) {
      return new Meta<T>(roots, flag, expandFilter, childFilter, resultFilter, excludeFilter);
    }

    public Meta<T> expand(@NotNull Condition<? super T> filter) {
      return new Meta<T>(roots, skipExpanded, Conditions.and2(expandFilter, filter), childFilter, resultFilter, excludeFilter);
    }

    public Meta<T> children(@NotNull Condition<? super T> filter) {
      return new Meta<T>(roots, skipExpanded, expandFilter, Conditions.and2(childFilter, filter), resultFilter, excludeFilter);
    }

    public Meta<T> filter(@NotNull Condition<? super T> filter) {
      return new Meta<T>(roots, skipExpanded, expandFilter, childFilter, Conditions.and2(resultFilter, filter), excludeFilter);
    }

    public Meta<T> exclude(Condition<? super T> filter) {
      // exclude filter is always accumulated
      return new Meta<T>(roots, skipExpanded, expandFilter, childFilter, resultFilter, Conditions.or2(excludeFilter, filter));
    }

    private static final Meta<?> EMPTY = new Meta<Object>(
      JBIterable.empty(), false, Conditions.TRUE, Conditions.TRUE, Conditions.TRUE, Conditions.FALSE);

    public static <T> Meta<T> empty() {
      return (Meta<T>)EMPTY;
    }

    public Meta<T> forChildren(Iterable<? extends T> children) {
      return new Meta<T>(children, false, Conditions.not(childFilter), Conditions.TRUE, childFilter, excludeFilter);
    }
  }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>psychic-ui: psychic_ui::SimpleMenuItem Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

psychic-ui
    ..

psychic_ui

SimpleMenuItem

Public Member Functions |
Public Attributes |
List of all members

psychic_ui::SimpleMenuItem Class Reference

Inheritance diagram for psychic_ui::SimpleMenuItem:

  <map id="psychic_5Fui::SimpleMenuItem_map" name="psychic_5Fui::SimpleMenuItem_map">
<area href="classpsychic__ui_1_1_menu_item.html" alt="psychic_ui::MenuItem" shape="rect" coords="0,0,170,24"/>
</map>

Public Member Functions

 	SimpleMenuItem (const std::string &itemLabel, std::function< void()> itemCallback, const std::string &itemShortcut="")

 Public Member Functions inherited from psychic_ui::MenuItem

 	MenuItem (const std::string &itemLabel, const std::string &itemShortcut="")

virtual void 	please_be_polymorphic ()

Public Attributes

std::function< void()> 	callback {nullptr}

 Public Attributes inherited from psychic_ui::MenuItem

std::string 	label {}

std::string 	shortcut {}

The documentation for this class was generated from the following file:

psychic-ui/components/Menu.hpp

<address class="footer">
Generated by

 1.8.13
</address>


text:
/*
 * ExecutorState.cpp
 *
 *  Created on: Mar 8, 2017
 *      Author: Péter Fankhauser
 *   Institute: ETH Zurich, Robotic Systems Lab
 */
#include <free_gait_core/executor/ExecutorState.hpp>

namespace free_gait {

ExecutorState::ExecutorState()
: stepNumber_(0),
  stepPhase_(0.0)
{
}

ExecutorState::ExecutorState(size_t stepNumber, double stepPhase)
: stepNumber_(stepNumber),
  stepPhase_(stepPhase)
{
}

ExecutorState::~ExecutorState()
{
}

void ExecutorState::setState(size_t stepNumber, double stepPhase)
{
   stepNumber_ = stepNumber;
   stepPhase_ = stepPhase;
}

const size_t ExecutorState::stepNumber() const
{
  return stepNumber_;
}

const double ExecutorState::stepPhase() const
{
  return stepPhase_;
}

bool operator>(const ExecutorState& stateA, const ExecutorState& stateB)
{
  return stateA.stepNumber() >= stateB.stepNumber() && stateA.stepPhase() > stateB.stepPhase();
}

bool operator>=(const ExecutorState& stateA, const ExecutorState& stateB)
{
  return stateA.stepNumber() >= stateB.stepNumber() && stateA.stepPhase() >= stateB.stepPhase();
}

bool operator<(const ExecutorState& stateA, const ExecutorState& stateB)
{
  return stateA.stepNumber() <= stateB.stepNumber() && stateA.stepPhase() < stateB.stepPhase();
}

bool operator<=(const ExecutorState& stateA, const ExecutorState& stateB)
{
  return stateA.stepNumber() <= stateB.stepNumber() && stateA.stepPhase() <= stateB.stepPhase();
}

} /* namespace free_gait */


text:
package org.apache.commons.validator;

import java.io.IOException;

import org.xml.sax.SAXException;

/**
 * Performs Validation Test.
 *
 * @version $Revision: 1739356 $
 */
public class MultipleTest extends AbstractCommonTest {

   /**
    * The key used to retrieve the set of validation
    * rules from the xml file.
    */
   protected static String FORM_KEY = "nameForm";

   /**
    * The key used to retrieve the validator action.
    */
   protected static String ACTION = "required";

   public MultipleTest(String name) {
       super(name);
   }

   /**
    * Load ValidatorResources from
    * validator-multipletest.xml.
    */
   @Override
protected void setUp() throws IOException, SAXException {
      // Load resources
      loadResources("MultipleTests-config.xml");
   }

   @Override
protected void tearDown() {
   }

   /**
    * With nothing provided, we should fail both because both are required.
    */
   public void testBothBlank() throws ValidatorException {
      // Create bean to run test on.
      NameBean name = new NameBean();

      // Construct validator based on the loaded resources
      // and the form key
      Validator validator = new Validator(resources, FORM_KEY);
      // add the name bean to the validator as a resource
      // for the validations to be performed on.
      validator.setParameter(Validator.BEAN_PARAM, name);

      // Get results of the validation.
      ValidatorResults results = null;

      // throws ValidatorException,
      // but we aren't catching for testing
      // since no validation methods we use
      // throw this
      results = validator.validate();

      assertNotNull("Results are null.", results);

      ValidatorResult firstNameResult = results.getValidatorResult("firstName");
      ValidatorResult lastNameResult = results.getValidatorResult("lastName");

      assertNotNull("First Name ValidatorResult should not be null.", firstNameResult);
      assertTrue("First Name ValidatorResult should contain the '" + ACTION +"' action.", firstNameResult.containsAction(ACTION));
      assertTrue("First Name ValidatorResult for the '" + ACTION +"' action should have failed.", !firstNameResult.isValid(ACTION));

      assertNotNull("Last Name ValidatorResult should not be null.", lastNameResult);
      assertTrue("Last Name ValidatorResult should contain the '" + ACTION +"' action.", lastNameResult.containsAction(ACTION));
      assertTrue("Last Name ValidatorResult for the '" + ACTION +"' action should have failed.", !lastNameResult.isValid(ACTION));
      assertTrue("Last Name ValidatorResults should not contain the 'int' action.", !lastNameResult.containsAction("int"));
   }

   /**
    * If the first name fails required, and the second test fails int, we should get two errors.
    */
   public void testRequiredFirstNameBlankLastNameShort() throws ValidatorException {
      // Create bean to run test on.
      NameBean name = new NameBean();
      name.setFirstName("");
      name.setLastName("Test");

      // Construct validator based on the loaded resources
      // and the form key
      Validator validator = new Validator(resources, FORM_KEY);
      // add the name bean to the validator as a resource
      // for the validations to be performed on.
      validator.setParameter(Validator.BEAN_PARAM, name);

      // Get results of the validation.
      ValidatorResults results = null;

      results = validator.validate();

      assertNotNull("Results are null.", results);

      ValidatorResult firstNameResult = results.getValidatorResult("firstName");
      ValidatorResult lastNameResult = results.getValidatorResult("lastName");

      assertNotNull("First Name ValidatorResult should not be null.", firstNameResult);
      assertTrue("First Name ValidatorResult should contain the '" + ACTION +"' action.", firstNameResult.containsAction(ACTION));
      assertTrue("First Name ValidatorResult for the '" + ACTION +"' action should have failed.", !firstNameResult.isValid(ACTION));

      assertNotNull("Last Name ValidatorResult should not be null.", lastNameResult);
      assertTrue("Last Name ValidatorResult should contain the 'int' action.", lastNameResult.containsAction("int"));
      assertTrue("Last Name ValidatorResult for the 'int' action should have failed.", !lastNameResult.isValid("int"));
   }

   /**
    * If the first name is there, and the last name fails int, we should get one error.
    */
   public void testRequiredLastNameShort() throws ValidatorException {
      // Create bean to run test on.
      NameBean name = new NameBean();
      name.setFirstName("Test");
      name.setLastName("Test");

      // Construct validator based on the loaded resources
      // and the form key
      Validator validator = new Validator(resources, FORM_KEY);
      // add the name bean to the validator as a resource
      // for the validations to be performed on.
      validator.setParameter(Validator.BEAN_PARAM, name);

      // Get results of the validation.
      ValidatorResults results = null;

      results = validator.validate();

      assertNotNull("Results are null.", results);

      ValidatorResult firstNameResult = results.getValidatorResult("firstName");
      ValidatorResult lastNameResult = results.getValidatorResult("lastName");

      assertNotNull("First Name ValidatorResult should not be null.", firstNameResult);
      assertTrue("First Name ValidatorResult should contain the '" + ACTION +"' action.", firstNameResult.containsAction(ACTION));
      assertTrue("First Name ValidatorResult for the '" + ACTION +"' action should have passed.", firstNameResult.isValid(ACTION));

      assertNotNull("Last Name ValidatorResult should not be null.", lastNameResult);
      assertTrue("Last Name ValidatorResult should contain the 'int' action.", lastNameResult.containsAction("int"));
      assertTrue("Last Name ValidatorResult for the 'int' action should have failed.", !lastNameResult.isValid("int"));
   }

   /**
    * If first name is ok and last name is ok and is an int, no errors.
    */
   public void testRequiredLastNameLong() throws ValidatorException {
      // Create bean to run test on.
      NameBean name = new NameBean();
      name.setFirstName("Joe");
      name.setLastName("12345678");

      // Construct validator based on the loaded resources
      // and the form key
      Validator validator = new Validator(resources, FORM_KEY);
      // add the name bean to the validator as a resource
      // for the validations to be performed on.
      validator.setParameter(Validator.BEAN_PARAM, name);

      // Get results of the validation.
      ValidatorResults results = null;

      results = validator.validate();

      assertNotNull("Results are null.", results);

      ValidatorResult firstNameResult = results.getValidatorResult("firstName");
      ValidatorResult lastNameResult = results.getValidatorResult("lastName");

      assertNotNull("First Name ValidatorResult should not be null.", firstNameResult);
      assertTrue("First Name ValidatorResult should contain the '" + ACTION +"' action.", firstNameResult.containsAction(ACTION));
      assertTrue("First Name ValidatorResult for the '" + ACTION +"' action should have passed.", firstNameResult.isValid(ACTION));

      assertNotNull("Last Name ValidatorResult should not be null.", lastNameResult);
      assertTrue("Last Name ValidatorResult should contain the 'int' action.", lastNameResult.containsAction("int"));
      assertTrue("Last Name ValidatorResult for the 'int' action should have passed.", lastNameResult.isValid("int"));
   }

   /**
    * If middle name is not there, then the required dependent test should fail.
    * No other tests should run
    *
    * @throws ValidatorException
    */
   public void testFailingFirstDependentValidator() throws ValidatorException {
       // Create bean to run test on.
       NameBean name = new NameBean();

       // Construct validator based on the loaded resources
       // and the form key
       Validator validator = new Validator(resources, FORM_KEY);
       // add the name bean to the validator as a resource
       // for the validations to be performed on.
       validator.setParameter(Validator.BEAN_PARAM, name);

       // Get results of the validation.
       ValidatorResults results = null;

       results = validator.validate();

       assertNotNull("Results are null.", results);

       ValidatorResult middleNameResult = results.getValidatorResult("middleName");

       assertNotNull("Middle Name ValidatorResult should not be null.", middleNameResult);

       assertTrue("Middle Name ValidatorResult should contain the 'required' action.", middleNameResult.containsAction("required"));
       assertTrue("Middle Name ValidatorResult for the 'required' action should have failed", !middleNameResult.isValid("required"));

       assertTrue("Middle Name ValidatorResult should not contain the 'int' action.", !middleNameResult.containsAction("int"));

       assertTrue("Middle Name ValidatorResult should not contain the 'positive' action.", !middleNameResult.containsAction("positive"));
   }

   /**
    * If middle name is there but not int, then the required dependent test
    * should pass, but the int dependent test should fail. No other tests should
    * run.
    *
    * @throws ValidatorException
    */
   public void testFailingNextDependentValidator() throws ValidatorException {
       // Create bean to run test on.
       NameBean name = new NameBean();
       name.setMiddleName("TEST");

       // Construct validator based on the loaded resources
       // and the form key
       Validator validator = new Validator(resources, FORM_KEY);
       // add the name bean to the validator as a resource
       // for the validations to be performed on.
       validator.setParameter(Validator.BEAN_PARAM, name);

       // Get results of the validation.
       ValidatorResults results = null;

       results = validator.validate();

       assertNotNull("Results are null.", results);

       ValidatorResult middleNameResult = results.getValidatorResult("middleName");

       assertNotNull("Middle Name ValidatorResult should not be null.", middleNameResult);

       assertTrue("Middle Name ValidatorResult should contain the 'required' action.", middleNameResult.containsAction("required"));
       assertTrue("Middle Name ValidatorResult for the 'required' action should have passed", middleNameResult.isValid("required"));

       assertTrue("Middle Name ValidatorResult should contain the 'int' action.", middleNameResult.containsAction("int"));
       assertTrue("Middle Name ValidatorResult for the 'int' action should have failed", !middleNameResult.isValid("int"));

       assertTrue("Middle Name ValidatorResult should not contain the 'positive' action.", !middleNameResult.containsAction("positive"));
   }

   /**
    * If middle name is there and a negative int, then the required and int
    * dependent tests should pass, but the positive test should fail.
    *
    * @throws ValidatorException
    */
   public void testPassingDependentsFailingMain() throws ValidatorException {
       // Create bean to run test on.
       NameBean name = new NameBean();
       name.setMiddleName("-2534");

       // Construct validator based on the loaded resources
       // and the form key
       Validator validator = new Validator(resources, FORM_KEY);
       // add the name bean to the validator as a resource
       // for the validations to be performed on.
       validator.setParameter(Validator.BEAN_PARAM, name);

       // Get results of the validation.
       ValidatorResults results = null;

       results = validator.validate();

       assertNotNull("Results are null.", results);

       ValidatorResult middleNameResult = results.getValidatorResult("middleName");

       assertNotNull("Middle Name ValidatorResult should not be null.", middleNameResult);

       assertTrue("Middle Name ValidatorResult should contain the 'required' action.", middleNameResult.containsAction("required"));
       assertTrue("Middle Name ValidatorResult for the 'required' action should have passed", middleNameResult.isValid("required"));

       assertTrue("Middle Name ValidatorResult should contain the 'int' action.", middleNameResult.containsAction("int"));
       assertTrue("Middle Name ValidatorResult for the 'int' action should have passed", middleNameResult.isValid("int"));

       assertTrue("Middle Name ValidatorResult should contain the 'positive' action.", middleNameResult.containsAction("positive"));
       assertTrue("Middle Name ValidatorResult for the 'positive' action should have failed", !middleNameResult.isValid("positive"));
   }

   /**
    * If middle name is there and a positve int, then the required and int
    * dependent tests should pass, and the positive test should pass.
    *
    * @throws ValidatorException
    */
   public void testPassingDependentsPassingMain() throws ValidatorException {
       // Create bean to run test on.
       NameBean name = new NameBean();
       name.setMiddleName("2534");

       // Construct validator based on the loaded resources
       // and the form key
       Validator validator = new Validator(resources, FORM_KEY);
       // add the name bean to the validator as a resource
       // for the validations to be performed on.
       validator.setParameter(Validator.BEAN_PARAM, name);

       // Get results of the validation.
       ValidatorResults results = null;

       results = validator.validate();

       assertNotNull("Results are null.", results);

       ValidatorResult middleNameResult = results.getValidatorResult("middleName");

       assertNotNull("Middle Name ValidatorResult should not be null.", middleNameResult);

       assertTrue("Middle Name ValidatorResult should contain the 'required' action.", middleNameResult.containsAction("required"));
       assertTrue("Middle Name ValidatorResult for the 'required' action should have passed", middleNameResult.isValid("required"));

       assertTrue("Middle Name ValidatorResult should contain the 'int' action.", middleNameResult.containsAction("int"));
       assertTrue("Middle Name ValidatorResult for the 'int' action should have passed", middleNameResult.isValid("int"));

       assertTrue("Middle Name ValidatorResult should contain the 'positive' action.", middleNameResult.containsAction("positive"));
       assertTrue("Middle Name ValidatorResult for the 'positive' action should have passed", middleNameResult.isValid("positive"));
   }
}


text:
package com.test.template.interfaces;

/**
 * <p/>
 * Created by Micha "Micha did it!" Pringle on December 15, 2014.
 */
public interface C01B1B2 extends B1A1A2, B2A1A3
{
	public String getC1B1B2();
}


text:
using System;
using System.Collections.Generic;
using IdmNet.Models;
using Microsoft.VisualStudio.TestTools.UnitTesting;
// ReSharper disable ObjectCreationAsStatement
// ReSharper disable UseObjectOrCollectionInitializer

namespace IdmNet.Models.Tests
{
    [TestClass]
    public class ma_dataTests
    {
        private ma_data _it;

        public ma_dataTests()
        {
            _it = new ma_data();
        }

        [TestMethod]
        public void It_has_a_paremeterless_constructor()
        {
            Assert.AreEqual("ma-data", _it.ObjectType);
        }

        [TestMethod]
        public void It_has_a_constructor_that_takes_an_IdmResource()
        {
            var resource = new IdmResource
            {
                DisplayName = "My Display Name",
                Creator = new Person { DisplayName = "Creator Display Name", ObjectID = "Creator ObjectID"},
            };
            var it = new ma_data(resource);

            Assert.AreEqual("ma-data", it.ObjectType);
            Assert.AreEqual("My Display Name", it.DisplayName);
            Assert.AreEqual("Creator Display Name", it.Creator.DisplayName);
        }

        [TestMethod]
        public void It_has_a_constructor_that_takes_an_IdmResource_without_Creator()
        {
            var resource = new IdmResource
            {
                DisplayName = "My Display Name",
            };
            var it = new ma_data(resource);

            Assert.AreEqual("My Display Name", it.DisplayName);
            Assert.IsNull(it.Creator);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void It_throws_when_you_try_to_set_ObjectType_to_anything_other_than_its_primary_ObjectType()
        {
            _it.ObjectType = "Invalid Object Type";
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_attribute_inclusion()
        {
            // Act
            _it.SyncConfig_attribute_inclusion = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_attribute_inclusion);
        }

        [TestMethod]
        public void It_has_SyncConfig_capabilities_mask_which_is_null_by_default()
        {
            // Assert
            Assert.IsNull(_it.SyncConfig_capabilities_mask);
        }

        [TestMethod]
        public void It_has_SyncConfig_capabilities_mask_which_can_be_set_back_to_null()
        {
            // Arrange
            _it.SyncConfig_capabilities_mask = 123;

            // Act
            _it.SyncConfig_capabilities_mask = null;

            // Assert
            Assert.IsNull(_it.SyncConfig_capabilities_mask);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_capabilities_mask()
        {
            // Act
            _it.SyncConfig_capabilities_mask = 123;

            // Assert
            Assert.AreEqual(123, _it.SyncConfig_capabilities_mask);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_category()
        {
            // Act
            _it.SyncConfig_category = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_category);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_component_mappings()
        {
            // Act
            _it.SyncConfig_component_mappings = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_component_mappings);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_controller_configuration()
        {
            // Act
            _it.SyncConfig_controller_configuration = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_controller_configuration);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_creation_time()
        {
            // Act
            _it.SyncConfig_creation_time = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_creation_time);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_dn_construction()
        {
            // Act
            _it.SyncConfig_dn_construction = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_dn_construction);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_encrypted_attributes()
        {
            // Act
            _it.SyncConfig_encrypted_attributes = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_encrypted_attributes);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_export_attribute_flow()
        {
            // Act
            _it.SyncConfig_export_attribute_flow = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_export_attribute_flow);
        }

        [TestMethod]
        public void It_has_SyncConfig_export_type_which_is_null_by_default()
        {
            // Assert
            Assert.IsNull(_it.SyncConfig_export_type);
        }

        [TestMethod]
        public void It_has_SyncConfig_export_type_which_can_be_set_back_to_null()
        {
            // Arrange
            _it.SyncConfig_export_type = 123;

            // Act
            _it.SyncConfig_export_type = null;

            // Assert
            Assert.IsNull(_it.SyncConfig_export_type);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_export_type()
        {
            // Act
            _it.SyncConfig_export_type = 123;

            // Assert
            Assert.AreEqual(123, _it.SyncConfig_export_type);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_extension()
        {
            // Act
            _it.SyncConfig_extension = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_extension);
        }

        [TestMethod]
        public void It_has_SyncConfig_format_version_which_is_null_by_default()
        {
            // Assert
            Assert.IsNull(_it.SyncConfig_format_version);
        }

        [TestMethod]
        public void It_has_SyncConfig_format_version_which_can_be_set_back_to_null()
        {
            // Arrange
            _it.SyncConfig_format_version = 123;

            // Act
            _it.SyncConfig_format_version = null;

            // Assert
            Assert.IsNull(_it.SyncConfig_format_version);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_format_version()
        {
            // Act
            _it.SyncConfig_format_version = 123;

            // Assert
            Assert.AreEqual(123, _it.SyncConfig_format_version);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_id()
        {
            // Act
            _it.SyncConfig_id = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_id);
        }

        [TestMethod]
        public void It_has_SyncConfig_internal_version_which_is_null_by_default()
        {
            // Assert
            Assert.IsNull(_it.SyncConfig_internal_version);
        }

        [TestMethod]
        public void It_has_SyncConfig_internal_version_which_can_be_set_back_to_null()
        {
            // Arrange
            _it.SyncConfig_internal_version = 123;

            // Act
            _it.SyncConfig_internal_version = null;

            // Assert
            Assert.IsNull(_it.SyncConfig_internal_version);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_internal_version()
        {
            // Act
            _it.SyncConfig_internal_version = 123;

            // Assert
            Assert.AreEqual(123, _it.SyncConfig_internal_version);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_join()
        {
            // Act
            _it.SyncConfig_join = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_join);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_last_modification_time()
        {
            // Act
            _it.SyncConfig_last_modification_time = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_last_modification_time);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_ma_companyname()
        {
            // Act
            _it.SyncConfig_ma_companyname = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_ma_companyname);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_ma_listname()
        {
            // Act
            _it.SyncConfig_ma_listname = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_ma_listname);
        }

        [TestMethod]
        public void It_has_SyncConfig_ma_partition_data_which_is_null_by_default()
        {
            // Assert
            Assert.IsNull(_it.SyncConfig_ma_partition_data);
        }

        [TestMethod]
        public void It_has_SyncConfig_ma_partition_data_which_can_be_set_back_to_null()
        {
            // Arrange
            var subObject1 = "foo1";
            var subObject2 = "foo2";
            var list = new List<string> { subObject1, subObject2 };
            _it.SyncConfig_ma_partition_data = list;

            // Act
            _it.SyncConfig_ma_partition_data = null;

            // Assert
            Assert.IsNull(_it.SyncConfig_ma_partition_data);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_ma_partition_data()
        {
            var subObject1 = "foo1";
            var subObject2 = "foo2";
            var list = new List<string> { subObject1, subObject2 };

            // Act
            _it.SyncConfig_ma_partition_data = list;

            // Assert
            Assert.AreEqual("foo1", _it.SyncConfig_ma_partition_data[0]);
            Assert.AreEqual("foo2", _it.SyncConfig_ma_partition_data[1]);
        }

        [TestMethod]
        public void It_has_SyncConfig_ma_run_data_which_is_null_by_default()
        {
            // Assert
            Assert.IsNull(_it.SyncConfig_ma_run_data);
        }

        [TestMethod]
        public void It_has_SyncConfig_ma_run_data_which_can_be_set_back_to_null()
        {
            // Arrange
            var subObject1 = "foo1";
            var subObject2 = "foo2";
            var list = new List<string> { subObject1, subObject2 };
            _it.SyncConfig_ma_run_data = list;

            // Act
            _it.SyncConfig_ma_run_data = null;

            // Assert
            Assert.IsNull(_it.SyncConfig_ma_run_data);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_ma_run_data()
        {
            var subObject1 = "foo1";
            var subObject2 = "foo2";
            var list = new List<string> { subObject1, subObject2 };

            // Act
            _it.SyncConfig_ma_run_data = list;

            // Assert
            Assert.AreEqual("foo1", _it.SyncConfig_ma_run_data[0]);
            Assert.AreEqual("foo2", _it.SyncConfig_ma_run_data[1]);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_ma_ui_settings()
        {
            // Act
            _it.SyncConfig_ma_ui_settings = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_ma_ui_settings);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_password_sync()
        {
            // Act
            _it.SyncConfig_password_sync = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_password_sync);
        }

        [TestMethod]
        public void It_has_SyncConfig_password_sync_allowed_which_is_null_by_default()
        {
            // Assert
            Assert.IsNull(_it.SyncConfig_password_sync_allowed);
        }

        [TestMethod]
        public void It_has_SyncConfig_password_sync_allowed_which_can_be_set_back_to_null()
        {
            // Arrange
            _it.SyncConfig_password_sync_allowed = 123;

            // Act
            _it.SyncConfig_password_sync_allowed = null;

            // Assert
            Assert.IsNull(_it.SyncConfig_password_sync_allowed);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_password_sync_allowed()
        {
            // Act
            _it.SyncConfig_password_sync_allowed = 123;

            // Assert
            Assert.AreEqual(123, _it.SyncConfig_password_sync_allowed);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_private_configuration()
        {
            // Act
            _it.SyncConfig_private_configuration = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_private_configuration);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_projection()
        {
            // Act
            _it.SyncConfig_projection = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_projection);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_provisioning_cleanup()
        {
            // Act
            _it.SyncConfig_provisioning_cleanup = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_provisioning_cleanup);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_provisioning_cleanup_type()
        {
            // Act
            _it.SyncConfig_provisioning_cleanup_type = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_provisioning_cleanup_type);
        }

        [TestMethod]
        public void It_has_SyncConfig_refresh_schema_which_is_null_by_default()
        {
            // Assert
            Assert.IsNull(_it.SyncConfig_refresh_schema);
        }

        [TestMethod]
        public void It_has_SyncConfig_refresh_schema_which_can_be_set_back_to_null()
        {
            // Arrange
            _it.SyncConfig_refresh_schema = 123;

            // Act
            _it.SyncConfig_refresh_schema = null;

            // Assert
            Assert.IsNull(_it.SyncConfig_refresh_schema);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_refresh_schema()
        {
            // Act
            _it.SyncConfig_refresh_schema = 123;

            // Assert
            Assert.AreEqual(123, _it.SyncConfig_refresh_schema);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_schema()
        {
            // Act
            _it.SyncConfig_schema = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_schema);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_stay_disconnector()
        {
            // Act
            _it.SyncConfig_stay_disconnector = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_stay_disconnector);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_sub_type()
        {
            // Act
            _it.SyncConfig_sub_type = "A string";

            // Assert
            Assert.AreEqual("A string", _it.SyncConfig_sub_type);
        }

        [TestMethod]
        public void It_has_SyncConfig_version_which_is_null_by_default()
        {
            // Assert
            Assert.IsNull(_it.SyncConfig_version);
        }

        [TestMethod]
        public void It_has_SyncConfig_version_which_can_be_set_back_to_null()
        {
            // Arrange
            _it.SyncConfig_version = 123;

            // Act
            _it.SyncConfig_version = null;

            // Assert
            Assert.IsNull(_it.SyncConfig_version);
        }

        [TestMethod]
        public void It_can_get_and_set_SyncConfig_version()
        {
            // Act
            _it.SyncConfig_version = 123;

            // Assert
            Assert.AreEqual(123, _it.SyncConfig_version);
        }

    }
}


text:
<ion-header>

  <ion-navbar color="primary">
    <ion-title>Profile</ion-title>
  </ion-navbar>

</ion-header>

<ion-content padding>
  <ion-card *ngIf="user">

    <ion-card-content>

{{user.name}}

{{user.email}}

    </ion-card-content>
    <ion-row>
      <ion-col>
        <button ion-button clear small>change photo</button>
      </ion-col>
      <ion-col>
        <button ion-button clear small (click)="openChangePass()">change pass</button>
      </ion-col>
    </ion-row>
  </ion-card>
</ion-content>


text:
*This project is a part of The [SOOMLA](http://www.soom.la) Framework, which is a series of open source initiatives with a joint goal to help mobile game developers do more together. SOOMLA encourages better game design, economy modeling, social engagement, and faster development.*

soomla-android-core
===============

When using the SOOMLA framework, you always start by initializing the core module from your main activity:
```java
Soomla.initialize(this, "[YOUR SOOMLA SECRET HERE]");
```

This sets up the local on-device database used by SOOMLA.  The secret is used for encrypting the data, make sure to choose a good one.

This core library holds common features and utilities used by all other modules of the SOOMLA framework.
It includes:
* An encrypted key-value storage (SQLite based) for persisting data locally on devices.
* Utilities for `String` and `JSONObject` manipulation.
* Utilities for Logging and encryption.
* An event bus (using Square's otto) for publish-subscribe events.
* `SoomlaEntity` - the base class from which all SOOMLA domain objects derive
* Reward domain objects and events - used to grant your users rewards.

SOOMLA modules internally use these features, though we encourage you to use them for your own needs as well.  For example, use our key-value storage for custom game data for usage across game sessions.

## Download

#### Pre baked jar:

- [soomla-android-core v1.3.0](http://library.soom.la/fetch/android-core/1.3.0?cf=github)

#### From sources:
 - Clone this repository recursively: `git clone --recursive https://github.com/soomla/soomla-android-core.git`
 - Run `./build_all` from project directory
 - Take created binaries from `build` directory and use it!

Our way of saying "Thanks !"
---

Other open-source projects that we use:

* [FBEncryptor](https://github.com/dev5tec/FBEncryptor)
* [Otto](http://square.github.io/otto/) - by Square

Contribution
---
SOOMLA appreciates code contributions! You are more than welcome to extend the capabilities of SOOMLA.

Fork -> Clone -> Implement -> Add documentation -> Test -> Pull-Request.

IMPORTANT: If you would like to contribute, please follow our [Documentation Guidelines](https://github.com/soomla/android-store/blob/master/documentation.md). Clear, consistent comments will make our code easy to understand.

## SOOMLA, Elsewhere ...

+ [Framework Website](http://www.soom.la/)
+ [Knowledge Base](http://know.soom.la/)

License
---
Apache License. Copyright (c) 2012-2014 SOOMLA. http://soom.la
+ http://opensource.org/licenses/Apache-2.0


text:
![logo](https://static.creatordev.io/logo-md-s.svg)
# LetMeCreateIoT

**Master**
[![Build Status](https://travis-ci.org/CreatorDev/LetMeCreateIoT.svg?branch=master)](https://travis-ci.org/CreatorDev/LetMeCreateIoT)
**Dev**
[![Build Status](https://travis-ci.org/CreatorDev/LetMeCreateIoT.svg?branch=dev)](https://travis-ci.org/CreatorDev/LetMeCreateIoT)

## Introduction

A collection of wrappers for the Contiki interfaces made to speed up the development of applications
for the Mikro-e PIC32MX clicker.

|Wrappers| |
|:------------| :-------------------|
|I²C|SPI|
|GPIO|GPIO Monitor|
|ADC|UDP/TCP & network helpers|
|Debug over 6lowpan|LEDs|
|UART|PWM|

All drivers are checked out from [LetMeCreate 1.5.1](https://github.com/CreatorDev/LetMeCreate/tree/v1.5.1) and
Contiki-specific patches are applied on top of them..

|Drivers| | |
|:------------|:-------------------|:-------------------|
|7Seg|8x8R (Led Matrix)|Accel|
|ADC|Air quality|Alcohol|
|Alphanum|Bargraph|CO|
|Color|Color2|EVE|
|Fan|GYRO|IR distance|
|IR eclipse|Joystick|Light|
|LIN Hall|Lora|Motion|
|OLED|Opto|Proximity|
|Relay (partial support)|Relay2|Relay4 (partial support)|
|RTC|Thermo3|UNI Hall|
|Weather| | |

## Installation and updating

### Installation

By default the library should be already in the [Creator branch of CreatorDev Contiki](https://github.com/CreatorDev/contiki/tree/creator).
If you want to use it with Contiki that does not have LMCIoT by default use following commands:

```sh
cd contiki/platform/mikro-e/apps
git clone https://github.com/CreatorDev/LetMeCreateIoT/ letmecreateiot
```

To use in your application add this to your application's Makefile:

```make
APPS += letmecreateiot
```

The library will automatically update all driver feeds when make is run.

## Development

To use include the appropriate header files in your project, eg.:

```C
#include "letmecreate/core/spi.h"
#include "letmecreate/click/accel.h"
```

For reference how to use the different interfaces or click wrappers refer to a wide selection of
examples in the examples directory.

### CI40 UDP server & client

In addition to wrappers for common networking functionality the repository contains two Python scripts
that can be used as 6lowpan client/server. Both of them can be found in the scripts directory, and
can be freely modifid to send and receive application data. For more help run:

```sh
python3 server.py -h
python3 client.py -h
```

If Python3 is not installed use [opkg](https://docs.creatordev.io/ci40/guides/openwrt-platform/#using-opkg)
to install the package:

```sh
opkg install python3
```

### Debug

LMCIoT offers debug capabilities over 6lowpan. This is achieved by adding a new macro, PRINTF, which
sends data over 6lowpan every time it is needed. To enable first include the DEBUG_IP compilation
define in the Makefile:

```Makefile
CFLAGS += -DDEBUG_IP=6lowpan:ip:of:ci40
```

By default data is not only sent over 6lowpan but also printed over UART. To disable serial logging use:

```Makefile
CFLAGS += -DDEBUG_IP=6lowpan:ip:of:ci40 -DDEBUG_NO_SERIAL
```

Then use the INIT_NETWORK_DEBUG and PRINTF macros in code:
```C
/* ... */
#include "letmecreate/core/debug.h"

PROCESS(main_process, "Main process");
AUTOSTART_PROCESSES(&main_process);
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(main_process, ev, data)
{
    PROCESS_BEGIN();
    INIT_NETWORK_DEBUG();
    {
        PRINTF("Start!\n");
        /* ... */
```
Finally, copy scripts/debug_server.py to a CI40 with Python3 installed and run:
```sh
python3 debug_server.py
```

To disable debugging simply remove DEBUG_IP from CFLAGS. In this case INIT_NETWORK_DEBUG will
resolve to no code at all and PRINTF will act as the standard printf function. For a full example
program visit [examples/debug](https://github.com/CreatorDev/LetMeCreateIoT/tree/master/examples/debug).
Additionally, all other examples can be used with network debug enabled by following the above steps.

### Compatibility with LMC

The interfaces are made to be as compatible with [LetMeCreate](https://github.com/CreatorDev/LetMeCreate)
as much as possible to ensure the code is portable. When adding support for a new Click use its LMC
version, modify for use with LMCIoT and generate a patch, then place it in the
feeds/patches/ directory.

### Known issues

- At the moment the new udp connection sends dummy data to force router solicitation as soon as
possible.


text:
ActiveRecord::Schema.define(:version => 20130628161227) do

  create_table "users", :force => true do |t|
    t.string   "name"
  end

end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Guepinia discinoides Henn. & E. Nyman

### Remarks
null


text:
<?php

namespace Acme\DemoBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;

//use FOS\RestBundle\View\View;
//use FOS\RestBundle\Decoder\DecoderInterface;

/**
 *
 */
class BaseController extends Controller
{
    /**
     *
     */
    protected function getDm()
    {
        return $this->get('doctrine.odm.mongodb.document_manager');

    }

    /**
     *
     */
    protected function getUser()
    {
        $sess = $this->getRequest()->getSession();
        $user = $sess->get('_security_default');
        if (!$user) throw new \Exception('No user defined');
        $user = unserialize($user)->getUser();

        return $user;
    }

}


text:
SET FEEDBACK OFF
SET HEADING OFF
SET LINESIZE 32000
SET LONG 32000
SET LONGCHUNKSIZE 32000
SET PAGESIZE 0
SET SPACE 0
SET TERMOUT OFF
SET TRIMSPOOL ON
SPOOL c:\spool.sql
SELECT 'SELECT * FROM '||TABLE_NAME||';';


text:
import markdown
import bleach

untrusted_text = '#Header 1\n* item 1\n*item 2\n\n'
html = bleach.clean(markdown.markdown(untrusted_text))

md = markdown.Markdown(safe_mode='replace',
                       html_replacement_text='--RAW HTML NOT ALLOWED--')

print md


text:
#ifndef NFREDISPLUGIN_NFREDISTESTER_H
#define NFREDISPLUGIN_NFREDISTESTER_H

#include "NFRedisClient.h"

class NFRedisTester
{
public:
    NFRedisTester(const std::string& ip, int port, const std::string& auth = "");

    bool RunTester();
    void Execute();
	bool IsConnect();

	bool Test_1();

    void TestHash();
    void TestKey();
    void TestList();
    void TestSet();
    void TestSort();
    void TestString();
	void TestPubSub();

    NFRedisClient mxRedisClient;
};

#endif //NFREDISPLUGIN_NFREDISTESTER_H


text:
package io.sundr.dsl.internal.element.functions;

import io.sundr.Function;
import io.sundr.dsl.annotations.Keyword;
import io.sundr.dsl.internal.utils.TypeDefUtils;

import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;
import java.util.HashSet;
import java.util.Set;

public class ToKeywords implements Function<Element, Set<String>> {

    private final TypeElement KEYWORD;
    private final Element VALUE;

    public ToKeywords(Elements elements) {
        KEYWORD = elements.getTypeElement(Keyword.class.getCanonicalName());
        VALUE = KEYWORD.getEnclosedElements().get(0);
    }

    public Set<String> apply(Element element) {
        Set<String> keywords = new HashSet<String>();
        for (AnnotationMirror mirror : element.getAnnotationMirrors()) {
            if (mirror.getAnnotationType().asElement().equals(KEYWORD)) {
                keywords.addAll(TypeDefUtils.toClassNames(mirror.getElementValues().get(VALUE).getValue()));
            }

            for (AnnotationMirror innerMirror : mirror.getAnnotationType().asElement().getAnnotationMirrors()) {
                if (innerMirror.getAnnotationType().asElement().equals(KEYWORD)) {
                    if (innerMirror.getElementValues().containsKey(VALUE)) {
                        keywords.addAll(TypeDefUtils.toClassNames(innerMirror.getElementValues().get(VALUE).getValue()));
                    } else {
                        keywords.addAll(TypeDefUtils.toClassNames(mirror.getAnnotationType().asElement().toString()));
                    }
                }
            }
        }
        return keywords;
    }

}


text:
/* $NoKeywords: $ */
/*
//
// Copyright (c) 1993-2011 Robert McNeel & Associates. All rights reserved.
// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
// McNeel & Associates.
//
// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
// MERCHANTABILITY ARE HEREBY DISCLAIMED.
//
// For complete openNURBS copyright information see <http://www.opennurbs.org>.
//
////////////////////////////////////////////////////////////////
*/

#if !defined(ON_BASE32_INC_)
#define ON_BASE32_INC_

/*
Description:
  Convert a number into base32 digits.
Parameters:
  x - [in]
  x_count - [in]
    x[] is an array of length x_count and represents the value
    x[0]*2^(8*(x_count-1)) + ... + x[x_count-2]*256 + x[x_count-1].
  base32_digits - [out]
    When base32_digits is not a dynamic array, base32_digits[]
    must a be an array of length at least
    ((8*x_count)/5) + (((8*x_count)%5)?1:0) or 1,
    whichever is greater.

    The base32_digits[] array will be filled in with base32 digit
    values (0 to 31) so that the value
    b[0]*32^(b_count-1) + ... + b[b_count-2]*32 + b[b_count-1]
    is the same as that defined by the x[] array.
Returns
  The number of base 32 digits in the base32_digits[] array.
  If 0 is returned, the input is not valid.
*/
ON_DECL
int ON_GetBase32Digits( const ON_SimpleArray<unsigned char>& x, ON_SimpleArray<unsigned char>& base32_digits );
ON_DECL
int ON_GetBase32Digits( const unsigned char* x, int x_count, unsigned char* base32_digits );

/*
Description:
  Convert a list of base32 digits into a string form.
Parameters:
  base32_digits - [in]
  base32_digit_count - [in]
    base32_digits[] is an array of length base32_digit_count.
    Each element is in the range 0 to 31.
  sBase32 - [out]
    sBase32[] must be an array of length base32_digit_count+1 or 2,
    whichever is greater. The string representation of the base 32
    number will be put in this string. A hash mark symbol (#) is
    used to indicate an error in the input value.  The returned
    string is null terminated.
Returns
  True if the input is valid.  False if the input is not valid,
  in which case hash marks indicate the invalid entries.
*/
ON_DECL
bool ON_Base32ToString( const ON_SimpleArray<unsigned char>& base32_digits, ON_String& sBase32 );
ON_DECL
bool ON_Base32ToString( const ON_SimpleArray<unsigned char>& base32_digits, ON_wString& sBase32 );
ON_DECL
bool ON_Base32ToString( const unsigned char* base32_digits, int base32_digit_count, char* sBase32 );

/*
Description:
  Fixt a common typos in sBase32 string.  Lower case letters are
  converted to upper case. The letters 'I', 'L', 'O' and 'S' are
  converted to '1' (one), '1' (one) '0' zero and '5' (five).
Parameters:
  sBase32 - [in]
  sBase32clean - [out]
    (can be the same string as sBase32)
Returns:
  If the input is valid, the length of the converted string is returned.
  If the input is not valid, 0 is returned.
*/
ON_DECL
int ON_CorrectBase32StringTypos( const wchar_t* sBase32, ON_wString& sBase32clean );
ON_DECL
int ON_CorrectBase32StringTypos( const char* sBase32, ON_String& sBase32clean );
ON_DECL
int ON_CorrectBase32StringTypos( const char* sBase32, char* sBase32clean );

/*
Description:
  Convert a null terminate string containing the 32 symbols

  0 1 2 3 4 5 6 7 8 9 A B C D E F G H J K M N P Q R T U V W X Y Z

  (I,L,O and S are missing) into a list of base 32 digits.
Parameters:
  sBase32 - [in]
    String with base 32 digits
  base32_digits - [out]
    base32_digits[] is an array of length strlen(sBase32).
    The returned array, element will be in the range 0 to 31.
    sBase32[] must be an array of length base32_digit_count+1 or 2,
    whichever is greater. The string representation of the base 32
    number will be put in this string. A hash mark symbol (#) is
    used to indicate an error in the input value.  The returned
    string is null terminated.
Returns
  True if the input is valid.  False if the input is not valid,
  in which case hash marks indicate the invalid entries.
*/
ON_DECL
int ON_StringToBase32(const ON_wString& sBase32, ON_SimpleArray<unsigned char>& base32_digits );
ON_DECL
int ON_StringToBase32(const ON_String& sBase32, ON_SimpleArray<unsigned char>& base32_digits );
ON_DECL
int ON_StringToBase32(const char* sBase32, unsigned char* base32_digits );

#endif


text:
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
		<link rel="stylesheet" href="https://bootswatch.com/superhero/bootstrap.min.css">

John Brown

Jim Mashlow

Natasa Blake

							Heart disease

							Asthma

							Chronic Cough

							Obesity

				<fieldset>
					Select record
					<select name="record" id="record">
						<option value="March 8 2015">March 8 2015</option>
						<option value="March 9 2015">March 9 2015</option>
					</select>
				</fieldset>

				<canvas id="canvasTime" width="800" height="256" style="border:1px solid #000000;"></canvas>
				<canvas id="canvasSpectrogram" width="800" height="256" style="border:1px solid #000000;"></canvas>


text:
layout: lecture
title: "Variables"
---

	Slides

Variables

	Learning Objectives

- Understand the concept of "data" for statistical analysis
- Explain what is a "variable"
- Understand the types of variables
- Difference between qualitative and quantitative variables
- Determine whether a variable is qualitative or quantitative

	Reading

Chapter 3, pages 42-44


text:
from urlparse import urlparse

from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase

from cabot.cabotapp.models import Service
from cabot.metricsapp.models import MetricsSourceBase, ElasticsearchStatusCheck, GrafanaInstance, GrafanaPanel

class TestMetricsReviewChanges(TestCase):

    def setUp(self):
        self.user = User.objects.create_user('user', email='user@example.com', password='password')
        self.source = MetricsSourceBase.objects.create(name='source')
        self.grafana_instance = GrafanaInstance.objects.create(
            name='test',
            url='http://test.url',
            api_key='88888'
        )
        self.grafana_panel = GrafanaPanel.objects.create(
            panel_id=1,
            panel_url='http://test.url/some-dashboard/1',
            grafana_instance=self.grafana_instance
        )
        self.metrics_check = ElasticsearchStatusCheck.objects.create(
            name='test',
            created_by=self.user,
            source=self.source,
            check_type='<=',
            warning_value=9.0,
            high_alert_value=15.0,
            retries=0,
            time_range=30,
            frequency=5,
            queries='{}',
            grafana_panel=self.grafana_panel,
            runbook=''
        )

        self.base_check_data = {
            'name': 'test',
            'queries': '{}',
            'active': True,
            'auto_sync': True,
            'check_type': '<=',
            'warning_value': 9.0,
            'high_alert_importance': Service.ERROR_STATUS,
            'high_alert_value': 15.0,
            'consecutive_failures': 1,
            'time_range': 30,
            'retries': 0,
            'frequency': 5,
            'ignore_final_data_point': True,
            'on_empty_series': 'fill_zero',
            'use_activity_counter': False,
            'run_delay': 0,
            'run_window': '',
            'runbook': '',
        }

    def test_review_changes(self):
        data = self.base_check_data.copy()
        data['name'] = 'ultra cool test'

        response = self.client.post(reverse('grafana-es-update', kwargs={'pk': self.metrics_check.pk}), data=data)
        self.assertNotContains(response, "No changes were made.", status_code=200, msg_prefix=str(response))
        self.assertNotContains(response, "errorlist", status_code=200, msg_prefix=str(response))

        # DB should NOT be updated yet
        self.metrics_check = ElasticsearchStatusCheck.objects.get(pk=self.metrics_check.pk)
        self.assertEqual(self.metrics_check.name, 'test')

        # now accept the changes by manually setting skip_review to True (which should be done in the response)
        # (would ideally do this by using a browser's normal submit routine on the response,
        # but I don't think we can do that with just django's standard testing functions.
        # we at least scan the HTML for the skip_review input to make sure it got set to True)
        self.assertContains(response,
                            '<input id="skip_review" name="skip_review" type="checkbox" checked="checked" />',
                            status_code=200)
        data['skip_review'] = True
        response = self.client.post(reverse('grafana-es-update', kwargs={'pk': self.metrics_check.pk}), data=data)

        # verify that we ended up at the success url (/check/<pk>)
        self.assertEqual(urlparse(response.url).path, reverse('check', kwargs={'pk': self.metrics_check.pk}))

        # DB should be updated, verify the name changed
        self.metrics_check = ElasticsearchStatusCheck.objects.get(pk=self.metrics_check.pk)
        self.assertEqual(self.metrics_check.name, 'ultra cool test')

    def test_review_changes_no_changes(self):
        """
        check that if we submit the form with no changes, we still go through the review changes flow
        """
        # no changes to the check
        data = self.base_check_data.copy()

        response = self.client.post(reverse('grafana-es-update', kwargs={'pk': self.metrics_check.pk}), data=data)
        self.assertNotContains(response, "errorlist", status_code=200, msg_prefix=str(response))
        self.assertContains(response, "No changes were made.", status_code=200, msg_prefix=str(response))

        # submitting again (with skip_review=True) should take us back to the check page
        data['skip_review'] = True
        response = self.client.post(reverse('grafana-es-update', kwargs={'pk': self.metrics_check.pk}), data=data)
        # verify that we ended up at the success url (/check/<pk>)
        self.assertEqual(urlparse(response.url).path, reverse('check', kwargs={'pk': self.metrics_check.pk}))


text:
namespace xwalk {

std::string GetUserAgent();

class XWalkContentClient : public content::ContentClient {
 public:
  XWalkContentClient();
  ~XWalkContentClient() override;

  static const char* const kNaClPluginName;

  void AddPepperPlugins(
      std::vector<content::PepperPluginInfo>* plugins) override;
  std::string GetProduct() const override;
  std::string GetUserAgent() const override;
  base::string16 GetLocalizedString(int message_id) const override;
  base::StringPiece GetDataResource(
      int resource_id,
      ui::ScaleFactor scale_factor) const override;
  base::RefCountedStaticMemory* GetDataResourceBytes(
      int resource_id) const override;
  gfx::Image& GetNativeImageNamed(int resource_id) const override;
  void AddAdditionalSchemes(
      std::vector<url::SchemeWithType>* standard_schemes,
      std::vector<std::string>* saveable_shemes) override;
  std::string GetProcessTypeNameInEnglish(int type) override;

 private:
  DISALLOW_COPY_AND_ASSIGN(XWalkContentClient);
};

}  // namespace xwalk

#endif  // XWALK_RUNTIME_COMMON_XWALK_CONTENT_CLIENT_H_


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Hyalopus violaceum Bat., H. Maia & A.F. Vital

### Remarks
null


text:
import itertools
import logging
import shlex
from itertools import chain
from pathlib import Path

from pants.core.target_types import ResourcesFieldSet, ResourcesGeneratorFieldSet
from pants.core.util_rules import stripped_source_files
from pants.core.util_rules.source_files import SourceFilesRequest
from pants.core.util_rules.stripped_source_files import StrippedSourceFiles
from pants.core.util_rules.system_binaries import BashBinary, TouchBinary, ZipBinary
from pants.engine.fs import Digest, MergeDigests
from pants.engine.internals.selectors import MultiGet
from pants.engine.process import Process, ProcessResult
from pants.engine.rules import Get, collect_rules, rule
from pants.engine.target import SourcesField
from pants.engine.unions import UnionRule
from pants.jvm import compile
from pants.jvm.compile import (
    ClasspathDependenciesRequest,
    ClasspathEntry,
    ClasspathEntryRequest,
    ClasspathEntryRequests,
    CompileResult,
    FallibleClasspathEntries,
    FallibleClasspathEntry,
)
from pants.jvm.subsystems import JvmSubsystem
from pants.util.logging import LogLevel

logger = logging.getLogger(__name__)

class JvmResourcesRequest(ClasspathEntryRequest):
    field_sets = (
        ResourcesFieldSet,
        ResourcesGeneratorFieldSet,
    )

@rule(desc="Assemble resources")
async def assemble_resources_jar(
    zip: ZipBinary,
    bash: BashBinary,
    touch: TouchBinary,
    jvm: JvmSubsystem,
    request: JvmResourcesRequest,
) -> FallibleClasspathEntry:
    # Request the component's direct dependency classpath, and additionally any prerequisite.
    # Filter out any dependencies that are generated by our current target so that each resource
    # only appears in a single input JAR.
    # NOTE: Generated dependencies will have the same dependencies as the current target, so we
    # don't need to inspect those dependencies.
    optional_prereq_request = [*((request.prerequisite,) if request.prerequisite else ())]
    fallibles = await MultiGet(
        Get(FallibleClasspathEntries, ClasspathEntryRequests(optional_prereq_request)),
        Get(FallibleClasspathEntries, ClasspathDependenciesRequest(request, ignore_generated=True)),
    )
    direct_dependency_classpath_entries = FallibleClasspathEntries(
        itertools.chain(*fallibles)
    ).if_all_succeeded()

    if direct_dependency_classpath_entries is None:
        return FallibleClasspathEntry(
            description=str(request.component),
            result=CompileResult.DEPENDENCY_FAILED,
            output=None,
            exit_code=1,
        )

    source_files = await Get(
        StrippedSourceFiles,
        SourceFilesRequest([tgt.get(SourcesField) for tgt in request.component.members]),
    )

    output_filename = f"{request.component.representative.address.path_safe_spec}.resources.jar"
    output_files = [output_filename]

    # #16231: Valid JAR files need the directories of each resource file as well as the files
    # themselves.

    paths = {Path(filename) for filename in source_files.snapshot.files}
    directories = {parent for path in paths for parent in path.parents}
    input_files = {str(path) for path in chain(paths, directories)}

    resources_jar_input_digest = source_files.snapshot.digest

    input_filenames = " ".join(shlex.quote(file) for file in sorted(input_files))

    resources_jar_result = await Get(
        ProcessResult,
        Process(
            argv=[
                bash.path,
                "-c",
                " ".join(
                    [
                        touch.path,
                        "-d 1980-01-01T00:00:00Z",
                        input_filenames,
                        "&&",
                        "TZ=UTC",
                        zip.path,
                        "-oX",
                        output_filename,
                        input_filenames,
                    ]
                ),
            ],
            description=f"Build resources JAR for {request.component}",
            input_digest=resources_jar_input_digest,
            output_files=output_files,
            level=LogLevel.DEBUG,
        ),
    )

    output_digest = resources_jar_result.output_digest
    cpe = ClasspathEntry(output_digest, output_files, [])

    merged_cpe_digest = await Get(
        Digest,
        MergeDigests(chain((cpe.digest,), (i.digest for i in direct_dependency_classpath_entries))),
    )

    merged_cpe = ClasspathEntry.merge(
        digest=merged_cpe_digest, entries=[cpe, *direct_dependency_classpath_entries]
    )

    return FallibleClasspathEntry(output_filename, CompileResult.SUCCEEDED, merged_cpe, 0)

def rules():
    return [
        *collect_rules(),
        *compile.rules(),
        *stripped_source_files.rules(),
        UnionRule(ClasspathEntryRequest, JvmResourcesRequest),
    ]


text:
#ifndef __CUSTOM_HPP_JWMXQYT3
#define __CUSTOM_HPP_JWMXQYT3

#include "pathway/input.hpp"

class CustomPathwayInput : public PathwayInput {
public:
    CustomPathwayInput(int height, int width);
    ~CustomPathwayInput();
    void generate(uint8_t graph[]) override;
    void getStartPoint(int *x, int *y);
    void getEndPoint(int *x, int *y);

protected:
    int m_height;
    int m_width;
    int m_sx, m_sy;
    int m_ex, m_ey;
};

#endif /* end of include guard: __CUSTOM_HPP_JWMXQYT3 */


text:
function add_vagrant_key {
    homedir=$(su - $1 -c 'echo $HOME')
    mkdir -p $homedir/.ssh
    curl -L 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -o $homedir/.ssh/authorized_keys2
    chown -Rf $1. $homedir/.ssh
    chmod 700 $homedir/.ssh
    chmod 600 $homedir/.ssh/authorized_keys2
}

if [ $(grep -c vagrant /etc/passwd) == 0 ] ; then
    useradd vagrant -m
fi

# Add public key to vagrant user
add_vagrant_key vagrant


text:
selenium.webdriver.firefox.extension\_connection
================================================

.. automodule:: selenium.webdriver.firefox.extension_connection

   .. rubric:: Classes

   .. autosummary::

      ExtensionConnection

   .. rubric:: Exceptions

   .. autosummary::

      ExtensionConnectionError


text:
vde.Vis.callback = (function() {
	var callback = {
		_registered: {
			// type: [fns]
		}
	};

	callback.register = function(type, caller, cb) {
		if(!this._registered[type]) this._registered[type] = [];
		this._registered[type].push({
			caller: caller,
			callback: cb
		});
	};

	callback.deregister = function(type, caller) {
		var del = [], regd = (this._registered[type] || []);
		regd.forEach(function(r, i) {
			if(r.caller == caller) del.push(i);
		});

		del.forEach(function(d) { regd.splice(d, 1); });
	};

	callback.run = function(type, item, opts) {
		opts.item = item;
		(this._registered[type] || []).forEach(function(r) {
			var cb = r.callback;
			cb.call(r.caller, opts);
		});
	};

	callback.clearAll = function() {
		this._registered = {};
	};

	return callback;
})();


text:
/* @test
 * @summary MarshalInputStream should verify codebase integrity (if
 * constructed to do so) even if the defaultLoader and the context class
 * loader identical, as long as neither of them are the same as or a
 * descendant of the defining class loader of the class being resolved.
 *
 *
 * @library ../../../../../testlibrary
 * @build VerifyWithEqualLoaders
 * @build Foo
 * @build HTTPD
 * @run main/othervm/policy=security.policy VerifyWithEqualLoaders
 */

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.rmi.server.RMIClassLoader;
import java.util.Collections;
import net.jini.io.MarshalInputStream;
import net.jini.io.MarshalOutputStream;

public class VerifyWithEqualLoaders {

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

	TestLibrary.suggestSecurityManager(null);

	String className = "Foo";
	TestLibrary.installClassInCodebase(className, "codebase");
	File codebaseDir =
	    new File(System.getProperty("user.dir", "."), "codebase");
	HTTPD httpd = new HTTPD(HTTPD.getDefaultPort(), codebaseDir.getPath());
	String codebase = "http://localhost:" + HTTPD.getDefaultPort() + "/";
	ClassLoader defaultLoader = ClassLoader.getSystemClassLoader();

	Class fooClass = RMIClassLoader.loadClass(codebase, className);
	Object toWrite = fooClass.newInstance();

	ByteArrayOutputStream bout = new ByteArrayOutputStream();
	MarshalOutputStream mout =
 	    new MarshalOutputStream(bout, Collections.EMPTY_LIST);
	mout.writeObject(toWrite);
	mout.flush();

	ByteArrayInputStream bin =
	    new ByteArrayInputStream(bout.toByteArray());
	MarshalInputStream min =
	    new MarshalInputStream(bin, defaultLoader, true, defaultLoader,
				   Collections.EMPTY_LIST);
	min.useCodebaseAnnotations();

	try {
	    Object read = min.readObject();
	    throw new RuntimeException(
		"TEST FAILED: object read successfully");
	} catch (ClassNotFoundException e) {
	    if (e.getCause() instanceof SecurityException) {
		e.printStackTrace();
		System.err.println("TEST PASSED");
	    } else {
		throw new RuntimeException(
		    "TEST FAILED: ClassNotFoundException, " +
		    "but doesn't contain SecurityException", e);
	    }
	}
    }
}


text:
\hypertarget{dir_c98970e3895dafcee35cfda3c712c620}{}\section{/home/ariel/\+Clion\+Projects/\+Tower\+Defense/src/\+Location Directory Reference}
\label{dir_c98970e3895dafcee35cfda3c712c620}\index{/home/ariel/\+Clion\+Projects/\+Tower\+Defense/src/\+Location Directory Reference@{/home/ariel/\+Clion\+Projects/\+Tower\+Defense/src/\+Location Directory Reference}}
Directory dependency graph for Location\+:
% FIG 0
\subsection*{Files}
\begin{DoxyCompactItemize}
\item
file \hyperlink{TilePoint_8cpp}{Tile\+Point.\+cpp}
\end{DoxyCompactItemize}


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Shops extends MY_Controller {

    public function __construct() {
        parent::__construct();
        $this->data["ctTemplate_slider"] = FALSE;
    }

    public function index() {
        $this->data['view'] = 'products';
        $this->load->view(ctTemplate(), $this->data);
    }

    public function checkout($id = NULL) {
        $this->data['view'] = 'shop-checkout';
        $this->load->view(ctTemplate('front','template-fullwidth'), $this->data);
    }
    public function login($id = NULL) {
        $this->data['view'] = 'shop-login';
        $this->load->view(ctTemplate('front','template-fullwidth'), $this->data);
    }
    public function cart($id = NULL) {
        $this->data['view'] = 'shop-cart';
        $this->load->view(ctTemplate('front','template-fullwidth'), $this->data);
    }

}


text:
"""Package contenant la commande 'embarquer'."""

from math import sqrt

from primaires.interpreteur.commande.commande import Commande
from secondaires.navigation.constantes import *

class CmdEmbarquer(Commande):

    """Commande 'embarquer'"""

    def __init__(self):
        """Constructeur de la commande"""
        Commande.__init__(self, "embarquer", "embark")
        self.nom_categorie = "navire"
        self.schema = "(<nom_navire>)"
        self.aide_courte = "embarque sur un navire proche"
        self.aide_longue = \
            "Cette commande permet d'embarquer sur un navire proche. " \
            "Vous devez l'entrer sur un quai. Si un navire se trouve " \
            "assez prêt, vous sauterez à bord, ce qui peut être utile " \
            "pour des navires n'ayant aucune passerelle. Vous pouvez " \
            "préciser en paramètre un fragment de nom de navire pour " \
            "embarquer dans un navire précis."

    def interpreter(self, personnage, dic_masques):
        """Méthode d'interprétation de commande"""
        personnage.agir("bouger")
        salle = personnage.salle
        navires = []
        if dic_masques["nom_navire"]:
            navires = [dic_masques["nom_navire"].navire]

        if hasattr(salle, "navire"):
            o_navire = salle.navire
            etendue = o_navire.etendue
        else:
            # On va chercher le navire le plus proche
            o_navire = None
            etendue = salle.etendue
            if etendue is None:
                personnage << "|err|Vous n'êtes pas sur un quai.|ff|"
                return

        if not navires:
            navires = [n for n in importeur.navigation.navires.values() if \
                    n.etendue is etendue and n is not o_navire]

        # On cherche la salle de nagvire la plus proche
        d_salle = None # la salle de destination
        navire = None
        distance = 2
        x, y, z = salle.coords.tuple()
        for t_navire in navires:
            for t_salle in t_navire.salles.values():
                if t_salle.coords.z == etendue.altitude:
                    t_x, t_y, t_z = t_salle.coords.tuple()
                    t_distance = sqrt((x - t_x) ** 2 + (y - t_y) ** 2)
                    if t_distance < distance:
                        navire = t_navire
                        d_salle = t_salle
                        distance = t_distance

        if d_salle is None:
            personnage << "|err|Aucun navire n'a pu être trouvé à " \
                    "proximité.|ff|"
            return

        personnage.salle = d_salle
        personnage << "Vous sautez dans {}.".format(
                navire.desc_survol)
        personnage << d_salle.regarder(personnage)
        d_salle.envoyer("{{}} arrive en sautant depuis {}.".format(
                salle.titre.lower()), personnage)
        salle.envoyer("{{}} saute dans {}.".format(
                navire.nom), personnage)
        importeur.hook["personnage:deplacer"].executer(
                personnage, d_salle, None, 0)
        importeur.navigation.ecrire_suivi("{} embarque dans {}.".format(
                personnage.nom_unique, navire.cle))

        # On appelle les pnj.arrive des PNJs de la salle
        for perso in d_salle.personnages:
            if perso is not personnage and hasattr(perso, "script") and \
                    perso.peut_voir(personnage):
                importeur.hook["pnj:arrive"].executer(perso,
                        personnage)


text:
using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Threading;

namespace Mono.Cecil.Inject
{
    /// <summary>
    ///     Specifies methods for easy parameter type creation and conversion between <see cref="Type" /> and
    ///     <see cref="TypeReference" />.
    ///     Most likely you won't need to use these, as Cecil.Inject does the conversion for you.
    /// </summary>
    public static class ParamHelper
    {
        private static readonly ModuleDefinition resolverModule;

        static ParamHelper()
        {
            resolverModule = ModuleDefinition.CreateModule("ResolverModule", new ModuleParameters());
        }

        /// <summary>
        ///     Creates a fake type with the specified name to use in place of generic types.
        /// </summary>
        /// <param name="name">Name of the type to create.</param>
        /// <returns>An instance of <see cref="Type" /> for the specified fake type.</returns>
        public static Type CreateDummyType(string name)
        {
            AssemblyName an = new AssemblyName("TmpAssembly");
            AssemblyBuilder ab = Thread.GetDomain().DefineDynamicAssembly(an, AssemblyBuilderAccess.ReflectionOnly);
            ModuleBuilder mb = ab.DefineDynamicModule("TmpModule");
            TypeBuilder tb = mb.DefineType(name);

            return tb.CreateType();
        }

        /// <summary>
        ///     Creates a generic type with a specified name.
        /// </summary>
        /// <param name="name">Name of the generic to create.</param>
        /// <returns>
        ///     Type reference for the generic type. The generic type does not have a namespace nor any properties besides its
        ///     name and the fact that it is a generic type.
        /// </returns>
        public static TypeReference CreateGeneric(string name)
        {
            return new GenericParameter(new TypeReference(name, null, resolverModule, null))
            {
                Name = name
            };
        }

        /// <summary>
        ///     Obtains the type reference from <see cref="System.Type" /> that has generic parameters.
        /// </summary>
        /// <typeparam name="T">Type to turn into Mono.Cecil representation of type refrence.</typeparam>
        /// <returns>Type reference of the type that contains generic parameters.</returns>
        public static TypeReference FromType<T>()
        {
            return FromType(typeof(T));
        }

        /// <summary>
        ///     Obtains the type reference from <see cref="Type" />.
        /// </summary>
        /// <param name="type">Type to turn into Mono.Cecil representation of type refrence.</param>
        /// <returns>An instance of <see cref="TypeReference" /> for the provided type.</returns>
        public static TypeReference FromType(Type type)
        {
            TypeReference tr = resolverModule.Import(type);
            return tr;
        }
    }
}