text:
* * *

title: "Artista: formas" view: page_curriculum theme: none

* * *

<%= partial('curriculum_header', :unittitle=>'Curso 1', :lesson=>10, :title=> 'Artista: formas', :unplugged=>false, :time=>30) %>

[content]

[together]

## Visão geral da aula

De volta ao Artista, os desafios desta fase se concentram em desenhar, combinar e dividir quadrados e retângulos.

[summary]

## Índice de ensino

### **Primeiros passos**

[Introdução](#GetStarted)

### **Atividade: Formas do artista**

[Artista: formas](#Activity)

### **Aprendizagem estendida**

[Atividades de extensão](#Extended)

[/summary]

## Objetivos da aula

### Os alunos vão:

  * Criar um programa para desenhar uma forma usando passos sequenciais
  * Explicar a diferença entre quadrados e retângulos com base em evidências que consistem nos comandos usados para desenhar diferentes formas
  * Comparar as posições de diferentes objetos usando "acima", "abaixo" e "ao lado"
  * Identificar formas corretamente, independentemente de sua dimensão
  * Comparar e contrastar quadrados e retângulos pelo número e tamanho dos lados

[/together]

[together]

## Primeiros passos

###  Introdução

Antes de começar a aula, os alunos devem ter um conhecimento básico sobre quadrados e retângulos.

  * Como você cria um quadrado? E um retângulo?
  * O que acontece quando você coloca dois quadrados juntos, um do lado do outro?

[/together]

[together]

## Atividade

###  [Artista: formas](http://learn.code.org/s/course1/stage/10/puzzle/1)

Se os alunos tiverem dificuldades para usar o número correto de blocos para desenhar uma reta, mostre que todo segmento de reta tem um ponto em cada extremidade.

[/together]

[together]

## Aprendizagem estendida

Use essas atividades para melhorar a aprendizagem do aluno. Elas podem ser usadas como atividades extraclasse ou como outra forma de aprendizado.

### A máquina copiadora

  * Dê aos alunos duas folhas de papel
  * Em uma delas, peça que os alunos desenhem uma imagem simples (apenas linhas retas e ângulos retos)
  * Na segunda folha, escreva instruções para recriar a imagem usando uma série de setas
  * Troque as folhas de instrução e tente recriar a imagem usando apenas as instruções fornecidas.

[/together]

[standards]

## Conexões e informações básicas

### Habilidades avaliadas pela PARCC / Smarter Balanced Assessment

  * Clicar / tocar
  * Arrastar e soltar
  * Selecionar objeto
  * Usar player de vídeo

### Padrões ISTE (anteriormente chamados NETS)

  * 1.a - Aplicar conhecimentos existentes para gerar novas ideias, produtos ou processos.
  * 1.b - Criar trabalhos originais por meio de processos pessoais ou em grupo.
  * 1.c - Usar modelos e simulações para explorar questões e sistemas complexos.
  * 4.b - Planejar e gerenciar atividades para desenvolver uma solução ou concluir um projeto.
  * 6.a - Entender e usar sistemas tecnológicos.
  * 6.c - Solucionar problemas de sistemas e aplicações.
  * 6.d - Transferir o conhecimento atual para o aprendizado de novas tecnologias.

### CSTA K-12 Computer Science Standards

  * CL.L1:3-02. Trabalhar de forma cooperativa e colaborativa com colegas e professores usando tecnologia.
  * CT.L1:3-01. Usar recursos tecnológicos (por exemplo, desafios e programas de pensamento lógico) para resolver problemas apropriados para a faixa etária.
  * CPP.L1:6-05. Construir um programa como um conjunto de instruções a serem seguidas passo a passo.
  * CPP.L1:6-06. Implementar soluções de problemas usando uma linguagem de programação visual baseada em blocos.
  * CT.L2-01. Usar os passos básicos de resolução de problemas com algoritmo para encontrar soluções.
  * CT.L2-06. Descrever e analisar uma sequência de instruções sendo seguidas.
  * CT.L2-08. Usar representações visuais dos estados, estruturas e dados do problema.
  * CT.L2-12. Usar abstração para decompor um problema em problemas menores.

### Next-Gen Science Standards

  * K-2-PS3-2. Usar ferramentas e materiais fornecidos para desenvolver e construir um dispositivo que resolva um problema específico, ou uma solução para um problema específico.

### Práticas matemáticas do Common Core

  *   1. Dar sentido aos problemas e perseverar para resolvê-los.
  *   1. Ter raciocínio abstrato e quantitativo.
  *   1. Criar modelos matemáticos
  *   1. Usar ferramentas apropriadas estrategicamente.
  *   1. Ter precisão.
  *   1. Procurar e fazer uso de estrutura.
  *   1. Procurar e expressar regularidade no raciocínio repetido.

### Padrões matemáticos do Common Core

  * K.G.A.1 - Descrever objetos no ambiente usando nomes de formas, e descrever as posições relativas desses objetos usando termos como acima, abaixo, ao lado, na frente, atrás e próximo a.
  * K.G.A.2 - Nomear as formas corretamente, independentemente das orientações ou dimensões.
  * K.G.B.6 - Compor formas simples para criar formas maiores. Por exemplo, "você pode juntar esses dois triângulos para criar um retângulo?"
  * 1.G.A.1 - Diferenciar atributos de definição (por exemplo, triângulos são formas fechadas e têm três lados) e atributos que não são de definição (por exemplo, cor, direção, dimensão); criar e desenhar formas que tenham atributos de definição.
  * 1.G.A.2 - Compor formas bidimensionais (retângulos, quadrados, trapézios, triângulos, semicírculos e quartos de círculo) ou formas tridimensionais (cubos, prismas retangulares retos, cones circulares retos e cilindros circulares retos) para criar uma forma composta, e compor novas formas a partir da forma composta.
  * 1.G.A.3 - Fragmentar círculos e retângulos em duas e quatro partes iguais, descrever as partes usando as palavras "metade" e "quarto", e usar sentenças "metade de" e "quarto de". Descrever o inteiro como duas ou quatro das partes. Entender, por meio desses exemplos, que a decomposição em mais partes iguais cria partes menores.
  * 2.G.A.1 - Reconhecer e desenhar formas a partir de atributos específicos, como um dado número de ângulos ou um dado número de faces iguais. Identificar triângulos, quadriláteros, pentágonos, hexágonos e cubos.

### Padrões de Língua e Literatura do Common Core

  * SL.K.1 - Participar de conversas colaborativas com vários parceiros sobre tópicos da educação infantil e trocar informações com colegas e adultos em pequenos e grandes grupos.
  * SL.K.5 - Adicionar desenhos ou outros elementos visuais às descrições para fornecer detalhes adicionais.
  * L.K.6 - Usar palavras e frases adquiridas em conversas e leituras e em resposta aos textos.
  * SL.1.1 - Participar de conversas colaborativas com vários parceiros sobre tópicos do primeiro ano e trocar informações com colegas e adultos em pequenos e grandes grupos.
  * SL.1.5 - Adicionar desenhos ou outros elementos visuais às descrições para esclarecer ideias, pensamentos e sentimentos.
  * L.1.6 - Usar palavras e frases adquiridas em conversas e leituras e em resposta aos textos, usando inclusive conjunções recorrentes para assinalar relações simples.
  * SL.2.1 - Participar de conversas colaborativas com vários parceiros sobre tópicos do segundo ano e trocar informações com colegas e adultos em pequenos e grandes grupos.
  * L.2.6 - Usar palavras e frases adquiridas em conversas e leituras e em resposta aos textos, inclusive adjetivos e advérbios para descrição.

[/standards]

[/content]

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


text:
BEGIN_DECLARE_MODULE(TeamCommSender)
  PROVIDE(DebugPlot)
  PROVIDE(DebugRequest)
  PROVIDE(DebugParameterList)

  REQUIRE(FrameInfo)
  REQUIRE(PlayerInfo)
  REQUIRE(RobotInfo)
  REQUIRE(MotionStatus)
  REQUIRE(RobotPose)
  REQUIRE(BallModel)
  REQUIRE(BodyState)
  REQUIRE(RoleDecisionModel)
  REQUIRE(SoccerStrategy)
  REQUIRE(TeamMessage)
  REQUIRE(BatteryData)
  REQUIRE(KickActionModel)
  REQUIRE(CpuData)
  REQUIRE(TeamBallModel)
  REQUIRE(WifiMode)

  PROVIDE(TeamMessageData)
  PROVIDE(TeamMessageDataOut)
END_DECLARE_MODULE(TeamCommSender)

class TeamCommSender: public TeamCommSenderBase
{
public:
  TeamCommSender();
  ~TeamCommSender();

  virtual void execute();

private:
  class Parameters: public ParameterList
  {
  public:
    Parameters(): ParameterList("TeamCommSender")
    {
      PARAMETER_REGISTER(sendBallAgeDobermann) = false;

      // load from the file after registering all parameters
      syncWithConfig();
    }

    bool sendBallAgeDobermann;

    virtual ~Parameters() {}
  } parameters;

private:
  unsigned int lastSentTimestamp;
  unsigned int send_interval;

  void fillMessageBeforeSending() const;
};

#endif // TEAMCOMMSENDER_H

redpajama_set_name: RedPajamaGithub


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/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Narrative Survey Email</title>

Would you recommend us?

                  Your opinion is important to us! Please take a moment and let us know how likely are you to recommend us to a friend?

                  Just click on one of the buttons below. 0 being not likely and 10 being very likely. It's that simple!

                          Not likely

                          Very likely

                      0
                      1
                      2
                      3
                      4
                      5
                      6
                      7
                      8
                      9
                      10

                              Thank you for your time!

Awesome Co

                  Contact Us  |
                  Facebook  |
                  Twitter  |
                  Support


text:
/*
 * File:   radiotftp.h
 * Author: alpsayin
 *
 * Created on April 9, 2012, 8:36 PM
 */

#ifndef RADIOTFTP_H
#define	RADIOTFTP_H

#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <stdint.h>

#include "manchester.h"
#include "ethernet.h"
#include "udp_ip.h"
#include "tftp.h"
#include "radiotftp.h"
#include "ax25.h"
#include "contiki.h"
#include "contiki-conf.h"
#include "contiki-net.h"
#include "contiki-lib.h"

#define RADIOTFTP_ENABLE_ACKNOWLEDGMENTS 1
#define REMOTE_FILENAME "sensors.dat"
#define APPEND 1
#define HELLO_WORLD_PORT 12345
#define END_OF_FILE 28 //do not change
#define AX25_ENABLED 1
#define ETHERNET_ENABLED 0
#define MY_AX25_CALLSIGN "SA0BXI\x0f"
#define MY_ETHERNET_ADDRESS	{0xf0, 0x0, 0x0, 0x0, 0x0, 0x1}
#define MY_IP_ADDRESS { 0xa1, 0xa2, 0xa3, 0xa4 }

void radiotftpAlarm_callback(void* data);
int uart0_rx(unsigned char receivedByte);
int uart1_rx(unsigned char receivedByte);
uint8_t setRTS(uint8_t level);
void radiotftp_setNumBytesToSend(uint16_t numBytes);
uint16_t radiotftp_getNumBytesToSend();
uint8_t queueSerialData(uint8_t* src, uint16_t src_port, uint8_t* dst, uint16_t dst_port, uint8_t* dataptr, uint16_t datalen);
uint16_t transmitSerialData(void);
uint8_t udp_packet_demultiplexer(uint8_t* src, uint16_t src_port, uint8_t* dst, uint16_t dst_port, uint8_t* payload, uint16_t len);
PROCESS_NAME(radiotftp_process);

#endif


text:
package org.finos.waltz.jobs.harness;

import org.finos.waltz.model.EntityKind;
import org.finos.waltz.service.DIConfiguration;
import org.jooq.DSLContext;
import org.jooq.Record;
import org.jooq.SelectConditionStep;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import static org.finos.waltz.schema.Tables.INVOLVEMENT;
import static org.finos.waltz.schema.tables.InvolvementKind.INVOLVEMENT_KIND;
import static org.finos.waltz.schema.tables.Measurable.MEASURABLE;
import static org.finos.waltz.schema.tables.Person.PERSON;

public class MeasurableExporterHarness {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
        DSLContext dsl = ctx.getBean(DSLContext.class);

        long categoryId = 1L;

        SelectConditionStep<Record> qry = dsl
                .select(MEASURABLE.NAME, MEASURABLE.DESCRIPTION, MEASURABLE.ID, MEASURABLE.PARENT_ID, MEASURABLE.EXTERNAL_ID)
                .select(INVOLVEMENT_KIND.NAME)
                .select(PERSON.DISPLAY_NAME)
                .from(MEASURABLE)
                .leftJoin(INVOLVEMENT)
                .on(INVOLVEMENT.ENTITY_ID.eq(MEASURABLE.ID).and(INVOLVEMENT.ENTITY_KIND.eq(EntityKind.MEASURABLE.name())))
                .leftJoin(INVOLVEMENT_KIND)
                .on(INVOLVEMENT_KIND.ID.eq(INVOLVEMENT.KIND_ID))
                .leftJoin(PERSON)
                .on(PERSON.EMPLOYEE_ID.eq(INVOLVEMENT.EMPLOYEE_ID))
                .where(MEASURABLE.MEASURABLE_CATEGORY_ID.eq(categoryId));

        qry.fetch().forEach(System.out::println);

    }
}


text:
<?php

namespace App\Listeners\ModelEventListener\User;

use App\Events\ModelEvents\UserCreated;
use App\Tools\Authenticates\InviteAble;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class SendInviteMail
{
    use InviteAble;

    /**
     * Handle the event.
     *
     * @param  UserCreated  $event
     * @return void
     */
    public function handle(UserCreated $event)
    {
        $this->invite($event->user);
    }
}


text:
- Show: [Fresh Prince of Bel-Air](http://www.imdb.com/title/tt0098800/)
- Episode: S1E02
- Time: 13:50
- Link to clip: None. Ask teacher for clip

## Script:
- Geoffrey Butler: Master William, there is a young gentleman downstairs with a rather large radio who is here to see you. He claims his name is Jazz.

- Will: Yo, word up. Send him up.

- Uncle Phil: No, No. Who is this Jazz fellow?

- Will: Yo, I heard the boy at a club. He is all of that. I hope he going to be Ashley's new music teacher. I mean, now, he is not as experienced as madam Chaska, but then who is.

- Geoffrey Butler: Mister Jazz.

- Aunt Vivian: It is nice to meet you Jazz.

- Uncle Phil: How do you do, I am Mr. Banks.

- Jazz: You got that right. Man, you loaded!

- Will: Yo, what's up J.

## Words:
- Master {Name}:
	+ Master is a term used for boys who have not entered society.

- gentleman
	+ Refers to any good man

- Rather ~ very
	+ rather large = very large
	+ rather small = very small
	+ rather ugly = very ugly
	+ rather beautiful = very beautiful

- claims
	+ he claims = he says

- yo
	+ A way of informally addressing someone; a sound of excitement.

- word up
	+ acknowledgement, approval, indication of enthusiasm

- Fellow
	+ a person

- the boy {the girl}
	+ a way of referring to someone else.

- All of that == all that
	+ The coolest person; the greatest person; a top quality person.

- Madam
	+ A polite way of addressing a lady.

- loaded
	+ Rich. Really rich.

## Phrases:
- A is not as {add word} as B
- A is not as {add word} as B, but then again, who is.
- How do you do. {state who you are}

## Sentences
- Master William, there is a young gentleman here to see you.
- Master Bruce, it is time to leave.
- Master Marcus, dinner is ready.

- There is a young gentleman here to see you.
- That gentleman just left.
- There is no such gentleman here.

- There is a young gentleman with a rather large radio here to see you.
- That book is rather large.
- That water bottle is rather small.
- That chair is rather small.
- That baby is rather ugly.
- That person is rather ugly
- That baby is rather beautiful.
- that person is rather beautiful.

- (s)he claims ~ (s)he says
	+ He claims his name is Jazz.
	+ She claims her name is Love.
	+ He claims we do not have homework.
	+ She claims there is no class this Friday.

- Yo, what's up?
- Yo, how have you been?
- Yo, did you see that?
- Yo! Word up. Send him up.

- Word up. Send him up.
- Word up, I am ready.
- Word up, let's go.

- Who is this Jazz fellow?
- That fellow over there wants a drink.
- I do not like this Marcus fellow.

- I heard the boy play at a club.
- I heard the girl sing at school.
- I saw the boy eating lunch outside.
- I saw the girl eating lunch outside.

- {statement}. He is all that.
- {statement}. She is all that.
- I heard the boy play at a club. He is all (of) that.

- Excuse me Madam.
- Madam Teran, here is your seat.
- May I help you Madam?

- He is not as tall as her.
	+ Meaning: She is taller than him.

- He is not as tall as her, but then again, who is.
	+ Meaning: She is taller than him.
	+ Meaning: She is very tall.
	+ Meaning: She is taller than most people.

- She is not as fast as him.
	+ Meaning: He is faster than her.

- She is not as fast as him, but then again, who is.
	+ Meaning: He is faster than her.
	+ Meaning: He is really fast.
	+ Meaning: He is faster than most people.

- He is not as experienced as her.
	+ Meaning: She has more experience than him.

- He is not as experienced as her, but then again, who is.
	+ Meaning: She has more experience than him.
	+ Meaning: She has a lot of experience.
	+ Meaning: She is more experienced that most people.

- How do you do. I am Marcus Willock.
- How do you do. I am Mr. Banks.
- How do you do. My name is James Bond.

- He's loaded!
- She's loaded!
- That person is loaded!


text:
#ifndef _INTERVAL_H_
#define _INTERVAL_H_

#ifdef __cplusplus
#include <cstddef>

using std::size_t;

extern "C" {
#else
#include <stddef.h>
#endif

#include <EXTERN.h>
#include <perl.h>

/* User-defined item handling */
typedef SV *(*dup_f) ( SV *p );
typedef void  (*rel_f) ( SV *p );

typedef struct interval {

  float  low, high; /* Interval boundaries, inclusive */
  SV   *data;     /* User-defined content */
  dup_f  dup;       /* Clone an interval data item */
  rel_f  rel;       /* Destroy an interval data item */

} interval_t;

/* Interval functions */
interval_t *interval_new ( float, float, SV*, dup_f, rel_f );
interval_t *interval_copy(const interval_t*);
void       interval_delete ( interval_t* );
int        interval_overlap ( const interval_t*, const interval_t* );
/*
 * WARNING
 *
 * Comparison of floating-point values does not guarantee the correct results
 * and is subject to machine-dependent behaviour.
 *
 * This is critical and needs to be revised.
 */
int        interval_equal ( const interval_t*, const interval_t* );

#ifdef __cplusplus
}
#endif

#endif /* _INTERVAL_H_ */


text:
const buildPrettierOptions = require('./buildPrettierOptions');
const { getCurrentFilePath } = require('../editorInterface');

const buildPrettierStylelintOptions = (editor: TextEditor, text: string) => ({
  text,
  prettierOptions: buildPrettierOptions(editor),
  filePath: getCurrentFilePath(editor),
});

module.exports = buildPrettierStylelintOptions;


text:
#ifndef BABYLON_ENUMS_H
#define BABYLON_ENUMS_H

#include <cstddef>

namespace BABYLON {

struct EnumClassHashFunction {
  template <typename T>
  std::size_t operator()(T t) const
  {
    return static_cast<std::size_t>(t);
  }
};

/** Animation types **/

/**
 * @brief Enum for the animation key frame interpolation type.
 */
enum class AnimationKeyInterpolation {
  /**
   * Do not interpolate between keys and use the start key value only. Tangents
   * are ignored
   */
  STEP = 1
}; // end of enum class AnimationKeyInterpolation

/**
 * @brief Event types
 */
enum class EventType {
  CONTEXT_MENU      = 0,
  MOUSE_BUTTON_DOWN = 1,
  MOUSE_BUTTON_UP   = 2,
  MOUSE_OUT         = 3,
  MOUSE_MOVE        = 4,
  MOUSE_WHEEL       = 5,
  DOM_MOUSE_SCROLL  = 6,
  KEY_DOWN          = 7,
  KEY_UP            = 8,
  BLUR              = 9,
  UNKNOWN           = 10,
}; // end of enum class EventType

/**
 * @brief Mouse button types
 */
enum class MouseButtonType {
  UNDEFINED = -1,
  LEFT      = 0,
  MIDDLE    = 1,
  RIGHT     = 2
}; // end of enum class MouseButtonType

/**
 * @brief Pointer types
 */
enum class PointerType {
  UNDEFINED = -1,
  MOUSE     = 0,
  TOUCH     = 1,
}; // end of enum class MouseButtonType

/**
 * @brief Property types
 */
enum class PropertyType : unsigned int { ROTATION = 100 }; // end of enum class PropertyType

/**
 * @brief Defines supported task for worker process.
 */
enum class WorkerTaskType {
  /** Initialization */
  INIT = 0,
  /** Update of geometry */
  UPDATE = 1,
  /** Evaluate collision */
  COLLIDE = 2
}; // end of enum class WorkerTaskType

/**
 * @brief Defines kind of replies returned by worker
 */
enum class WorkerReplyType {
  /** Success */
  SUCCESS = 0,
  /** Unkown error */
  UNKNOWN_ERROR = 1
}; // end of enum class WorkerReplyType

/**
 * @brief Defines operator used for tonemapping
 */
enum class TonemappingOperator {
  /** Hable */
  HABLE = 0,
  /** Reinhard */
  REINHARD = 1,
  /** HejiDawson */
  HEJIDAWSON = 2,
  /** Photographic */
  PHOTOGRAPHIC = 3,
}; // end of enum class TonemappingOperator

/** Math Enums **/

/**
 * @brief Defines supported spaces.
 */
enum class Space {
  /** Local (object) space */
  LOCAL = 0,
  /** World space */
  WORLD = 1,
  /** Bone space */
  BONE = 2
}; // end of enum class Space

/**
 * @brief Defines cartesian components.
 */
enum class Coordinate {
  /** X axis */
  X,
  /** Y axis */
  Y,
  /** Z axis */
  Z
}; // end of enum class Coordinate

/**
 * @brief Defines potential orientation for back face culling.
 */
enum class Orientation {
  /** Clockwise */
  CW = 0,
  /** Counter clockwise */
  CCW = 1,
}; // end of enum class Orientation

/** Mesh Enums **/

/**
 * @brief The implemented types of simplification.
 * At the moment only Quadratic Error Decimation is implemented
 * @see https://doc.babylonjs.com/how_to/in-browser_mesh_simplification
 */
enum class SimplificationType {
  /** Quadratic error decimation */
  QUADRATIC
}; // end of enum class SimplificationType

enum class Type : unsigned int {
  NODE  = 0,
  SCENE = 1,
  // Bones
  BONE     = 2,
  SKELETON = 3,
  // Cameras
  CAMERA                  = 10,
  ARCFOLLOWCAMERA         = 11,
  ARCROTATECAMERA         = 12,
  DEVICEORIENTATIONCAMERA = 13,
  FOLLOWCAMERA            = 14,
  FREECAMERA              = 15,
  TARGETCAMERA            = 16,
  // Lights
  LIGHT            = 50,
  DIRECTIONALLIGHT = 51,
  HEMISPHERICLIGHT = 52,
  POINTLIGHT       = 53,
  SPOTLIGHT        = 54,
  // Materials
  MATERIAL         = 100,
  MULTIMATERIAL    = 101,
  SHADERMATERIAL   = 102,
  STANDARDMATERIAL = 103,
  PBRMATERIAL      = 104,
  NORMALMATERIAL   = 105,
  PUSHMATERIAL     = 106,
  // Meshes
  ABSTRACTMESH  = 150,
  GROUNDMESH    = 151,
  INSTANCEDMESH = 152,
  LINESMESH     = 153,
  MESH          = 154,
  TRANSFORMNODE = 155,
  // Particles
  PARTICLE          = 200,
  PARTICLESYSTEM    = 201,
  GPUPARTICLESYSTEM = 202,
  // Texture
  BASETEXTURE = 250,
  TEXTURE     = 251,
  // Morph
  MORPHTARGET = 300,
  // Sprite
  SPRITE = 350,
  // Piplines
  STANDARDRENDERINGPIPLINE = 400
}; // end of enum class Type

/**
 * @brief Represents the unit of the delta* values' scroll amount.
 */
enum class WheelEvent : unsigned int {
  DOM_DELTA_PIXEL = 0x00,
  DOM_DELTA_LINE  = 0x01,
  DOM_DELTA_PAGE  = 0x02,
}; // end of enum class WheelEvent

} // end of namespace BABYLON

#endif // end of BABYLON_ENUMS_H


text:
/* number of "windows" on the directory browser */
var BROWSER_NUM = 3;

/* the border around the playing item in the playlist */
var PLAYLIST_PLAYING_STYLE = "1px solid #33BBCC";

/* this is the color thing that you add blink in */
var DEFAULT_BLINK_COLOR = "#C1DAD6";

var BASE_IMG_DIR = "../theme/thexy/images/";

var IMAGE = new Object();

IMAGE.BUTTON_PLAY 		= BASE_IMG_DIR + "play_light.jpg";
IMAGE.BUTTON_STOP     = BASE_IMG_DIR + "stop_light.jpg";
IMAGE.BUTTON_PAUSE    = BASE_IMG_DIR + "pause_light.jpg";
IMAGE.BUTTON_PREVIOUS = BASE_IMG_DIR + "previous_light.jpg";
IMAGE.BUTTON_NEXT     = BASE_IMG_DIR + "next_light.jpg";

IMAGE.BROWSER_PLAYLIST_REMOVE = BASE_IMG_DIR + "disabled.png";

IMAGE.SERVER_SETTINGS_ENABLED   = BASE_IMG_DIR + "enabled.png";
IMAGE.SERVER_SETTINGS_DISABLED  = BASE_IMG_DIR + "disabled.png";
IMAGE.SERVER_SETTINGS_XFADE_DOWN= BASE_IMG_DIR + "back.png";
IMAGE.SERVER_SETTINGS_XFADE_UP  = BASE_IMG_DIR + "forward.png";

IMAGE.CLOSE    = BASE_IMG_DIR + "fileclose.png";
IMAGE.WORKING  = BASE_IMG_DIR + "activity.gif";

IMAGE.MENU_ITEM_CROP      = BASE_IMG_DIR + "crop_selection.png";
IMAGE.MENU_ITEM_REMOVE    = BASE_IMG_DIR + "remove_selection.png";
IMAGE.MENU_ITEM_DIRECTORY = BASE_IMG_DIR + "browse_media.png";

IMAGE.PAGINATION_FOLLOW   = BASE_IMG_DIR + "enabled.png";
IMAGE.PAGINATION_NOFOLLOW = BASE_IMG_DIR + "disabled.png";

IMAGE.JUMP_CURRENT = BASE_IMG_DIR + "jump.png";

IMAGE.STREAM_BGCOLOR = "1118481";


text:
using System.Collections.Generic;

namespace TrueSync.Physics2D
{
    public enum GravityType
    {
        Linear,
        DistanceSquared
    }

    public class GravityController : Controller
    {
        public GravityController(FP strength)
            : base(ControllerType.GravityController)
        {
            Strength = strength;
            MaxRadius = FP.MaxValue;
            GravityType = GravityType.DistanceSquared;
            Points = new List<TSVector2>();
            Bodies = new List<Body>();
        }

        public GravityController(FP strength, FP maxRadius, FP minRadius)
            : base(ControllerType.GravityController)
        {
            MinRadius = minRadius;
            MaxRadius = maxRadius;
            Strength = strength;
            GravityType = GravityType.DistanceSquared;
            Points = new List<TSVector2>();
            Bodies = new List<Body>();
        }

        public FP MinRadius { get; set; }
        public FP MaxRadius { get; set; }
        public FP Strength { get; set; }
        public GravityType GravityType { get; set; }
        public List<Body> Bodies { get; set; }
        public List<TSVector2> Points { get; set; }

        public override void Update(FP dt)
        {
            TSVector2 f = TSVector2.zero;

            foreach (Body worldBody in World.BodyList)
            {
                if (!IsActiveOn(worldBody))
                    continue;

                foreach (Body controllerBody in Bodies)
                {
                    if (worldBody == controllerBody || (worldBody.IsStatic && controllerBody.IsStatic) || !controllerBody.Enabled)
                        continue;

                    TSVector2 d = controllerBody.Position - worldBody.Position;
                    FP r2 = d.LengthSquared();

                    if (r2 <= Settings.Epsilon || r2 > MaxRadius * MaxRadius || r2 < MinRadius * MinRadius)
                        continue;

                    switch (GravityType)
                    {
                        case GravityType.DistanceSquared:
                            f = Strength / r2 * worldBody.Mass * controllerBody.Mass * d;
                            break;
                        case GravityType.Linear:
                            f = Strength / FP.Sqrt(r2) * worldBody.Mass * controllerBody.Mass * d;
                            break;
                    }

                    worldBody.ApplyForce(ref f);
                }

                foreach (TSVector2 point in Points)
                {
                    TSVector2 d = point - worldBody.Position;
                    FP r2 = d.LengthSquared();

                    if (r2 <= Settings.Epsilon || r2 > MaxRadius * MaxRadius || r2 < MinRadius * MinRadius)
                        continue;

                    switch (GravityType)
                    {
                        case GravityType.DistanceSquared:
                            f = Strength / r2 * worldBody.Mass * d;
                            break;
                        case GravityType.Linear:
                            f = Strength / FP.Sqrt(r2) * worldBody.Mass * d;
                            break;
                    }

                    worldBody.ApplyForce(ref f);
                }
            }
        }

        public void AddBody(Body body)
        {
            Bodies.Add(body);
        }

        public void AddPoint(TSVector2 point)
        {
            Points.Add(point);
        }
    }
}


text: <title>Test Action</title>


text:
include_recipe 'postfix::_common'

include_recipe 'postfix::sasl_auth' if node['postfix']['main']['smtp_sasl_auth_enable'] == 'yes'

include_recipe 'postfix::aliases' if node['postfix']['use_alias_maps']

include_recipe 'postfix::transports' if node['postfix']['use_transport_maps']

include_recipe 'postfix::access' if node['postfix']['use_access_maps']

include_recipe 'postfix::virtual_aliases' if node['postfix']['use_virtual_aliases']

include_recipe 'postfix::virtual_aliases_domains' if node['postfix']['use_virtual_aliases_domains']

include_recipe 'postfix::relay_restrictions' if node['postfix']['use_relay_restrictions_maps']

include_recipe 'postfix::maps' if node['postfix']['maps']


text:
FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType type)
{
	// first, verify that path is within the system's root folder
	FileData* root = system->getRootFolder();
	bool contains = false;
	std::string relative = Utils::FileSystem::removeCommonPath(path, root->getPath(), contains, true);

	if(!contains)
	{
		LOG(LogError) << "File path \"" << path << "\" is outside system path \"" << system->getStartPath() << "\"";
		return NULL;
	}

	Utils::FileSystem::stringList pathList = Utils::FileSystem::getPathList(relative);
	auto path_it = pathList.begin();
	FileData* treeNode = root;
	bool found = false;
	while(path_it != pathList.end())
	{
		const std::unordered_map<std::string, FileData*>& children = treeNode->getChildrenByFilename();

		std::string key = *path_it;
		found = children.find(key) != children.cend();
		if (found) {
			treeNode = children.at(key);
		}

		// this is the end
		if(path_it == --pathList.end())
		{
			if(found)
				return treeNode;

			if(type == FOLDER)
			{
				LOG(LogWarning) << "gameList: folder doesn't already exist, won't create";
				return NULL;
			}

			FileData* file = new FileData(type, path, system->getSystemEnvData(), system);

			// skipping arcade assets from gamelist
			if(!file->isArcadeAsset())
			{
				treeNode->addChild(file);
			}
			return file;
		}

		if(!found)
		{
			// don't create folders unless it's leading up to a game
			// if type is a folder it's gonna be empty, so don't bother
			if(type == FOLDER)
			{
				LOG(LogWarning) << "gameList: folder doesn't already exist, won't create";
				return NULL;
			}

			// create missing folder
			FileData* folder = new FileData(FOLDER, Utils::FileSystem::getStem(treeNode->getPath()) + "/" + *path_it, system->getSystemEnvData(), system);
			treeNode->addChild(folder);
			treeNode = folder;
		}

		path_it++;
	}

	return NULL;
}

void parseGamelist(SystemData* system)
{
	bool trustGamelist = Settings::getInstance()->getBool("ParseGamelistOnly");
	std::string xmlpath = system->getGamelistPath(false);

	if(!Utils::FileSystem::exists(xmlpath))
		return;

	LOG(LogInfo) << "Parsing XML file \"" << xmlpath << "\"...";

	pugi::xml_document doc;
	pugi::xml_parse_result result = doc.load_file(xmlpath.c_str());

	if(!result)
	{
		LOG(LogError) << "Error parsing XML file \"" << xmlpath << "\"!\n	" << result.description();
		return;
	}

	pugi::xml_node root = doc.child("gameList");
	if(!root)
	{
		LOG(LogError) << "Could not find <gameList> node in gamelist \"" << xmlpath << "\"!";
		return;
	}

	std::string relativeTo = system->getStartPath();

	const char* tagList[2] = { "game", "folder" };
	FileType typeList[2] = { GAME, FOLDER };
	for(int i = 0; i < 2; i++)
	{
		const char* tag = tagList[i];
		FileType type = typeList[i];
		for(pugi::xml_node fileNode = root.child(tag); fileNode; fileNode = fileNode.next_sibling(tag))
		{
			const std::string path = Utils::FileSystem::resolveRelativePath(fileNode.child("path").text().get(), relativeTo, false, true);

			if(!trustGamelist && !Utils::FileSystem::exists(path))
			{
				LOG(LogWarning) << "File \"" << path << "\" does not exist! Ignoring.";
				continue;
			}

			FileData* file = findOrCreateFile(system, path, type);
			if(!file)
			{
				LOG(LogError) << "Error finding/creating FileData for \"" << path << "\", skipping.";
				continue;
			}
			else if(!file->isArcadeAsset())
			{
				std::string defaultName = file->metadata.get("name");
				file->metadata = MetaDataList::createFromXML(GAME_METADATA, fileNode, relativeTo);

				//make sure name gets set if one didn't exist
				if(file->metadata.get("name").empty())
					file->metadata.set("name", defaultName);

				file->metadata.resetChangedFlag();
			}
		}
	}
}

void addFileDataNode(pugi::xml_node& parent, const FileData* file, const char* tag, SystemData* system)
{
	//create game and add to parent node
	pugi::xml_node newNode = parent.append_child(tag);

	//write metadata
	file->metadata.appendToXML(newNode, true, system->getStartPath());

	if(newNode.children().begin() == newNode.child("name") //first element is name
		&& ++newNode.children().begin() == newNode.children().end() //theres only one element
		&& newNode.child("name").text().get() == file->getDisplayName()) //the name is the default
	{
		//if the only info is the default name, don't bother with this node
		//delete it and ultimately do nothing
		parent.remove_child(newNode);
	}else{
		//there's something useful in there so we'll keep the node, add the path

		// try and make the path relative if we can so things still work if we change the rom folder location in the future
		newNode.prepend_child("path").text().set(Utils::FileSystem::createRelativePath(file->getPath(), system->getStartPath(), false, true).c_str());
	}
}

void updateGamelist(SystemData* system)
{
	//We do this by reading the XML again, adding changes and then writing it back,
	//because there might be information missing in our systemdata which would then miss in the new XML.
	//We have the complete information for every game though, so we can simply remove a game
	//we already have in the system from the XML, and then add it back from its GameData information...

	if(Settings::getInstance()->getBool("IgnoreGamelist"))
		return;

	pugi::xml_document doc;
	pugi::xml_node root;
	std::string xmlReadPath = system->getGamelistPath(false);

	std::string relativeTo = system->getStartPath();

	if(Utils::FileSystem::exists(xmlReadPath))
	{
		//parse an existing file first
		pugi::xml_parse_result result = doc.load_file(xmlReadPath.c_str());

		if(!result)
		{
			LOG(LogError) << "Error parsing XML file \"" << xmlReadPath << "\"!\n	" << result.description();
			return;
		}

		root = doc.child("gameList");
		if(!root)
		{
			LOG(LogError) << "Could not find <gameList> node in gamelist \"" << xmlReadPath << "\"!";
			return;
		}
	}else{
		//set up an empty gamelist to append to
		root = doc.append_child("gameList");
	}

	std::vector<FileData*> changedGames;
	std::vector<FileData*> changedFolders;

	//now we have all the information from the XML. now iterate through all our games and add information from there
	FileData* rootFolder = system->getRootFolder();
	if (rootFolder != nullptr)
	{
		int numUpdated = 0;

		//get only files, no folders
		std::vector<FileData*> files = rootFolder->getFilesRecursive(GAME | FOLDER);

		// Stage 1: iterate through all files in memory, checking for changes
		for(std::vector<FileData*>::const_iterator fit = files.cbegin(); fit != files.cend(); ++fit)
		{

			// do not touch if it wasn't changed anyway
			if (!(*fit)->metadata.wasChanged())
				continue;

			// adding item to changed list
			if ((*fit)->getType() == GAME)
			{
				changedGames.push_back((*fit));
			}
			else
			{
				changedFolders.push_back((*fit));
			}
		}

		// Stage 2: iterate XML if needed, to remove and add changed items
		const char* tagList[2] = { "game", "folder" };
		FileType typeList[2] = { GAME, FOLDER };
		std::vector<FileData*> changedList[2] = { changedGames, changedFolders };

		for(int i = 0; i < 2; i++)
		{
			const char* tag = tagList[i];
			std::vector<FileData*> changes = changedList[i];

			// if changed items of this type
			if (changes.size() > 0) {
				// check if the item already exists in the XML
				// if it does, remove all corresponding items before adding
				for(pugi::xml_node fileNode = root.child(tag); fileNode; )
				{
					pugi::xml_node pathNode = fileNode.child("path");

					// we need this as we were deleting the iterator and things would become inconsistent
					pugi::xml_node nextNode = fileNode.next_sibling(tag);

					if(!pathNode)
					{
						LOG(LogError) << "<" << tag << "> node contains no <path> child!";
						continue;
					}

					// apply the same transformation as in Gamelist::parseGamelist
					std::string xmlpath = Utils::FileSystem::resolveRelativePath(pathNode.text().get(), relativeTo, false, true);

					for(std::vector<FileData*>::const_iterator cfit = changes.cbegin(); cfit != changes.cend(); ++cfit)
					{
						if(xmlpath == (*cfit)->getPath())
						{
							// found it
							root.remove_child(fileNode);
							break;
						}
					}
					fileNode = nextNode;

				}

				// add items to XML
				for(std::vector<FileData*>::const_iterator cfit = changes.cbegin(); cfit != changes.cend(); ++cfit)
				{
					// it was either removed or never existed to begin with; either way, we can add it now
					addFileDataNode(root, *cfit, tag, system);
					++numUpdated;
				}
			}
		}

		// now write the file

		if (numUpdated > 0) {
			const auto startTs = std::chrono::system_clock::now();

			//make sure the folders leading up to this path exist (or the write will fail)
			std::string xmlWritePath(system->getGamelistPath(true));
			Utils::FileSystem::createDirectory(Utils::FileSystem::getParent(xmlWritePath));

			LOG(LogInfo) << "Added/Updated " << numUpdated << " entities in '" << xmlReadPath << "'";

			if (!doc.save_file(xmlWritePath.c_str())) {
				LOG(LogError) << "Error saving gamelist.xml to \"" << xmlWritePath << "\" (for system " << system->getName() << ")!";
			}

			const auto endTs = std::chrono::system_clock::now();
			LOG(LogInfo) << "Saved gamelist.xml for system \"" << system->getName() << "\" in " << std::chrono::duration_cast<std::chrono::milliseconds>(endTs - startTs).count() << " ms";
		}
	}else{
		LOG(LogError) << "Found no root folder for system \"" << system->getName() << "\"!";
	}
}


text: Ocurrió un error al intentar conectar al servidor LDAP. El servidor"$var['error']" no se pudo encontrar. Por favor intenta otro servidor.


text:
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Text;
using Joinrpg.Web.Identity;
using JoinRpg.Portal.Identity;
using JoinRpg.Portal.Infrastructure.Authentication;
using JoinRpg.Web.XGameApi.Contract;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Microsoft.IdentityModel.Tokens;

namespace JoinRpg.Portal.Controllers.XGameApi;

[ApiController]
public class XApiLoginController : ControllerBase
{
    private readonly ApplicationUserManager userManager;
    private readonly JwtSecretOptions secret;
    private readonly JwtBearerOptions jwt;

    public XApiLoginController(ApplicationUserManager userManager, IOptions<JwtBearerOptions> jwt, IOptions<JwtSecretOptions> secret)
    {
        this.userManager = userManager;
        this.secret = secret.Value;
        this.jwt = jwt.Value;
    }

    [HttpPost("/x-api/token")]
    [IgnoreAntiforgeryToken]
    [ProducesResponseType(400)]
    [ProducesResponseType(200)]
    public async Task<ActionResult> Login(
        [FromForm] string username,
        [FromForm] string password,
        [FromForm(Name = "grant_type")] string grantType)
    {
        if (grantType != "password")
        {
            return BadRequest();
        }

        var user = await userManager.FindByEmailAsync(username);
        if (user == null)
        {
            return Forbid();
        }
        if (!await userManager.CheckPasswordAsync(user, password))
        {
            return Forbid();
        }
        JwtSecurityToken jwtSecurityToken = await CreateJwtToken(user);
        return Ok(new AuthenticationResponse
        {
            access_token = new JwtSecurityTokenHandler().WriteToken(jwtSecurityToken),
            expires_in = (int)Math.Floor(secret.JwtLifetime.TotalSeconds),
        });
    }

    private async Task<JwtSecurityToken> CreateJwtToken(JoinIdentityUser user)
    {
        var userClaims = await userManager.GetClaimsAsync(user);
        var roles = await userManager.GetRolesAsync(user);

        var claims = new[]
        {
            new Claim(JwtRegisteredClaimNames.Sub, user.UserName),
            new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
            new Claim(JwtRegisteredClaimNames.Email, user.UserName),
            new Claim("uid", user.Id.ToString()),
        }
        .Union(userClaims)
        .Union(roles.Select(r => new Claim("roles", r)));

        var symmetricSecurityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secret.SecretKey));
        var signingCredentials = new SigningCredentials(symmetricSecurityKey, SecurityAlgorithms.HmacSha256);
        var jwtSecurityToken = new JwtSecurityToken(
            issuer: secret.Issuer,
            audience: jwt.Audience,
            claims: claims,
            expires: DateTime.UtcNow.Add(secret.JwtLifetime),
            signingCredentials: signingCredentials);
        return jwtSecurityToken;
    }
}


