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

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
Csv
</title><link rel="stylesheet" type="text/css" href="../../../stylesheet.css" />

Csv

A facility to read from and write to CSV (comma separated values) files. When
 reading, the BOM (the byte-order-mark) character 0xfeff at the beginning of
 the file is ignored.

Methods

static Csv
getInstance()

Get a new object of this class.

static Csv
getInstance()

Get a new object of this class.

Returns:

the new instance

boolean
getCaseSensitiveColumnNames()

Get the current case sensitive column names setting.

boolean
getCaseSensitiveColumnNames()

Get the current case sensitive column names setting.

Returns:

whether column names are case sensitive

char
getEscapeCharacter()

Get the current escape character.

char
getEscapeCharacter()

Get the current escape character.

Returns:

the escape character

char
getFieldDelimiter()

Get the current field delimiter.

char
getFieldDelimiter()

Get the current field delimiter.

Returns:

the field delimiter

char
getFieldSeparatorRead()

Get the current field separator for reading.

char
getFieldSeparatorRead()

Get the current field separator for reading.

Returns:

the field separator

String
getFieldSeparatorWrite()

Get the current field separator for writing.

String
getFieldSeparatorWrite()

Get the current field separator for writing.

Returns:

the field separator

char
getLineCommentCharacter()

Get the line comment character.

char
getLineCommentCharacter()

Get the line comment character.

Returns:

the line comment character, or 0 if disabled

String
getLineSeparator()

Get the current line separator.

String
getLineSeparator()

Get the current line separator.

Returns:

the line separator

String
getNullString()

Get the current null string.

String
getNullString()

Get the current null string.

Returns:

the null string.

boolean
getPreserveWhitespace()

Whether whitespace in unquoted text is preserved.

boolean
getPreserveWhitespace()

Whether whitespace in unquoted text is preserved.

Returns:

the current value for the setting

String
getRowSeparatorWrite()

Get the current row separator for writing.

String
getRowSeparatorWrite()

Get the current row separator for writing.

Returns:

the row separator

boolean
getWriteColumnHeader()

Whether the column header is written.

boolean
getWriteColumnHeader()

Whether the column header is written.

Returns:

the current value for the setting

ResultSet
read(String inputFileName, String[] colNames, String charset)

Reads from the CSV file and returns a result set.

ResultSet
read(String inputFileName, String[] colNames, String charset) throws SQLException

Reads from the CSV file and returns a result set. The rows in the result
 set are created on demand, that means the file is kept open until all
 rows are read or the result set is closed.

 If the columns are read from the CSV file, then the following rules are
 used: columns names that start with a letter or '_', and only
 contain letters, '_', and digits, are considered case insensitive
 and are converted to uppercase. Other column names are considered
 case sensitive (that means they need to be quoted when accessed).

Parameters:

inputFileName - the file name

colNames - or null if the column names should be read from the CSV
          file

charset - the charset or null to use the system default charset
          (see system property file.encoding)

Returns:

the result set

Throws:

SQLException

ResultSet
read(Reader reader, String[] colNames)

Reads CSV data from a reader and returns a result set.

ResultSet
read(Reader reader, String[] colNames) throws IOException

Reads CSV data from a reader and returns a result set. The rows in the
 result set are created on demand, that means the reader is kept open
 until all rows are read or the result set is closed.

Parameters:

reader - the reader

colNames - or null if the column names should be read from the CSV file

Returns:

the result set

Throws:

IOException

void
setCaseSensitiveColumnNames(boolean caseSensitiveColumnNames)

Override the case sensitive column names setting.

void
setCaseSensitiveColumnNames(boolean caseSensitiveColumnNames)

Override the case sensitive column names setting. The default is false.
 If enabled, the case of all column names is always preserved.

Parameters:

caseSensitiveColumnNames - whether column names are case sensitive

void
setEscapeCharacter(char escapeCharacter)

Set the escape character.

void
setEscapeCharacter(char escapeCharacter)

Set the escape character. The escape character is used to escape the
 field delimiter. This is needed if the data contains the field delimiter.
 The default escape character is " (a double quote), which is the same as
 the field delimiter. If the field delimiter and the escape character are
 both " (double quote), and the data contains a double quote, then an
 additional double quote is added. Example:

 Data: He said "Hello".
 Escape character: "
 Field delimiter: "
 CSV file: "He said ""Hello""."

 If the field delimiter is a double quote and the escape character is a
 backslash, then escaping is done similar to Java (however, only the field
 delimiter is escaped). Example:

 Data: He said "Hello".
 Escape character: \
 Field delimiter: "
 CSV file: "He said \"Hello\"."

 The value 0 means no escape character is used.

Parameters:

escapeCharacter - the escape character

void
setFieldDelimiter(char fieldDelimiter)

Set the field delimiter.

void
setFieldDelimiter(char fieldDelimiter)

Set the field delimiter. The default is " (a double quote).
 The value 0 means no field delimiter is used.

Parameters:

fieldDelimiter - the field delimiter

void
setFieldSeparatorRead(char fieldSeparatorRead)

Override the field separator for reading.

void
setFieldSeparatorRead(char fieldSeparatorRead)

Override the field separator for reading. The default is ','.

Parameters:

fieldSeparatorRead - the field separator

void
setFieldSeparatorWrite(String fieldSeparatorWrite)

Override the field separator for writing.

void
setFieldSeparatorWrite(String fieldSeparatorWrite)

Override the field separator for writing. The default is ",".

Parameters:

fieldSeparatorWrite - the field separator

void
setLineCommentCharacter(char lineCommentCharacter)

Set the line comment character.

void
setLineCommentCharacter(char lineCommentCharacter)

Set the line comment character. The default is character code 0 (line
 comments are disabled).

Parameters:

lineCommentCharacter - the line comment character

void
setLineSeparator(String lineSeparator)

Set the line separator.

void
setLineSeparator(String lineSeparator)

Set the line separator.

Parameters:

lineSeparator - the line separator

void
setNullString(String nullString)

Set the value that represents NULL.

void
setNullString(String nullString)

Set the value that represents NULL. It is only used for non-delimited
 values.

Parameters:

nullString - the null

void
setPreserveWhitespace(boolean value)

Enable or disable preserving whitespace in unquoted text.

void
setPreserveWhitespace(boolean value)

Enable or disable preserving whitespace in unquoted text.

Parameters:

value - the new value for the setting

void
setRowSeparatorWrite(String rowSeparatorWrite)

Override the end-of-row marker for writing.

void
setRowSeparatorWrite(String rowSeparatorWrite)

Override the end-of-row marker for writing. The default is null. After
 writing the end-of-row marker, a line feed is written (\n or \r\n
 depending on the system settings).

Parameters:

rowSeparatorWrite - the row separator

void
setWriteColumnHeader(boolean value)

Enable or disable writing the column header.

void
setWriteColumnHeader(boolean value)

Enable or disable writing the column header.

Parameters:

value - the new value for the setting

int
write(Writer writer, ResultSet rs)

Writes the result set to a file in the CSV format.

int
write(Writer writer, ResultSet rs) throws SQLException

Writes the result set to a file in the CSV format.

Parameters:

writer - the writer

rs - the result set

Returns:

the number of rows written

Throws:

SQLException

int
write(String outputFileName, ResultSet rs, String charset)

Writes the result set to a file in the CSV format.

int
write(String outputFileName, ResultSet rs, String charset) throws SQLException

Writes the result set to a file in the CSV format. The result set is read
 using the following loop:

 while (rs.next()) {
     writeRow(row);
 }

Parameters:

outputFileName - the name of the csv file

rs - the result set - the result set must be positioned before the
          first row.

charset - the charset or null to use the system default charset
          (see system property file.encoding)

Returns:

the number of rows written

Throws:

SQLException

int
write(Connection conn, String outputFileName, String sql, String charset)

Writes the result set of a query to a file in the CSV format.

int
write(Connection conn, String outputFileName, String sql, String charset) throws SQLException

Writes the result set of a query to a file in the CSV format.

Parameters:

conn - the connection

outputFileName - the file name

sql - the query

charset - the charset or null to use the system default charset
          (see system property file.encoding)

Returns:

the number of rows written

Throws:

SQLException


text:
"""
This script checks the python specific mool tests.
Environment variables should be set before running this script.

Ensure exit on first failure!!
"""

import logging
import os
import subprocess
import sys
import zipfile

import file_utils as fu
import tests_config as tc

LOGGER = None
BU_SCRIPT_DIR = os.environ['BU_SCRIPT_DIR']
BU_SCRIPT = os.path.join(BU_SCRIPT_DIR, 'bu')
BUILD_ROOT = os.environ['BUILD_ROOT']
BUILD_OUT_DIR = os.environ['BUILD_OUT_DIR']
LOG_FILE_PATH = os.environ['MOOL_TESTS_LOG_FILE']
SKIP_BUILD_STRING = 'Skipping build for mool'
EMIT_BUILD_STRING = 'Emitting'

class Error(Exception):
    """Error class."""
    def __exit__(self, etype, value, traceback):
        LOGGER.error(str(self.message))

def configure_logging(console=True):
    """Setup logging. Enable console logging by default."""
    logger = logging.getLogger(__name__)
    logger.setLevel(logging.DEBUG)
    if console:
        console_handle = logging.StreamHandler(sys.stdout)
        console_handle.setLevel(logging.DEBUG)
        console_handle.setFormatter(
            logging.Formatter('%(levelname)s: %(message)s'))
        logger.addHandler(console_handle)
    return logger

def validate_pattern_count(expected_count, pattern, file_path):
    """Check given ZIP has expected_count number of files matching pattern."""
    zipped_files = None
    with zipfile.ZipFile(file_path, 'r') as zip_obj:
        zipped_files = zip_obj.namelist()
    match_count = len(
        [name for name in zipped_files if name.find(pattern) >= 0])
    if not expected_count == match_count:
        LOGGER.error('Unexpected number of pattern lines: %d', match_count)
        LOGGER.error('  Expected number of pattern lines: %d', expected_count)
        raise Error('Failed validating pattern count for %s.' % file_path)

def check_file_count(expected_count, file_path):
    """Check given JAR file has expected_count number of files."""
    zipped_file_count = 0
    with zipfile.ZipFile(file_path, 'r') as zip_obj:
        zipped_file_count = len(zip_obj.namelist())
    if not zipped_file_count == expected_count:
        LOGGER.error('Unexpected file count: %d', zipped_file_count)
        LOGGER.error('  Expected file count: %d', expected_count)
        raise Error('Failed checking file count for %s.' % file_path)

def check_jar_contents(filename, jar_full_path):
    """Check if given JAR contains a file with name filename."""
    LOGGER.debug('Checking %s in %s.', filename, jar_full_path)
    with zipfile.ZipFile(jar_full_path, 'r') as zipfile_obj:
        if not filename in zipfile_obj.namelist():
            LOGGER.error('File "%s" missing in "%s".', filename, jar_full_path)
            raise Error('Failed validating JAR contents!!')

def check_submitq_test(expected_tests, changed_files):
    """Check if submit queue outputs expected tests for given changed files."""
    LOGGER.debug('Running SUBMITQ tests on: [%s].', ', '.join(changed_files))
    try:
        # In debug mode, the tests are only listed. Otherwise the tests are
        # actually executed.
        os.environ['SUBMITQ_DEBUG_MODE'] = 'true'
        input_file = fu.get_temp_file()
        output_file = fu.get_temp_file()
        input_data = [os.path.join(BUILD_ROOT, f) for f in changed_files]
        fu.write_file(input_file, '\n'.join(input_data))
        with open(output_file, 'w') as stdout_obj:
            subprocess.check_call([BU_SCRIPT, 'do_test_changes', input_file],
                                  stdout=stdout_obj)
        actual_tests = [l for l in fu.read_file(output_file).split('\n') if l]
        expected_tests.sort()
        actual_tests.sort()
        if expected_tests != actual_tests:
            LOGGER.error('Expected tests: %s', ' '.join(expected_tests))
            LOGGER.error('  Actual tests: %s', ' '.join(actual_tests))
            raise Error('SUBMITQ tests failed!!')
    finally:
        os.remove(input_file)
        os.remove(output_file)

