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

        <title>SFML - Simple and Fast Multimedia Library</title>
        <meta http-equiv="Content-Type" content="text/html;"/>
        <meta charset="utf-8"/>

        <link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />

                SFML 2.4.1

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Class List

Class Index

Class Hierarchy

Class Members

sf

TcpListener

Public Types |
Public Member Functions |
Protected Types |
Protected Member Functions |
List of all members

sf::TcpListener Class Reference
Network module

Socket that listens to new TCP connections.
 More...

#include <TcpListener.hpp>

Inheritance diagram for sf::TcpListener:

  <map id="sf::TcpListener_map" name="sf::TcpListener_map">
<area href="classsf_1_1Socket.html" title="Base class for all the socket types. " alt="sf::Socket" shape="rect" coords="0,56,105,80"/>
<area href="classsf_1_1NonCopyable.html" title="Utility class that makes any derived class non-copyable. " alt="sf::NonCopyable" shape="rect" coords="0,0,105,24"/>
</map>

Public Types

enum  	Status {

  Done,
NotReady,
Partial,
Disconnected,

  Error

 }

 	Status codes that may be returned by socket functions.  More...

enum  	{ AnyPort = 0
 }

 	Some special values used by sockets.  More...

Public Member Functions

 	TcpListener ()

 	Default constructor.  More...

unsigned short 	getLocalPort () const

 	Get the port to which the socket is bound locally.  More...

Status 	listen (unsigned short port, const IpAddress &address=IpAddress::Any)

 	Start listening for connections.  More...

void 	close ()

 	Stop listening and close the socket.  More...

Status 	accept (TcpSocket &socket)

 	Accept a new connection.  More...

void 	setBlocking (bool blocking)

 	Set the blocking state of the socket.  More...

bool 	isBlocking () const

 	Tell whether the socket is in blocking or non-blocking mode.  More...

Protected Types

enum  	Type { Tcp,
Udp
 }

 	Types of protocols that the socket can use.  More...

Protected Member Functions

SocketHandle 	getHandle () const

 	Return the internal handle of the socket.  More...

void 	create ()

 	Create the internal representation of the socket.  More...

void 	create (SocketHandle handle)

 	Create the internal representation of the socket from a socket handle.  More...

Detailed Description

Socket that listens to new TCP connections.

A listener socket is a special type of socket that listens to a given port and waits for connections on that port.

This is all it can do.

When a new connection is received, you must call accept and the listener returns a new instance of sf::TcpSocket that is properly initialized and can be used to communicate with the new client.

Listener sockets are specific to the TCP protocol, UDP sockets are connectionless and can therefore communicate directly. As a consequence, a listener socket will always return the new connections as sf::TcpSocket instances.

A listener is automatically closed on destruction, like all other types of socket. However if you want to stop listening before the socket is destroyed, you can call its close() function.

Usage example:

// Create a listener socket and make it wait for new

// connections on port 55001

sf::TcpListener listener;

listener.listen(55001);

// Endless loop that waits for new connections

while (running)

{

    sf::TcpSocket client;

    if (listener.accept(client) == sf::Socket::Done)

    {

        // A new client just connected!

        std::cout << "New connection received from " << client.getRemoteAddress() << std::endl;

        doSomethingWith(client);

    }

}

See also

sf::TcpSocket, sf::Socket

Definition at line 44 of file TcpListener.hpp.

Member Enumeration Documentation

          anonymous enum

inherited

Some special values used by sockets.

Enumerator

AnyPort

Special value that tells the system to pick any available port.

Definition at line 66 of file Socket.hpp.

          enum sf::Socket::Status

inherited

Status codes that may be returned by socket functions.

Enumerator

Done

The socket has sent / received the data.

NotReady

The socket is not ready to send / receive data yet.

Partial

The socket sent a part of the data.

Disconnected

The TCP socket has been disconnected.

Error

An unexpected error happened.

Definition at line 53 of file Socket.hpp.

          enum sf::Socket::Type

protectedinherited

Types of protocols that the socket can use.

Enumerator

Tcp

TCP protocol.

Udp

UDP protocol.

Definition at line 114 of file Socket.hpp.

Constructor & Destructor Documentation

          sf::TcpListener::TcpListener
          (
          	)

Default constructor.

Member Function Documentation

          Status sf::TcpListener::accept
          (
          TcpSocket &
          socket	)

Accept a new connection.

If the socket is in blocking mode, this function will not return until a connection is actually received.

Parameters

socket	Socket that will hold the new connection

Returns

Status code

See also

listen

          void sf::TcpListener::close
          (
          	)

Stop listening and close the socket.

This function gracefully stops the listener. If the socket is not listening, this function has no effect.

See also

listen

          void sf::Socket::create
          (
          	)

protectedinherited

Create the internal representation of the socket.

This function can only be accessed by derived classes.

          void sf::Socket::create
          (
          SocketHandle
          handle	)

protectedinherited

Create the internal representation of the socket from a socket handle.

This function can only be accessed by derived classes.

Parameters

handle	OS-specific handle of the socket to wrap

          SocketHandle sf::Socket::getHandle
          (
          	)
           const

protectedinherited

Return the internal handle of the socket.

The returned handle may be invalid if the socket was not created yet (or already destroyed). This function can only be accessed by derived classes.

Returns

The internal (OS-specific) handle of the socket

          unsigned short sf::TcpListener::getLocalPort
          (
          	)
           const

Get the port to which the socket is bound locally.

If the socket is not listening to a port, this function returns 0.

Returns

Port to which the socket is bound

See also

listen

          bool sf::Socket::isBlocking
          (
          	)
           const

inherited

Tell whether the socket is in blocking or non-blocking mode.

Returns

True if the socket is blocking, false otherwise

See also

setBlocking

          Status sf::TcpListener::listen
          (
          unsigned short
          port,

          const IpAddress &
          address = IpAddress::Any

          )

Start listening for connections.

This functions makes the socket listen to the specified port, waiting for new connections. If the socket was previously listening to another port, it will be stopped first and bound to the new port.

Parameters

port	Port to listen for new connections

address	Address of the interface to listen on

Returns

Status code

See also

accept, close

          void sf::Socket::setBlocking
          (
          bool
          blocking	)

inherited

Set the blocking state of the socket.

In blocking mode, calls will not return until they have completed their task. For example, a call to Receive in blocking mode won't return until some data was actually received. In non-blocking mode, calls will always return immediately, using the return code to signal whether there was data available or not. By default, all sockets are blocking.

Parameters

blocking	True to set the socket as blocking, false for non-blocking

See also

isBlocking

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

TcpListener.hpp

                SFML is licensed under the terms and conditions of the zlib/png license.

                Copyright © Laurent Gomila  ::
                Documentation generated by doxygen  ::


text:
package cn.ac.ict.htc.tools;

import org.apache.hadoop.io.Writable;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by lubinb on 14-3-27.
 */
public class NumberListWritable<E extends Number> implements Writable {
    private List<E> innerList;
    private int size = 0;
    private Number test = null;

    //
    private final byte TYPE_BYTE = 0;
    private final byte TYPE_SHORT = 1;
    private final byte TYPE_INTEGER = 2;
    private final byte TYPE_LONG = 3;
    private final byte TYPE_FLOAT = 4;
    private final byte TYPE_DOUBLE = 5;
    //
    private byte TYPE_LOCAL = -1;

    public NumberListWritable(){
    }
    public NumberListWritable(List<E> list){
        set(list);
    }

    public void set(List<E> list){
        innerList = new ArrayList<E>(list.size());
        innerList.addAll(list);
        size = innerList.size();
        if(list.size()>0){
            test = list.get(0);
        }
    }

    public List<E> get(){
        return innerList;
    }

    @Override
    public void readFields(DataInput in) throws IOException {
        byte _type = in.readByte();
        int _size = in.readInt();
        innerList = new ArrayList<E>();
        if(_type == -1)
            throw new RuntimeException("read the element type is wrong!");
        for(int i = 0;i < _size;i++){
            innerList.add(readNext(in, _type));
        }
        TYPE_LOCAL = _type;
		size=innerList.size();
    }

    @Override
    public void write(DataOutput out) throws IOException {
        byte type = getType();
        if(type == -1)
            throw new RuntimeException("The element type is wrong!");
        out.writeByte(type);
        out.writeInt(size);
        if(size == 0){
            return;
        }
        for(int i = 0;i < size;i++){
            writeNumber(out,innerList.get(i),type);
        }
    }
    private E readNext(DataInput in,byte type) throws IOException{
        E number = null;
        switch(type){
            case TYPE_BYTE:
                number = (E)new Byte(in.readByte());
                break;
            case TYPE_SHORT:
                number = (E)new Short(in.readShort());
                break;
            case TYPE_INTEGER:
                number = (E)new Integer(in.readInt());
                break;
            case TYPE_FLOAT:
                number = (E)new Float(in.readFloat());
                break;
            case TYPE_DOUBLE:
                number = (E)new Double(in.readDouble());
                break;
            default:
                break;
        }
        return number;
    }

    private void writeNumber(DataOutput out,E number,byte type) throws IOException{
        switch(type){
            case TYPE_BYTE:
                out.writeByte(number.byteValue());
                break;
            case TYPE_SHORT:
                out.writeShort(number.shortValue());
                break;
            case TYPE_INTEGER:
                out.writeInt(number.intValue());
                break;
            case TYPE_FLOAT:
                out.writeFloat(number.floatValue());
                break;
            case TYPE_DOUBLE:
                out.writeDouble(number.doubleValue());
                break;
            default:
                break;
        }
    }

    private byte getType(){
        if(TYPE_LOCAL != -1){
            return TYPE_LOCAL;
        }else if(test instanceof Byte) {
            TYPE_LOCAL = TYPE_BYTE;
        }else if(test instanceof Float){
            TYPE_LOCAL = TYPE_FLOAT;
        }else if(test instanceof Integer) {
            TYPE_LOCAL = TYPE_INTEGER;
        }else if (test instanceof Double) {
            TYPE_LOCAL = TYPE_DOUBLE;
        }else if(test instanceof Long) {
            TYPE_LOCAL = TYPE_LONG;
        }else if(test instanceof Short) {
            TYPE_LOCAL = TYPE_SHORT;
        }
        return TYPE_LOCAL;
    }

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