text:
import React from 'react';
import ReactDOM from 'react-dom';
import ReactTestUtils from 'react-dom/test-utils';

const modalDriverFactory = ({element, wrapper, component}) => {

  const getPortal = () => document.body.querySelector('.portal');
  const getOverlay = () => document.body.querySelector('.ReactModal__Overlay');
  const getContent = () => document.body.querySelector('.ReactModal__Content');

  return {
    exists: () => !!(getPortal()),
    element: () => element,
    isOpen: () => !!(getContent()),
    isThemeExist: theme => !!getPortal().querySelector(`.${theme}`),
    getChildBySelector: selector => getPortal().querySelector(selector),
    isScrollable: () => !getPortal().classList.contains('portalNonScrollable'),
    clickOnOverlay: () => {
      const overlay = getOverlay();
      ReactTestUtils.Simulate.click(overlay);
    },
    setProps: props => {
      const ClonedWithProps = React.cloneElement(component, Object.assign({}, component.props, props), ...(component.props.children || []));
      ReactDOM.render(
 element = r}>{ClonedWithProps}
, wrapper);
    }
  };
};

export default modalDriverFactory;


text:
<?php

namespace Drupal\media\Plugin\media\Source;

use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\media\MediaTypeInterface;

/**
 * Media source wrapping around an audio file.
 *
 * @see \Drupal\file\FileInterface
 *
 * @MediaSource(
 *   id = "audio_file",
 *   label = @Translation("Audio file"),
 *   description = @Translation("Use audio files for reusable media."),
 *   allowed_field_types = {"file"},
 *   default_thumbnail_filename = "audio.png"
 * )
 */