def validate_binary_output(binary_path, grep_items):
    """Check that given binary has all the list of patterns."""
    LOGGER.debug('Checking output of %s binary.', binary_path)
    try:
        output_file = fu.get_temp_file()
        with open(output_file, 'w') as stdout_obj:
            subprocess.check_call(binary_path, stdout=stdout_obj)
        stdout_lines = fu.read_file(output_file).split('\n')
        for grep_item in grep_items:
            matched_lines = [line for line in stdout_lines if grep_item in line]
            if not matched_lines:
                LOGGER.error('Expected pattern: %s', grep_item)
                LOGGER.error('   Actual output: %s', '\n'.join(stdout_lines))
                msg = 'Binary output validation failed for %s!!' % binary_path
                raise Error(msg)
    finally:
        os.remove(output_file)

def validate_build_fails(build_rule, grep_items, operation='do_build'):
    """Verify that the given build_rule fails and errors have grep patterns."""
    try:
        output_file = fu.get_temp_file()
        build_cmd = [BU_SCRIPT, operation, build_rule]
        subprocess.check_output(build_cmd, stderr=subprocess.STDOUT)
        raise Error('Build rule "%s" must fail but it passed!', build_rule)
    except subprocess.CalledProcessError as exp:
        output = exp.output
        for grep_item in grep_items:
            if output.find(grep_item) < 0:
                LOGGER.error('Pattern: "%s" not found in output!', grep_item)
                LOGGER.error('Full output: %s', output)
                raise Error('Didn\'t find expected pattern in output!')
        LOGGER.info('Build rule "%s" failed as expected.', build_rule)
    finally:
        os.remove(output_file)

def check_no_pyc(dir_to_check):
    """Recursively check for existence of .pyc files."""
    LOGGER.debug('Checking .pyc files in %s.', dir_to_check)
    for root, ___, files in os.walk(dir_to_check):
        if '__pycache__' in root:
            raise Error('__pycache__ directory found in %s!!' % root)
        for file_path in files:
            full_file_path = os.path.join(root, file_path)
            if full_file_path.endswith('.pyc'):
                raise Error('Compiled binary %s found.' % full_file_path)

def execute_and_log(cmd, grep_str=None):
    """
    Executes the cmd using subprocess Popen and logs the output to logging
    object. Returns match count corresponding to grep_str if it is not None.
    """
    pattern_count = 0
    LOGGER.info('Executing "%s"', ' '.join(cmd))
    with open(os.devnull, 'w') as devnull:
        with open(LOG_FILE_PATH, 'w') as logfile:
            subprocess.check_call(cmd, stdout=devnull, stderr=logfile)
    if grep_str:
        with open(LOG_FILE_PATH, 'r') as logfile:
            lines = logfile.read().split('\n')
            pattern_count = len([line for line in lines
                                 if line.find(grep_str) >= 0])
    return pattern_count

def test_bld_file_updates():
    """Test that a changed BLD file triggers build for a rule only if there
    is any change in rule details."""
    build_rule, build_file = tc.BLD_UPDATE_TEST[0:2]
    build_cmd = [BU_SCRIPT, 'do_build', build_rule]
    for bld_file, rebuilds in tc.BLD_UPDATE_TEST[2:]:
        try:
            execute_and_log(['cp', bld_file, build_file])
            count = execute_and_log(build_cmd, grep_str=EMIT_BUILD_STRING)
            if count == rebuilds:
                continue
            LOGGER.error('Unexpected number of builds emitted: %s', count)
            LOGGER.error('  Expected number of builds emitted: %s', rebuilds)
            raise Error('Updating BLD file didn\'t trigger expected builds!!')
        finally:
            if os.path.exists(build_file):
                os.remove(build_file)

def misc_tests():
    """Run all miscellaneous tests."""
    test_bld_file_updates()
    for build_rule, grep_items in tc.BUILD_FAIL_TESTS:
        validate_build_fails(build_rule, grep_items, 'do_test')
    test_name = 'mool.ccroot.failures.mem_leak_test'
    if 'VALGRIND_PREFIX' in os.environ:
        validate_build_fails(
            test_name, 'definitely lost: 4 bytes in 1 blocks', 'do_test')
    else:
        execute_and_log([BU_SCRIPT, 'do_test', test_name])

def adhoc_tests():
    """Build and test file collection, binary output and SUBMITQ tests."""
    for res_file, jars_to_check in tc.FILE_COLLECTION_TESTS:
        for jar in jars_to_check:
            check_jar_contents(res_file, os.path.join(BUILD_OUT_DIR, jar))

    for expected_tests, changed_files in tc.SUBMITQ_TESTS:
        check_submitq_test(expected_tests, changed_files)

    for binary, patterns in tc.VALIDATE_BINARY_OUTPUT:
        validate_binary_output(os.path.join(BUILD_OUT_DIR, binary), patterns)

    check_no_pyc(os.path.join(BUILD_ROOT, 'pyroot'))

def regression_tests():
    """Build and test regression tests."""
    build_cmd = [BU_SCRIPT, 'do_build']
    build_cmd.extend(tc.REG_BUILD_RULES)
    execute_and_log(build_cmd)

    for test in tc.REG_PATTERN_TESTS:
        count, pattern, file_path = test
        full_path = os.path.join(BUILD_OUT_DIR, file_path)
        validate_pattern_count(count, pattern, full_path)
    LOGGER.info('Regression tests passed!!')

def build_test_all_rules():
    """Build and test all rules."""
    build_cmd = [BU_SCRIPT, 'do_build']
    build_cmd.extend(tc.BUILD_RULES)
    execute_and_log(build_cmd)

    for count, file_path in tc.FILE_COUNT_TESTS:
        full_path = os.path.join(BUILD_OUT_DIR, file_path)
        check_file_count(count, full_path)

    for count, pattern, file_path in tc.PATTERN_TESTS:
        full_path = os.path.join(BUILD_OUT_DIR, file_path)
        validate_pattern_count(count, pattern, full_path)

    # Execute all tests from BUILD_TESTS.
    test_cmd = [BU_SCRIPT, 'do_test']
    test_cmd.extend(tc.BUILD_TESTS)
    test_cmd.extend(tc.BUILD_RULES)
    execute_and_log(test_cmd)

    test_cmd = [BU_SCRIPT, 'do_build']
    test_cmd.extend(tc.BUILD_RULES)
    pattern_count = execute_and_log(test_cmd, grep_str=SKIP_BUILD_STRING)
    if pattern_count is not tc.SKIPPED_BUILD_COUNT:
        LOGGER.error(('Unexpected number of skipped builds: %d\n'
                      'Expected number: %d'), pattern_count,
                     tc.SKIPPED_BUILD_COUNT)
        raise Error('Skipped builds check failed.')

    # Test all executables.
    java_exec = os.path.join(os.environ['JAVA_HOME'], 'bin', 'java')
    for exec_params in tc.EXECUTABLES_TO_RUN:
        executable = exec_params[0] if len(exec_params) == 2 else exec_params
        options = exec_params[1] if len(exec_params) == 2 else []
        command = []
        if executable.endswith('.jar'):
            command.append(java_exec)
            command.extend(options)
            command.extend(['-jar', '-ea'])
        command.append(os.path.join(BUILD_OUT_DIR, executable))
        execute_and_log(command)

def _set_boost_path():
    """Set boost path in load library path."""
    boost_lib_path = os.path.join(os.environ['BOOST_DIR'], 'lib')
    if sys.platform.startswith('darwin'):
        os.environ['DYLD_LIBRARY_PATH'] = boost_lib_path
    elif sys.platform.startswith('linux'):
        os.environ['LD_LIBRARY_PATH'] = boost_lib_path
    else:
        raise Error('Unexpected OS: ' + sys.platform)

def do_main():
    """Builds and executes all tests."""
    _set_boost_path()
    # Start from a clean state.
    execute_and_log([BU_SCRIPT, 'do_clean'])

    regression_tests()
    build_test_all_rules()
    adhoc_tests()
    misc_tests()

    LOGGER.info('---------------------------------------------')
    LOGGER.info('All C++, java and python code root tests passed!!!')

if __name__ == "__main__":
    LOGGER = configure_logging()
    LOGGER.info('Check %s for errors from last build.', LOG_FILE_PATH)
    do_main()

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: FUHU
 * Date: 12/15/13
 * Time: 8:01 AM
 * To change this template use File | Settings | File Templates.
 */

namespace Application\Document;

use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

/** @ODM\Document(collection="comment") */
class Comment
{
    /** @ODM\Id */
    private $id;

    /** @ODM\Field(type="string") */
    private $commentid;

    /** @ODM\Field(type="string") */
    private $actionid;

    /** @ODM\Field(type="string") */
    private $commentcontent;

    //******* GET METHOD *******//

    /**
     * @return the $id
     */

    public function getId()
    {
        return $this->id;
    }

    /**
     * @return the $commentid
     */
    public function getCommentid()
    {
        return $this->commentid;
    }

    /**
     * @return the $actionid
     */
    public function getActionid()
    {
        return $this->actionid;
    }

    /**
     * @return the $commentcontent
     */
    public function getCommentcontent()
    {
        return $this->commentcontent;
    }

    //*****SET METHOD*****//

    /**
     * @param field_type $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @param field_type $commentid
     */
    public function setCommentid($commentid)
    {
        $this->commentid = $commentid;
    }

    /**
     * @param field_type $actionid
     */
    public function setActionid($actionid)
    {
        $this->actionid = $actionid;
    }

    /**
     * @param field_type $commentcontent
     */
    public function setCommentcontent($commentcontent)
    {
        $this->commentcontent = $commentcontent;
    }

}


text:
package io.lettuce.core.output;

import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import io.lettuce.core.StreamMessage;
import io.lettuce.core.codec.RedisCodec;
import io.lettuce.core.internal.LettuceAssert;

/**
 * {@link List} of {@link StreamMessage}s.
 *
 * @author Mark Paluch
 * @since 5.1
 */
public class StreamMessageListOutput<K, V> extends CommandOutput<K, V, List<StreamMessage<K, V>>>
        implements StreamingOutput<StreamMessage<K, V>> {

    private final K stream;

    private boolean initialized;

    private Subscriber<StreamMessage<K, V>> subscriber;

    private K key;

    private String id;

    private Map<K, V> body;

    public StreamMessageListOutput(RedisCodec<K, V> codec, K stream) {
        super(codec, Collections.emptyList());
        setSubscriber(ListSubscriber.instance());
        this.stream = stream;
    }

    @Override
    public void set(ByteBuffer bytes) {

        if (id == null) {
            id = decodeAscii(bytes);
            return;
        }

        if (key == null) {
            key = codec.decodeKey(bytes);
            return;
        }

        if (body == null) {
            body = new LinkedHashMap<>();
        }

        body.put(key, bytes == null ? null : codec.decodeValue(bytes));
        key = null;
    }

    @Override
    public void multi(int count) {

        if (!initialized) {
            output = OutputFactory.newList(count);
            initialized = true;
        }
    }

    @Override
    public void complete(int depth) {

        if (depth == 1) {
            subscriber.onNext(output, new StreamMessage<>(stream, id, body));
            key = null;
            id = null;
            body = null;
        }
    }

    @Override
    public void setSubscriber(Subscriber<StreamMessage<K, V>> subscriber) {
        LettuceAssert.notNull(subscriber, "Subscriber must not be null");
        this.subscriber = subscriber;
    }

    @Override
    public Subscriber<StreamMessage<K, V>> getSubscriber() {
        return subscriber;
    }

}


text:
package at.fh.swenga.model;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "USER")
public class UserModel implements java.io.Serializable {