        NumberListWritable<Double> tt = new NumberListWritable<Double>();
        ArrayList<Double> df = new ArrayList<Double>();
        for(int i = 0;i < 10;i++){
            df.add(new Double(i));
        }
        tt.set(df);
        DataInput di = new DataInputStream(new FileInputStream("C:\\data.dat"));
        DataOutput dot = new DataOutputStream(new FileOutputStream("C:\\data.dat"));

        tt.write(dot);

        NumberListWritable<Double> tt_o = new NumberListWritable<Double>();
        tt_o.readFields(di);
        System.out.println(tt_o.get().size());
    }
}

redpajama_set_name: RedPajamaGithub


text:
![Hypatia 0.3.6](media/logos/logotype-blacktext-transparentbg.png)

[![GitHub license](https://img.shields.io/github/license/hypatia-software-organization/hypatia-engine.svg?style=flat-square)](https://raw.githubusercontent.com/hypatia-software-organization/hypatia-engine/master/LICENSE)
[![PyPI Version](https://img.shields.io/pypi/v/hypatia_engine.svg?style=flat-square)](https://pypi.python.org/pypi/hypatia_engine/)
[![Travis](https://img.shields.io/travis/hypatia-software-organization/hypatia-engine.svg?style=flat-square)](https://travis-ci.org/hypatia-software-organization/hypatia-engine)
[![Code Climate](https://img.shields.io/codeclimate/github/lillian-lemmer/hypatia.svg?style=flat-square)](https://codeclimate.com/github/hypatia-software-organization/hypatia-engine)
[![PyPI Popularity](https://img.shields.io/pypi/dm/hypatia_engine.svg?style=flat-square)](https://pypi.python.org/pypi/hypatia_engine/)
[![Bountysource](https://img.shields.io/bountysource/team/hypatia-engine/activity.svg?style=flat-square)](https://www.bountysource.com/teams/hypatia-software-org)
[![Donate with Paypal](https://img.shields.io/badge/paypal-donate-ff69b4.svg?style=flat-square)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZU5EVKVY2DX2S)

Make 2D action adventure games. For programmers and nonprogrammers alike.

Create games like
[_Legend of Zelda: Oracle of Ages_ and _Oracle of Seasons_](http://en.wikipedia.org/wiki/The_Legend_of_Zelda:_Oracle_of_Seasons_and_Oracle_of_Ages).

The included demo game (`demo/game.py`) in action:

![The demo game in action.](media/demo-2015-11-07.gif)

## What makes this project special?

  * Each release tested in FreeBSD, Mac OS X, Linux, and Windows
  * Built and tested in FreeBSD first
  * A labor of love,
    [permissively (MIT) licensed](./LICENSE),
    meaning you Hypatia for commercial or non-commercial purposes and
    not worry about legalese--it's really free for any purpose without
    strings attached.

Hypatia stricly enforces the `CODE-OF-CONDUCT.md`. We strive for a
safe, healthy social environment for all women, whether
[cis](https://en.wikipedia.org/wiki/Cisgender) or trans.

Trans women have access to mentorships, funding, team chat,
and more! For more information please see the
[Hypatia Software Organization website](http://hypatia.software).

## Resources

  * [Hypatia Software Organization](http://hypatia.software): The
    organization which made this fine product.
  * [The official Hypatia website](http://engine.hypatia.software)
  * Official IRC support chat:
    [#hypatia on Freenode (webui!)](http://webchat.freenode.net/?channels=hypatia)
  * You can contact the author via email: lillian.lynn.lemmer@gmail.com,
    [@LilyLemmer](https:/twitter.com/LilyLemmer) on Twitter.

To know your way around the project, I strongly recommend reading the
[CONTRIBUTING.md](./CONTRIBUTING.md)
file. It covers everything you need to know about contributing to
Hypatia, as well as navigating the project.

## Getting Started

If you have just one version of Python installed, simply use:

```shell
./scripts/bootstrap
```

Otherwise, if you want to install for a
specific version of Python, use something like:

```shell
python3.3 scripts/bootstrap
```

If the bootstrap fails, you can try to install yourself:

  1. Install Pygame (platform-specific). Installing Pygame is
     a different process on various systems. See the
     *Installing Pygame* section below.
  2. `pip install --user .`

### Checkout the Demo

```shell
$ cd demo
$ python game.py
```

### Installing Pygame

**You can skip this section if the bootstrap worked for you.**

Installing Pygame on various platforms. I assume you have Python
installed and know how to use `pip`.

#### FreeBSD, DragonflyBSD, PC-BSD, etc.

The easiest thing to do is use Python 2.7. You can simply:

```shell
sudo pkg install py27-game
```

#### OpenBSD

```shell
sudo pkg_add pygame
```

#### Debian, Ubuntu

```shell
sudo apt-get install python-pygame
```

#### Mac OS X

Install pygame through Homebrew. You may want to install
Python through Homebrew as well.

```shell
# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install pygame through homebrew
brew install homebrew/python/pygame
```

#### Windows

For Python 2.x I recommend using
[Pygame's official Windows installers](http://www.pygame.org/download.shtml).

If you're using Python 3.x, I recommend using Christoph Gohlke's
*unofficial* Pygame binaries. Make sure to download the `whl` specific
to your Python version and architecture (win32 vs win_amd64). To
install the `whl` do the following in command prompt (in the directory
containing the `whl`):

```shell
pip install wheel
pip install pygame-*.whl
```


text:
/*
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE', which is part of this source code package.
 *
 * @author Christopher Armenio
 */
#ifndef CXA_DUMMY_USART_H_
#define CXA_DUMMY_USART_H_

// ******** includes ********
#include <stdbool.h>
#include <stdio.h>
#include <cxa_config.h>
#include <cxa_usart.h>
#include <cxa_fixedFifo.h>
#include <cxa_gpio.h>

// ******** global macro definitions ********

// ******** global type definitions *********
/**
 * @public
 * @brief "Forward" declaration of the cxa_dummy_usart_t object
 */
typedef struct cxa_dummy_usart cxa_dummy_usart_t;

/**
 * @private
 */
struct cxa_dummy_usart
{
	cxa_usart_t super;
};

// ******** global function prototypes ********
/**
 * @public
 * @brief Initializes the specified USART for no hardware handshaking using the specified baud rate.
 *
 * @param[in] usartIn pointer to a pre-allocated USART object
 * @param[in] baudRate_bpsIn the desired baud rate, in bits-per-second
 */
void cxa_dummy_usart_init_noHH(cxa_dummy_usart_t *const usartIn, const uint32_t baudRate_bpsIn);

#endif


text:
import {createLocal} from '../create/local';
import {cloneWithOffset} from '../units/offset';
import isFunction from '../utils/is-function';
import {hooks} from '../utils/hooks';

export function getCalendarFormat(myMoment, now) {
    var diff = myMoment.diff(now, 'days', true);
    return diff < -6 ? 'sameElse' :
        diff < -1 ? 'lastWeek' :
            diff < 0 ? 'lastDay' :
                diff < 1 ? 'sameDay' :
                    diff < 2 ? 'nextDay' :
                        diff < 7 ? 'nextWeek' : 'sameElse';
}

export function calendar(time, formats) {
    // We want to compare the start of today, vs this.
    // Getting start-of-today depends on whether we're local/utc/offset or not.
    var now = time || createLocal(),
        sod = cloneWithOffset(now, this).startOf('day'),
        format = hooks.calendarFormat(this, sod) || 'sameElse';

    var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);

    return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
}


text:
CKEDITOR.plugins.setLang( 'lockunlock2', 'ug', {
	title: 'ئورۇن بەلگە خاسلىقى',
	toolbar: 'ئورۇن بەلگە قۇر',
	name: 'Placeholder Name', // MISSING
	invalidName: 'The placeholder can not be empty and can not contain any of following characters: [, ], <, >', // MISSING
	pathName: 'lockunlock2' // MISSING
} );


text:
/**************************
 * bed_mesh_edit_screen.h *
 *************************/

/****************************************************************************
 *   Written By Marcio Teixeira 2020                                        *
 *                                                                          *
 *   This program is free software: you can redistribute it and/or modify   *
 *   it under the terms of the GNU General Public License as published by   *
 *   the Free Software Foundation, either version 3 of the License, or      *
 *   (at your option) any later version.                                    *
 *                                                                          *
 *   This program is distributed in the hope that it will be useful,        *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
 *   GNU General Public License for more details.                           *
 *                                                                          *
 *   To view a copy of the GNU General Public License, go to the following  *
 *   location: <https://www.gnu.org/licenses/>.                             *
 ****************************************************************************/

#pragma once

#define FTDI_BED_MESH_EDIT_SCREEN
#define FTDI_BED_MESH_EDIT_SCREEN_CLASS BedMeshEditScreen

struct BedMeshEditScreenData {
  bool needSave, savedMeshLevelingState, savedEndstopState;
  xy_uint8_t highlight;
  float zAdjustment;
};

class BedMeshEditScreen : public BedMeshBase, public CachedScreen<BED_MESH_EDIT_SCREEN_CACHE> {
  private:
    static void makeMeshValid();
    static float getHighlightedValue();
    static void setHighlightedValue(float value);
    static void moveToHighlightedValue();
    static void adjustHighlightedValue(float increment);
    static void saveAdjustedHighlightedValue();
    static bool changeHighlightedValue(uint8_t tag);
    static void drawHighlightedPointValue();
  public:
    static void onEntry();
    static void onExit();
    static void onRedraw(draw_mode_t);
    static bool onTouchHeld(uint8_t tag);
    static bool onTouchEnd(uint8_t tag);
    static void show();
};


text:
package org.apache.accumulo.core.client.mapreduce;

import static org.junit.Assert.assertEquals;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.sample.SamplerConfiguration;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.util.Pair;
import org.apache.hadoop.io.Text;
import org.junit.Before;
import org.junit.Test;

/**
 * @deprecated since 2.0.0
 */
@Deprecated
public class InputTableConfigTest {

  private InputTableConfig tableQueryConfig;

  @Before
  public void setUp() {
    tableQueryConfig = new InputTableConfig();
  }

  @Test
  public void testSerialization_OnlyTable() throws IOException {
    byte[] serialized = serialize(tableQueryConfig);
    InputTableConfig actualConfig = deserialize(serialized);

    assertEquals(tableQueryConfig, actualConfig);
  }

  @Test
  public void testSerialization_allBooleans() throws IOException {
    tableQueryConfig.setAutoAdjustRanges(false);
    tableQueryConfig.setOfflineScan(true);
    tableQueryConfig.setUseIsolatedScanners(true);
    tableQueryConfig.setUseLocalIterators(true);
    byte[] serialized = serialize(tableQueryConfig);
    InputTableConfig actualConfig = deserialize(serialized);

    assertEquals(tableQueryConfig, actualConfig);
  }

  @Test
  public void testSerialization_ranges() throws IOException {
    List<Range> ranges = new ArrayList<>();
    ranges.add(new Range("a", "b"));
    ranges.add(new Range("c", "d"));
    tableQueryConfig.setRanges(ranges);

    byte[] serialized = serialize(tableQueryConfig);
    InputTableConfig actualConfig = deserialize(serialized);

    assertEquals(ranges, actualConfig.getRanges());
  }

  @Test
  public void testSerialization_columns() throws IOException {
    Set<Pair<Text,Text>> columns = new HashSet<>();
    columns.add(new Pair<>(new Text("cf1"), new Text("cq1")));
    columns.add(new Pair<>(new Text("cf2"), null));
    tableQueryConfig.fetchColumns(columns);

    byte[] serialized = serialize(tableQueryConfig);
    InputTableConfig actualConfig = deserialize(serialized);

    assertEquals(actualConfig.getFetchedColumns(), columns);
  }

  @Test
  public void testSerialization_iterators() throws IOException {
    List<IteratorSetting> settings = new ArrayList<>();
    settings.add(new IteratorSetting(50, "iter", "iterclass"));
    settings.add(new IteratorSetting(55, "iter2", "iterclass2"));
    tableQueryConfig.setIterators(settings);
    byte[] serialized = serialize(tableQueryConfig);
    InputTableConfig actualConfig = deserialize(serialized);
    assertEquals(actualConfig.getIterators(), settings);

  }

  @Test
  public void testSamplerConfig() throws IOException {
    SamplerConfiguration sc = new SamplerConfiguration("com.foo.S1").addOption("k1", "v1");
    tableQueryConfig.setSamplerConfiguration(sc);
    InputTableConfig actualConfig = deserialize(serialize(tableQueryConfig));
    assertEquals(sc, actualConfig.getSamplerConfiguration());
  }

  private byte[] serialize(InputTableConfig tableQueryConfig) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    tableQueryConfig.write(new DataOutputStream(baos));
    baos.close();
    return baos.toByteArray();
  }

  private InputTableConfig deserialize(byte[] bytes) throws IOException {
    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
    InputTableConfig actualConfig = new InputTableConfig(new DataInputStream(bais));
    bais.close();
    return actualConfig;
  }
}


text:
'use strict';

module.exports = {
	app: {
		title: 'MajorMan',
		description: ' A smart academic advising tool for students at Emory University',
		keywords: 'Academic advisiing, Emory Univerisity, School course and major demand analytic tool'
	},
	port: process.env.PORT || 3000,
	templateEngine: 'swig',
	sessionSecret: 'MEAN',
	sessionCollection: 'sessions',
	assets: {
		lib: {
			css: [
				'public/lib/bootstrap/dist/css/bootstrap.css',
				'public/lib/bootstrap/dist/css/bootstrap-theme.css',
			],
			js: [
				'public/lib/angular/angular.js',
				'public/lib/angular-resource/angular-resource.js',
				'public/lib/angular-cookies/angular-cookies.js',
				'public/lib/angular-animate/angular-animate.js',
				'public/lib/angular-touch/angular-touch.js',
				'public/lib/angular-sanitize/angular-sanitize.js',
				'public/lib/angular-ui-router/release/angular-ui-router.js',
				'public/lib/angular-ui-utils/ui-utils.js',
				'public/lib/angular-bootstrap/ui-bootstrap-tpls.js'
			]
		},
		css: [
			'public/modules/**/css/*.css'
		],
		js: [
			'public/config.js',
			'public/application.js',
			'public/modules/*/*.js',
			'public/modules/*/*[!tests]*/*.js'
		],
		tests: [
			'public/lib/angular-mocks/angular-mocks.js',
			'public/modules/*/tests/*.js'
		]
	}
};


text:
/*!
 * Grouphub email template Scripts
 * Author: bedeute
 * Email: bedeute@gmail.com
 */
!function(n){"use strict";n(function(){})}(jQuery);


text:
FrameBuffer::FrameBuffer(
	int u0, int v0,
	unsigned int _w, unsigned int _h) :
	Fl_Gl_Window(u0, v0, _w, _h, 0),
	w(_w),
	h(_h)
{
}

FrameBuffer::~FrameBuffer()
{
}

// function called automatically on event within window (callback)
int FrameBuffer::handle(int event) {

	// from users guide:
	// You must return non - zero if your handle() method uses the event.
	// If you return zero, the parent widget will try sending the event to another widget.
	switch (event)
	{
	case FL_KEYBOARD:
		keyboardHandle();
		return 1;
		// In order to receive FL_DRAG events, the widget must return non-zero when handling FL_PUSH.
	case FL_PUSH:
		if (Fl::event_button1()) {
			mouseLeftClickDragHandle(FL_PUSH);
			return 1;
		}
		else if (Fl::event_button3()) {
			mouseRightClickDragHandle(FL_PUSH);
			return 1;
		}
		return 0;
		// In order to receive the FL_RELEASE event, the widget must return non - zero when handling FL_PUSH.
	case FL_RELEASE:
		if (Fl::event_button1() || Fl::event_button3()) {
			return 1;
		}
		return 0;
	case FL_DRAG:
		if (Fl::event_button1()) {
			mouseLeftClickDragHandle(FL_DRAG);
			return 1;
		}
		else if (Fl::event_button3()) {
			mouseRightClickDragHandle(FL_DRAG);
			return 1;
		}
		return 0;
	default:
		return 0;
	}
}


text:
package jebl.gui.trees.treeviewer_dev.painters;

import jebl.evolution.trees.Tree;
import jebl.gui.trees.treeviewer_dev.decorators.Decorator;

import java.awt.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.prefs.Preferences;
import java.util.Collection;

/**
 * @author Andrew Rambaut
 * @version $Id: LabelPainter.java 536 2006-11-21 16:10:24Z rambaut $
 */
public abstract class LabelPainter<T> extends AbstractPainter<T> {

	protected LabelPainter() {
	}

	// Abstract

	public abstract String[] getAttributes();

    public abstract void setupAttributes(Collection<? extends Tree> trees);

    public abstract void setDisplayAttribute(String displayAttribute);

	// Getters

	public Paint getForeground() {
		return foreground;
	}

	public Paint getBackground() {
		return background;
	}

	public Paint getBorderPaint() {
		return borderPaint;
	}

	public Stroke getBorderStroke() {
		return borderStroke;
	}

	public Font getFont() {
		return font;
	}

	public NumberFormat getNumberFormat() {
		return numberFormat;
	}

	public boolean isVisible() {
	    return visible;
	}

	// Setters

	public void setBackground(Paint background) {
	    this.background = background;
	    firePainterChanged();
	}

	public void setBorder(Paint borderPaint, Stroke borderStroke) {
	    this.borderPaint = borderPaint;
	    this.borderStroke = borderStroke;
	    firePainterChanged();
	}

	public void setFont(Font font) {
		this.font = font;
	    firePainterChanged();
	}

	public void setForeground(Paint foreground) {
	    this.foreground = foreground;
	    firePainterChanged();
	}

	public void setNumberFormat(NumberFormat numberFormat) {
		this.numberFormat = numberFormat;
	    firePainterChanged();
	}

	public void setVisible(boolean visible) {
	    this.visible = visible;
	    firePainterChanged();
	}

	private Paint foreground = Color.BLACK;
	private Paint background = null;
	private Paint borderPaint = null;
	private Stroke borderStroke = null;

	private Font font;
	private boolean visible = true;

	private NumberFormat numberFormat = null;

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
All Classes
</TITLE>

<META NAME="date" CONTENT="2011-09-25">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

All Classes

ArrayUtils

BaseColumns

Contacts

Contacts.ContactMethods

Contacts.ContactMethodsColumns

Contacts.OrganizationColumns

Contacts.PeopleColumns

Contacts.Phones

Contacts.PhonesColumns

ContactStruct

ContactStruct.ContactMethod

ContactStruct.OrganizationData

ContactStruct.PhoneData

ContentValues

Editable

Editable.Factory

GetChars

InputFilter

InputFilter.LengthFilter

Log

NoCopySpan

NoCopySpan.Concrete

PhoneNumberUtils

PropertyNode

Selection

Spannable

SpannableStringBuilder

Spanned

SpanWatcher

TextUtils

TextWatcher

VBuilder

VCardComposer

VCardException

VCardNestedException

VCardParser

VCardParser_V21

VCardParser_V30

VCardSourceDetector

VCardVersionException

VDataBuilder

VNode


text:
package net.fortuna.ical4j.vcard.property;

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

import org.junit.runners.Parameterized.Parameters;

import net.fortuna.ical4j.vcard.Parameter;
import net.fortuna.ical4j.vcard.Property;
import net.fortuna.ical4j.vcard.PropertyTest;
import net.fortuna.ical4j.vcard.Property.Id;

public class OrgTest extends PropertyTest {

    public OrgTest(Property property, String expectedName,
            String expectedValue, Parameter[] expectedParams) {
        super(property, expectedName, expectedValue, expectedParams);
    }

    @Parameters
    public static Collection<Object[]> parameters() {
        final List<Object[]> params = new ArrayList<Object[]>();
        params.add(new Object[] { new Org(""), Id.ORG.toString(), "",
                new Parameter[] {} });
        params.add(new Object[] {
                new Org("ABC, Inc.", "North American Division", "Marketing"),
                Id.ORG.toString(),
                "ABC\\, Inc.;North American Division;Marketing",
                new Parameter[] {} });
        params.add(new Object[] {
                new Org(new ArrayList<Parameter>(), "ABC, Inc.;North American Division;Marketing"),
                Id.ORG.toString(),
                "ABC\\, Inc.;North American Division;Marketing",
                new Parameter[] {} });
        return params;
    }

}


text:
@import A;
#else
@import DependsOnA;
#endif

#if FROM_PATH != EXPECTED_PATH
#error "Got the wrong module!"
#endif

// expected-no-diagnostics


text:
class Project < ActiveRecord::Base
  attr_accessor :email
	acts_as_taggable_on :tags
	acts_as_commentable
	enum status: [:preproject, :in_progress, :finished, :canceled]

	belongs_to :mentor
	belongs_to :city
	has_many :phases
	has_many :participations
	has_many :users, -> { distinct }, through: :participations

	mount_uploader :picture, PictureUploader

	validates :name, presence: true
	validates :description, presence: true

  def owner
    self.participations.where(role: 2).first.user
  end

  def owner?(user)
    if self.owner == user
      true
    else
      false
    end
  end

  def members
    members = []
    participations = self.participations.where(role: 0)
    participations.each do |part|
      members << part.user
    end
    return members
  end

  def member?(user)
    participants = []
    participations = self.participations
    participations.each do |part|
      if user == part.user
        return true
      end
    end
    return false
  end
end


text:
package org.curioswitch.common.server.framework.redis;

import io.lettuce.core.SetArgs;
import java.util.concurrent.CompletionStage;

interface RemoteCache<K, V> {

  CompletionStage<V> get(K key);

  CompletionStage<String> set(K key, V value, SetArgs setArgs);

  CompletionStage<Long> del(K key);
}


text:
/* jshint node:true, esversion: 6 */
'use strict';

const _get          = require('lodash').get;

module.exports = function (platform, projectPath, iconData) {
  let props = {
    id: iconData.id,
    src: iconData.path
  };

  if (platform === 'ios') {
    props.height = iconData.size.toString();
    props.width = iconData.size.toString();
  } else if (platform === 'android') {
    props.density = iconData.id;
  } else if (platform === 'windows') {
    const target = _get(iconData, 'attrs.target', iconData.id);
    props.target = target;
  }

  return props;
};


text:
module VerifiedDouble
  module IsAnInstanceDouble
    def verified_instance_double?
      true
    end
  end
end


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var cluster = require("cluster");
var memshared = require("memshared");
var http = require("http");
var os = require("os");
var parseURL = require("url-parse");
var Master_1 = require("./cluster/Master");
var Worker_1 = require("./cluster/Worker");
var Protocol_1 = require("./Protocol");
var MatchMaker_1 = require("./MatchMaker");
var Debug_1 = require("./Debug");
var cache = memshared.store;
var ClusterServer = /** @class */ (function () {
    function ClusterServer(options) {
        if (options === void 0) { options = {}; }
        var _this = this;
        if (cluster.isMaster) {
            Debug_1.debugCluster("master spawned with pid " + process.pid);
            this.matchMakingWorker = Master_1.spawnMatchMaking();
            cache['matchmaking_process'] = this.matchMakingWorker.pid;
            Debug_1.debugCluster("matchmaking spawned with pid " + this.matchMakingWorker.pid);
            this.server = options.server || http.createServer();
            this.server.on('connection', function (socket) {
                socket.pause();
            });
            this.server.on('request', function (request, response) {
                var socket = request.connection;
                var worker = Master_1.getNextWorkerForSocket(socket);
                var body = [];
                request.on('data', function (chunk) {
                    body.push(chunk);
                }).on('end', function () {
                    worker.send([Protocol_1.Protocol.PASS_HTTP_SOCKET, {
                            url: request.url,
                            headers: request.headers,
                            body: Buffer.concat(body).toString(),
                            method: request.method,
                        }], socket);
                });
            });
            this.server.on('upgrade', function (request, socket, head) {
                var worker = _this.matchMakingWorker;
                var roomId = parseURL(request.url).pathname.substr(1);
                // bind client to the worker that has the requested room spawed
                if (cache[roomId]) {
                    worker = memshared.getProcessById(cache[roomId]);
                }
                // send socket connection from master to a child process
                worker.send([Protocol_1.Protocol.PASS_WEBSOCKET, {
                        headers: request.headers,
                        method: request.method,
                    }, head, request.url], socket);
            });
        }
        if (cluster.isWorker) {
            this.matchMaker = new MatchMaker_1.MatchMaker();
        }
    }
    ClusterServer.prototype.fork = function (numWorkers) {
        if (numWorkers === void 0) { numWorkers = os.cpus().length; }
        Master_1.spawnWorkers(numWorkers);
    };
    ClusterServer.prototype.listen = function (port, hostname, backlog, listeningListener) {
        if (cluster.isMaster) {
            this.server.listen(port, hostname, backlog, listeningListener);
        }
    };
    ClusterServer.prototype.register = function (name, handler, options) {
        if (options === void 0) { options = {}; }
        if (!cluster.isWorker) {
            console.warn("ClusterServer#register should be called from a worker process.");
            return;
        }
        return this.matchMaker.registerHandler(name, handler, options);
    };
    ClusterServer.prototype.attach = function (options) {
        var _this = this;
        if (!cluster.isWorker) {
            console.warn("ClusterServer#attach should be called from a worker process.");
            return;
        }
        if (options.server) {
            // Don't expose internal server to the outside.
            var server_1 = options.server.listen(0, 'localhost');
            server_1.on('listening', function () {
                _this.server = Worker_1.setupWorker(server_1, _this.matchMaker);
            });
        }
    };
    return ClusterServer;
}());
exports.ClusterServer = ClusterServer;


text:
function factorial(n) {
  if (n <= 1) {
    return 1;
  } else {
    return n * factorial(n-1);
  }
}

// From JavaScript: The Good Parts
var memoizer = function(memo, formula) {
  var recur = function(n) {
    var result = memo[n];
    if (typeof result !== 'number') {
      result = formula(recur, n);
      memo[n] = result;
    }
    return result;
  };
  return recur;
};

var memoizedFactorial = memoizer([1, 1], function(recur, n) {
  return n * recur(n-1);
});


text:
#ifndef _MAILUTILS_HEADER_H
#define _MAILUTILS_HEADER_H

#include <mailutils/types.h>

#ifdef __cplusplus
extern "C" {
#endif

#define MU_HEADER_UNIX_FROM                 "From "
#define MU_HEADER_RETURN_PATH               "Return-Path"
#define MU_HEADER_RECEIVED                  "Received"
#define MU_HEADER_DATE                      "Date"
#define MU_HEADER_DCC                       "Dcc"
#define MU_HEADER_FROM                      "From"
#define MU_HEADER_SENDER                    "Sender"
#define MU_HEADER_RESENT_FROM               "Resent-From"
#define MU_HEADER_SUBJECT                   "Subject"
#define MU_HEADER_SENDER                    "Sender"
#define MU_HEADER_RESENT_SENDER             "Resent-SENDER"
#define MU_HEADER_TO                        "To"
#define MU_HEADER_RESENT_TO                 "Resent-To"
#define MU_HEADER_CC                        "Cc"
#define MU_HEADER_RESENT_CC                 "Resent-Cc"
#define MU_HEADER_BCC                       "Bcc"
#define MU_HEADER_RESENT_BCC                "Resent-Bcc"
#define MU_HEADER_REPLY_TO                  "Reply-To"
#define MU_HEADER_RESENT_REPLY_TO           "Resent-Reply-To"
#define MU_HEADER_MESSAGE_ID                "Message-ID"
#define MU_HEADER_RESENT_MESSAGE_ID         "Resent-Message-ID"
#define MU_HEADER_IN_REPLY_TO               "In-Reply-To"
#define MU_HEADER_REFERENCE                 "Reference"
#define MU_HEADER_REFERENCES                "References"
#define MU_HEADER_ENCRYPTED                 "Encrypted"
#define MU_HEADER_PRECEDENCE                "Precedence"
#define MU_HEADER_STATUS                    "Status"
#define MU_HEADER_CONTENT_LENGTH            "Content-Length"
#define MU_HEADER_CONTENT_LANGUAGE          "Content-Language"
#define MU_HEADER_CONTENT_TRANSFER_ENCODING "Content-transfer-encoding"
#define MU_HEADER_CONTENT_ID                "Content-ID"
#define MU_HEADER_CONTENT_TYPE              "Content-Type"
#define MU_HEADER_CONTENT_DESCRIPTION       "Content-Description"
#define MU_HEADER_CONTENT_DISPOSITION       "Content-Disposition"
#define MU_HEADER_CONTENT_MD5               "Content-MD5"
#define MU_HEADER_MIME_VERSION              "MIME-Version"
#define MU_HEADER_X_MAILER                  "X-Mailer"
#define MU_HEADER_X_UIDL                    "X-UIDL"
#define MU_HEADER_X_UID                     "X-UID"
#define MU_HEADER_X_IMAPBASE                "X-IMAPbase"
#define MU_HEADER_ENV_SENDER                "X-Envelope-Sender"
#define MU_HEADER_ENV_DATE                  "X-Envelope-Date"
#define MU_HEADER_FCC                       "Fcc"
#define MU_HEADER_DELIVERY_DATE             "Delivery-date"
#define MU_HEADER_ENVELOPE_TO               "Envelope-to"
#define MU_HEADER_X_EXPIRE_TIMESTAMP        "X-Expire-Timestamp"

#define MU_HEADER_REPLACE 0x01
#define MU_HEADER_BEFORE  0x02

extern int mu_header_create (mu_header_t *, const char *, size_t, void *);
extern void mu_header_destroy (mu_header_t *, void *);
extern void *mu_header_get_owner (mu_header_t);

extern int mu_header_is_modified (mu_header_t);
extern int mu_header_clear_modified (mu_header_t);

/* Set and get field values by field name. */
extern int mu_header_set_value (mu_header_t, const char *, const char *, int);
extern int mu_header_remove (mu_header_t, const char *, int);
extern int mu_header_append (mu_header_t header, const char *fn,
			     const char *fv);
extern int mu_header_prepend (mu_header_t header, const char *fn,
			      const char *fv);
extern int mu_header_insert (mu_header_t, const char *, const char *,
			     const char *, int, int);

extern int mu_header_sget_value_n (mu_header_t, const char *, int,
				   const char **);
#define mu_header_sget_value(header, name, pval) \
  mu_header_sget_value_n (header, name, 1, pval)

extern int mu_header_get_value_n (mu_header_t, const char *, int, char *,
				  size_t, size_t *);
#define mu_header_get_value(header, name, buffer, buflen, pn) \
  mu_header_get_value_n (header, name, 1, buffer, buflen, pn)

extern int mu_header_aget_value_n (mu_header_t, const char *, int, char **);
#define mu_header_aget_value(header, name, pptr) \
  mu_header_aget_value_n (header, name, 1, pptr)

/* Get field values as an mu_address_t. */
extern int mu_header_get_address_n (mu_header_t, const char *,
				    int, mu_address_t *);
#define mu_header_get_address(header, name, addr) \
  mu_header_get_address_n (header, name, 1, addr)

/* Set and get field values by field index (1-based). */
extern int mu_header_get_field_count (mu_header_t, size_t *count);

extern int mu_header_sget_field_name (mu_header_t, size_t index,
				      const char **);

extern int mu_header_get_field_name (mu_header_t, size_t index,
				     char *, size_t, size_t *);
extern int mu_header_aget_field_name (mu_header_t, size_t index,
				      char **);

extern int mu_header_sget_field_value (mu_header_t, size_t index,
				       const char **);
extern int mu_header_get_field_value (mu_header_t, size_t index,
				      char *, size_t, size_t *);
extern int mu_header_aget_field_value (mu_header_t, size_t index, char **);

extern int mu_header_get_value_unfold_n (mu_header_t header,
					 const char *name, int n,
					 char *buffer, size_t buflen,
					 size_t *pn);
#define mu_header_get_value_unfold(header, name, buffer, buflen, pn) \
  mu_header_get_value_unfold_n (header, name, 1, buffer, buflen, pn)

extern int mu_header_aget_value_unfold_n (mu_header_t header,
					  const char *name, int n,
					  char **pvalue);
#define mu_header_aget_value_unfold(header, name, pvalue) \
  mu_header_aget_value_unfold_n (header, name, 1, pvalue)

extern int mu_header_get_field_value_unfold (mu_header_t header, size_t num,
					     char *buf, size_t buflen,
					     size_t *nwritten);
extern int mu_header_aget_field_value_unfold (mu_header_t header, size_t num,
					      char **pvalue);

extern int mu_header_get_stream (mu_header_t, mu_stream_t *);
/* FIXME: This function does not exist:
   extern int mu_header_set_stream (mu_header_t, mu_stream_t, void *);
*/
extern int mu_header_size (mu_header_t, size_t *);
extern int mu_header_lines (mu_header_t, size_t *);

extern int mu_header_get_iterator (mu_header_t, mu_iterator_t *);

extern int mu_header_set_fill (mu_header_t,
      int (*_fill) (mu_header_t, char *, size_t, mu_off_t, size_t *), void *owner);

#ifdef __cplusplus
}
#endif

#endif /* _MAILUTILS_HEADER_H */


text:
package org.onosproject.yangutils.parser.impl;

import java.io.IOException;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.parser.exceptions.ParserException;

/**
 * Test cases for testing tree walk listener functionality.
 */
public class TreeWalkListenerTest {

    private final YangUtilsParserManager manager = new YangUtilsParserManager();

    @Rule
    public ExpectedException thrown = ExpectedException.none();

    /**
     * Checks whether exception is thrown for ordered statement.
     */
    @Test
    public void processOrderedByStatement() throws IOException, ParserException {
        thrown.expect(ParserException.class);
        thrown.expectMessage("YANG file error : \"ordered-by\" is not supported in current version, please check wiki" +
                " for YANG utils road map.");
        manager.getDataModel("src/test/resources/OrderedByStatement.yang");
    }

    /**
     * Checks whether exception is thrown for anyxml statement.
     */
    @Test
    public void processAnyXmlStatement() throws IOException, ParserException {
        thrown.expect(ParserException.class);
        thrown.expectMessage("YANG file error : \"anyxml\" is not supported.");
        manager.getDataModel("src/test/resources/AnyxmlStatement.yang");
    }

    /**
     * Checks whether exception is thrown when extra brace is added in the EOF.
     */
    @Test
    public void processFileWithExtraBrace() throws IOException, ParserException {
        thrown.expect(ParserException.class);
        thrown.expectMessage("mismatched input '}' expecting <EOF>");
        manager.getDataModel("src/test/resources/ProcessFileWithExtraBrace.yang");
    }

    /**
     * Checks whether exception is thrown when leaf is given after module ends.
     */
    @Test
    public void processFileWithExtraLeaf() throws IOException, ParserException {
        thrown.expect(ParserException.class);
        thrown.expectMessage("mismatched input 'leaf' expecting <EOF>");
        manager.getDataModel("src/test/resources/ProcessFileWithExtraLeaf.yang");
    }

    /**
     * Checks whether exception is thrown when extra brace is added in between the EOF.
     */
    @Test
    public void processFileWithExtraBraceInBetween() throws IOException, ParserException {
        thrown.expect(ParserException.class);
        thrown.expectMessage("mismatched input 'container' expecting <EOF>");
        manager.getDataModel("src/test/resources/ProcessFileWithExtraBraceInBetween.yang");
    }
}


text:
'use strict';

const knex = require('knex');

/**
 * Initialize Knex, creating a database connection.
 *
 * The options provided to the Knex initializer below assume that you have
 * Postgres installed. It's up to you to initialize Knex correctly for your use
 * case, but I would personally advise using a "knexfile" to store the config,
 * which can then also be used for the Knex command-line tool (for migrations).
 *
 * Relevant docs:
 * - http://knexjs.org/#installation-client
 * - http://knexjs.org/#knexfile
 */
const knexConnection = knex({
  client: 'postgresql',
  connection: 'postgres:///postgres'
});

module.exports = knexConnection;


text:
package iris.audit.server.test.util;

import iris.audit.server.service.AbstractAuditContextImpl;

public class TestAbstractAuditContextImpl
  extends AbstractAuditContextImpl
{
}


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE590_Free_Memory_Not_on_Heap__delete_array_wchar_t_alloca_72b.cpp
Label Definition File: CWE590_Free_Memory_Not_on_Heap__delete_array.label.xml
Template File: sources-sink-72b.tmpl.cpp
*/
/*
 * @description
 * CWE: 590 Free Memory Not on Heap
 * BadSource: alloca Data buffer is allocated on the stack with alloca()
 * GoodSource: Allocate memory on the heap
 * Sinks:
 *    BadSink : Print then free data
 * Flow Variant: 72 Data flow: data passed in a vector from one function to another in different source files
 *
 * */

#include "std_testcase.h"
#include <vector>

#include <wchar.h>

using namespace std;

namespace CWE590_Free_Memory_Not_on_Heap__delete_array_wchar_t_alloca_72
{

#ifndef OMITBAD

void badSink(vector<wchar_t *> dataVector)
{
    /* copy data out of dataVector */
    wchar_t * data = dataVector[2];
    printWLine(data);
    /* POTENTIAL FLAW: Possibly deallocating memory allocated on the stack */
    delete [] data;
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B uses the GoodSource with the BadSink */
void goodG2BSink(vector<wchar_t *> dataVector)
{
    wchar_t * data = dataVector[2];
    printWLine(data);
    /* POTENTIAL FLAW: Possibly deallocating memory allocated on the stack */
    delete [] data;
}

#endif /* OMITGOOD */

} /* close namespace */


text:
<bill session="115" type="h" number="705" updated="2017-06-19T20:45:10Z">
  <state datetime="2017-01-27">REFERRED</state>
  <status>
    <introduced datetime="2017-01-27"/>
  </status>
  <introduced datetime="2017-01-27"/>
  <titles>
    <title type="short" as="introduced">Verify Eligibility Coverage Act</title>
    <title type="short" as="introduced">Verify Eligibility Coverage Act</title>
    <title type="official" as="introduced">To amend titles XI and XIX of the Social Security Act to promote program integrity with respect to the enrollment of certain immigrants in State plans under Medicaid, and for other purposes.</title>
    <title type="display">Verify Eligibility Coverage Act</title>
  </titles>
  <sponsor bioguide_id="F000461"/>
  <cosponsors>
    <cosponsor bioguide_id="C001092" joined="2017-01-27"/>
    <cosponsor bioguide_id="G000558" joined="2017-01-27"/>
    <cosponsor bioguide_id="M001190" joined="2017-01-27"/>
  </cosponsors>
  <actions>
    <action datetime="2017-01-27">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-01-27" state="REFERRED">
      <text>Referred to the House Committee on Energy and Commerce.</text>
    </action>
    <action datetime="2017-02-03">
      <text>Referred to the Subcommittee on Health.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSIF" name="House Energy and Commerce" activity="Referral"/>
    <committee subcommittee="Health" code="HSIF14" name="House Energy and Commerce" activity="Referral"/>
  </committees>
  <relatedbills/>
  <subjects>
    <term name="Health"/>
    <term name="Emergency medical services and trauma care"/>
    <term name="Health programs administration and funding"/>
    <term name="Home and outpatient care"/>
    <term name="Immigrant health and welfare"/>
    <term name="Immigration status and procedures"/>
    <term name="Medicaid"/>
  </subjects>
  <amendments/>
  <summary date="2017-01-27T05:00:00Z" status="Introduced in House">Verify Eligibility Coverage Act

 The bill amends title XIX (Medicaid) of the Social Security Act to allow a state to delay or deny an individual's initial eligibility for Medicaid benefits without providing a reasonable opportunity to submit evidence of a satisfactory immigration status or pending official verification of such status. A state that elects to provide a reasonable period for an individual to provide such evidence may not receive payment for amounts expended on the individual's medical assistance during that period.

In FY2018-FY2026, the Centers for Medicare & Medicaid Services, using the Medicaid Improvement Fund, shall pay a 90% federal matching rate to eligible states for home- and community-based services furnished under a state Medicaid waiver to patients who had been on a waiting list for such services.</summary>
  <committee-reports/>
</bill>


text:
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    CulatorManger *mgr = [[CulatorManger alloc] init];

    [mgr calculte:^int(int result) {

        result += 2;
        result *= 2;
        return result;
    }];
}

@end


text:
using NUnit.Framework;

namespace FluentRegex.Tests
{
	/// <summary>
	/// A set of slightly more complex tests which test multiple properties/methods at once.
	/// </summary>
	[TestFixture]
	public class CompositePatternTests
	{
		[Test]
		public void Group()
		{
			Pattern p = Pattern.With.Group(Pattern.With
												  .Digit
												  .Word);

			Assert.That(p.ToString(), Is.EqualTo(@"(\d\w)"));
		}

		[Test]
		public void Set()
		{
			Pattern p = Pattern.With.Set(Pattern.With
												.Digit
												.Word);

			Assert.That(p.ToString(), Is.EqualTo(@"[\d\w]"));
		}

		[Test]
		public void NegatedSet()
		{
			Pattern p = Pattern.With.NegatedSet(Pattern.With
													   .Digit
													   .Word);

			Assert.That(p.ToString(), Is.EqualTo(@"[^\d\w]"));
		}

		[Test]
		public void Choice_With2Options()
		{
			Pattern p = Pattern.With.Choice(Pattern.With.Digit.Repeat.Times(3),
											Pattern.With.Whitespace);

			Assert.That(p.ToString(), Is.EqualTo("(\\d{3}|\\s)"));
		}

		[Test]
		public void Choice_With3Options()
		{
			Pattern p = Pattern.With.Choice(Pattern.With.Digit.Repeat.Times(3),
											Pattern.With.Whitespace,
											Pattern.With.Literal("a"));

			Assert.That(p.ToString(), Is.EqualTo("(\\d{3}|\\s|a)"));
		}

		[Test]
		public void Email()
		{
			string regex = @"^[a-zA-Z\d\.-_]+@[a-zA-Z\d\.-]+\.[a-zA-Z]{2,4}$";

			Pattern p = Pattern.With
			                   .StartOfLine
			                   .Set(Pattern.With.Letter.Digit.Literal(".-_")).Repeat.OneOrMore
			                   .Literal("@")
			                   .Set(Pattern.With.Letter.Digit.Literal(".-")).Repeat.OneOrMore
			                   .Literal(".")
			                   .Set(Pattern.With.Letter).Repeat.Times(2, 4)
			                   .EndOfLine;

			Assert.That(p.ToString(), Is.EqualTo(regex));
		}

		[Test]
		public void SSN()
		{
			string regex = @"^\d{3}-?\d{2}-?\d{4}$";

			Pattern p = Pattern.With
							   .StartOfLine
			                   .Digit.Repeat.Times(3)
			                   .Literal("-").Repeat.Optional
			                   .Digit.Repeat.Times(2)
			                   .Literal("-").Repeat.Optional
			                   .Digit.Repeat.Times(4)
			                   .EndOfLine;

			Assert.That(p.ToString(), Is.EqualTo(regex));
		}
	}
}


text:
using System.Runtime.CompilerServices;

namespace System.Net {
	[Imported, NamedValues]
	public enum HttpVerb {
		[ScriptName("GET")] Get = 0,
		[ScriptName("POST")] Post = 1,
		[ScriptName("PUT")] Put = 2,
		[ScriptName("DELETE")] Delete = 3,
		[ScriptName("HEAD")] Head = 4
	}
}


text:
package org.ensembl.healthcheck.testcase.compara;

import java.sql.Connection;

import org.ensembl.healthcheck.DatabaseRegistryEntry;
import org.ensembl.healthcheck.ReportManager;
import org.ensembl.healthcheck.Team;
import org.ensembl.healthcheck.testcase.SingleDatabaseTestCase;

/**
 * An EnsEMBL Healthcheck test case that looks for broken foreign-key
 * relationships.
 */

public class ForeignKeyGenomicAlignBlockId extends SingleDatabaseTestCase {

    /**
     * Create an ForeignKeyGenomicAlignBlockId that applies to a specific set of databases.
     */
    public ForeignKeyGenomicAlignBlockId() {

        addToGroup("compara_genomic");
        setDescription("Check for broken foreign-key relationships in ensembl_compara databases.");
        setTeamResponsible(Team.COMPARA);

    }

    /**
     * Run the test.
     *
     * @param dbre
     *          The database to use.
     * @return true if the test passed.
     *
     */
    public boolean run(DatabaseRegistryEntry dbre) {

        boolean result = true;

       Connection con = dbre.getConnection();

        if (tableHasRows(con, "genomic_align_block")) {

            result &= checkForOrphans(con, "genomic_align_block", "genomic_align_block_id",
                "genomic_align", "genomic_align_block_id");
            result &= checkForOrphans(con, "genomic_align", "genomic_align_block_id",
                "genomic_align_block", "genomic_align_block_id");

            if (tableHasRows(con, "conservation_score")) {

                result &= checkForOrphans(con, "conservation_score", "genomic_align_block_id",
                    "genomic_align_block", "genomic_align_block_id");

            }

        } else {
            ReportManager.correct(this, con, "NO ENTRIES in genomic_align_block table, so nothing to test IGNORED");
        }

        return result;

    }

} // ForeignKeyGenomicAlignBlockId


text:
module Queri
  class Stats
    class CallDistributionByDayOfWeek
      class SalesPerDayOfWeek < Queri::Stats
        include CompositeReportHelpers

        class << self
          def xml_code
            CallDistributionByDayOfWeek.xml_code + ".SalesPerDOW"
          end

          def key_translations
            ActiveSupport::OrderedHash[
              :day_of_week, "DayOfWeek",
              :conv, "Conv.",
              :qconv, "QConv.",
              :sales, "Sales",
              :sales_percentage, " ",
              :placeholder_for_sales_bar_graph, " ",
              :qcont, "QCont.",
              :contacts, "Contacts",
              :contacts_percentage, " ",
              :placeholder_for_contacts_bar_graph, " "
            ]
          end
        end
      end
    end
  end
end


text:
package com.sksamuel.avro4s

import java.io.ByteArrayOutputStream

import org.apache.avro.file.CodecFactory
import org.scalatest.{Matchers, WordSpec}

class AvroDataOutputStreamTest extends WordSpec with Matchers {

  case class Composer(name: String, birthplace: String, compositions: Seq[String])
  val ennio = Composer("ennio morricone", "rome", Seq("legend of 1900", "ecstasy of gold"))

  "AvroDataOutputStream" should {
    "include schema" in {
      val baos = new ByteArrayOutputStream()
      val output = AvroOutputStream.data[Composer](baos)
      output.write(ennio)
      output.close()
      new String(baos.toByteArray) should include ("birthplace")
      new String(baos.toByteArray) should include ("compositions")
    }

    "include snappy coded in metadata when serialized with snappy" in {
      val baos = new ByteArrayOutputStream()
      val output = AvroOutputStream.data[Composer](baos, CodecFactory.snappyCodec())
      output.write(ennio)
      output.close()
      new String(baos.toByteArray) should include ("snappy")
    }

    "include deflate coded in metadata when serialized with deflate" in {
      val baos = new ByteArrayOutputStream()
      val output = AvroOutputStream.data[Composer](baos, CodecFactory.deflateCodec(CodecFactory.DEFAULT_DEFLATE_LEVEL))
      output.write(ennio)
      output.close()
      new String(baos.toByteArray) should include ("deflate")
    }

    "include bzip2 coded in metadata when serialized with bzip2" in {
      val baos = new ByteArrayOutputStream()
      val output = AvroOutputStream.data[Composer](baos, CodecFactory.bzip2Codec())
      output.write(ennio)
      output.close()
      new String(baos.toByteArray) should include ("bzip2")
    }
  }
}


text:
'use strict'

/* application modules */
const ImmutableCoreModel = require('../lib/immutable-core-model')
const initTestEnv = require('./helpers/init-test-env')

describe('immutable-core-model - elasticsearch', function () {

    var mysql, elasticsearch, redis, reset, session

    before(async function () {
        [mysql, redis, reset, session, elasticsearch] = await initTestEnv({elasticsearch: true})
    })

    beforeEach(async function () {
        await reset()
    })

    after(async function () {
        await mysql.close()
    })

    // will be pouplated in before
    var foo1, foo2, foo3, globalFooModel, fooModel

    it('should create a new model with an elasticsearch client', function () {
        var fooModel = new ImmutableCoreModel({
            mysql: mysql,
            elasticsearch: elasticsearch,
            name: 'foo',
            redis: redis,
        })
        // get client
        assert.deepEqual(fooModel.elasticsearch(), elasticsearch)
    })

    it('should get/set client on model', function () {
        var fooModel = new ImmutableCoreModel({
            mysql: mysql,
            name: 'foo',
            redis: redis,
        })
        // set client - should return instance
        assert.deepEqual(fooModel.elasticsearch(elasticsearch), fooModel)
        // get client
        assert.deepEqual(fooModel.elasticsearch(), elasticsearch)
    })

    it('should get/set global client', function () {
         // set client - should return instance
        assert.deepEqual(ImmutableCoreModel.elasticsearchGlobal(elasticsearch), ImmutableCoreModel)
        // get client
        assert.deepEqual(ImmutableCoreModel.elasticsearchGlobal(), elasticsearch)
    })

    it('should use global client when elasticsearch true and setting after model creation', function () {
        // create model that requires elasticsearch client to be set
        var fooModel = new ImmutableCoreModel({
            mysql: mysql,
            elasticsearch: true,
            name: 'foo',
            redis: redis,
        })
        // set global elasticsearch client
        ImmutableCoreModel.elasticsearchGlobal(elasticsearch)
        // model should have client
        assert.deepEqual(fooModel.elasticsearch(), elasticsearch)
    })

    it('should use global client when elasticsearch true and setting before model creation', function () {
        // set global elasticsearch client
        ImmutableCoreModel.elasticsearchGlobal(elasticsearch)
        // create model that requires elasticsearch client to be set
        var fooModel = new ImmutableCoreModel({
            mysql: mysql,
            elasticsearch: true,
            name: 'foo',
            redis: redis,
        })
        // model should have client
        assert.deepEqual(fooModel.elasticsearch(), elasticsearch)
    })

    it('should not use global client when elasticsearch not true', function () {
        // create model that requires elasticsearch client to be set
        var fooModel = new ImmutableCoreModel({
            mysql: mysql,
            name: 'foo',
            redis: redis,
        })
        // set global elasticsearch client
        ImmutableCoreModel.elasticsearchGlobal(elasticsearch)
        // model should not have client
        assert.strictEqual(fooModel.elasticsearch(), null)
    })

    it('should throw error on invalid elasticsearch on model creation', function () {
        assert.throws(function () {
            // create model with invalid client
            var fooModel = new ImmutableCoreModel({
                mysql: mysql,
                elasticsearch: {},
                name: 'foo',
                redis: redis,
            })
        })
    })

    it('should throw error seting invalid elasticsearch on model', function () {
        assert.throws(function () {
            var fooModel = new ImmutableCoreModel({
                mysql: mysql,
                name: 'foo',
                redis: redis,
            })
            // set invalid client
            fooModel.elasticsearch({})
        })
    })

    it('should not throw error seting invalid elasticsearch globally', function () {
        assert.doesNotThrow(function () {
            // set invalid client
            ImmutableCoreModel.elasticsearchGlobal({})
        })
    })

})


text:
% This code reproduces the analyses in the paper
% Urai AE, Braun A, Donner THD (2016) Pupil-linked arousal is driven
% by decision uncertainty and alters serial choice bias.
%
% Permission is hereby granted, free of charge, to any person obtaining a
% copy of this software and associated documentation files (the "Software"),
% to deal in the Software without restriction, including without limitation
% the rights to use, copy, modify, merge, publish, distribute, sublicense,
% and/or sell copies of the Software, and to permit persons to whom the
% Software is furnished to do so, subject to the following conditions:
%
% The above copyright notice and this permission notice shall be included
% in all copies or substantial portions of the Software.
% If you use the Software for your own research, cite the paper.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
% OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
% DEALINGS IN THE SOFTWARE.
%
% Anne Urai, 2016
% anne.urai@gmail.com

close all;
global mypath;

subplot(441); motionEnergy_Timecourse;
subplot(442); motionEnergy_Probability;

% add psychometric functions, chronometric functions and RT distributions
subplot(445); psychometricFunction('all');
subplot(446); b = uncertainty_byErrorCorrect('rt', 6);
print(gcf, '-dpdf', sprintf('%s/Figures/Figure2.pdf', mypath));


text:
package eu.toolchain.scribe.jackson.encoding;

import eu.toolchain.scribe.Context;
import eu.toolchain.scribe.jackson.JsonNode;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class StringEncoder extends AbstractEncoder<String> {
  @Override
  public JsonNode encode(final Context path, final String instance) {
    return new JsonNode.StringJsonNode(instance);
  }

  private static final StringEncoder INSTANCE = new StringEncoder();

  public static StringEncoder get() {
    return INSTANCE;
  }
}


text:
package root.lang;

import java.util.Iterator;

/**
 * Extends the {@link Iterable} interface to incorporate the {@link Itemizer} concept. The iterator() method returns an {@link Itemizer}
 * which extends {@link Iterator} with additional methods that are useful in various situations.
 *

 * The following methods are defined here for {@link Itemizable} implementations as they are generally useful extensions of the {@link Iterable}
 * interface.
 *

 *

 * Methods
 * Description
 *

 *

 * {@link #clear()}
 * Clears this instance of all items it currently holds
 *

 *

 * {@link #getSize()}
 * Returns the size of this instance which represents the number of items it currently holds
 *

 *

 * {@link #isEmpty()}
 * Returns true if the size of this instance is zero, false otherwise
 *

 *

 *
 * @author Edward Smith
 * @version 0.5
 * @since 0.5
 *
 * @param <T>
 *            The type of elements returned by the {@link Itemizer}
 */
public interface Itemizable<T> extends Iterable<T> {

	/**
	 * Removes all of the elements from this {@link Itemizable} (optional operation).
	 */
	void clear();

	/**
	 * Returns the number of elements in this {@link Itemizable} implementation.
	 *
	 * @return the number of elements in this {@link Itemizable} implementation
	 */
	int getSize();

	/**
	 * Returns true if this {@link Itemizable} contains no elements, false otherwise.
	 *
	 * @return true if this {@link Itemizable} contains no elements, false otherwise
	 */
	boolean isEmpty();

	/**
	 * Returns an {@link Itemizer} over a set of elements of type T.
	 *
	 * @return an {@link Itemizer} over a set of elements of type T
	 */
	@Override
	Itemizer<T> iterator();

} // End Itemizable


text:
/**
 * Copyright (C) 2015 Andre White (adarro@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package io.truthencode.ddo

/**
 * Allows given object to have / use an abbreviation
 */
trait Abbreviation {

  /**
   * The short form of the word
   */
  val abbr: String

  /**
   * Expands the abbr to its full value
   */
  def toFullWord: String
}


text:
import * as Expressions from "../abap/2_statements/expressions";
import {Issue} from "../issue";
import {ABAPRule} from "./_abap_rule";
import {BasicRuleConfig} from "./_basic_rule_config";
import {EditHelper} from "../edit_helper";
import {Token} from "../abap/1_lexer/tokens/_token";
import {IRuleMetadata, RuleTag} from "./_irule";
import {ABAPFile} from "../abap/abap_file";

export class PreferredCompareOperatorConf extends BasicRuleConfig {
  /** Operators which are not allowed */
  public badOperators: string[] = ["EQ", "><", "NE", "GE", "GT", "LT", "LE"];
}

export class PreferredCompareOperator extends ABAPRule {

  private conf = new PreferredCompareOperatorConf();

  private readonly operatorMapping: Map<string, string> = new Map<string, string>();

  public getMetadata(): IRuleMetadata {
    return {
      key: "preferred_compare_operator",
      title: "Preferred compare operator",
      shortDescription: `Configure undesired operator variants`,
      tags: [RuleTag.SingleFile, RuleTag.Quickfix],
    };
  }

  private getDescription(operator: string): string {
    return "Compare operator \"" + operator + "\" not preferred";
  }

  public getConfig() {
    return this.conf;
  }

  public setConfig(conf: PreferredCompareOperatorConf) {
    this.conf = conf;
  }

  public runParsed(file: ABAPFile) {
    this.buildMapping();
    const issues: Issue[] = [];

    const struc = file.getStructure();
    if (struc === undefined) {
      return [];
    }

    const operators = struc.findAllExpressionsMulti([Expressions.CompareOperator, Expressions.SQLCompareOperator]);
    for (const op of operators) {
      const token = op.getLastToken();
      // todo, performance, lookup in hash map instead(JS object)
      if (this.conf.badOperators.indexOf(token.getStr().toUpperCase()) >= 0) {
        issues.push(this.createIssue(token, file));
      }
    }

    return issues;
  }

  private buildMapping() {
    if (this.operatorMapping.size === 0) {
      this.operatorMapping.set("EQ", "=");
      this.operatorMapping.set("><", "<>");
      this.operatorMapping.set("NE", "<>");
      this.operatorMapping.set("GE", ">=");
      this.operatorMapping.set("GT", ">");
      this.operatorMapping.set("LT", "<");
      this.operatorMapping.set("LE", "<=");

      this.operatorMapping.set("=", "EQ");
      this.operatorMapping.set("<>", "NE");
      this.operatorMapping.set(">=", "GE");
      this.operatorMapping.set(">", "GT");
      this.operatorMapping.set("<", "LT");
      this.operatorMapping.set("<=", "LE");
    }
  }

  private createIssue(token: Token, file: ABAPFile): Issue {
    const message = this.getDescription(token.getStr());
    const replacementToken = this.operatorMapping?.get(token.getStr());
    // values in badOperators can be entered by the user and may not necessarily be actual operators
    if (replacementToken) {
      const fix = EditHelper.replaceRange(file, token.getStart(), token.getEnd(), replacementToken);
      const issue = Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity, fix);
      return issue;
    }
    else {
      const issue = Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);
      return issue;
    }
  }

}


text:
'use strict';

(function (scope) {
    /**
     * Text tag item
     *
     * @class TextTagItem
     * @param {Object} [obj]
     * @constructor
     */
    function TextTagItem(obj) {
        this.inkRanges = [];
        if (obj) {
            this.tagType = obj.tagType;
            if (obj.inkRanges) {
                var ranges = obj.inkRanges;
                if (!Array.isArray(ranges)) {
                    ranges = ranges.split(/[\s]+/);
                }
                for (var i in ranges) {
                    this.inkRanges.push(new scope.TextInkRange(ranges[i]));
                }
            }
        }
    }

    /**
     * Get tag type
     *
     * @method getTagType
     * @returns {String}
     */
    TextTagItem.prototype.getTagType = function () {
        return this.tagType;
    };

    /**
     * Get ink ranges
     *
     * @method getInkRanges
     * @returns {TextInkRange[]}
     */
    TextTagItem.prototype.getInkRanges = function () {
        return this.inkRanges;
    };

    // Export
    scope.TextTagItem = TextTagItem;
})(MyScript);


text:
'use strict';

var builder = require('focus').component.builder;
var React = require('react');

// Common mixins.
var definitionMixin = require('../mixin/definition');
//let fieldComponentBehaviour = require('../mixin/field-component-behaviour');
var builtInComponents = require('../mixin/built-in-components');
var storeBehaviour = require('../mixin/store-behaviour');
var ownIdentifierBehaviour = require('../mixin/own-identifier');
//Form mixins.

var _require = require('./mixin');

var actionBehaviour = _require.actionBehaviour;
var referenceBehaviour = _require.referenceBehaviour;
var validationBehaviour = _require.validationBehaviour;

/**
* Mixin to create a block for the rendering.
* @type {Object}
*/
var formMixin = {
    mixins: [ownIdentifierBehaviour, definitionMixin, referenceBehaviour, storeBehaviour, validationBehaviour, actionBehaviour, builtInComponents],
    /** @inheritdoc */
    getDefaultProps: function getFormDefaultProps() {
        return {
            hasForm: true,
            /**
            * Defines it the form can have  an edit mode.
            * @type {Boolean}
            */
            hasEdit: true,
            /**
            * Defines if the form has a delete action button.
            * @type {Boolean}
            */
            hasDelete: false,
            /**
            * Does the form call the load action on componentdid mount.
            * @type {Boolean}
            */
            hasLoad: true,
            /**
            * Defines
            * @type {Boolean}
            */
            isEdit: false,
            /**
            * Style of the component.
            * @type {Object}
            */
            style: {}
        };
    },
    /** @inheritdoc */
    getInitialState: function getFormInitialState() {
        return {
            /**
            * Identifier of the entity.
            * @type {[type]}
            */
            id: this.props.id,
            isEdit: this.props.isEdit
        };
    },
    componentWillReceiveProps: function componentWillReceiveProps() {
        var newProps = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
        var isEdit = newProps.isEdit;

        if (isEdit !== undefined) {
            this.setState({ isEdit: isEdit });
        }
    },
    /** @inheritdoc */
    callMountedActions: function formCallMountedActions() {
        if (this.props.hasLoad) {
            this._loadData();
        }
        this._loadReference();
    },
    /** @inheritdoc */
    componentDidMount: function formDidMount() {
        //Build the definitions.
        if (this.registerListeners) {
            this.registerListeners();
        }
        if (this.callMountedActions) {
            this.callMountedActions();
        }
    },
    /** @inheritdoc */
    componentWillUnmount: function formWillMount() {
        if (this.unregisterListeners) {
            this.unregisterListeners();
        }
    },
    _mode: function _mode() {
        return '' + (this.state.isEdit ? 'edit' : 'consult');
    },
    _className: function formClassName() {
        return 'form-horizontal ' + this.props.style.className;
    },
    _renderActions: function renderActions() {
        if (this.renderActions) {
            return this.renderActions();
        }
        return this.state.isEdit ? this._renderEditActions() : this._renderConsultActions();
    },
    _renderEditActions: function _renderEditActions() {
        return this.renderEditActions ? this.renderEditActions() : React.createElement(
            'span',
            null,
            this.buttonSave(),
            this.buttonCancel()
        );
    },
    _renderConsultActions: function _renderConsultActions() {
        return this.renderConsultActions ? this.renderConsultActions() : React.createElement(
            'div',
            null,
            this.props.hasEdit && this.buttonEdit(),
            this.props.hasDelete && this.buttonDelete()
        );
    },
    /**
    * Handle the form submission.
    * @param {Event} e - React sanityze event from the form submit.
    */
    _handleSubmitForm: function _handleSubmitForm(e) {
        e.preventDefault();
        if (this._validate()) {
            this.action.save.call(this, this._getEntity());
        }
        //return false;
    },
    /** @inheritdoc */
    render: function render() {
        //console.log('state form', this.state);
        if (this.props.hasForm) {
            return React.createElement(
                'form',
                {
                    onSubmit: this._handleSubmitForm,
                    className: this._className(),
                    'data-mode': this._mode(),
                    'data-loading': this.state.isLoading
                },
                React.createElement(
                    'fieldset',
                    null,
                    this.renderContent()
                )
            );
        }
        return this.renderContent();
    }
};

module.exports = builder(formMixin);


text:
#pragma once

#include "utility/rect.hpp"

#include "boost/utility/string_ref.hpp"

#include <cstdint>

namespace ts
{
  namespace resources
  {

  }
}


text:
/**
 *
 */
package com.srushti.bhim.exception;

/**
 * @author bhargav
 *
 */
public class UsernameAlreadyInUseException extends Exception {
	public UsernameAlreadyInUseException(String username) {
		super("The username '" + username + "' is already in use.");
	}
}


text:
EXAMPLE_NAMES = bez fifthorder cubicspline roundedcorners cusp zee
EXAMPLE_STLS = $(patsubst %,examples/%.stl,$(EXAMPLE_NAMES))

%.inc.scad: %.inc
	./bezcompiler $<

%.stl: %.scad %.inc.scad
	openscad -o $@ $<

.PRECIOUS: *.inc.scad

.PHONY: examples
examples: $(EXAMPLE_STLS)

.PHONY: clean
clean:
	rm -f examples/*.inc.scad examples/*.stl


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

/// <summary>
/// Summary description for dal
/// </summary>
public class dal
{

    SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
    SqlCommand cmd = new SqlCommand();
    SqlDataReader dr;

    public string getemail(string s)
    {

        cmd = new SqlCommand("select * from Donor_table where email_id = @email",sqlcon);

        cmd.Parameters.AddWithValue("@email", s);

        sqlcon.Open();

        dr = cmd.ExecuteReader();

        if (dr.Read())
        {

            s = dr["email_id"].ToString();
            sqlcon.Close();

            return s;
        }
        else
        {

            return "#$%^vfdfgf8vt4&";

        }

    }

    public void updatel(string login, string pass)
    {

        cmd = new SqlCommand("update adminlogintbl set pass  = @pass where logid = @id ", sqlcon);
        cmd.Parameters.AddWithValue("@pass", pass);
        cmd.Parameters.AddWithValue("@id", login);
        sqlcon.Close();
        sqlcon.Open();
        cmd.ExecuteNonQuery();
        sqlcon.Close();
    }
    public string changepass(string s , string s2 )
    {

        cmd = new SqlCommand("select * from adminlogintbl where logid = @log  and pass  = @pass", sqlcon);

        cmd.Parameters.AddWithValue("@log",s);
        cmd.Parameters.AddWithValue("@pass",s2);
        sqlcon.Open();
        dr = cmd.ExecuteReader();

        if(dr.Read())
        {

            string s5 = dr["pass"].ToString();

            return s5 ;
        }

        sqlcon.Close();
        return " @$****23";

    }

    public void adddata(pal p)
    {
        cmd = new SqlCommand("insertdata", sqlcon);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@name", p.name);
        cmd.Parameters.AddWithValue("@gender", p.gender);
        cmd.Parameters.AddWithValue("@blood", p.blood);
        cmd.Parameters.AddWithValue("@address", p.address);
        cmd.Parameters.AddWithValue("@contact", p.contact);
        cmd.Parameters.AddWithValue("@email", p.email);
        cmd.Parameters.AddWithValue("@password", p.password);
        cmd.Parameters.AddWithValue("@confirmpass", p.confirmpass);
        sqlcon.Open();
        cmd.ExecuteNonQuery();
        sqlcon.Close();
    }

    public string loginuser(string email,string password)
    {
        cmd = new SqlCommand("select * from Donor_table where email_id=@email and confirm_password=@password", sqlcon);
        cmd.Parameters.AddWithValue("@email", email);
        cmd.Parameters.AddWithValue("@password", password);
        sqlcon.Open();
        dr = cmd.ExecuteReader();
        if (dr.Read())
        {
            string s1 = dr["confirm_password"].ToString();
            return s1;
        }
        sqlcon.Close();
        return "hkjhk$&902jka1*%**@";
    }

}


text:
```javascript
var str = require('tmpl/index.html');
```

## Install
```bash
npm install bringify
```

## Usage

#### 1. Package Configuration

```javascript
{
  "browserify": {
      "transform": [
        "bringify"
      ]
  },
    "bringify": {
        "extname": ['.html']
    }
}
```

#### 2. API

```javascript
b.transform('bringify', { extname: ['.html'] })
```

## Options

#### extname : Array, list of file extname, default: []


text:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<title>404 Not Found</title>

Not Found

The requested URL /lapack/lapack_routine\dggglm.f was not found on this server.


text:
QBWC.configure do |c|

  #Currently Only supported for single logins.
  c.username = "foo"
  c.password = "bar"

  #Path to Company File (blank for open or named path or function etc..)
  c.company_file_path = ""

  #Minimum Quickbooks Version Required for use in QBXML Requests
  c.min_version = 7.0

  #Quickbooks Type (either :qb or :qbpos)
  c.api = :qb

  #Quickbooks Support URL provided in QWC File
  c.support_site_url = "localhost:3000"

  #Quickbooks Owner ID provided in QWC File
  c.owner_id = '{57F3B9B1-86F1-4fcc-B1EE-566DE1813D20}'

  # Perform response processing after session termination. Enabling this option
  # will speed up qbwc session time (and potentially fix timeout issues) but
  # will necessarily eat up more memory since every response must be stored
  # until it is processed.
  c.delayed_processing = false

  # In the event of an error in the communication process do you wish the sync to stop or blaze through
  #
  # Options:
  # :stop
  # :continue
  c.on_error = :stop

  # Rails Cache Hot Boot  (Check the rails cache for existing API object to speed app boot)
  # This Feature is Unstable and is Extreme Alpha.  IT is known not to work
  # c.warm_boot = false

end