class AudioFile extends File {

  /**
   * {@inheritdoc}
   */
  public function createSourceField(MediaTypeInterface $type) {
    return parent::createSourceField($type)->set('settings', ['file_extensions' => 'mp3 wav aac']);
  }

  /**
   * {@inheritdoc}
   */
  public function prepareViewDisplay(MediaTypeInterface $type, EntityViewDisplayInterface $display) {
    $display->setComponent($this->getSourceFieldDefinition($type)->getName(), [
      'type' => 'file_audio',
    ]);
  }

}


text:
package org.powermock.core.classloader;

import javassist.CtClass;

/**
 *  Instance of this interface can be used to mark {@link CtClass} that it was created and loaded by PowerMock
 */
public interface JavaAssistClassMarker {
    /**
     * Mark type as loaded by PowerMock
     * @param type to mark.
     */
    void mark(CtClass type);
}


text:
class InvitationsMailer < ActionMailer::Base

  default :from => "yoyoyo@bla.com>"

  def new_message(message)
    @message = message
    mail(:to => "#{message.email}", :subject => "#{message.subject}", :content_type => 'text/html')
  end

end


text:
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Nef_polyhedron_3<Kernel, CGAL::SNC_indexed_items> Nef_polyhedron;
typedef CGAL::Nef_nary_union_3<Nef_polyhedron> Union;
typedef CGAL::Nef_nary_intersection_3<Nef_polyhedron> Intersection;
typedef Kernel::Vector_3 Vector_3;
typedef Kernel::Aff_transformation_3 Aff_transformation_3;