	// Attributes
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Id
	@Column(name = "userId")
	private long userId;

	@Column(nullable = false, length = 15)
	private String username;

	@Column(nullable = false, length = 200)
	private String password;

	@Column(nullable = false, length = 30)
	private String email_address;

	@Column(nullable = true, length = 100)
	private String signature;

	@Column(nullable = true, length = 50)
	private String profile_picture;

	@Column(nullable = false)
	private boolean isBlocked;

	@Column(nullable = false)
	private boolean isHidden;

	@Column(nullable = false)
	private boolean isActivated;

	@Column(nullable = false)
	private int total_enemies_slain;

	@Column(nullable = false)
	private int total_waves_completed;

	@Column(nullable = false)
	private int total_towers_built;

	@Column(nullable = false)
	private int playtime;

	//Relationships
	@ManyToMany
	private List<LevelModel> level_statistics;

	@OneToMany
	private List<EntryModel> entries;

	@OneToMany
	private List<ReportModel> reports;

	@OneToMany(fetch = FetchType.EAGER, mappedBy = "user")
	private Set<UserRoleModel> userRole = new HashSet<UserRoleModel>(0);

	//Constructor
	public UserModel() {
	}

	public UserModel(String username, String password, String email_address) {
		super();
		this.username = username;
		this.password = password;
		this.email_address = email_address;
		this.signature = null;
		this.profile_picture = null;
		this.isBlocked = false;
		this.isHidden = false;
		this.isActivated = false;
		this.total_enemies_slain = 0;
		this.total_waves_completed = 0;
		this.total_towers_built = 0;
		this.playtime = 0;
	}

	public UserModel(String username, String password, String email_address, boolean isBlocked, boolean isHidden, boolean isActivated, int currentLevel,
			int total_enemies_slain, int total_waves_completed, int total_towers_built, int playtime) {
		super();
		this.username = username;
		this.password = password;
		this.email_address = email_address;
		this.signature = null;
		this.profile_picture = null;
		this.isBlocked = isBlocked;
		this.isHidden = isHidden;
		this.isActivated = isActivated;
		this.total_enemies_slain = total_enemies_slain;
		this.total_waves_completed = total_waves_completed;
		this.total_towers_built = total_towers_built;
		this.playtime = playtime;
	}

	public UserModel(String username, String password, String email_address, String signature, String profile_picture,
			boolean isBlocked, boolean isHidden, boolean isActivated , int currentLevel,
			int total_enemies_slain, int total_waves_completed, int total_towers_built, int playtime) {
		super();
		level_statistics = new ArrayList<LevelModel>();
		this.username = username;
		this.password = password;
		this.email_address = email_address;
		this.signature = signature;
		this.profile_picture = profile_picture;
		this.isBlocked = isBlocked;
		this.isHidden = isHidden;
		this.isActivated = isActivated;
		this.total_enemies_slain = total_enemies_slain;
		this.total_waves_completed = total_waves_completed;
		this.total_towers_built = total_towers_built;
		this.playtime = playtime;
	}

	//Getter & Setter
	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail_address() {
		return email_address;
	}

	public void setEmail_address(String email_address) {
		this.email_address = email_address;
	}

	public String getSignature() {
		return signature;
	}

	public void setSignature(String signature) {
		this.signature = signature;
	}

	public String getProfile_picture() {
		return profile_picture;
	}

	public void setProfile_picture(String profile_picture) {
		this.profile_picture = profile_picture;
	}

	public boolean isBlocked() {
		return isBlocked;
	}

	public void setBlocked(boolean isBlocked) {
		this.isBlocked = isBlocked;
	}

	public boolean isHidden() {
		return isHidden;
	}

	public void setHidden(boolean isHidden) {
		this.isHidden = isHidden;
	}

	public boolean isActivated() {
		return isActivated;
	}

	public void setActivated(boolean isActivated) {
		this.isActivated = isActivated;
	}

	public List<LevelModel> getLevel_statistics() {
		return level_statistics;
	}

	public void setLevel_statistics(List<LevelModel> level_statistics) {
		this.level_statistics = level_statistics;
	}

	public List<EntryModel> getEntries() {
		return entries;
	}

	public void setEntries(List<EntryModel> entries) {
		this.entries = entries;
	}

	public List<ReportModel> getReports() {
		return reports;
	}

	public void setReports(List<ReportModel> reports) {
		this.reports = reports;
	}

	public int getTotal_enemies_slain() {
		return total_enemies_slain;
	}

	public void setTotal_enemies_slain(int total_enemies_slain) {
		this.total_enemies_slain = total_enemies_slain;
	}

	public int getTotal_waves_completed() {
		return total_waves_completed;
	}

	public void setTotal_waves_completed(int total_waves_completed) {
		this.total_waves_completed = total_waves_completed;
	}

	public int getTotal_towers_built() {
		return total_towers_built;
	}

	public void setTotal_towers_built(int total_towers_built) {
		this.total_towers_built = total_towers_built;
	}

	public int getPlaytime() {
		return playtime;
	}

	public void setPlaytime(int playtime) {
		this.playtime = playtime;
	}

	public Set<UserRoleModel> getUserRole() {
		return userRole;
	}

	public void setUserRole(Set<UserRoleModel> userRole) {
		this.userRole = userRole;
	}

	//equals & hashcode
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((email_address == null) ? 0 : email_address.hashCode());
		result = prime * result + ((password == null) ? 0 : password.hashCode());
		result = prime * result + (int) (userId ^ (userId >>> 32));
		result = prime * result + ((username == null) ? 0 : username.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserModel other = (UserModel) obj;
		if (email_address == null) {
			if (other.email_address != null)
				return false;
		} else if (!email_address.equals(other.email_address))
			return false;
		if (password == null) {
			if (other.password != null)
				return false;
		} else if (!password.equals(other.password))
			return false;
		if (userId != other.userId)
			return false;
		if (username == null) {
			if (other.username != null)
				return false;
		} else if (!username.equals(other.username))
			return false;
		return true;
	}
}


text:
/*******************************************************************************
*   touch.c
*   Atmel Corporation:  http://www.atmel.com \n
*   Support email:  touch@atmel.com
******************************************************************************/

/*  License
*   Copyright (c) 2010, Atmel Corporation All rights reserved.
*
*   Redistribution and use in source and binary forms, with or without
*   modification, are permitted provided that the following conditions are met:
*
*   1. Redistributions of source code must retain the above copyright notice,
*   this list of conditions and the following disclaimer.
*
*   2. Redistributions in binary form must reproduce the above copyright notice,
*   this list of conditions and the following disclaimer in the documentation
*   and/or other materials provided with the distribution.
*
*   3. The name of ATMEL may not be used to endorse or promote products derived
*   from this software without specific prior written permission.
*
*   THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
*   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
*   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND
*   SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
*   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
*   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
*   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
*   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
*   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
*   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*  This is an automatically generated file. Do not modify the contents manually.
    Instead, use the Project Builder Wizard to make changes to the design.
*/
/*----------------------------------------------------------------------------
                            compiler information
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
                                include files
----------------------------------------------------------------------------*/

#include <avr/io.h>
#include <avr/interrupt.h>

#define __delay_cycles(n)     __builtin_avr_delay_cycles(n)

/*  now include touch api.h with the localization defined above */
#include "touch_api.h"
#include "touch.h"
#ifdef _DEBUG_INTERFACE_
/* Include files for QTouch Studio integration */
#include "QDebug.h"
#include "QDebugTransport.h"
#endif

/*----------------------------------------------------------------------------
                            manifest constants
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
                            type definitions
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
                                prototypes
----------------------------------------------------------------------------*/

/* This will initialize touch related code */
void touch_init( void );
/* This will call all the functions for touch related measurement */
void touch_measure(void);
/*  Assign the parameters values to global configuration parameter structure    */
static void qt_set_parameters( void );
/*  Configure the sensors */
static void config_sensors(void);

#ifdef _DEBUG_INTERFACE_
void set_timestamp1(void); // used for timestamping
#endif

/*----------------------------------------------------------------------------
                            Structure Declarations
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
                                    macros
----------------------------------------------------------------------------*/
#ifdef _DEBUG_INTERFACE_
  #ifdef _QDEBUG_TIME_STAMPS_
    /* This below code is used for timestamping related information */

	#define TIMER_COUNTER_L TCC0.CNTL
	#define TIMER_COUNTER_H TCC0.CNTH

    #define TIMESTAMP0  asm("cli"); timestamp0_lword = (uint16_t)TIMER_COUNTER_L;timestamp0_lword |= (uint16_t)(TIMER_COUNTER_H << 8); timestamp0_hword = current_time_ms_touch; asm("sei");
    #define TIMESTAMP1  asm("cli"); timestamp1_lword = (uint16_t)TIMER_COUNTER_L;timestamp1_lword |= (uint16_t)(TIMER_COUNTER_H << 8); timestamp1_hword = current_time_ms_touch; asm("sei");
    #define TIMESTAMP2  asm("cli"); timestamp2_lword = (uint16_t)TIMER_COUNTER_L;timestamp2_lword |= (uint16_t)(TIMER_COUNTER_H << 8); timestamp2_hword = current_time_ms_touch; asm("sei");
    #define TIMESTAMP3  asm("cli"); timestamp3_lword = (uint16_t)TIMER_COUNTER_L;timestamp3_lword |= (uint16_t)(TIMER_COUNTER_H << 8); timestamp3_hword = current_time_ms_touch; asm("sei");
    #define TIMESTAMP4  asm("cli"); timestamp4_lword = (uint16_t)TIMER_COUNTER_L;timestamp4_lword |= (uint16_t)(TIMER_COUNTER_H << 8); timestamp4_hword = current_time_ms_touch; asm("sei");
    #define TIMESTAMP5  asm("cli"); timestamp5_lword = (uint16_t)TIMER_COUNTER_L;timestamp5_lword |= (uint16_t)(TIMER_COUNTER_H << 8); timestamp5_hword = current_time_ms_touch; asm("sei");

  #else

	#define TIMESTAMP0   {}
    #define TIMESTAMP1   {}
    #define TIMESTAMP2   {}
    #define TIMESTAMP3   {}
    #define TIMESTAMP4   {}
    #define TIMESTAMP5   {}

  #endif
#endif

/*----------------------------------------------------------------------------
                                global variables
----------------------------------------------------------------------------*/

#ifdef _DEBUG_INTERFACE_
 #ifdef _QDEBUG_TIME_STAMPS_
  uint16_t timestamp0_hword=0;
  uint16_t timestamp0_lword=0;
  uint16_t timestamp1_hword=0;
  uint16_t timestamp1_lword=0;
  uint16_t timestamp2_hword=0;
  uint16_t timestamp2_lword=0;
  uint16_t timestamp3_hword=0;
  uint16_t timestamp3_lword=0;
  uint16_t timestamp4_hword=0;
  uint16_t timestamp4_lword=0;
  uint16_t timestamp5_hword=0;
  uint16_t timestamp5_lword=0;
 #endif
#endif

/*----------------------------------------------------------------------------
                                extern variables
----------------------------------------------------------------------------*/
/* This configuration data structure parameters if needs to be changed will be
   changed in the qt_set_parameters function */
extern qt_touch_lib_config_data_t qt_config_data;
/* touch output - measurement data */
extern qt_touch_lib_measure_data_t qt_measure_data;
/* Get sensor delta values */
extern int16_t qt_get_sensor_delta( uint8_t sensor);
#ifdef QTOUCH_STUDIO_MASKS
extern TOUCH_DATA_T SNS_array[2][2];
extern TOUCH_DATA_T SNSK_array[2][2];
#endif

extern uint8_t time_to_measure_touch;
extern uint16_t current_time_ms_touch;

/* Output can be observed in the watch window using this pointer */
qt_touch_lib_measure_data_t *pqt_measure_data = &qt_measure_data;

/*----------------------------------------------------------------------------
                                static variables
----------------------------------------------------------------------------*/

/*============================================================================
Name    :   touch_init
------------------------------------------------------------------------------
Purpose :   This will initialize touch related code.
Input   :   n/a
Output  :   n/a
Notes   :
============================================================================*/

void touch_init( void )
{

    #ifdef QTOUCH_STUDIO_MASKS
	    SNS_array[0][0]= 0x55;
	    SNS_array[0][1]= 0xaa;
	    SNS_array[1][0]= 0x55;
	    SNS_array[1][1]= 0xaa;

    	SNSK_array[0][0]= 0x55;
    	SNSK_array[0][1]= 0xaa;
    	SNSK_array[1][0]= 0x55;
    	SNSK_array[1][1]= 0xaa;
	#endif

	/* Configure the Sensors as keys or Keys With Rotor/Sliders in this function */
    config_sensors();

    /* initialise touch sensing */
    qt_init_sensing();

    /*  Set the parameters like recalibration threshold, Max_On_Duration etc in this function by the user */
    qt_set_parameters( );

    /*  Address to pass address of user functions   */
    /*  This function is called after the library has made capacitive measurements,
    *   but before it has processed them. The user can use this hook to apply filter
    *   functions to the measured signal values.(Possibly to fix sensor layout faults)    */
    #ifdef _DEBUG_INTERFACE_
        qt_filter_callback = &set_timestamp1;
    #else
        qt_filter_callback = 0;
    #endif

    #ifdef _DEBUG_INTERFACE_
        /* Initialize debug protocol */
        QDebug_Init();

        /* Process commands from PC */
        QDebug_ProcessCommands();

    #endif

}

#ifdef _DEBUG_INTERFACE_
void set_timestamp1(void)
{
	TIMESTAMP1;
}
#endif

/*============================================================================
Name    :   touch_measure
------------------------------------------------------------------------------
Purpose :   This will call all the functions for touch related measurement.
Input   :   n/a
Output  :   n/a
Notes   :
============================================================================*/

void touch_measure(void)
{
	/*status flags to indicate the re-burst for library*/
	static uint16_t status_flag = 0u;
	static uint16_t burst_flag = 0u;

	if( time_to_measure_touch )
	{
	    /*  clear flag: it's time to measure touch  */
		time_to_measure_touch = 0u;

		do {
			#ifdef _DEBUG_INTERFACE_
				TIMESTAMP0;
			#endif

			/*  one time measure touch sensors    */
			status_flag = qt_measure_sensors( current_time_ms_touch );

			#ifdef _DEBUG_INTERFACE_
				TIMESTAMP2;
			#endif

			burst_flag = status_flag & QTLIB_BURST_AGAIN;

			#ifdef _DEBUG_INTERFACE_
				/* send debug data */
				QDebug_SendData(status_flag);
				/* Process commands from PC */
				QDebug_ProcessCommands();
			#endif

			/* Time-critical host application code goes here */

			#ifdef _DEBUG_INTERFACE_
				TIMESTAMP3;
			#endif
		}while (burst_flag) ;

	}
	#ifdef _DEBUG_INTERFACE_
		TIMESTAMP4;
	#endif

	/* Non-Time critical host application code goes here */

	#ifdef _DEBUG_INTERFACE_
		TIMESTAMP5;
	#endif
	/* Host sleep code goes here */

}

/*============================================================================
Name    :   qt_set_parameters
------------------------------------------------------------------------------
Purpose :   This will fill the default threshold values in the configuration
            data structure.But User can change the values of these parameters .
Input   :   n/a
Output  :   n/a
Notes   :   Generated Code from QTouch Studio. Do not change
============================================================================*/

static void qt_set_parameters( void )
{

/*  This will be modified by the user to different values   */
qt_config_data.qt_di              = 4;
qt_config_data.qt_neg_drift_rate  = 20;
qt_config_data.qt_pos_drift_rate  = 5;
qt_config_data.qt_max_on_duration = 0;
qt_config_data.qt_drift_hold_time = 20;
qt_config_data.qt_recal_threshold = 1;
qt_config_data.qt_pos_recal_delay = 3;

}

/*============================================================================
Name    :   config_sensors -
------------------------------------------------------------------------------
Purpose :   Configure the sensors
Input   :   n/a
Output  :   n/a
Notes   :   Generated code from QTouch Studio. Do not change
============================================================================*/
static void config_sensors(void)
{
	qt_enable_key( CHANNEL_0, NO_AKS_GROUP, 10u, HYST_6_25 );
	qt_enable_key( CHANNEL_1, NO_AKS_GROUP, 10u, HYST_6_25 );
	qt_enable_key( CHANNEL_2, NO_AKS_GROUP, 10u, HYST_6_25 );
	qt_enable_key( CHANNEL_3, NO_AKS_GROUP, 10u, HYST_6_25 );
	qt_enable_key( CHANNEL_4, NO_AKS_GROUP, 10u, HYST_6_25 );
	qt_enable_key( CHANNEL_5, NO_AKS_GROUP, 10u, HYST_6_25 );
	qt_enable_key( CHANNEL_6, NO_AKS_GROUP, 10u, HYST_6_25 );
	qt_enable_key( CHANNEL_7, NO_AKS_GROUP, 10u, HYST_6_25 );
	qt_enable_key( CHANNEL_8, NO_AKS_GROUP, 10u, HYST_6_25 );
	qt_enable_key( CHANNEL_9, NO_AKS_GROUP, 10u, HYST_6_25 );
	qt_enable_slider( CHANNEL_10, CHANNEL_12, NO_AKS_GROUP, 10u, HYST_6_25, RES_8_BIT, 0u  );
	qt_enable_rotor( CHANNEL_13, CHANNEL_15, NO_AKS_GROUP, 10u, HYST_6_25, RES_8_BIT, 0u );
}


text:
ctags -R ./client tests/helpers/ tests/*.ts lib/*
#cat tags >> tags_temp
#cat tags_temp | sort > tags
#rm tags_temp


text:
package org.apache.cassandra.locator;

import java.net.InetAddress;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import com.google.common.net.InetAddresses;
import org.apache.cassandra.utils.FBUtilities;
import org.junit.Assert;
import org.junit.Test;

/**
 * Unit tests for {@link GossipingPropertyFileSnitch}.
 */
public class GossipingPropertyFileSnitchTest
{
    public static void checkEndpoint(final AbstractNetworkTopologySnitch snitch,
                                     final String endpointString, final String expectedDatacenter,
                                     final String expectedRack)
    {
        final InetAddress endpoint = InetAddresses.forString(endpointString);
        Assert.assertEquals(expectedDatacenter, snitch.getDatacenter(endpoint));
        Assert.assertEquals(expectedRack, snitch.getRack(endpoint));
    }

    @Test
    public void testAutoReloadConfig() throws Exception
    {
        String confFile = FBUtilities.resourceToFile(SnitchProperties.RACKDC_PROPERTY_FILENAME);

        final GossipingPropertyFileSnitch snitch = new GossipingPropertyFileSnitch(/*refreshPeriodInSeconds*/1);
        checkEndpoint(snitch, FBUtilities.getBroadcastAddress().getHostAddress(), "DC1", "RAC1");

        final Path effectiveFile = Paths.get(confFile);
        final Path backupFile = Paths.get(confFile + ".bak");
        final Path modifiedFile = Paths.get(confFile + ".mod");

        try
        {
            Files.copy(effectiveFile, backupFile);
            Files.copy(modifiedFile, effectiveFile, java.nio.file.StandardCopyOption.REPLACE_EXISTING);

            Thread.sleep(1500);

            checkEndpoint(snitch, FBUtilities.getBroadcastAddress().getHostAddress(), "DC2", "RAC2");
        }
        finally
        {
            Files.copy(backupFile, effectiveFile, java.nio.file.StandardCopyOption.REPLACE_EXISTING);
            Files.delete(backupFile);
        }
    }
}


text:
<?php

// Latest Tweets
class TB_Twitter_Activity extends WP_Widget {

	function TB_Twitter_Activity() {
		$widget_ops = array('classname' => 'tb_twitter_activity', 'description' => __( 'Twitter Activity', 'the-cause') );
		$this->WP_Widget('TB_Twitter_Activity', __('TB Twitter Activity', 'the-cause'), $widget_ops);

	}

	function widget( $args, $instance ) {
		extract($args);

		$title = apply_filters('widget_title', empty($instance['title']) ? __('Twitter Activity', 'the-cause') : $instance['title'], $instance, $this->id_base);

		echo $before_widget;

		$before_title = str_replace('h4', 'h4 class="twitter"', $before_title);

		if ( $title ) echo $before_title . $title . $after_title;

		?>

        <?php $tweetsNumber = (int)(empty($instance['tweetsNumber']) ? '3' : $instance['tweetsNumber']); ?>
        <?php $twitterID = get_option('tb_twitter_id'); ?>

    	<?php

		echo $after_widget;
	}

	function update( $new_instance, $old_instance ) {

		$instance = $old_instance;
		$instance['title'] = strip_tags($new_instance['title']);

		$instance['tweetsNumber'] = (int) strip_tags($new_instance['tweetsNumber']);
		return $instance;
	}

	function form( $instance ) {

		$instance = wp_parse_args( (array) $instance, array( 'tweetsNumber' => 3, 'title' => 'Twitter Activity' ) );
		$tweetsNumber = (int) strip_tags($instance['tweetsNumber']);
		$title = strip_tags($instance['title']);

	?>

        	<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'the-cause'); ?>
	        <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" />

        	<label for="<?php echo $this->get_field_id('tweetsNumber'); ?>"><?php _e('Number of Tweets:', 'the-cause'); ?>
	        <input class="widefat" id="<?php echo $this->get_field_id('tweetsNumber'); ?>" name="<?php echo $this->get_field_name('tweetsNumber'); ?>" type="text" value="<?php echo absint($tweetsNumber); ?>" />

	<?php
	}
}

function tb_register_twitter_widget() {

	register_widget('TB_Twitter_Activity');

	do_action('widgets_init');
}

add_action('init', 'tb_register_twitter_widget', 1);

?>


text:
package models.pcf.pcl

class PCLProcessElement(val alias:String, val name:String) extends PCLModel {

  def this(name:String) = this("", name)

  //  override def toString = "[" + elementType + " " + super.toString + ", alias = " + alias + ", name = " + name + "]"
  override def toString = if ( alias != "" ) "[alias = " + alias + ", name = " + name + "]" else "[name = " + name + "]"
}


text:
package wango

import (
	"strconv"

	"github.com/pkg/errors"
	"golang.org/x/net/websocket"
)

func (c *Conn) receiveWelcome() error {
	var data []byte
	err := websocket.Message.Receive(c.connection, &data)
	if err != nil {
		return errors.Wrap(err, "Can't receive welcome message")
	}
	msgType, msg, err := parseMessage(data)
	if err != nil {
		return errors.Wrap(err, "Parsing welcome message")
	}
	if msgType != msgWelcome {
		if typeString, ok := msgIntTypes[msgType]; ok {
			return errors.New("First message received must be welcome. Received: " + typeString)
		}
		return errors.New("First message received must be welcome. Received unknown type " + strconv.Itoa(msgType))
	}
	if len(msg) < 3 {
		return errors.New("Invalid welcome message")
	}
	// sessionID, ok := msg[1].(string)
	// if !ok {
	// 	return errors.New("Invalid welcome message. SessionID is not a string")
	// }
	// c.sessionID = sessionID

	// protocolVersion, ok := msg[1].(float64)
	// if !ok {
	// 	return errors.New("Invalid welcome message. ProtocolVersion is not a number")
	// }
	// c.protocolVersion = int(protocolVersion)

	// serverIdent, ok := msg[1].(string)
	// if !ok {
	// 	return errors.New("Invalid welcome message. ServerIdent is not a string")
	// }
	// c.serverIdent = serverIdent

	// if c.sessionOpenCallback != nil {
	// 	c.sessionOpenCallback(c.sessionID)
	// }

	return nil
}