int main()
{
  Nef_polyhedron N;
  std::ifstream in("data/cube.nef3.SH");
  in >> N;

  Nef_polyhedron C0, C1, C2;
  C0.transform(Aff_transformation_3(CGAL::TRANSLATION, Vector_3(1, 0, 0, 100)));
  C1.transform(Aff_transformation_3(CGAL::TRANSLATION, Vector_3(0, 1, 0, 100)));
  C2.transform(Aff_transformation_3(CGAL::TRANSLATION, Vector_3(0, 0, 1, 100)));

  Union u;
  u.add_polyhedron(C0);
  u.add_polyhedron(C1);
  u.add_polyhedron(C2);
  u.get_union();
  u.add_polyhedron(N);

  Intersection i;
  i.add_polyhedron(C0);
  i.add_polyhedron(C1);
  i.add_polyhedron(C2);
  i.get_intersection();
  i.add_polyhedron(N);

  return 0;
}


text:
package pl.edu.icm.sedno.common.util;

import pl.edu.icm.sedno.common.model.DataObject;
import pl.edu.icm.sedno.patterns.Visitor;
/**
 *
 * @author bart

 */
public class UnproxyHVisitor implements Visitor<DataObject>{

    @Override
    public void visit(DataObject object) {
    	ReflectionUtil.unproxyHReferences(object);
    }
}