text:
layout: post
title:  C'de Data Type
description: C'deki data tipleri, değişkenlerin veya farklı türdeki fonksiyonları bildirilmesi için kullanılan geniş bir sistemi ifade eder.
date:   2018-01-15 13:53:00
excerpt: "C, Programming"
tags:   C Programlama Linux
categories: Programming
permalink: /:categories/:title/
comments: false
published: true
lang: tr
redirect_from:
  - /ceviriler/ceviriler2/2018-01-08-C-Data-Type.html
---

## Data Tipleri

![data type](/images/data-type/data-type.jpg "data type"){:height="100%" width="100%"}

C'deki data tipleri, değişkenlerin veya farklı türdeki fonksiyonları bildirilmesi için kullanılan geniş bir sistemi ifade eder. Bir değişkenin depolamada ne kadar yer kapladığını ve saklanan bit düzeninin nasıl yorumlandığını tipi belirler.

C'deki tipler aşağıdaki gibi sınıflandırılabilir:

- Temel tipler

|Bunlar aritmetik tiplerdir ve ayrıca: (a) integer tipler ve (b) kayan noktalı tipler olarak sınıflandırılırlar.

- Numaralandırılmış tipler

|Bunlar tekrar aritmetik türleridir ve program boyunca yalnızca belirli kesikli tamsayı değerlerini atayabilen değişkenleri tanımlamak için kullanılırlar.

- void tipi

|void belirleyici tip, kullanılabilir bir değer olmadığını gösterir.

- Türemiş tipler

|(A) Pointer tipler, (b) Array tipler, (c) Structure tipler, (d) Union tipler ve (e) Fonksiyon tipler.

Array tipleri ve structure tipleri ortaklaşa toplanmış tipler olarak adlandırılır. Bir fonksiyon tipi, fonksiyon dönüş değerinin tipini belirtir. Gelecek bölümlerde başka tiplerin de ele alınacağı aşağıdaki bölümde temel tipleri göreceğiz.

![data type](/images/data-type/Structured-Data.png "data type"){:height="100%" width="100%"}

## Integer Tipler

Aşağıdaki tabloda, standart integer tiplerinin ayrıntıları, depolama alanı boyutlarıyla ve değer aralıklarıyla birlikte verilmektedir.

Type
Storage size
Value range

char
1 byte
-128 to 127 or 0 to 255

unsigned char
1 byte
0 to 255

signed char
1 byte
-128 to 127

int
2 or 4 bytes
-32,768 to 32,767 or -2,147,483,648 to 2,147,483,647

unsigned int
2 or 4 bytes
0 to 65,535 or 0 to 4,294,967,295

short
2 bytes
-32,768 to 32,767

unsigned short
2 bytes
0 to 65,535

long
4 bytes
-2,147,483,648 to 2,147,483,647

unsigned long
4 bytes
0 to 4,294,967,295

Belli bir data tipinin veya değişkenin tam boyutunu elde etmek için ```sizeof``` operatörünü kullanabilirsiniz. ```sizeof(type)``` ifadeleri, nesnenin veya yazının bayt cinsinden depolama boyutu sağlar. Aşağıda verilen, herhangi bir makinedeki ```int``` türünün boyutunu elde etmek için bir örnektir.

~~~c
#include <stdio.h>
#include <limits.h>

int main() {

   printf("Storage size for int : %ld \n", sizeof(int));

   return 0;
}
~~~

~~~bash
cc -std=c11 -Wall -g my_app.c -o my_app
Storage size for int : 4
~~~

## Kayan Noktalı Tipler

Aşağıdaki tabloda, standart kayan nokta tiplerinin ayrıntıları, depolama boyutları ve değer aralıkları ve bunların hassaslığı ile birlikte verilmektedir.

Type
Storage size
Value range
Precision

float
4 byte
1.2E-38 to 3.4E+38
6 decimal places

double
8 byte
2.3E-308 to 1.7E+308
15 decimal places

long double
10 byte
3.4E-4932 to 1.1E+4932
19 decimal places

float.h üst başlık dosyası, yukarda verlen bu değerleri ve programlarınızdaki gerçek sayıların ikili gösterimi hakkında diğer detayları kullanmanıza izin veren makroları tanımlar. Aşağıdaki örnek, bir float tipini ve onun değer aralığı tarafından alınan saklama alanını yazdırır.

~~~c
#include <stdio.h>
#include <float.h>

int main() {
   printf("Storage size for float : %ld\n", sizeof(float));
   printf("Minimum float positive value: %E\n", FLT_MIN );
   printf("Maximum float positive value: %E\n", FLT_MAX );
   printf("Precision value: %d\n", FLT_DIG );

   return 0;
}
~~~

Yukarıdaki programı derlediğinizde ve çalıştırdığınızda, Linux'ta aşağıdaki sonucu verir:

~~~bash
Storage size for float : 4
Minimum float positive value: 1.175494E-38
Maximum float positive value: 3.402823E+38
Precision value: 6
~~~

## void tip

void tip, kullanılabilir bir değer olmadığını belirtir. Üç çeşit durumlarda kullanılır.

Sr.No.
Types & Description

1

Function dönüşü olarak void

C'de herhangi bir değer döndürmeyen çeşitli foksiyonlar vardır ya da void döndürdüklerini söyleyebilirsiniz. Dönüş değeri olmayan bir foksiyonun void dönüş tipi vardır. Örneğin, void exit (int status);

2

Fonksiyon parametresi olarak void

C'de herhangi bir parametre kabul etmeyen çeşitli fonksiyonlar vardır. Parametre içermeyen bir fonksiyon boşluğu kabul edebilir. Örneğin, int rand(void);

3

Pointers olarak void

void * tipinde bir işaretçi, bir nesnenin adresini temsil eder, ancak tipini belirtmez. Örneğin bir bellek ayırma fonksiyonu, a memory allocation function void *malloc( size_t size ); herhangi bir veri türüne aktarılabilen void bir işaretçi döndürür.

* * *


text:
package com.sureshjoshi.android.ndkexample;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

import com.sureshjoshi.core.IntVector;
import com.sureshjoshi.core.SeePlusPlus;
import com.sureshjoshi.core.StringVector;

import java.util.Random;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends Activity {

    static {
        // Use the name of the Java wrapper library (which is already linked to the original library)
        System.loadLibrary("SeePlusPlus_Wrapper");
    }

    private SeePlusPlus mCpp;

    @BindView(R.id.textview_multiply_int)
    TextView mTextviewMultiplyInt;

    @BindView(R.id.textview_multiply_double)
    TextView mTextviewMultiplyDouble;

    @BindView(R.id.textview_random_numbers)
    TextView mTextviewRandomNumbers;

    @BindView(R.id.textview_unsorted_strings)
    TextView mTextviewUnsortedStrings;

    @BindView(R.id.textview_sorted_strings)
    TextView mTextviewSortedStrings;

    @BindView(R.id.textview_android_studio_ndk_integration)
    TextView mTextviewAndroidStudioNdkIntegration;

    @OnClick(R.id.button_refresh)
    void onClick() {
        runNativeFunctions();
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);

        mCpp = new SeePlusPlus();
        runNativeFunctions();
    }

    void runNativeFunctions() {
        mTextviewMultiplyInt.setText(runMultiplyInts());
        mTextviewMultiplyDouble.setText(runMultiplyDoubles());
        mTextviewRandomNumbers.setText(runRandomNumbers());
        mTextviewSortedStrings.setText(runSortString());
//        mTextviewAndroidStudioNdkIntegration.setText(runAndroidStudioNativeString());
    }

    String runMultiplyInts() {
        // Generate two random ints in range 0..99
        Random randomGenerator = new Random();
        int x = randomGenerator.nextInt(100);
        int y = randomGenerator.nextInt(100);

        int result = mCpp.Multiply(x, y);

        return getString(R.string.multiply_int)
                + " " + Integer.toString(x)
                + " and " + Integer.toString(y) + " = " + Integer.toString(result);
    }

    String runMultiplyDoubles() {
        // Generate two random doubles in range 0..99
        double x = Math.random() * 100.0;
        double y = Math.random() * 100.0;

        double result = mCpp.Multiply(x, y);

        return getString(R.string.multiply_double)
                + " " + String.format("%.2f", x)
                + " and " + String.format("%.2f", y) + " = "
                + String.format("%.2f", result);
    }

    String runRandomNumbers() {
        // Print out random numbers
        Random randomGenerator = new Random();
        int size = randomGenerator.nextInt(10);
        IntVector numbers = mCpp.RandomNumbers(size);

        String message = getString(R.string.random_numbers) + " ";
        for (int i = 0; i < size; ++i) {
            message += numbers.get(i);
            message += " ";
        }
        return message;
    }

    String runSortString() {
        // Create an unsorted set of strings by splitting on commas
        String unsortedString = "lorem,ipsum,dolor,sit,amet,consectetur,adipiscing,elit";
        String[] unsortedStrings = unsortedString.split(",");

        StringVector unsortedStringVector = new StringVector();
        for (String value : unsortedStrings) {
            unsortedStringVector.add(value);
        }

        StringVector sortedStringVector = mCpp.Sort(unsortedStringVector);

        String message = getString(R.string.unsorted_strings) + " " + unsortedString;
        mTextviewUnsortedStrings.setText(message);

        StringBuilder sortedMessage = new StringBuilder();
        sortedMessage.append(getString(R.string.sorted_strings))
                .append(" ");
        int size = (int) sortedStringVector.size();
        for (int i = 0; i < size; ++i) {
            sortedMessage.append(sortedStringVector.get(i))
                    .append(",");
        }
        return sortedMessage.toString();
    }

//    native String runAndroidStudioNativeString();

}


text:
export MSGSIZE=100
qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:///tmp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory  -d amq.Queue -tc jms.r11.Receiver $*


text:
#ifdef __cpp_exceptions

#include "driver/i2c.h"
#include "i2c_cxx.hpp"

using namespace std;