text:
package org.apache.camel.itest.osgi.freemarker;

import org.apache.camel.Exchange;
import org.apache.camel.InvalidPayloadException;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;

import static org.ops4j.pax.exam.OptionUtils.combine;
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures;

@RunWith(JUnit4TestRunner.class)
public class FreemarkerTest extends OSGiIntegrationTestSupport {

    @Test
    public void testReceivesResponse() throws Exception {
        assertRespondsWith("foo", "<hello>foo</hello>");
        assertRespondsWith("bar", "<hello>bar</hello>");
    }

    protected void assertRespondsWith(final String value, String expectedBody) throws InvalidPayloadException {
        Exchange response = template.request("direct:a", new Processor() {
            public void process(Exchange exchange) throws Exception {
                Message in = exchange.getIn();
                in.setBody("answer");
                in.setHeader("cheese", value);
            }
        });
        assertOutMessageBodyEquals(response, expectedBody);
    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
                from("direct:a").to("freemarker:org/apache/camel/itest/osgi/freemarker/example.ftl");
            }
        };
    }

    @Configuration
    public static Option[] configure() {
        Option[] options = combine(
            getDefaultCamelKarafOptions(),
            // using the features to install the other camel components
            scanFeatures(getCamelKarafFeatureUrl(), "camel-freemarker"));

        return options;
    }

}


text:
package nodetasks

import (
	"fmt"
	"strings"

	"k8s.io/klog/v2"
	"k8s.io/kops/upup/pkg/fi"
	"k8s.io/kops/upup/pkg/fi/nodeup/cloudinit"
	"k8s.io/kops/upup/pkg/fi/nodeup/local"
)

// Chattr performs a chattr command, in particular to set a file as immutable
type Chattr struct {
	File string `json:"file"`
	Mode string `json:"mode"`

	Deps []fi.Task `json:"-"`
}

var _ fi.Task = &Chattr{}

func (s *Chattr) String() string {
	return fmt.Sprintf("Chattr: chattr %s %s", s.Mode, s.File)
}

var _ fi.HasName = &Archive{}

func (e *Chattr) GetName() *string {
	return fi.String("Chattr-" + e.File)
}

var _ fi.HasDependencies = &Chattr{}

// GetDependencies implements HasDependencies::GetDependencies
func (e *Chattr) GetDependencies(tasks map[string]fi.Task) []fi.Task {
	return e.Deps
}

func (e *Chattr) Find(c *fi.Context) (*Chattr, error) {
	// We always re-run the chattr command
	return nil, nil
}

func (e *Chattr) Run(c *fi.Context) error {
	return fi.DefaultDeltaRunMethod(e, c)
}

func (s *Chattr) CheckChanges(a, e, changes *Chattr) error {
	return nil
}

func (_ *Chattr) RenderLocal(t *local.LocalTarget, a, e, changes *Chattr) error {
	return e.execute(t)
}

func (e *Chattr) execute(t Executor) error {
	chattrCommand := []string{"chattr", e.Mode, e.File}

	klog.Infof("running chattr command chattr %s", chattrCommand)
	if output, err := t.CombinedOutput(chattrCommand); err != nil {
		return fmt.Errorf("error doing %q: %v: %s", strings.Join(chattrCommand, " "), err, string(output))
	}

	return nil
}

func (_ *Chattr) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *Chattr) error {
	return fmt.Errorf("Chattr::RenderCloudInit not implemented")
}


text:
/*
Theme Name:  Monstroid
Theme URI:   http://www.templatemonster.com/wordpress-themes/monstroid/
Description: Monstroid is powered by the latest Cherry Framework 4 that ensures easy and worry-free installation and customization. With over 30 inbuilt premium extensions, you can get any kind of functionality required for a specific project. Thanks to the brand new backup options, you can restore the theme any time you need.
Author:      Monstroid Team
Author URI:  http://www.templatemonster.com
Version:     1.1.2
License:     GNU General Public License v3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Tags:        fixed-layout, fluid-layout, responsive-layout, left-sidebar, right-sidebar, custom-menu, featured-images, full-width-template, post-formats, sticky-post, theme-options, translation-ready
Text Domain: monstroid
Template:    cherryframework4
*/

/* Theme customization starts here
-------------------------------------------------------------- */
@import url(https://fonts.googleapis.com/css?family=Catamaran:400,700,300);
html, p, strong, b, textarea, input, h1, h2, h4, h5, h6, div{
  font-family: Catamaran !important;
}
.footer-top.static-area, .site-header, #menu-primary-items.menu-items:not(.mega-menu-direction-vertical) .before-menu, #menu-primary-items.menu-items:not(.mega-menu-direction-vertical) .after-menu, #menu-primary-items.menu-items:not(.mega-menu-direction-vertical) #magic-line-left, #menu-primary-items.menu-items:not(.mega-menu-direction-vertical) #magic-line-right, .menu-items>.menu-item>a:before{
  background: #DBE283 !important;
  color: #000 !important
}
.site-header a, .footer-top.static-area a, .footer-top.static-area h1, .footer-top.static-area h2, .footer-top.static-area h3, .footer-top.static-area h4, .footer-top.static-area h5, .footer-top.static-area h6{
  color: #000 !important
}
.site-description{
display: none
}
.footer-top.static-area .static-footer-sidebars > div > div .widget:before{
background: #DBE283 !important
}


text:
@interface UIView (Subviews)

-(void) removeAllSubviews;

@end


text:
package router;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

public class HAProxyController {
    private String executablePath;

    public HAProxyController(String executablePath) {
        this.executablePath = executablePath;
        if (!this.executablePath.endsWith("haproxy")) {
            if (!this.executablePath.endsWith("/")) {
                this.executablePath += "/";
            }
            this.executablePath += "haproxy";
        }

        killAll("haproxy");
    }

    public void start() throws Exception {
        File conf = new File("/tmp/haproxy.conf");
        if (!conf.exists()) {
            throw new Exception("/tmp/haproxy.conf does not exists");
        }

        String command = executablePath + " -f /tmp/haproxy.conf -p /tmp/haproxy.pid";
        runCommand(command);
    }

    public void stop() throws Exception {
        killAll("haproxy");
    }

    public void reload() throws Exception {
        String pid = new String(Files.readAllBytes(Paths.get("/tmp/haproxy.pid")));
        String command = executablePath + " -f /tmp/haproxy.conf -p /tmp/haproxy.pid -sf " + pid;
        runCommand(command);
    }

    private void killAll(String processName) {
        runCommand("killall " + processName);
    }

    private void runCommand(String command) {
        try {
            Runtime.getRuntime().exec(command);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


text:
<!DOCTYPE html>
<meta charset=utf-8>
<title>empty poster is not valid</title>
<video poster="
"></video>


text:
/*
 * ISR2 Stub implementation
 *
 * Author: 2013,  Giuseppe Serano
 */

/* ISR2 Stub declaration */
#include "cpu/avr8/inc/ee_avr8_irqstub.h"

/*
 * I need Kernel inclusion for callbacks and Common Context Implementation,
 * so I include the whole internal.
 */
#include "ee_internal.h"

/* Plus I need Common End-ISR Scheduler Implementation */
#include "cpu/common/inc/ee_irqstub.h"

#ifdef	__MULTI__
#ifdef	__IRQ_STACK_NEEDED__
struct EE_TOS EE_avr8_old_tos = {(EE_ADDR)0U};
extern	void EE_avr8_IRQ_change_stack( void );
extern	void EE_avr8_IRQ_stack_back( void );
#define	EE_std_IRQ_change_stack()	EE_avr8_IRQ_change_stack()
#define	EE_std_IRQ_stack_back()		EE_avr8_IRQ_stack_back()
#else
#define	EE_std_IRQ_change_stack()	((void)0)
#define	EE_std_IRQ_stack_back()		((void)0)
#endif
#else
#define	EE_std_IRQ_change_stack()	((void)0)
#define	EE_std_IRQ_stack_back()		((void)0)
#endif	/* __MULTI__ */

/* Needed by common irq stub */
#ifdef __ALLOW_NESTED_IRQ__

#define	EE_std_enableIRQ_nested()	EE_avr8_enableIRQ()
#define	EE_std_disableIRQ_nested()	EE_avr8_disableIRQ()

#endif  /* __ALLOW_NESTED_IRQ__ */

/*
 * ISR Type 1 stub.
 */
void EE_COMPILER_KEEP EE_NAKED EE_avr8_isr1_stub(EE_VOID_CALLBACK f)
{

  EE_AVR8_ISR_PREINSTUB();

  /* Disable IRQ */
  EE_hal_disableIRQ();

#ifdef	__IRQ_STACK_NEEDED__
  if ( !EE_is_inside_ISR_call() ) {

    EE_std_IRQ_change_stack();

  }
#endif	/* __IRQ_STACK_NEEDED__ */

  /* Increment nesting level here, with IRQ disabled */
  EE_increment_IRQ_nesting_level();

  /* Enable IRQ if nesting is allowed */
  EE_std_enableIRQ_nested();

  /* Call The ISR User Handler */
  f();

  /*
   * Disable IRQ if nesting is allowed.
   * Note:	if nesting is not allowed, the IRQs are already disabled
   */
  EE_std_disableIRQ_nested();

  /* Decrement nesting level here, with IRQ disabled */
  EE_decrement_IRQ_nesting_level();

  /* Check for scheduling point */
  if ( !EE_is_inside_ISR_call() ) {

    /* Restore task stack pointer if needed */
    EE_std_IRQ_stack_back();

  }

  EE_AVR8_ISR_POSTINSTUB();

  /* Enable IRQ */
  EE_hal_enableIRQ();

  EE_return();

}	/* EE_avr8_isr1_stub() */

/*
 * ISR Type 2 stub.
 */
void EE_COMPILER_KEEP EE_NAKED EE_avr8_isr2_stub(EE_VOID_CALLBACK f)
{

  EE_AVR8_ISR_PREINSTUB();

  /* Disable IRQ */
  EE_hal_disableIRQ();

#ifdef	__IRQ_STACK_NEEDED__
  if ( !EE_is_inside_ISR_call() ) {

    EE_std_IRQ_change_stack();

  }
#endif	/* __IRQ_STACK_NEEDED__ */

  /* Increment nesting level here, with IRQ disabled */
  EE_increment_IRQ_nesting_level();

  /* Enable IRQ if nesting is allowed */
  EE_std_enableIRQ_nested();

  /* Call The ISR User Handler */
  f();

  /*
   * Disable IRQ if nesting is allowed.
   * Note:	if nesting is not allowed, the IRQs are already disabled
   */
  EE_std_disableIRQ_nested();

  /*
   * ISR2 instance clean-up as requested by AR, must be called before
   * EE_decrement_IRQ_nesting_level()
   */
  EE_std_end_IRQ_post_stub();

  /* Decrement nesting level here, with IRQ disabled */
  EE_decrement_IRQ_nesting_level();

#ifdef	__ATXMEGA__
#ifdef	__IRQ_STACK_NEEDED__
  if ( !EE_is_inside_ISR_call() ) {

    EE_std_IRQ_stack_back();

  }
#endif	/* __IRQ_STACK_NEEDED__ */

  /* Call the scheduler */
  EE_avr8_after_IRQ_schedule();
#endif	/* __ATXMEGA__ */

#ifdef	__ATMEGA__
  if ( !EE_is_inside_ISR_call() ) {

#ifdef	__IRQ_STACK_NEEDED__
    EE_std_IRQ_stack_back();
#endif	/* __IRQ_STACK_NEEDED__ */

    EE_std_after_IRQ_schedule();

  }

#endif	/* __ATMEGA__ */

  EE_AVR8_ISR_POSTINSTUB();

  /* Enable IRQ */
  EE_hal_enableIRQ();

  EE_return();

}	/* EE_avr8_isr2_stub() */

#ifdef	__ATXMEGA__
extern void EE_avr8_after_IRQ_schedule( void );

volatile void EE_avr8_std_after_IRQ_schedule( void ) {

  /*
   * Disable IRQ: RETI ENABLE INTERRUPT!!!
   */
  EE_avr8_disableIRQ();

  /* Check for scheduling point */
  if ( !EE_is_inside_ISR_call() && !EE_is_inside_hw_ISR_call() ) {

    /* Call the scheduler */
    EE_std_after_IRQ_schedule();

  }

}
#endif	/* __ATXMEGA__ */


text:
#include "poller.h"

#include "clbuf.h"
#include "clgstr.h"
#include "clinsert.h"
#include "cllog.h"
#include "clsnmp.h"
#include "globals.h"
#include "multithread.h"
#include "rtgtargets.h"
#include "xmalloc.h"
#include <stdio.h>
#include <string.h>
#include <time.h>

static void thread_inactive(unsigned id, unsigned iterations);
static void thread_active(unsigned id);
static void process_host(unsigned id, struct queryhost *host, unsigned max_errors_per_host);
static void process_queries(unsigned id, struct clinsert **host_queries);

void *poller_run(void *ptr)
{
        struct mt_context *thread_context = (struct mt_context *) ptr;
        struct poller_ctx *poller_context = (struct poller_ctx *) thread_context->param;

        unsigned id = thread_context->thread_id;
        struct rtgtargets *targets = poller_context->targets;
        unsigned iterations = 0;

        /* Start looping. */
        while (!thread_stop_requested) {
                struct queryhost *host;

                /* Wait for green light. */
                thread_inactive(id, iterations);

                if (thread_stop_requested)
                        break;

                /* Mark ourself active. */
                thread_active(id);

                /* Loop over our share of the hosts. */
                while (!thread_stop_requested && (host = rtgtargets_next(targets)))
                        process_host(id, host, poller_context->max_errors_per_host);

                /* Prepare for next iteration. */
                iterations++;
        }
        return NULL;
}

void thread_inactive(unsigned id, unsigned iterations)
{
        pthread_mutex_lock(&global_lock);

        /* Only decrease thread counter if this is not the first iteration. */
        if (iterations > 0) {
                active_threads--;
                cllog(2, "Thread %u blocking.", id);
        }

        if (!active_threads)    /* We are the last one */
                statistics.query_threads_finished = curms();

        /* Wait for monitor to broadcast go signal. */
        pthread_cond_wait(&global_cond, &global_lock);

        pthread_mutex_unlock(&global_lock);
}

void thread_active(unsigned id)
{
        cllog(2, "Thread %u starting.", id);

        pthread_mutex_lock(&global_lock);
        active_threads++;
        pthread_mutex_unlock(&global_lock);
}

void process_host(unsigned id, struct queryhost *host, unsigned max_errors_per_host)
{
        struct clinsert **host_queries;

        cllog(2, "Thread %u picked host '%s'.", id, host->host);

        /* Poll the host, get back the list of inserts, and queue them all. */
        host_queries = get_clinserts(host, max_errors_per_host);
        process_queries(id, host_queries);
        free(host_queries);
}

void process_queries(unsigned id, struct clinsert **host_queries)
{
        unsigned n_queries = clinsert_count(host_queries);
        unsigned dropped_queries;
        unsigned queued_queries;
        unsigned queued_values;
        unsigned processed_inserts;
        unsigned depth;

        cllog(2, "Thread %u queueing %u queries.", id, n_queries);

        queued_queries = 0;
        queued_values = 0;
        for (processed_inserts = 0; processed_inserts < n_queries; processed_inserts++) {
                void *result = 0;
                if (clbuf_count_free(queries) > 0)
                        result = clbuf_push(queries, host_queries[processed_inserts]);

                if (result) {
                        queued_queries++;
                        queued_values += host_queries[processed_inserts]->nvalues;
                } else {
                        clinsert_free(host_queries[processed_inserts]);
                }
        }

        depth = clbuf_count_used(queries);
        dropped_queries = n_queries - processed_inserts;

        if (dropped_queries)
                cllog(0, "Thread %u dropped %u queries due to database queue full.", id, dropped_queries);

        /* Update statistics. */
        pthread_mutex_lock(&global_lock);
        statistics.insert_rows += queued_values;
        statistics.insert_queries += queued_queries;
        statistics.dropped_queries += dropped_queries;
        statistics.max_queue_depth = statistics.max_queue_depth > depth ? statistics.max_queue_depth : depth;
        pthread_mutex_unlock(&global_lock);
}

void calculate_rate(time_t prev_time, unsigned long long prev_counter, time_t cur_time, unsigned long long cur_counter, int bits, unsigned long long *counter_diff, unsigned *rate)
{
        if (bits == 0) {
                /* It's a gauge so just return the value as both counter diff and rate. */
                *counter_diff = cur_counter;
                *rate = (unsigned) cur_counter;
        } else {
                time_t time_diff = cur_time - prev_time;
                if (time_diff == 0) {
                        cllog(0, "Fatal error: time_diff == 0 (can't happen!)");
                        exit(-1);
                }
                *counter_diff = cur_counter - prev_counter;
                if (prev_counter > cur_counter) {
                        /* We seem to have a wrap.
                           Wrap it back to find the correct rate. */
                        if (bits == 64)
                                *counter_diff += 18446744073709551615ull + 1;   /* 2^64-1 + 1 */
                        else
                                *counter_diff += 4294967296ull; /* 2^32 */
                }
                /* Return the calculated rate. */
                *rate = (unsigned) (*counter_diff / time_diff);
        }
}

struct clinsert **get_clinserts(struct queryhost *host, unsigned max_errors_per_host)
{
        unsigned snmp_fail = 0;
        unsigned snmp_success = 0;

        /* Start a new SNMP session. */
        struct clsnmp_session *session = clsnmp_session_create(host->host, host->community, host->snmpver);

        /* Prepare a list of inserts. */
        struct clinsert **inserts = (struct clinsert **) xmalloc(sizeof(struct clinsert *) * MAX_TABLES);
        memset(inserts, 0, sizeof(struct clinsert *) * MAX_TABLES);

        if (session) {
                int errors = 0;
                /* Iterate over all targets in the host. */
                unsigned i;
                for (i = 0; i < host->nrows; i++) {
                        struct queryrow *row = host->rows[i];

                        unsigned long long counter;
                        time_t dtime;
                        int success = clsnmp_get(session, row->oid, &counter, &dtime);
                        if (success) {
                                if (row->bits == 0 || row->cached_time) {
					/* Only insert if we have a previous value (or if the interface is stuck at zero,
 * 						 in which case we'll let allow_db_zero make the decision in build_insert_query() */
                        		if((row->cached_counter > 0) || ((row->cached_counter == 0) && (counter == 0))) {
                                                unsigned long long counter_diff;
                                                unsigned rate;
                                                calculate_rate(row->cached_time, row->cached_counter, dtime, counter, row->bits, &counter_diff, &rate);
                                                if (rate < row->speed) {
                                                        struct clinsert *insert = clinsert_for_table(inserts, row->table);
                                                        clinsert_push_value(insert, row->id, counter_diff, rate, dtime, counter);
                                                } else {
                                                        cllog(1, "Rate %u exceeds speed %llu bps for host %s oid %s", rate, row->speed, host->host, row->oid);
                                                }
                                        }
                                        else {
				                cllog(1, "Unable to determine previous counter value for host %s oid %s. Skipping insert.", host->host, row->oid);
                                        }
                                }
                                row->cached_time = dtime;
                                row->cached_counter = counter;
                                snmp_success++;
                        } else {
                                cllog(1, "SNMP get for %s OID %s failed.", host->host, row->oid);
                                errors++;
                                snmp_fail++;
                        }
                        if (errors >= max_errors_per_host) {
                                cllog(0, "Too many errors for host %s, aborted.", host->host);
                                break;
                        }
                }
        } else {
                cllog(0, "Error in SNMP setup.");
        }
        clsnmp_session_free(session);

        pthread_mutex_lock(&global_lock);
        statistics.snmp_fail += snmp_fail;
        statistics.snmp_success += snmp_success;
        pthread_mutex_unlock(&global_lock);

        return inserts;
}


text:
CREATE TABLE IF NOT EXISTS AM_USAGE_UPLOADED_FILES (
   FILE_NAME varchar(255) NOT NULL,
   FILE_TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
   FILE_PROCESSED tinyint(1) DEFAULT 0,
   FILE_CONTENT MEDIUMBLOB DEFAULT NULL,
   PRIMARY KEY (FILE_NAME, FILE_TIMESTAMP)
);


text:
package com.stratio.crossdata.connector.mongodb

import com.mongodb.casbah.MongoClient
import com.mongodb.casbah.commons.MongoDBObject
import org.apache.spark.sql.crossdata.ExecutionType._
import org.apache.spark.sql.crossdata.exceptions.CrossdataException
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner

@RunWith(classOf[JUnitRunner])
class MongoConnectorIT extends MongoWithSharedContext {

  //(id BIGINT, age INT, description STRING, enrolled BOOLEAN, name STRING, optionalField BOOLEAN)

  "The Mongo connector" should "execute natively a select *" in {
    assumeEnvironmentIsUpAndRunning
    val dataframe = sql(s"SELECT * FROM $Collection ")
    val schema = dataframe.schema
    val result = dataframe.collect(Native)
    result should have length 10
    schema.fieldNames should equal (Seq("id", "age", "description", "enrolled", "name", "optionalField"))
    result.head.toSeq should equal (Seq(1, 11, "description1", false, "Name 1", null))
  }

  it should "return the columns in the requested order" in {
    assumeEnvironmentIsUpAndRunning
    val dataframe = sql(s"SELECT name, id FROM $Collection ")
    val schema = dataframe.schema
    val result = dataframe.collect(Native)
    result should have length 10
    schema.fieldNames should equal (Seq("name", "id"))
    result.head.toSeq should equal (Seq( "Name 1", 1))
  }

  it should "execute natively a simple project" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT id FROM $Collection ").collect(Native)
    result should have length 10
    result(0) should have length 1
  }

  it should "execute natively an EqualTo filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE id = 1").collect(Native)
    result should have length 1
  }