namespace idf {

#define I2C_CHECK_THROW(err) CHECK_THROW_SPECIFIC((err), I2CException)

/**
 * I2C bus are defined in the header files, let's check that the values are correct
 */
#if SOC_I2C_NUM >= 2
static_assert(I2C_NUM_1 == 1, "I2C_NUM_1 must be equal to 1");
#endif // SOC_I2C_NUM >= 2
static_assert(I2C_NUM_MAX == SOC_I2C_NUM, "I2C_NUM_MAX must be equal to SOC_I2C_NUM");

namespace {
i2c_port_t i2c_num_to_driver_type(I2CNumber num) {
    return static_cast<i2c_port_t>(num.get_num());
}
}

esp_err_t check_i2c_num(uint32_t i2c_num) noexcept
{
    if (i2c_num >= I2C_NUM_MAX) {
        return ESP_ERR_INVALID_ARG;
    }

    return ESP_OK;
}

esp_err_t check_i2c_addr(uint32_t addr) noexcept
{
    // maximum I2C address currently supported in the C++ classes is 127
    if (addr > 0x7f) {
        return ESP_ERR_INVALID_ARG;
    }

    return ESP_OK;
}

I2CException::I2CException(esp_err_t error) : ESPException(error) { }

I2CTransferException::I2CTransferException(esp_err_t error) : I2CException(error) { }

uint32_t I2CNumber::get_num()
{
    return get_value();
}

I2CAddress::I2CAddress(uint8_t addr) : StrongValueComparable<uint8_t> (addr)
{
    esp_err_t error = check_i2c_addr(addr);
    if (error != ESP_OK) {
        throw I2CException(error);
    }
}

uint8_t I2CAddress::get_addr()
{
    return get_value();
}

I2CCommandLink::I2CCommandLink()
{
    handle = i2c_cmd_link_create();
    if (!handle) {
        throw I2CException(ESP_ERR_NO_MEM);
    }
}

I2CCommandLink::~I2CCommandLink()
{
    i2c_cmd_link_delete(handle);
}

void I2CCommandLink::start()
{
    I2C_CHECK_THROW(i2c_master_start(handle));
}

void I2CCommandLink::write(const std::vector<uint8_t> &bytes, bool expect_ack)
{
    I2C_CHECK_THROW(i2c_master_write(handle, bytes.data(), bytes.size(), expect_ack));
}

void I2CCommandLink::write_byte(uint8_t byte, bool expect_ack)
{
    I2C_CHECK_THROW(i2c_master_write_byte(handle, byte, expect_ack));
}

void I2CCommandLink::read(std::vector<uint8_t> &bytes)
{
    I2C_CHECK_THROW(i2c_master_read(handle, bytes.data(), bytes.size(), I2C_MASTER_LAST_NACK));
}

void I2CCommandLink::stop()
{
    I2C_CHECK_THROW(i2c_master_stop(handle));
}

void I2CCommandLink::execute_transfer(I2CNumber i2c_num, chrono::milliseconds driver_timeout)
{
    esp_err_t err = i2c_master_cmd_begin(i2c_num_to_driver_type(i2c_num), handle, driver_timeout.count() / portTICK_PERIOD_MS);
    if (err != ESP_OK) {
        throw I2CTransferException(err);
    }
}

I2CBus::I2CBus(I2CNumber i2c_number) : i2c_num(std::move(i2c_number)) { }

I2CBus::~I2CBus() { }

I2CMaster::I2CMaster(I2CNumber i2c_number,
                     SCL_GPIO scl_gpio,
                     SDA_GPIO sda_gpio,
                     Frequency clock_speed,
                     bool scl_pullup,
                     bool sda_pullup)
    : I2CBus(std::move(i2c_number))
{
    i2c_config_t conf = {};
    conf.mode = I2C_MODE_MASTER;
    conf.scl_io_num = scl_gpio.get_num();
    conf.scl_pullup_en = scl_pullup;
    conf.sda_io_num = sda_gpio.get_num();
    conf.sda_pullup_en = sda_pullup;
    conf.master.clk_speed = clock_speed.get_value();
    I2C_CHECK_THROW(i2c_param_config(i2c_num_to_driver_type(i2c_num), &conf));
    I2C_CHECK_THROW(i2c_driver_install(i2c_num_to_driver_type(i2c_num), conf.mode, 0, 0, 0));
}

I2CMaster::~I2CMaster()
{
    i2c_driver_delete(i2c_num_to_driver_type(i2c_num));
}

void I2CMaster::sync_write(I2CAddress i2c_addr, const vector<uint8_t> &data)
{
    I2CWrite writer(data);

    writer.do_transfer(i2c_num, i2c_addr);
}

std::vector<uint8_t> I2CMaster::sync_read(I2CAddress i2c_addr, size_t n_bytes)
{
    I2CRead reader(n_bytes);

    return reader.do_transfer(i2c_num, i2c_addr);
}

vector<uint8_t> I2CMaster::sync_transfer(I2CAddress i2c_addr,
        const std::vector<uint8_t> &write_data,
        size_t read_n_bytes)
{
    I2CComposed composed_transfer;
    composed_transfer.add_write(write_data);
    composed_transfer.add_read(read_n_bytes);

    return composed_transfer.do_transfer(i2c_num, i2c_addr)[0];
}

#if CONFIG_SOC_I2C_SUPPORT_SLAVE
I2CSlave::I2CSlave(I2CNumber i2c_number,
        SCL_GPIO scl_gpio,
        SDA_GPIO sda_gpio,
        I2CAddress slave_addr,
        size_t rx_buf_len,
        size_t tx_buf_len,
        bool scl_pullup,
        bool sda_pullup)
    : I2CBus(std::move(i2c_number))
{
    i2c_config_t conf = {};
    conf.mode = I2C_MODE_SLAVE;
    conf.scl_io_num = scl_gpio.get_value();
    conf.scl_pullup_en = scl_pullup;
    conf.sda_io_num = sda_gpio.get_value();
    conf.sda_pullup_en = sda_pullup;
    conf.slave.addr_10bit_en = 0;
    conf.slave.slave_addr = slave_addr.get_addr();
    I2C_CHECK_THROW(i2c_param_config(i2c_num_to_driver_type(i2c_num), &conf));
    I2C_CHECK_THROW(i2c_driver_install(i2c_num_to_driver_type(i2c_num), conf.mode, rx_buf_len, tx_buf_len, 0));
}

I2CSlave::~I2CSlave()
{
    i2c_driver_delete(i2c_num_to_driver_type(i2c_num));
}

int I2CSlave::write_raw(const uint8_t *data, size_t data_len, chrono::milliseconds timeout)
{
    return i2c_slave_write_buffer(i2c_num_to_driver_type(i2c_num), data, data_len, (TickType_t) timeout.count() / portTICK_PERIOD_MS);
}

int I2CSlave::read_raw(uint8_t *buffer, size_t buffer_len, chrono::milliseconds timeout)
{
    return i2c_slave_read_buffer(i2c_num_to_driver_type(i2c_num), buffer, buffer_len, (TickType_t) timeout.count() / portTICK_PERIOD_MS);
}
#endif // CONFIG_SOC_I2C_SUPPORT_SLAVE

I2CWrite::I2CWrite(const vector<uint8_t> &bytes, chrono::milliseconds driver_timeout)
    : I2CTransfer<void>(driver_timeout), bytes(bytes)
{
    if (bytes.empty()) {
        throw I2CException(ESP_ERR_INVALID_ARG);
    }
}

void I2CWrite::queue_cmd(I2CCommandLink &handle, I2CAddress i2c_addr)
{
    handle.start();
    handle.write_byte(i2c_addr.get_value() << 1 | I2C_MASTER_WRITE);
    handle.write(bytes);
}

void I2CWrite::process_result() { }

I2CRead::I2CRead(size_t size, chrono::milliseconds driver_timeout)
    : I2CTransfer<vector<uint8_t> >(driver_timeout), bytes(size)
{
    if (size == 0) {
        throw I2CException(ESP_ERR_INVALID_ARG);
    }
}

void I2CRead::queue_cmd(I2CCommandLink &handle, I2CAddress i2c_addr)
{
    handle.start();
    handle.write_byte(i2c_addr.get_value() << 1 | I2C_MASTER_READ);
    handle.read(bytes);
}

vector<uint8_t> I2CRead::process_result()
{
    return bytes;
}

I2CComposed::I2CComposed(chrono::milliseconds driver_timeout)
    : I2CTransfer<vector<vector<uint8_t> > >(driver_timeout), transfer_list() { }

void I2CComposed::CompTransferNodeRead::queue_cmd(I2CCommandLink &handle, I2CAddress i2c_addr)
{
    handle.write_byte(i2c_addr.get_value() << 1 | I2C_MASTER_READ);
    handle.read(bytes);
}

void I2CComposed::CompTransferNodeRead::process_result(std::vector<std::vector<uint8_t> > &read_results)
{
    read_results.push_back(bytes);
}

void I2CComposed::CompTransferNodeWrite::queue_cmd(I2CCommandLink &handle, I2CAddress i2c_addr)
{
    handle.write_byte(i2c_addr.get_value() << 1 | I2C_MASTER_WRITE);
    handle.write(bytes);
}

void I2CComposed::add_read(size_t size)
{
    if (!size) {
        throw I2CException(ESP_ERR_INVALID_ARG);
    }

    transfer_list.push_back(make_shared<CompTransferNodeRead>(size));
}

void I2CComposed::add_write(std::vector<uint8_t> bytes)
{
    if (bytes.empty()) {
        throw I2CException(ESP_ERR_INVALID_ARG);
    }

    transfer_list.push_back(make_shared<CompTransferNodeWrite>(bytes));
}

void I2CComposed::queue_cmd(I2CCommandLink &handle, I2CAddress i2c_addr)
{
    for (auto it = transfer_list.begin(); it != transfer_list.end(); it++) {
        handle.start();
        (*it)->queue_cmd(handle, i2c_addr);
    }
}

std::vector<std::vector<uint8_t> > I2CComposed::process_result()
{
    std::vector<std::vector<uint8_t> > results;
    for (auto it = transfer_list.begin(); it != transfer_list.end(); it++) {
        (*it)->process_result(results);
    }
    return results;
}

} // idf

#endif // __cpp_exceptions


text:
require 'spec_helper'

module Alchemy
  describe ElementsController do

    let(:page)       { FactoryGirl.create(:public_page, :restricted => true) }
    let(:element)    { FactoryGirl.create(:element, :page => page, :name => 'download') }

    it "should not be possible to see restricted elements" do
      get :show, :id => element.id
      response.status.should == 302
      response.should redirect_to(login_path)
    end

    context "as a registered user" do

      before do
        activate_authlogic
        UserSession.create(FactoryGirl.create(:registered_user))
      end

      it "should be possible to see restricted elements" do
        get :show, :id => element.id
        response.status.should == 200
      end

    end

  end
end


text:
'use strict';
/**
 * Exports an object for different page or API
 *
 * Created by Shadowlong on 15/12/1.
 */
module.exports = {

    index: function(req, res){

        res.json({
            status: 200,
            msg: 'Good job!'
        });

    }

};


text:
# Copyright 2021 The Kubeflow Authors. All Rights Reserved.
#
# 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.
"""Setup script."""

import glob
import importlib
import os
import types

import dependencies
from setuptools import find_packages
from setuptools import setup

relative_directory = os.path.relpath(os.path.dirname(os.path.abspath(__file__)))
GCPC_DIR_NAME = "google_cloud_pipeline_components"
relative_data_path = os.path.join(relative_directory, GCPC_DIR_NAME)

loader = importlib.machinery.SourceFileLoader(
    fullname="version",
    path=os.path.join(relative_directory, GCPC_DIR_NAME, "version.py"),
)
version = types.ModuleType(loader.name)
loader.exec_module(version)

# Get the long descriptions including link to RELEASE notes from README files.
with open("README.md") as fp:
  _GCPC_LONG_DESCRIPTION = fp.read()

setup(
    name="google-cloud-pipeline-components",
    version=version.__version__,
    description="This SDK enables a set of First Party (Google owned) pipeline"
    " components that allow users to take their experience from Vertex AI"
    " SDK and other Google Cloud services and create a corresponding pipeline"
    " using KFP or Managed Pipelines.",
    long_description=_GCPC_LONG_DESCRIPTION,
    long_description_content_type="text/markdown",
    url="https://github.com/kubeflow/pipelines/tree/master/components/google-cloud",
    author="The Google Cloud Pipeline Components authors",
    author_email="google-cloud-pipeline-components@google.com",
    license="Apache License 2.0",
    extras_require={"tests": dependencies.make_required_test_packages()},
    include_package_data=True,
    install_requires=dependencies.make_required_install_packages(),
    dependency_links=dependencies.make_dependency_links(),
    classifiers=[
        "Development Status :: 4 - Beta",
        "Operating System :: Unix",
        "Operating System :: MacOS",
        "Intended Audience :: Developers",
        "Intended Audience :: Education",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: Apache Software License",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Topic :: Scientific/Engineering",
        "Topic :: Scientific/Engineering :: Artificial Intelligence",
        "Topic :: Software Development",
        "Topic :: Software Development :: Libraries",
        "Topic :: Software Development :: Libraries :: Python Modules",
    ],
    package_dir={
        GCPC_DIR_NAME: os.path.join(relative_directory, GCPC_DIR_NAME)
    },
    packages=find_packages(where=relative_directory, include="*"),
    package_data={
        GCPC_DIR_NAME: [
            x.replace(relative_data_path + "/", "") for x in
            glob.glob(relative_data_path + "/**/*.yaml", recursive=True) +
            glob.glob(
                relative_data_path + "/**/automl/**/*.json",
                recursive=True)
        ]
    },
)