  it should "execute natively an In filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE id IN ('1','5','9')").collect(Native)
    result should have length 3
  }

  it should "execute natively a LessThan filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE age < 13").collect(Native)
    result should have length 2
  }

  it should "execute natively a LessThanOrEqual filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE age <= 13").collect(Native)
    result should have length 3
  }

  it should "execute natively a GreaterThan filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE age > 13").collect(Native)
    result should have length 7
  }

  it should "execute natively a GreaterThanOrEqual filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE age >= 13").collect(Native)
    result should have length 8
  }

  it should "execute natively an IsNull filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE optionalField IS NULL").collect(Native)
    result should have length 4
  }

  it should "execute natively an IsNotNull filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE optionalField IS NOT NULL").collect(Native)
    result should have length 6
  }

  it should "execute natively a StringStartsWith filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE description LIKE 'descr%'").collect(Native)
    result should have length 10
  }

  it should "execute natively a StringEndsWith filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE description LIKE '%ion1'").collect(Native)
    result should have length 1
  }

  it should "execute natively a StringContains filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE description LIKE '%ion%'").collect(Native)
    result should have length 10
  }

  it should "execute natively an AND filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE id = 3 AND age = 13 AND description = 'description3' ").collect(Native)
    result should have length 1
  }

  it should "execute natively an OR filter" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE id = 3 OR id = 4 ").collect(Native)
    result should have length 2
  }

  it should "execute natively an AND filter in a complex query (nested filters)" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection WHERE id = 3 OR (age = 14 AND description = 'description4') ").collect(Native)
    result should have length 2
  }

  it should "execute natively a query with LIMIT 0" in {
    assumeEnvironmentIsUpAndRunning
    val result = sql(s"SELECT * FROM $Collection LIMIT 0").collect(Native)
    result should have length 0
  }

  // NOT SUPPORTED => JOIN
  it should "not execute natively a (SELECT * ...  ORDER BY _ )" in {
    assumeEnvironmentIsUpAndRunning

    the[CrossdataException] thrownBy {
      sql(s"SELECT * FROM $Collection CROSS JOIN $Collection").collect(Native)
    } should have message "The operation cannot be executed without Spark"
  }

  // IMPORT OPERATIONS

  it should "import all user collections" in {
    assumeEnvironmentIsUpAndRunning

    def tableCountInHighschool: Long = sql("SHOW TABLES").count()
    val initialLength = tableCountInHighschool

    //This crates a new collection in the database which will not be initially registered at the Spark
    val client = MongoClient(MongoHost, MongoPort)(Database)(UnregisteredCollection).insert(MongoDBObject("id" -> 1))

    // TODO import tables should return the tables registered
    sql(
      s"""
         |IMPORT TABLES
         |USING $SourceProvider
         |OPTIONS (
         |host '$MongoHost:$MongoPort',
         |schema_samplingRatio  '0.1'
         |)
      """.stripMargin)

    // TODO We need to create an unregister table
    // TODO We have to modify the test when the new catalog is ready
    tableCountInHighschool should be > initialLength

  }

  it should "not import tables for sentences lacking required options:" in {
    assumeEnvironmentIsUpAndRunning
    an[Exception] shouldBe thrownBy(sql(s"IMPORT TABLES USING $SourceProvider"))
  }

}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, user-scalable=no">
  <meta name="description" content="">
  <meta name="author" content="Yong Su & Jing Jin">
  <title>Jin & Su</title>
  <link href="css/normalize.css" rel="stylesheet" type="text/css">
  <link href="css/style.css" rel="stylesheet" type="text/css">

The Story of Jin and Su

Story one

She spent her days designing and filled her nights with   freelance illustration.

About her


text:
title: Binding to ASP DataSource components
page_title: Binding to ASP DataSource components | RadAutoCompleteBox for ASP.NET AJAX Documentation
description: Binding to ASP DataSource components
slug: autocompletebox/data-binding/binding-to-asp-datasource-components
tags: binding,to,asp,datasource,components
published: True
position: 3
---

# Binding to ASP DataSource components

**RadAutoCompleteBox** supports binding to all ASP.NET 2.0 DataSource components, including:

* AccessDataSource

* SqlDataSource

* XmlDataSource

* ObjectDataSource

* SiteMapDataSource

* LinqDataSource

To bind RadAutoCompleteBox to a DataSource component, you need to set its **DataSourceID** property to the ID of the DataSource component. You should also set its **DataTextField** and **DataValueField** properties to map the **Text** and **Value** properties of the items to the respective columns / fields from the data source.

## AccessDataSource

````ASPNET
<telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" DataSourceID="AccessDataSource1"
		DataTextField="ProductName" DataValueField="ProductID">
</telerik:RadAutoCompleteBox>

<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb"
		SelectCommand="SELECT [ProductID], [ProductName], [SupplierID], [CategoryID], [QuantityPerUnit], [UnitPrice],
		[UnitsInStock], [UnitsOnOrder], [ReorderLevel], [Discontinued] FROM [Products]">
</asp:AccessDataSource>
````

## SqlDataSource

````ASPNET
<telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" DataSourceID="SqlDataSource1"
		DataTextField="ProductName" DataValueField="ProductID">
</telerik:RadAutoCompleteBox>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
		ProviderName="<%$ ConnectionStrings:NorthwindConnectionString.ProviderName %>"
		SelectCommand="SELECT [ProductID], [ProductName], [SupplierID], [CategoryID], [QuantityPerUnit], [UnitPrice],
		[UnitsInStock], [UnitsOnOrder], [ReorderLevel], [Discontinued] FROM [Products]">
</asp:SqlDataSource>
````

## XmlDataSource

````ASPNET
<telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" DataSourceID="Xmldatasource1"
	DataTextField="Text" DataValueField="Value">
</telerik:RadAutoCompleteBox>

<asp:XmlDataSource ID="Xmldatasource1" runat="server" DataFile="~/App_Data/RadAutoCompleteBox.xml" XPath="/Items/Item" />
````

When using an **XmlDataSource**, the XML file should have the format shown below:

````XML
<Items>
  <Item Text="Barcelona" Value="14" />
  <Item Text="Bonn" Value="18" />
  <Item Text="Boston" Value="9" />
  <Item Text="Brussels" Value="17" />
</Items>
````

## ObjectDataSource

````ASPNET
<telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" DataSourceID="ObjectDataSource1"
	DataTextField="Text" DataValueField="ID">
</telerik:RadAutoCompleteBox>

<asp:ObjectDataSource ID="ObjectDataSource1" TypeName="RadAutoCompleteBoxObjectData" SelectMethod="GetItems"
runat="server"></asp:ObjectDataSource>
````

````C#

public class RadAutoCompleteBoxObjectData
{
	public RadAutoCompleteBoxObjectData()
	{
	}

	public static List<AutoCompleteBoxDataItem> GetItems()
	{
		List<AutoCompleteBoxDataItem> itemsList = new List<AutoCompleteBoxDataItem>();
		itemsList.Add(new AutoCompleteBoxDataItem(1, "New York"));
		itemsList.Add(new AutoCompleteBoxDataItem(2, "Rome"));
		itemsList.Add(new AutoCompleteBoxDataItem(3, "Paris"));
		return itemsList;
	}
	public class AutoCompleteBoxDataItem
	{
		private string _text;
		private int _id;
		public string Text
		{
			get
			{
				return _text;
			}
			set
			{
				_text = value;
			}
		}
		public int ID
		{
			get
			{
				return _id;
			}
			set
			{
				_id = value;
			}
		}
		public AutoCompleteBoxDataItem(int id, string text)
		{
			_id = id;
			_text = text;
		}
	}
}