text:
CloudWatch Exporter
=====

A Prometheus exporter for [Amazon CloudWatch](http://aws.amazon.com/cloudwatch/).

## Alternatives

For ECS workloads, there is also an [ECS exporter](https://github.com/prometheus-community/ecs_exporter).

For a different approach to CloudWatch metrics, with automatic discovery, consider [Yet Another CloudWatch Exporter (YACE)](https://github.com/nerdswords/yet-another-cloudwatch-exporter).

## Building and running

Cloudwatch Exporter requires at least Java 11.

`mvn package` to build.

`java -jar target/cloudwatch_exporter-*-SNAPSHOT-jar-with-dependencies.jar 9106 example.yml` to run.

The most recent pre-built JAR can be found at http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22cloudwatch_exporter%22

## Credentials and permissions

The CloudWatch Exporter uses the
[AWS Java SDK](http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/welcome.html),
which offers [a variety of ways to provide credentials](http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/credentials.html).
This includes the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment
variables.

The `cloudwatch:ListMetrics`, `cloudwatch:GetMetricStatistics` and `cloudwatch:GetMetricData` IAM permissions are required.
The `tag:GetResources` IAM permission is also required to use the `aws_tag_select` feature.

## Configuration
The configuration is in YAML.

An example with common options and `aws_dimension_select`:
```
---
region: eu-west-1
metrics:
 - aws_namespace: AWS/ELB
   aws_metric_name: RequestCount
   aws_dimensions: [AvailabilityZone, LoadBalancerName]
   aws_dimension_select:
     LoadBalancerName: [myLB]
   aws_statistics: [Sum]
```

A similar example with common options and `aws_tag_select`:
```
---
region: eu-west-1
metrics:
 - aws_namespace: AWS/ELB
   aws_metric_name: RequestCount
   aws_dimensions: [AvailabilityZone, LoadBalancerName]
   aws_tag_select:
     tag_selections:
       Monitoring: ["enabled"]
     resource_type_selection: "elasticloadbalancing:loadbalancer"
     resource_id_dimension: LoadBalancerName
   aws_statistics: [Sum]
```
**Note:** configuration examples for different namespaces can be found in [examples](./examples) directory

**Note:** A configuration builder can be found [here](https://github.com/djloude/cloudwatch_exporter_metrics_config_builder).

Name     | Description
---------|------------
region   | Optional. The AWS region to connect to. If none is provided, an attempt will be made to determine the region from the [default region provider chain](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-region-selection.html#default-region-provider-chain).
role_arn   | Optional. The AWS role to assume. Useful for retrieving cross account metrics.
metrics  | Required. A list of CloudWatch metrics to retrieve and export
aws_namespace  | Required. Namespace of the CloudWatch metric.
aws_metric_name  | Required. Metric name of the CloudWatch metric.
aws_dimensions | Required. This should contain exactly all the dimensions available for a metric. Run `aws cloudwatch list-metrics` to find out which dimensions you need to include for your metric.
aws_dimension_select | Optional. Which dimension values to filter. Specify a map from the dimension name to a list of values to select from that dimension.
aws_dimension_select_regex | Optional. Which dimension values to filter on with a regular expression. Specify a map from the dimension name to a list of regexes that will be applied to select from that dimension.
aws_tag_select | Optional. A tag configuration to filter on, based on mapping from the tagged resource ID to a CloudWatch dimension.
tag_selections | Optional, under `aws_tag_select`. Specify a map from a tag key to a list of tag values to apply [tag filtering](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html#resourcegrouptagging-GetResources-request-TagFilters) on resources from which metrics will be gathered.
resource_type_selection | Required, under `aws_tag_select`. Specify the [resource type](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namesspaces) to filter on. `resource_type_selection` should be comprised as `service:resource_type`, as per the [resource group tagging API](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html#resourcegrouptagging-GetResources-request-TagFilters). Where `resource_type` could be an empty string, like in S3 case: `resource_type_selection: "s3:"`.
resource_id_dimension | Required, under `aws_tag_select`. For the current metric, specify which CloudWatch dimension maps to the ARN [resource ID](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-syntax).
aws_statistics | Optional. A list of statistics to retrieve, values can include Sum, SampleCount, Minimum, Maximum, Average. Defaults to all statistics unless extended statistics are requested.
aws_extended_statistics | Optional. A list of extended statistics to retrieve. Extended statistics currently include percentiles in the form `pN` or `pN.N`.
delay_seconds | Optional. The newest data to request. Used to avoid collecting data that has not fully converged. Defaults to 600s. Can be set globally and per metric.
range_seconds | Optional. How far back to request data for. Useful for cases such as Billing metrics that are only set every few hours. Defaults to 600s. Can be set globally and per metric.
period_seconds | Optional. [Period](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#CloudWatchPeriods) to request the metric for. Only the most recent data point is used. Defaults to 60s. Can be set globally and per metric.
set_timestamp | Optional. Boolean for whether to set the Prometheus metric timestamp as the original Cloudwatch timestamp. For some metrics which are updated very infrequently (such as S3/BucketSize), Prometheus may refuse to scrape them if this is set to true (see #100). Defaults to true. Can be set globally and per metric.
use_get_metric_data | Optional. Boolean (experimental) Use GetMetricData API to get metrics instead of GetMetricStatistics.
list_metrics_cache_ttl | Optional. Number of seconds to cache the result of calling the ListMetrics API. Defaults to 0 (no cache). Can be set globally and per metric.
warn_on_empty_list_dimensions | Optional. Boolean Emit warning if the exporter cannot determine what metrics to request

The above config will export time series such as
```
# HELP aws_elb_request_count_sum CloudWatch metric AWS/ELB RequestCount Dimensions: ["AvailabilityZone","LoadBalancerName"] Statistic: Sum Unit: Count
# TYPE aws_elb_request_count_sum gauge
aws_elb_request_count_sum{job="aws_elb",instance="",load_balancer_name="mylb",availability_zone="eu-west-1c",} 42.0
aws_elb_request_count_sum{job="aws_elb",instance="",load_balancer_name="myotherlb",availability_zone="eu-west-1c",} 7.0
```

If the `aws_tag_select` feature was used, an additional information metric will be exported for each AWS tagged resource matched by the resource type selection and tag selection (if specified), such as
```
# HELP aws_resource_info AWS information available for resource
# TYPE aws_resource_info gauge
aws_resource_info{job="aws_elb",instance="",arn="arn:aws:elasticloadbalancing:eu-west-1:121212121212:loadbalancer/mylb",load_balancer_name="mylb",tag_Monitoring="enabled",tag_MyOtherKey="MyOtherValue",} 1.0
```
aws_recource_info can be joined with other metrics using group_left in PromQL such as the following:
```
  aws_elb_request_count_sum
* on(load_balancer_name) group_left(tag_MyOtherKey)
  aws_resource_info
```
All metrics are exported as gauges.

In addition `cloudwatch_exporter_scrape_error` will be non-zero if an error
occurred during the scrape, and `cloudwatch_exporter_scrape_duration_seconds`
contains the duration of that scrape. `cloudwatch_exporter_build_info` contains
labels referencing the current build version and build release date.

### Build Info Metric

`cloudwatch_exporter_build_info` is a default cloudwatch exporter metric that contains the current
cloudwatch exporter version and release date as label values. The numeric metric value is statically
set to 1. If the metrics label values are "unknown" the build information scrap failed.

### CloudWatch doesn't always report data

Cloudwatch reports data either always or only in some cases, example only if there is a non-zero value. The CloudWatch Exporter mirrors this behavior, so you should refer to the Cloudwatch documentation to find out if your metric is always reported or not.

### Timestamps

CloudWatch has been observed to sometimes take minutes for reported values to converge. The
default `delay_seconds` will result in data that is at least 10 minutes old
being requested to mitigate this. The samples exposed will have the timestamps of the
data from CloudWatch, so usual staleness semantics will not apply and values will persist
for 5m for instant vectors.

In practice this means that if you evaluate an instant vector at the current
time, you will not see data from CloudWatch. An expression such as
`aws_elb_request_count_sum offset 10m` will allow you to access the data, and
should be used in recording rules and alerts.

For certain metrics which update relatively rarely, such as from S3,
`set_timestamp` should be configured to false so that they are not exposed with
a timestamp. This is as the true timestamp from CloudWatch could be so old that
Prometheus would reject the sample.

### Special handling for certain DynamoDB metrics

The DynamoDB metrics listed below break the usual CloudWatch data model.

 * ConsumedReadCapacityUnits
 * ConsumedWriteCapacityUnits
 * ProvisionedReadCapacityUnits
 * ProvisionedWriteCapacityUnits
 * ReadThrottleEvents
 * WriteThrottleEvents

When these metrics are requested in the TableName dimension CloudWatch will
return data only for the table itself, not for its Global Secondary Indexes.
Retrieving data for indexes requires requesting data across both the TableName
and GlobalSecondaryIndexName dimensions. This behaviour is different to that
of every other CloudWatch namespace and requires that the exporter handle these
metrics differently to avoid generating duplicate HELP and TYPE lines.

When exporting one of the problematic metrics for an index the exporter will use
a metric name in the format `aws_dynamodb_METRIC_index_STATISTIC` rather than
the usual `aws_dynamodb_METRIC_STATISTIC`. The regular naming scheme will still
be used when exporting these metrics for a table, and when exporting any other
DynamoDB metrics not listed above.

### Reloading Configuration

There are two ways to reload configuration:

1. Send a SIGHUP signal to the pid: `kill -HUP 1234`
2. POST to the `reload` endpoint: `curl -X POST localhost:9106/-/reload`

If an error occurs during the reload, check the exporter's log output.

### Cost

Amazon charges for every CloudWatch API request or for every Cloudwatch metric requested, see the [current charges](http://aws.amazon.com/cloudwatch/pricing/).

- In case of using `GetMetricStatistics` (default) - Every metric retrieved requires one API request, which can include multiple
statistics.
- In addition, when `aws_dimensions` is provided, the exporter needs to do API requests to determine what metrics to request. This should be negligible compared to the requests for the metrics themselves.

In the case that all `aws_dimensions` are provided in the `aws_dimension_select` list, the exporter will not perform the
above API request.  It will request all possible combination of values for those dimensions.
This will reduce cost as the values for the dimensions do not need to be queried anymore, assuming that all possible value combinations are present in CloudWatch.

If you have 100 API requests every minute, with the price of USD$10 per million
requests (as of Aug 2018), that is around $45 per month. The
`cloudwatch_requests_total` counter tracks how many requests are being made.

When using the `aws_tag_select` feature, additional requests are made to the Resource Groups Tagging API, but these are [free](https://aws.amazon.com/blogs/aws/new-aws-resource-tagging-api/).
The `tagging_api_requests_total` counter tracks how many requests are being made for these.

### Experimental GetMetricData
We are transitioning to use `GetMetricsData` instead of `GetMetricsStatistics`.
The benefits of using `GetMetricsData` is mainly around much better performence.

Please refer to [this doc](https://aws.amazon.com/premiumsupport/knowledge-center/cloudwatch-getmetricdata-api/) explaining why it is best practice to use `GetMetricData`

API | performence | Costs | Stability
--- |--- |--- |---
`GetMetricStatistics` | May be slow at scale | Charged per API request | stable. (Default option)
`GetMetricData` | Can retrieve data faster at scale | Charged per **metric** requested | New (opt-in via configuration)

#### Transition plan
At first this feature would be opt-in to allow you to decide when and how to test it
On later versions we would swap the default so everyone can enjoy the benefits.

Cloudwatch exporter also expose a new self metric called `cloudwatch_metrics_requested_total` that allows you to track number of requested metrics in addition to the number of API requests.

## Docker Images

To run the CloudWatch exporter on Docker, you can use the image from

* [prom/cloudwatch-exporter](https://hub.docker.com/r/prom/cloudwatch-exporter/)
* [quay.io/prometheus/cloudwatch-exporter](https://quay.io/repository/prometheus/cloudwatch-exporter)

The available tags are

* `main`: snapshot updated on every push to the main branch
* `latest`: the latest released version
* `vX.Y.Z`: the specific version X.Y.Z. Note that up to version 0.11.0, the format was `cloudwatch-exporter_X.Y.Z`.

The image exposes port 9106 and expects the config in `/config/config.yml`.
To configure it, you can bind-mount a config from your host:

```sh
docker run -p 9106 -v /path/on/host/config.yml:/config/config.yml quay.io/prometheus/cloudwatch-exporter
```

Specify the config as the CMD:

```sh
docker run -p 9106 -v /path/on/host/us-west-1.yml:/config/us-west-1.yml quay.io/prometheus/cloudwatch-exporter /config/us-west-1.yml
```

Or create a config file named `config.yml` along with following
Dockerfile in the same directory and build it with `docker build`:

```Dockerfile
FROM prom/cloudwatch-exporter
ADD config.yml /config/
```


text:
<?php

/**
 * CodePax
 *
 * LICENSE
 *
 * This source file is subject to the New BSD license that is bundled
 * with this package in the file LICENSE
 * It is also available through the world-wide-web at this URL:
 * http://www.codepax.com/license.html
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@codepax.com so we can send you a copy immediately.
 * */
/**
 * The main page of the app
 *
 * @category CodePax
 * @copyright Copyright (c) 2012 Zitec COM srl, Romania
 * @license New BSD http://www.codepax.com/license.html
 */
require '../application/bootstrap.php';

// initialize view object
$view = new CodePax_View();
$view->setViewsPath(VIEWS_PATH);
$view->setCurrentView('index');

try {
    $repo_wrapper = CodePax_Scm_Factory::Factory(VERSIONING);

    //--- execute some action: update, switch, etc
    if (!empty($_GET)) {
        $response_string = null;

        $switch_to_branch = isset($_GET['branch']) && strlen($_GET['branch']) > 1 && defined(
                        'SWITCH_TO_BRANCH'
                ) && SWITCH_TO_BRANCH === true;
        $switch_to_tag = isset($_GET['tag']) && strlen($_GET['tag']) > 1 && defined('SWITCH_TO_TAG')
            && SWITCH_TO_TAG === true;
        $switch_to_stable = isset($_GET['stable']) && defined('SWITCH_TO_TRUNK') && SWITCH_TO_TRUNK === true;

        $automate_operations = isset($_GET['automate_operations']) && defined('AUTOMATE_OPERATIONS')
            && AUTOMATE_OPERATIONS === true && APPLICATION_ENVIRONMENT === 'dev';

        //--- automated operations on switch to branch and staging

        if($automate_operations && ($switch_to_branch || $switch_to_stable || $switch_to_tag)) {
            $db_versioning_handler = CodePax_DbVersioning_Environments_Factory::factory(APPLICATION_ENVIRONMENT);
            $db_versioning_handler->generateTestData();
        }
        //--- switch to branch
        if ($switch_to_branch) {
            $response_string = $repo_wrapper->switchToBranch($_GET['branch']);
        }
        //--- switch to tag
        if ($switch_to_tag) {
            $response_string = $repo_wrapper->switchToTag($_GET['tag']);
        }
        //--- switch to stable
        if ($switch_to_stable) {
            $response_string = $repo_wrapper->switchToTrunk();
        }

        //--- switch to revision
        if (isset($_GET['revision_no']) && defined('SWITCH_TO_REVISION') && SWITCH_TO_REVISION === true) {
            $response_string = $repo_wrapper->switchToRevision($_GET['revision_no']);
        }
        if($automate_operations && ($switch_to_branch || $switch_to_stable || $switch_to_tag)) {
            // run the change scripts
            $db_versioning_handler = CodePax_DbVersioning_Environments_Factory::factory(APPLICATION_ENVIRONMENT);
            $db_scripts_result = $db_versioning_handler->runScripts(false);

            // unset some keys that are redundant on DEV
            unset($db_scripts_result['run_change_scripts'], $db_scripts_result['run_data_change_scripts']);
            $view->db_scripts_result = $db_scripts_result;
            $hooks_hanlder = new CodePax_Hooks_Handler();
            $available_hooks = $hooks_hanlder->getList();
            $hooks_hanlder->run($available_hooks);
            $view->hooks_output = $hooks_hanlder->getResults();
        }
        //--- run SVN cleanup
        if (isset($_GET['svncleanup']) && VERSIONING == 'SVN') {
            $response_string = $repo_wrapper->svnCleanup();
        }

        $view->response_string = array_filter(explode("\n", $response_string));

        //--- recreate object with new info
        $repo_wrapper = CodePax_Scm_Factory::Factory(VERSIONING);
    }
} catch (Exception $e) {
    $view->error_message = $e->getMessage();
    $view->render();
    exit();
}

$view->project_name = PROJECT_NAME;
$view->environment = APPLICATION_ENVIRONMENT;

$view->repo_info = $repo_wrapper->getRepoInfo();
$view->repo_top_info = $repo_wrapper->getRepoTopInfo();
$view->repo_more_info = $repo_wrapper->getRepoMoreInfo();
$view->revision_status = $repo_wrapper->getBranchStatus();

// repo current working copy
$view->current_position = $repo_wrapper->getCurrentPosition(); //$repo_wrapper->getCurrentPosition(); //FIXME
//--- show "switch to trunk" button
if (defined('SWITCH_TO_TRUNK') && SWITCH_TO_TRUNK === true) {
    $view->switch_to_trunk = true;
    $view->switch_to_trunk_button = SCM_STABLE_NAME;
}

//--- show/hide branches
if (defined('SWITCH_TO_BRANCH') && SWITCH_TO_BRANCH === true) {
    $view->active_branches = $repo_wrapper->getActiveBranches();
}

//--- show/hide tags
if (defined('SWITCH_TO_TAG') && SWITCH_TO_TAG === true) {
    $view->tags = $repo_wrapper->getTags();
}

//--- hide "switch to revision"
if (defined('SWITCH_TO_REVISION') && SWITCH_TO_REVISION === true) {
    $view->switch_to_revision = true;
}

if(defined('AUTOMATE_OPERATIONS') && AUTOMATE_OPERATIONS === true) {
    $view->automate_operations = true;
}

if (VERSIONING == 'SVN' &&
        !empty($response_string) &&
        is_numeric(
                strpos(
                        strtolower($response_string), "run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)"
                )
        )
) {
    $view->working_copy_locked = true;
}

//--- show HOOKS section
if (defined('USE_HOOKS')) {
    $view->use_hooks = USE_HOOKS;

    $hooks_hanlder = new CodePax_Hooks_Handler();
    $hooks = $hooks_hanlder->getList();
    $view->hooks = array_keys($hooks);
}

//--- show Db versioning section
if (defined('USE_DB_VERSIONING') && USE_DB_VERSIONING === true) {
    $view->use_db_versioning = true;
    try {
        // get current DB version
        $db_versions_model = CodePax_DbVersions::factory();
        if (in_array(APPLICATION_ENVIRONMENT, array('dev', 'prod'))) {
            $latest_baseline_file = CodePax_DbVersioning_Files_Manager::getLatestBaselineVersion();
            if (!$db_versions_model->checkIsVersionRegistred(
                            $latest_baseline_file, CodePax_DbVersions::TYPE_BASELINE
                    )
            ) {
                $db_versions_model->addVersion($latest_baseline_file, CodePax_DbVersions::TYPE_BASELINE);
            }
        }

        $latest_structure_version = $db_versions_model->getLatestVersion(CodePax_DbVersions::TYPE_CHANGE_SCRIPT);
        $latest_data_version = $db_versions_model->getLatestVersion(CodePax_DbVersions::TYPE_DATA_CHANGE_SCRIPT);

        $view->database_name = DB_NAME;
        $view->database_structure_version = $latest_structure_version[CodePax_DbVersions::VERSION_ATTRIBUTE];
        $view->database_structure_last_update = $latest_structure_version[CodePax_DbVersions::DATE_ADDED_ATTRIBUTE];
        $view->database_data_version = $latest_data_version[CodePax_DbVersions::VERSION_ATTRIBUTE];
        $view->database_data_last_update = !empty($latest_data_version[CodePax_DbVersions::DATE_ADDED_ATTRIBUTE]) ? $latest_data_version[CodePax_DbVersions::DATE_ADDED_ATTRIBUTE] : 'n/a';

        // get change scripts to run
        $db_versioning_handler = CodePax_DbVersioning_Environments_Factory::factory(APPLICATION_ENVIRONMENT);
        $change_scripts = $db_versioning_handler->getChangeScripts();
        $data_change_scripts = $db_versioning_handler->getDataChangeScripts();

        $new_baseline_available = false;
        if (in_array(APPLICATION_ENVIRONMENT, array('dev', 'prod'))) {
            $new_baseline_available = (version_compare(
                            $latest_structure_version[CodePax_DbVersions::VERSION_ATTRIBUTE], $db_versioning_handler->getLatestBaselineVersion()
                    ) == -1);
        }

        // database is up-to-date
        if (empty($change_scripts) && empty($data_change_scripts) && !$new_baseline_available) {
            $view->db_is_updated = true;
        } else {
            // data change scripts
            if (!empty($change_scripts)) {
                $view->db_scripts = array_keys($change_scripts);
            }

            // data change scripts
            if (!empty($data_change_scripts)) {
                $view->data_db_scripts = array_keys($data_change_scripts);
            }

            // when on DEV, show extra info
            if (APPLICATION_ENVIRONMENT == 'dev') {
                // `getLatestBaselineVersion` is available only for DEV
                $view->baseline_script = $db_versioning_handler->getLatestBaselineVersion();
                $view->db_versioning_dev_note = true;
            }
        }
    } catch (PDOException $pdo_e) {
        $view->error_message = $pdo_e->getMessage();
        $view->render();
        exit();
    }
}

try {
    $view->render();
} catch (CodepPax_View_Exception $e) {
    echo $e->getMessage();
    exit();
}


text:
package com.chariotsolutions.jshepard;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public class ExampleRepository implements ResultSets {
  private JdbcTemplate jdbcTemplate;

  private final RowMapper<Name> rowMapper = (rs, rowNum) -> new Name(
      rs.getInt(1),
      rs.getString(2),
      rs.getString(3),
      Optional.ofNullable(rs.getString(4)),
      convertTimestampToLocalDateTime(rs.getTimestamp(5))
  );

  public List<Name> getAllNames() {
    return jdbcTemplate.query("select * from name", rowMapper);
  }

  public List<String> getAllFirstNames() {
    return jdbcTemplate.query("select first_name from name", (rs, rowNum) -> rs.getString(1));
  }

  @Autowired
  public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
    this.jdbcTemplate = jdbcTemplate;
  }
}


text:
'use strict';

/* eslint-disable no-console */
var logger = {
  error: console.error.bind(console),
  info: console.info.bind(console),
  log: console.log.bind(console)
};
/* eslint-enable no-console */

module.exports = logger;


text:
//
//  DnnTrainerNesterov.hpp
//
//  Created by Barrett Davis on 9/13/16.
//  Copyright © 2016 Tree Frog Software. All rights reserved.
//

#ifndef DnnTrainerNesterov_hpp
#define DnnTrainerNesterov_hpp

#include "DnnTrainer.hpp"

namespace tfs {

    class DnnTrainerNesterov : public DnnTrainer {

    protected:
        virtual DNN_NUMERIC adjustWeights( void );

    public:
        DnnTrainerNesterov( Dnn *dnn );
        virtual ~DnnTrainerNesterov( void );

    };

}   // namespace tfs

#endif /* DnnTrainerNesterov_hpp */