````
````VB.NET

Public Class RadAutoCompleteBoxObjectData
	Public Sub New()
	End Sub

	Public Shared Function GetItems() As List(Of AutoCompleteBoxDataItem)
		Dim itemsList As New List(Of AutoCompleteBoxDataItem)()
		itemsList.Add(New AutoCompleteBoxDataItem(1, "New York"))
		itemsList.Add(New AutoCompleteBoxDataItem(2, "Rome"))
		itemsList.Add(New AutoCompleteBoxDataItem(3, "Paris"))
		Return itemsList
	End Function
	Public Class AutoCompleteBoxDataItem
		Private _text As String
		Private _id As Integer
		Public Property Text() As String
			Get
				Return _text
			End Get
			Set(value As String)
				_text = value
			End Set
		End Property
		Public Property ID() As Integer
			Get
				Return _id
			End Get
			Set(value As Integer)
				_id = value
			End Set
		End Property
		Public Sub New(id As Integer, text As String)
			_id = id
			_text = text
		End Sub
	End Class
End Class

````

# See Also

 * [Overview]({%slug autocompletebox/server-side-programming/overview%})


text:
@implementation PomodoroUnit

@end


text:
We got the parts that were ordered by kurt, including
* Raspberry PI
* 4 Gearbox Motors
* 4 Wheels
* 2 Free-moving wheels
* RaspiRobot Board
### We're meeting now
We met in the SSE lab at 12pm
* The plan may be to continue having meetings at this time.

## Where we are going
### What we know it will do
We want the final version to draw on the whiteboard with existing python code (CS1).
* This should be fundamentally easy, none of the CS1 code prohibits us by using complicated functions.
The library should work with most (not quite all) python-turtle functions.
* These have been documented on the github repository.
### We still need to do research
We need to look into how the RaspiRobot Board will let us talk to the motors.
* These should be documented on sparkfun.
We need to decide / search for where we will be buying the magnets.
* We need to be able to buy different kinds of magnets from the same source.
We need to look into where we can do 3D printing on campus.
* There is such a place on campus, which may do it for free.
### We need to design
We need to design a case.
* We can use a 3D modeling program (CAD, Blender, etc...) to do this.
We need to figure out how the marker is going to move inside the case.


text:
using System;
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Shapes;
using WinRTXamlToolkit.Controls.Common;

namespace WinRTXamlToolkit.Controls
{
    /// <summary>
    /// A path that represents a pie slice with a given
    /// Radius,
    /// StartAngle and
    /// EndAngle.
    /// </summary>
    public class PieSlice : Path
    {
        private bool _isUpdating;

        #region StartAngle
        /// <summary>
        /// The start angle property
        /// </summary>
        public static readonly DependencyProperty StartAngleProperty =
            DependencyProperty.Register(
                "StartAngle",
                typeof(double),
                typeof(PieSlice),
                new PropertyMetadata(
                    0d,
                    OnStartAngleChanged));

        /// <summary>
        /// Gets or sets the start angle.
        /// </summary>
        /// <value>
        /// The start angle.
        /// </value>
        public double StartAngle
        {
            get { return (double)GetValue(StartAngleProperty); }
            set { SetValue(StartAngleProperty, value); }
        }

        private static void OnStartAngleChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var target = (PieSlice)sender;
            var oldStartAngle = (double)e.OldValue;
            var newStartAngle = (double)e.NewValue;
            target.OnStartAngleChanged(oldStartAngle, newStartAngle);
        }

        private void OnStartAngleChanged(double oldStartAngle, double newStartAngle)
        {
            UpdatePath();
        }
        #endregion

        #region EndAngle
        /// <summary>
        /// The end angle property.
        /// </summary>
        public static readonly DependencyProperty EndAngleProperty =
            DependencyProperty.Register(
                "EndAngle",
                typeof(double),
                typeof(PieSlice),
                new PropertyMetadata(
                    0d,
                    OnEndAngleChanged));

        /// <summary>
        /// Gets or sets the end angle.
        /// </summary>
        /// <value>
        /// The end angle.
        /// </value>
        public double EndAngle
        {
            get { return (double)GetValue(EndAngleProperty); }
            set { SetValue(EndAngleProperty, value); }
        }

        private static void OnEndAngleChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var target = (PieSlice)sender;
            var oldEndAngle = (double)e.OldValue;
            var newEndAngle = (double)e.NewValue;
            target.OnEndAngleChanged(oldEndAngle, newEndAngle);
        }

        private void OnEndAngleChanged(double oldEndAngle, double newEndAngle)
        {
            UpdatePath();
        }
        #endregion

        #region Radius
        /// <summary>
        /// The radius property.
        /// </summary>
        public static readonly DependencyProperty RadiusProperty =
            DependencyProperty.Register(
                "Radius",
                typeof(double),
                typeof(PieSlice),
                new PropertyMetadata(
                    0d,
                    OnRadiusChanged));

        /// <summary>
        /// Gets or sets the radius of the pie slice.
        /// </summary>
        /// <value>
        /// The radius.
        /// </value>
        public double Radius
        {
            get { return (double)GetValue(RadiusProperty); }
            set { SetValue(RadiusProperty, value); }
        }

        private static void OnRadiusChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var target = (PieSlice)sender;
            var oldRadius = (double)e.OldValue;
            var newRadius = (double)e.NewValue;
            target.OnRadiusChanged(oldRadius, newRadius);
        }

        private void OnRadiusChanged(double oldRadius, double newRadius)
        {
            this.Width = this.Height = 2 * Radius;
            UpdatePath();
        }
        #endregion

        /// <summary>
        /// Initializes a new instance of the <see cref="PieSlice" /> class.
        /// </summary>
        public PieSlice()
        {
            this.SizeChanged += OnSizeChanged;
            new PropertyChangeEventSource<double>(
                 this, "StrokeThickness", BindingMode.OneWay).ValueChanged +=
                 OnStrokeThicknessChanged;
        }

        private void OnStrokeThicknessChanged(object sender, double e)
        {
            UpdatePath();
        }

        private void OnSizeChanged(object sender, SizeChangedEventArgs e)
        {
            UpdatePath();
        }

        /// <summary>
        /// Suspends path updates until EndUpdate is called;
        /// </summary>
        public void BeginUpdate()
        {
            _isUpdating = true;
        }

        /// <summary>
        /// Resumes immediate path updates every time a component property value changes. Updates the path.
        /// </summary>
        public void EndUpdate()
        {
            _isUpdating = false;
            UpdatePath();
        }

        private void UpdatePath()
        {
            var radius = this.Radius - this.StrokeThickness / 2;

            if (_isUpdating ||
                this.ActualWidth == 0 ||
                radius <= 0)
            {
                return;
            }

            var pathGeometry = new PathGeometry();
            var pathFigure = new PathFigure();
            pathFigure.StartPoint = new Point(radius, radius);
            pathFigure.IsClosed = true;

            // Starting Point
            var lineSegment =
                new LineSegment
                {
                    Point = new Point(
                        radius + Math.Sin(StartAngle * Math.PI / 180) * radius,
                        radius - Math.Cos(StartAngle * Math.PI / 180) * radius)
                };

            // Arc
            var arcSegment = new ArcSegment();
            arcSegment.IsLargeArc = (EndAngle - StartAngle) >= 180.0;
            arcSegment.Point =
                new Point(
                        radius + Math.Sin(EndAngle * Math.PI / 180) * radius,
                        radius - Math.Cos(EndAngle * Math.PI / 180) * radius);
            arcSegment.Size = new Size(radius, radius);
            arcSegment.SweepDirection = SweepDirection.Clockwise;
            pathFigure.Segments.Add(lineSegment);
            pathFigure.Segments.Add(arcSegment);
            pathGeometry.Figures.Add(pathFigure);
            this.Data = pathGeometry;
            this.InvalidateArrange();
        }
    }
}


text:
package com.zebdar.tom.chat.model;

/**
 * Created by qiaoliang on 2017/6/24.
 */

public class IMMessageBody {
}


text:
<?php

// Protect from unauthorized access
defined('_JEXEC') or die();

JHtml::_('behavior.modal');

/** @var  AkeebaViewConfig  $this */
?>

<?php
// Configuration Wizard prompt
if (!\Akeeba\Engine\Factory::getConfiguration()->get('akeeba.flag.confwiz', 0))
{
	echo $this->loadAnyTemplate('admin:com_akeeba/config/confwiz_modal');
}
?>

<div class="akeeba-bootstrap" id="ftpdialog" title="<?php echo JText::_('CONFIG_UI_FTPBROWSER_TITLE') ?>" style="display:none;">

		<?php echo JText::_('FTPBROWSER_LBL_INSTRUCTIONS'); ?>

<?php echo JText::_('FTPBROWSER_LBL_ERROR'); ?>

<div class="akeeba-bootstrap" id="sftpdialog" title="<?php echo JText::_('CONFIG_UI_SFTPBROWSER_TITLE') ?>" style="display:none;">

		<?php echo JText::_('SFTPBROWSER_LBL_INSTRUCTIONS'); ?>

<?php echo JText::_('SFTPBROWSER_LBL_ERROR'); ?>

<form name="adminForm" id="adminForm" method="post" action="index.php" class="form-horizontal form-horizontal-wide">

<div id="dialog" title="<?php echo JText::_('CONFIG_UI_BROWSER_TITLE') ?>">

	<?php if($this->securesettings == 1): ?>

		<?php echo JText::_('CONFIG_UI_SETTINGS_SECURED'); ?>

	<?php elseif($this->securesettings == 0): ?>

		<?php echo JText::_('CONFIG_UI_SETTINGS_NOTSECURED'); ?>

	<?php endif; ?>

		<?php echo JText::_('CPANEL_PROFILE_TITLE'); ?>:
		#<?php echo $this->profileid; ?> <?php echo $this->profilename; ?>

		<?php echo JText::_('CONFIG_WHERE_ARE_THE_FILTERS'); ?>

		<?php echo JText::_('PROFILE_LABEL_DESCRIPTION') ?>

		<label class="control-label" for="profilename" rel="popover"
			data-original-title="<?php echo JText::_('PROFILE_LABEL_DESCRIPTION') ?>"
			data-content="<?php echo JText::_('PROFILE_LABEL_DESCRIPTION_TOOLTIP') ?>">
			<?php echo JText::_('PROFILE_LABEL_DESCRIPTION') ?>

			<input type="text" name="profilename" id="profilename" value="<?php echo $this->escape($this->profilename); ?>" />

<input type="hidden" name="option" value="com_akeeba" />
<input type="hidden" name="view" value="config" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="<?php echo JFactory::getSession()->getFormToken()?>" value="1" />

</form>