text:
/** Texyed - Buttons module
 *
 * Pozor! Neaplikuje se na textareu, ale např. na toolbar
 * - $('#mytoolbar').teAddButton('Save', function() {...});
 *
 * @author		Jan Pecha, <janpecha@email.cz>
 * @license		see file license.md
 * @version		2012-11-20-1
 */

;(function($){
	$.extend($.fn, {
		teAddButton: function(title, handler, className) {
			var classes = '';

			if(typeof className !== 'undefined')
			{
				classes = className;
			}

			$('' + title + '')
				.on('click', handler)
				.appendTo(this);

			return this;
		}
	})
})(('Zepto' in window) ? Zepto : jQuery);


text:
<?xml version="1.0" encoding="utf-8"?>
  <!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
  <!--
    phpSysInfo language file Language: French Created by: Damien ROTH
  -->
<tns:translationPlugin language="french" charset="utf-8"
  xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
  <expression id="plugin_updatenotifier_001" name="updatenotifier_title">
    <exp>Updates Notifier</exp>
  </expression>
  <expression id="plugin_updatenotifier_002" name="updatenotifier_th">
    <exp>Mises à jour disponibles</exp>
  </expression>
  <expression id="plugin_updatenotifier_003" name="updatenotifier_packages">
    <exp>paquets peuvent être mit à jour.</exp>
  </expression>
  <expression id="plugin_updatenotifier_004" name="updatenotifier_security">
    <exp>mises à jour concernent la sécurité.</exp>
  </expression>
  <expression id="plugin_updatenotifier_005" name="updatenotifier_no">
    <exp>Pas de mises à jour disponibles</exp>
  </expression>
  <expression id="plugin_updatenotifier_006" name="updatenotifier_no_packages">
    <exp>Number of packages</exp>
  </expression>
  <expression id="plugin_updatenotifier_007" name="updatenotifier_no_security">
    <exp>Number of security packages</exp>
  </expression>
</tns:translationPlugin>

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Circle314\Component\ShutdownHandling;

interface ShutdownHandlingInterface
{
    public function handleShutdown();
}


text:
  {{title}}

Home
About
<router-outlet></router-outlet>


text:
http module
===========

.. toctree::
   :maxdepth: 5

http_utilities
--------------

.. automodule:: py_utilities.http.http_utilities
   :members:


text:
/**
 *
 */
package bl.mysqlbus;

import java.util.List;

import org.hibernate.Query;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import bl.beans.UserBean;
import bl.beans.UserGroupBean;
import bl.common.BeanContext;
import dao.MysqlHibernateDao;

/**
 * @author pli
 * @since $Date:2014-07-16$
 */
public class UserBusiness extends MysqlBusiness<BeanContext, UserBean> {
    private static Logger log = LoggerFactory.getLogger(UserBusiness.class);

    public UserBusiness() {
        this.cls = UserBean.class;
    }

    public List<UserGroupBean> getUserGroupBeans() {
        Query query = MysqlHibernateDao.currentSession().createQuery("from " + UserGroupBean.class.getSimpleName());
        List<UserGroupBean> list = query.list();
        MysqlHibernateDao.closeSession();
        return list;
    }
}


text:
title: Why Ruby, Why Rails?
description: How can something so old be good?
---

## An odd couple

## Why Ruby
### Practical reasons

## Why Rails
### Practical reasons
- Fairly stable releases
- Adoption
- Popularity
- Forward thinkingness fast adoption
- Convention
- Ruby is getting faster

## Conformity is Individuality

## Ruby is just the start


text:
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 *
 * @package PhpMyAdmin
 */

/**
 * no need for variables importing
 * @ignore
 */
if (! defined('PMA_NO_VARIABLES_IMPORT')) {
    define('PMA_NO_VARIABLES_IMPORT', true);
}
require_once './libraries/common.inc.php';

$GLOBALS['js_include'][] = 'server_variables.js';

PMA_AddJSVar('pma_token', $_SESSION[' PMA_token ']);
PMA_AddJSVar('url_query', str_replace('&', '&', PMA_generate_common_url($db)));
PMA_AddJSVar('is_superuser', PMA_isSuperuser() ? true : false);

/**
 * Does the common work
 */
require './libraries/server_common.inc.php';

/**
 * Required to display documentation links
 */
require './libraries/server_variables_doc.php';

/**
 * Ajax request
 */

if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
    // Send with correct charset
    header('Content-Type: text/html; charset=UTF-8');

    if (isset($_REQUEST['type'])) {
        switch($_REQUEST['type']) {
            case 'getval':
                $varValue = PMA_DBI_fetch_single_row('SHOW GLOBAL VARIABLES WHERE Variable_name="' . PMA_sqlAddslashes($_REQUEST['varName']) . '";', 'NUM');
                if (isset($VARIABLE_DOC_LINKS[$_REQUEST['varName']][3])
                    && $VARIABLE_DOC_LINKS[$_REQUEST['varName']][3] == 'byte') {
                    exit(implode(' ', PMA_formatByteDown($varValue[1], 3, 3)));
                }
                exit($varValue[1]);
                break;

            case 'setval':
                $value = $_REQUEST['varValue'];

                if (isset($VARIABLE_DOC_LINKS[$_REQUEST['varName']][3])
                   && $VARIABLE_DOC_LINKS[$_REQUEST['varName']][3] == 'byte'
                   && preg_match('/^\s*(\d+(\.\d+)?)\s*(mb|kb|mib|kib|gb|gib)\s*$/i', $value, $matches)) {
                    $exp = array('kb' => 1, 'kib' => 1, 'mb' => 2, 'mib' => 2, 'gb' => 3, 'gib' => 3);
                    $value = floatval($matches[1]) * pow(1024, $exp[strtolower($matches[3])]);
                } else {
                    $value = PMA_sqlAddslashes($value);
                }

                if (! is_numeric($value)) $value="'" . $value . "'";

                if (! preg_match("/[^a-zA-Z0-9_]+/", $_REQUEST['varName']) && PMA_DBI_query('SET GLOBAL ' . $_REQUEST['varName'] . ' = ' . $value)) {
                    // Some values are rounded down etc.
                    $varValue = PMA_DBI_fetch_single_row('SHOW GLOBAL VARIABLES WHERE Variable_name="' . PMA_sqlAddslashes($_REQUEST['varName']) . '";', 'NUM');

                    exit(json_encode(array(
                        'success' => true,
                        'variable' => formatVariable($_REQUEST['varName'], $varValue[1])
                        ))
                    );
                }

                exit(json_encode(array(
                    'success' => false,
                    'error' => __('Setting variable failed')
                    ))
                );
                break;
        }
    }
}

/**
 * Displays the links
 */
require './libraries/server_links.inc.php';

/**
 * Displays the sub-page heading
 */
echo '
' . "\n"
   . ($cfg['MainPageIconic'] ? PMA_getImage('s_vars.png') : '')
   . '' . __('Server variables and settings') . "\n"
   . PMA_showMySQLDocu('server_system_variables', 'server_system_variables')
   . '
' . "\n";

/**
 * Sends the queries and buffers the results
 */
$serverVarsSession = PMA_DBI_fetch_result('SHOW SESSION VARIABLES;', 0, 1);
$serverVars = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES;', 0, 1);

/**
 * Displays the page
 */
?>
<fieldset id="tableFilter" style="display:none;">
<legend><?php echo __('Filters'); ?></legend>

    <?php echo __('Containing the word:'); ?>
    <input name="filterText" type="text" id="filterText" style="vertical-align: baseline;" />

</fieldset>

<?php echo __('Variable'); ?>

<?php
echo __('Session value') . ' / ' . __('Global value');
?>

    <?php echo __('Documentation'); ?>

<?php
$odd_row = true;
foreach ($serverVars as $name => $value) {
    $has_session_value = isset($serverVarsSession[$name]) && $serverVarsSession[$name] != $value;
    $row_class = ($odd_row ? 'odd' : 'even') . ' ' . ($has_session_value ? 'diffSession' : '');
    ?>
<tr class="<?php echo $row_class; ?>">
    <?php echo htmlspecialchars(str_replace('_', ' ', $name)); ?>
    <?php echo formatVariable($name, $value); ?>
    <?php
    // To display variable documentation link
    if (isset($VARIABLE_DOC_LINKS[$name]))
        echo PMA_showMySQLDocu($VARIABLE_DOC_LINKS[$name][1], $VARIABLE_DOC_LINKS[$name][1], false, $VARIABLE_DOC_LINKS[$name][2] . '_' . $VARIABLE_DOC_LINKS[$name][0]);
    ?>
    <?php
    if ($has_session_value) {
        ?>

<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?> ">
    (<?php echo __('Session value'); ?>)
    <?php echo formatVariable($name, $serverVarsSession[$name]); ?>

    <?php } ?>

    <?php
    $odd_row = ! $odd_row;
}
?>

<?php

function formatVariable($name, $value)
{
    global $VARIABLE_DOC_LINKS;

    if (is_numeric($value)) {
        if (isset($VARIABLE_DOC_LINKS[$name][3]) && $VARIABLE_DOC_LINKS[$name][3]=='byte')
            return ''.implode(' ', PMA_formatByteDown($value, 3, 3)).'';
        else return PMA_formatNumber($value, 0);
    }
    return htmlspecialchars($value);
}

/**
 * Sends the footer
 */
require './libraries/footer.inc.php';

?>


text:
package org.apache.oozie.command.coord;

import java.io.IOException;
import java.io.StringReader;
import java.net.HttpURLConnection;
import java.net.URL;

import org.apache.hadoop.conf.Configuration;
import org.apache.oozie.CoordinatorActionBean;
import org.apache.oozie.ErrorCode;
import org.apache.oozie.client.OozieClient;
import org.apache.oozie.command.CommandException;
import org.apache.oozie.command.PreconditionException;
import org.apache.oozie.util.LogUtils;
import org.apache.oozie.util.ParamChecker;
import org.apache.oozie.util.XConfiguration;
import org.apache.oozie.util.XLog;

/**
 * This class will send the notification for the coordinator action
 */
public class CoordActionNotificationXCommand extends CoordinatorXCommand<Void> {

    private final CoordinatorActionBean actionBean;
    private static final String STATUS_PATTERN = "\\$status";
    private static final String ACTION_ID_PATTERN = "\\$actionId";

    private int retries = 0;

    public CoordActionNotificationXCommand(CoordinatorActionBean actionBean) {
        super("coord_action_notification", "coord_action_notification", 0);
        ParamChecker.notNull(actionBean, "Action Bean");
        this.actionBean = actionBean;
    }

    /* (non-Javadoc)
     * @see org.apache.oozie.command.XCommand#execute()
     */
    @Override
    protected Void execute() throws CommandException {
        LOG.info("STARTED Coordinator Notification actionId=" + actionBean.getId() + " : " + actionBean.getStatus());
        Configuration conf;
        try {
            conf = new XConfiguration(new StringReader(actionBean.getRunConf()));
        }
        catch (IOException e1) {
            LOG.warn("Configuration parse error. read from DB :" + actionBean.getRunConf());
            throw new CommandException(ErrorCode.E1005, e1.getMessage(), e1);
        }
        String url = conf.get(OozieClient.COORD_ACTION_NOTIFICATION_URL);
        if (url != null) {
            url = url.replaceAll(ACTION_ID_PATTERN, actionBean.getId());
            url = url.replaceAll(STATUS_PATTERN, actionBean.getStatus().toString());
            LOG.debug("Notification URL :" + url);
            try {
                URL urlObj = new URL(url);
                HttpURLConnection urlConn = (HttpURLConnection) urlObj.openConnection();
                if (urlConn.getResponseCode() != HttpURLConnection.HTTP_OK) {
                    handleRetry(url);
                }
            }
            catch (IOException ex) {
                handleRetry(url);
            }
        }
        else {
            LOG.info("No Notification URL is defined. Therefore nothing to notify for job " + actionBean.getJobId()
                    + " action ID " + actionBean.getId());
        }
        LOG.info("ENDED Coordinator Notification actionId=" + actionBean.getId());
        return null;
    }

    /**
     * This method handles the retry for the coordinator action.
     *
     * @param url This is the URL where the notification has to be sent.
     */
    private void handleRetry(String url) {
        if (retries < 3) {
            retries++;
            this.resetUsed();
            queue(this, 60 * 1000);
        }
        else {
            LOG.warn(XLog.OPS, "could not send notification [{0}]", url);
        }
    }

    /* (non-Javadoc)
     * @see org.apache.oozie.command.XCommand#getEntityKey()
     */
    @Override
    protected String getEntityKey() {
        return actionBean.getId();
    }

    /* (non-Javadoc)
     * @see org.apache.oozie.command.XCommand#isLockRequired()
     */
    @Override
    protected boolean isLockRequired() {
        return false;
    }

    /* (non-Javadoc)
     * @see org.apache.oozie.command.XCommand#loadState()
     */
    @Override
    protected void loadState() throws CommandException {
        LogUtils.setLogInfo(actionBean, logInfo);
    }

    /* (non-Javadoc)
     * @see org.apache.oozie.command.XCommand#verifyPrecondition()
     */
    @Override
    protected void verifyPrecondition() throws CommandException, PreconditionException {
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>nl.paulinternet.gtasaveedit</groupId>
    <artifactId>gtasaveedit</artifactId>
    <version>3.3.0-SNAPSHOT</version>

    <packaging>pom</packaging>

    <name>GTA:SA Savegame Editor</name>
    <url>http://paulinternet.nl/?page=sa</url>

    <organization>
        <name>${project.name} Contributors</name>
        <url>http://paulinternet.nl/?page=sa</url>
    </organization>

    <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <libsavegame.version>1.0.2</libsavegame.version>
    </properties>

    <modules>
        <module>savegame-editor</module>
        <module>cli</module>
    </modules>

    <licenses>
        <license>
            <name>MIT</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>timestamp-property</id>
                        <goals>
                            <goal>timestamp-property</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <name>current.year</name>
                            <pattern>yyyy</pattern>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>4.0.4</version>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                        <phase>initialize</phase>
                    </execution>
                </executions>
                <configuration>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
                    <includeOnlyProperties>
                        <!--includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty-->
                        <includeOnlyProperty>git.branch</includeOnlyProperty>
                        <includeOnlyProperty>git.commit.id.abbrev</includeOnlyProperty>
                        <includeOnlyProperty>git.tags</includeOnlyProperty>
                    </includeOnlyProperties>
                    <commitIdGenerationMode>full</commitIdGenerationMode>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
    </repositories>

</project>


text: I announce the event of a test case finished running.


text:
module Selling
  module PaymentTypeHelper
  end
end


text:
<?php

require_once 'PHPUnit/Util/Filter.php';

PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');

if (! interface_exists('PHPUnit_Framework_SkippedTest', FALSE)) {

  /**
   * A marker interface for marking a unit test as being skipped.
   *
   * @category   Testing
   * @package    PHPUnit
   * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
   * @copyright  2002-2008 Sebastian Bergmann <sb@sebastian-bergmann.de>
   * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
   * @version    Release: 3.2.9
   * @link       http://www.phpunit.de/
   * @since      Interface available since Release 3.0.0
   */
  interface PHPUnit_Framework_SkippedTest {
  }

}
?>


text:
@doc """
# Description

Parse an integer from a sequence of bytes.

# Arguments

* `bytes::Vector{Uint8}`: A sequence of bytes

# Returns

* `value::Int`
* `success::Bool`
""" ->
function print_error(i::Int, j::Int, reader::CSVReader)
    # TODO: Reconstruct the input row along w/ type inference results
    # Saw: 1,1.0,foo,false,NULL
    # Expected: Int,Float64,Bool,Bool
    error(
        @sprintf(
            "Parsing failed at row %d, col %d while reading this text:\n\"\"\"%s\"\"\"\n",
            i,
            j,
            bytestring(reader.main),
        )
    )
end

@doc """
# Description

Parse an integer from a sequence of bytes.

# Arguments

* `bytes::Vector{Uint8}`: A sequence of bytes

# Returns

* `value::Int`
* `success::Bool`
""" ->
function readnrows(
    io::IO,
    reader::CSVReader,
    output::Any,
    max_rows::Integer = typemax(Int),
    output_i::Integer = 1,
)
    if !isempty(reader.skip_rows)
        skip_row_idx = 1
        skip_row = reader.skip_rows[skip_row_idx]
    else
        skip_row_idx = 0
        skip_row = 0
    end

    input_i = 0
    output_i -= 1
    nrows = available_rows(output, reader)
    ncols = length(reader.column_types)
    while !eof(io) && input_i < max_rows
        input_i += 1
        output_i += 1

        # Allocate space for more rows if necessary
        if output_i > nrows
            add_rows!(output, ceil(Integer, 1.5 * output_i), ncols)
            nrows = available_rows(output, reader)
        end

        # Handle skip rows
        while input_i == skip_row
            skiprow(io, reader)
            skip_row_idx += 1
            if skip_row_idx <= length(reader.skip_rows)
                skip_row = reader.skip_rows[skip_row_idx]
            else
                skip_row = 0
            end
            input_i += 1
        end

        # Attempt to read the first column
        j = 1
        readfield(io, reader, reader.column_types[j])
        if ncols > 1 && reader.eor
            if !isempty(reader.main)
                print_error(input_i, j, reader)
            end
            if reader.allow_comments && reader.contained_comment
                output_i -= 1
                continue
            end
            if reader.skip_blanks && !reader.contained_comment && !reader.contained_quote
                output_i -= 1
                continue
            end
        end
        store_field!(output, output_i, j, reader)

        # Move on if the data source only has one column per row
        if ncols == 1
            continue
        end

        # Read intermediate columns between first column and last column
        for j in 2:(ncols - 1)
            readfield(io, reader, reader.column_types[j])
            if reader.eor
                print_error(input_i, j, reader)
            end
            store_field!(output, output_i, j, reader)
        end

        # Read final column
        j = ncols
        readfield(io, reader, reader.column_types[j])
        if !reader.eor
            print_error(input_i, j, reader)
        end
        store_field!(output, output_i, j, reader)
    end

    return finalize(output, output_i, ncols)
end


text:
namespace blink {

class ComputedStyle;
class NGInlineBreakToken;
class NGLogicalLineItems;

class CORE_EXPORT NGLineBoxFragmentBuilder final
    : public NGContainerFragmentBuilder {
  STACK_ALLOCATED();

 public:
  NGLineBoxFragmentBuilder(NGInlineNode node,
                           scoped_refptr<const ComputedStyle> style,
                           const NGConstraintSpace& space,
                           WritingDirectionMode writing_direction)
      : NGContainerFragmentBuilder(
            node,
            style,
            space,
            // Always use LTR because line items are in visual order.
            {writing_direction.GetWritingMode(), TextDirection::kLtr}),
        line_box_type_(NGPhysicalLineBoxFragment::kNormalLineBox),
        base_direction_(TextDirection::kLtr) {}
  NGLineBoxFragmentBuilder(const NGLineBoxFragmentBuilder&) = delete;
  NGLineBoxFragmentBuilder& operator=(const NGLineBoxFragmentBuilder&) = delete;

  void Reset();

  LayoutUnit LineHeight() const {
    return metrics_.LineHeight().ClampNegativeToZero();
  }

  void SetInlineSize(LayoutUnit inline_size) {
    size_.inline_size = inline_size;
  }

  void SetHangInlineSize(LayoutUnit hang_inline_size) {
    hang_inline_size_ = hang_inline_size;
  }

  // Mark this line box is an "empty" line box. See NGLineBoxType.
  void SetIsEmptyLineBox();

  absl::optional<LayoutUnit> LineBoxBfcBlockOffset() const {
    return line_box_bfc_block_offset_;
  }
  void SetLineBoxBfcBlockOffset(LayoutUnit offset) {
    DCHECK(bfc_block_offset_);
    line_box_bfc_block_offset_ = offset;
  }

  void SetAnnotationBlockOffsetAdjustment(LayoutUnit adjustment) {
    annotation_block_offset_adjustment_ = adjustment;
  }

  const FontHeight& Metrics() const { return metrics_; }
  void SetMetrics(const FontHeight& metrics) { metrics_ = metrics; }

  void SetBaseDirection(TextDirection direction) {
    base_direction_ = direction;
  }

  // Set the break token for the fragment to build.
  // Is nullptr if we didn't break.
  void SetBreakToken(const NGInlineBreakToken* break_token) {
    break_token_ = break_token;
  }

  // Propagate data in |ChildList| without adding them to this builder. When
  // adding children as fragment items, they appear in the container, but there
  // are some data that should be propagated through line box fragments.
  void PropagateChildrenData(NGLogicalLineItems&);

  void SetClearanceAfterLine(LayoutUnit clearance) {
    clearance_after_line_ = clearance;
  }

  // Creates the fragment. Can only be called once.
  const NGLayoutResult* ToLineBoxFragment();

 private:
  absl::optional<LayoutUnit> line_box_bfc_block_offset_;
  LayoutUnit annotation_block_offset_adjustment_;
  FontHeight metrics_ = FontHeight::Empty();
  LayoutUnit hang_inline_size_;
  LayoutUnit clearance_after_line_;
  NGPhysicalLineBoxFragment::NGLineBoxType line_box_type_;
  TextDirection base_direction_;

  friend class NGLayoutResult;
  friend class NGPhysicalLineBoxFragment;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_INLINE_NG_LINE_BOX_FRAGMENT_BUILDER_H_


text: A BroLevelStatisticsItem is used for displaying a specific game related information.


text:
require "active_support/inflector"
require "creamerscript/sweeteners"
require "creamerscript/sweeteners/base"
require "creamerscript/sweeteners/array"
require "creamerscript/sweeteners/js_argument_list"
require "creamerscript/sweeteners/method_definition"
require "creamerscript/sweeteners/method_invocation"
require "creamerscript/sweeteners/object"
require "creamerscript/sweeteners/string"
require "creamerscript/sweeteners/block"

module Creamerscript
  module Sweeteners
    def self.register(sweetener)
      sweetener.new.tap { |s| sweeteners[s.type] = s }
    end

    def self.each
      sweeteners.each { |type, sweetener| yield sweetener }
    end

    def self.for(type)
      sweeteners[type]
    end

    def self.sweeteners
      @sweeteners ||= {}
    end
  end
end

Creamerscript::Sweeteners.register(Creamerscript::Sweeteners::String)
Creamerscript::Sweeteners.register(Creamerscript::Sweeteners::Object)
Creamerscript::Sweeteners.register(Creamerscript::Sweeteners::Array)
Creamerscript::Sweeteners.register(Creamerscript::Sweeteners::JSArgumentList)
Creamerscript::Sweeteners.register(Creamerscript::Sweeteners::Block)
Creamerscript::Sweeteners.register(Creamerscript::Sweeteners::MethodInvocation)
Creamerscript::Sweeteners.register(Creamerscript::Sweeteners::MethodDefinition)


text:
@interface FriendNavViewController : UINavigationController

@end


text:
// MIT License
//
// Copyright (c) 2017 Kyle Kingsbury
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace Sitecore.Foundation.CDN.Media
{
    using System;
    using Data.Items;
    using Domain;
    using Resources.Media;

    public class CdnMediaProvider : MediaProvider
    {
        /// <summary>
        ///     The Cdn Settings
        /// </summary>
        private readonly ICdnSettings cdnSettings;

        public CdnMediaProvider(ICdnSettings cdnSettings)
        {
            this.cdnSettings = cdnSettings;
        }

        /// <summary>
        ///     Overrides the <see cref="MediaProvider" /> and investigates if the Cdn Target Database is the current
        ///     database, if not removes the cdn prefix
        /// </summary>
        /// <param name="item">The item</param>
        /// <param name="options">The options</param>
        /// <returns>The Media Url</returns>
        public override string GetMediaUrl(MediaItem item, MediaUrlOptions options)
        {
            if (this.cdnSettings.Enabled
                && item.Database.Name != this.cdnSettings.TargetDatabase
                && options.AlwaysIncludeServerUrl
                && !String.IsNullOrEmpty(options.MediaLinkServerUrl))
            {
                options.AlwaysIncludeServerUrl = false;
            }

            return base.GetMediaUrl(item, options);
        }
    }
}


text:
package org.zaproxy.zap.extension.ascanrulesBeta;

import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat;

import org.junit.Test;
import org.parosproxy.paros.network.HttpMessage;
import org.zaproxy.zap.model.Tech;
import org.zaproxy.zap.model.TechSet;

/** Unit test for {@link IntegerOverflow}. */
public class IntegerOverflowUnitTest extends ActiveScannerTest<IntegerOverflow> {

    @Override
    protected IntegerOverflow createScanner() {
        return new IntegerOverflow();
    }

    @Test
    public void shouldTargetCTech() {
        // Given
        TechSet techSet = techSet(Tech.C);
        // When
        boolean targets = rule.targets(techSet);
        // Then
        assertThat(targets, is(equalTo(true)));
    }

    @Test
    public void shouldNotTargetNonCTechs() {
        // Given
        TechSet techSet = techSetWithout(Tech.C);
        // When
        boolean targets = rule.targets(techSet);
        // Then
        assertThat(targets, is(equalTo(false)));
    }

    @Test
    public void shouldSkipScanning500ErrorMessage() throws Exception {
        // Given
        HttpMessage message = getHttpMessage("?param=value");
        message.setResponseHeader(
                "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n");
        rule.init(message, parent);
        // When
        rule.scan();
        // Then
        assertThat(httpMessagesSent, is(empty()));
    }

    @Test
    public void shouldScanNon500ErrorMessage() throws Exception {
        // Given
        rule.init(getHttpMessage("?param=value"), parent);
        // When
        rule.scan();
        // Then
        assertThat(httpMessagesSent, is(not(empty())));
    }

    @Test
    public void shouldSkipScanIfStopped() throws Exception {
        // Given
        rule.init(getHttpMessage("?param=value"), parent);
        parent.stop();
        // When
        rule.scan();
        // Then
        assertThat(httpMessagesSent, is(empty()));
    }
}


text:
<?php

namespace Pion\Laravel\ChunkUpload\Exceptions;

class ChunkSaveException extends \Exception
{
}


text:
from __future__ import division, print_function

__all__ = ["izip", "imap", "iteritems", "xrange"]

try:
    from itertools import izip, imap

except ImportError:
    izip = zip
    imap = map

    def iteritems(d):
        return d.items()

else:
    def iteritems(d):
        return d.iteritems()

try:
    xrange = xrange
except NameError:
    xrange = range


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SACOI.Constants;
using MySql.Data.MySqlClient;

namespace SACOI.Classes
{
    class Notificacoes
    {
        public static Boolean criarNotificacao(string _nome_user, string _notificacao)
        {
            string query = "INSERT INTO " + NotificacaoConstants.GetTBNotificacoes() + "(id, id_user, notificacao) VALUES((MID(UUID(),1,32)), (SELECT id FROM sacoi.usuario WHERE nome_user = '"  + _nome_user + "'), '" + _notificacao + "');";
            MySqlConnection conn = new MySqlConnection(ConnectionConstants.GetConnection());
            MySqlCommand command = new MySqlCommand(query, conn);
            MySqlDataReader reader;
            conn.Open();
            try
            {
                reader = command.ExecuteReader();
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
            finally
            {
                conn.Close();
            }
        }
    }
}


text:
//
//  UAEC2DescribeAccountAttributesRequest.m
//  AWS iOS SDK
//
//  Copyright © Unsigned Apps 2014. See License file.
//  Created by Rob Amos.
//
//

#import "UAEC2DescribeAccountAttributesRequest.h"
#import "UAAWSAdditionalAccessors.h"
#import "UAEC2DescribeAccountAttributesResponse.h"

@interface UAEC2DescribeAccountAttributesRequest ()

@property (nonatomic, copy) NSString *action;
@property (nonatomic, copy) NSString *version;

@end

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wincomplete-implementation"

@implementation UAEC2DescribeAccountAttributesRequest

@synthesize action=_action, version=_version, dryRun=_dryRun, attributeNames=_attributeNames;

- (id)init
{
	if (self = [super init])
	{
		[self setAction:@"DescribeAccountAttributes"];
		[self setVersion:@"2014-05-01"];

		[self UA_addAtIndexAdditionalAccessorForSelector:@selector(attributeNameAtIndex:) propertyName:@"attributeNames"];
		[self UA_addAddObjectAdditionalAccessorForSelector:@selector(addAttributeName:) propertyName:@"attributeNames"];
	}
	return self;
}

- (Class)UA_ResponseClass
{
	return [UAEC2DescribeAccountAttributesResponse class];
}

+ (NSDictionary *)queryStringKeyPathsByPropertyKey
{
    // Start with super's key paths (if there are any)
    NSMutableDictionary *keyPaths = [[UAEC2Request queryStringKeyPathsByPropertyKey] mutableCopy];

    [keyPaths addEntriesFromDictionary:
    @{
        @"action": @"Action",
        @"version": @"Version",
        @"dryRun": @"DryRun",
        @"attributeNames": @"AttributeName"
    }];
    return [keyPaths copy];
}

+ (NSValueTransformer *)dryRunQueryStringTransformer
{
    return [UAMTLValueTransformer UA_JSONTransformerForBooleanString];
}

/*#pragma mark - Invocation

- (void)invokeWithOwner:(id)owner completionBlock:(UAEC2DescribeAccountAttributesRequestCompletionBlock)completionBlock
{
    [self setUA_Owner:owner];
    [self setUA_RequestCompletionBlock:completionBlock];
    [self invoke];
}

- (void)waitWithOwner:(id)owner shouldContinueWaitingBlock:(UAEC2DescribeAccountAttributesRequestShouldContinueWaitingBlock)shouldContinueWaitingBlock completionBlock:(UAEC2DescribeAccountAttributesRequestCompletionBlock)completionBlock
{
    [self setUA_Owner:owner];
    [self setUA_ShouldContinueWaiting:shouldContinueWaitingBlock];
    [self setUA_RequestCompletionBlock:completionBlock];
    [self invoke];
}

- (void)waitWithOwner:(id)owner untilValueAtKeyPath:(NSString *)keyPath isInArray:(NSArray *)array completionBlock:(UAEC2DescribeAccountAttributesRequestCompletionBlock)completionBlock
{
    [self setUA_Owner:self];
    [self setUA_ShouldContinueWaiting:[UAAWSRequest UA_ShouldContinueWaitingBlockUntilValueAtKeyPath:keyPath isInArray:array]];
    [self setUA_RequestCompletionBlock:completionBlock];
    [self invoke];
}
*/
@end

#pragma clang diagnostic pop


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

#if FEATURE_PROCESS

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
using System.Text;
using System.Runtime.InteropServices;

using IronPython.Runtime;
using IronPython.Runtime.Exceptions;
using IronPython.Runtime.Operations;

[assembly: PythonModule("_subprocess", typeof(IronPython.Modules.PythonSubprocess), PlatformsAttribute.PlatformFamily.Windows)]
namespace IronPython.Modules {
    [PythonType("_subprocess")]
    public static class PythonSubprocess {
        public const string __doc__ = "_subprocess Module";

        #region Public API

        public static PythonTuple CreatePipe(
            CodeContext context,
            object pSec /*Python passes None*/,
            int bufferSize) {
            IntPtr hReadPipe;
            IntPtr hWritePipe;

            SECURITY_ATTRIBUTES pSecA = new SECURITY_ATTRIBUTES();
            pSecA.nLength = Marshal.SizeOf(pSecA);
            if (pSec != null) {
                /* If pSec paseed in from Python is not NULL
                 * there needs to be some conversion done here...*/
            }

            // TODO: handle failures
            CreatePipePI(
                out hReadPipe,
                out hWritePipe,
                ref pSecA,
                (uint)bufferSize);

            return PythonTuple.MakeTuple(
                new PythonSubprocessHandle(hReadPipe),
                new PythonSubprocessHandle(hWritePipe)
            );
        }

        private static string FormatError(int errorCode) {
            return new Win32Exception(errorCode).Message;
        }

        public static PythonTuple CreateProcess(
            CodeContext context,
            string applicationName,
            string commandLineArgs,
            object pSec /*subprocess.py passes None*/,
            object tSec /*subprocess.py passes None*/,
            int? bInheritHandles,
            uint? dwCreationFlags,
            object lpEnvironment,
            string lpCurrentDirectory,
            object lpStartupInfo /* subprocess.py passes STARTUPINFO*/) {

            object dwFlags = PythonOps.GetBoundAttr(context, lpStartupInfo, "dwFlags"); //public Int32 dwFlags;
            object hStdInput = PythonOps.GetBoundAttr(context, lpStartupInfo, "hStdInput"); //public IntPtr hStdInput;
            object hStdOutput = PythonOps.GetBoundAttr(context, lpStartupInfo, "hStdOutput"); //public IntPtr hStdOutput;
            object hStdError = PythonOps.GetBoundAttr(context, lpStartupInfo, "hStdError"); //public IntPtr hStdError;
            object wShowWindow = PythonOps.GetBoundAttr(context, lpStartupInfo, "wShowWindow"); //Int16 wShowWindow;

            Int32 dwFlagsInt32 = dwFlags != null ? Converter.ConvertToInt32(dwFlags) : 0;
            IntPtr hStdInputIntPtr = hStdInput != null ? new IntPtr(Converter.ConvertToInt32(hStdInput)) : IntPtr.Zero;
            IntPtr hStdOutputIntPtr = hStdOutput != null ? new IntPtr(Converter.ConvertToInt32(hStdOutput)) : IntPtr.Zero;
            IntPtr hStdErrorIntPtr = hStdError != null ? new IntPtr(Converter.ConvertToInt32(hStdError)) : IntPtr.Zero;
            Int16 wShowWindowInt16 = wShowWindow != null ? Converter.ConvertToInt16(wShowWindow) : (short)0;

            STARTUPINFO startupInfo = new STARTUPINFO();
            startupInfo.dwFlags = dwFlagsInt32;
            startupInfo.hStdInput = hStdInputIntPtr;
            startupInfo.hStdOutput = hStdOutputIntPtr;
            startupInfo.hStdError = hStdErrorIntPtr;
            startupInfo.wShowWindow = wShowWindowInt16;

            // No special security
            SECURITY_ATTRIBUTES pSecSA = new SECURITY_ATTRIBUTES();
            pSecSA.nLength = Marshal.SizeOf(pSecSA);

            SECURITY_ATTRIBUTES tSecSA = new SECURITY_ATTRIBUTES();
            tSecSA.nLength = Marshal.SizeOf(tSecSA);

            if (pSec != null) {
                /* If pSec paseed in from Python is not NULL
                 * there needs to be some conversion done here...*/
            }
            if (tSec != null) {
                /* If tSec paseed in from Python is not NULL
                 * there needs to be some conversion done here...*/
            }

            // If needed convert lpEnvironment Dictionary to lpEnvironmentIntPtr
            string lpEnvironmentStr = EnvironmentToNative(context, lpEnvironment);

            PROCESS_INFORMATION lpProcessInformation = new PROCESS_INFORMATION();
            bool result = CreateProcessPI(
                String.IsNullOrEmpty(applicationName) ? null : applicationName/*applicationNameHelper*//*processStartInfo.FileName*/,
                String.IsNullOrEmpty(commandLineArgs) ? null : commandLineArgs/*commandLineArgsHelper*//*processStartInfo.Arguments*/,
                ref pSecSA, ref tSecSA,
                bInheritHandles.HasValue && bInheritHandles.Value > 0 ? true : false,
                dwCreationFlags.HasValue ? dwCreationFlags.Value : 0,
                lpEnvironmentStr,
                lpCurrentDirectory,
                ref startupInfo,
                out lpProcessInformation);

            if (!result) {
                int error = Marshal.GetLastWin32Error();
                throw PythonExceptions.CreateThrowable(PythonExceptions.WindowsError, error, FormatError(error));
            }

            IntPtr hp = lpProcessInformation.hProcess;
            IntPtr ht = lpProcessInformation.hThread;
            int pid = lpProcessInformation.dwProcessId;
            int tid = lpProcessInformation.dwThreadId;

            return PythonTuple.MakeTuple(
                new PythonSubprocessHandle(hp, true),
                new PythonSubprocessHandle(ht),
                pid, tid);
        }

        private static string EnvironmentToNative(CodeContext context, object environment) {
            if (environment == null) {
                return null;
            }
            var dict = environment as PythonDictionary ?? new PythonDictionary(context, environment);
            var res = new StringBuilder();
            foreach (var keyValue in dict) {
                res.Append(keyValue.Key);
                res.Append('=');
                res.Append(keyValue.Value);
                res.Append('\0');
            }
            return res.ToString();
        }

        /// <summary>
        /// Duplicates a subprocess handle which was created for piping.
        ///
        /// This is only called when we're duplicating the handle to make it inheritable to the child process.  In CPython
        /// the parent handle is always reliably garbage collected.  Because we know this handle is not going to be
        /// used we close the handle being duplicated.
        /// </summary>
        public static PythonSubprocessHandle DuplicateHandle(CodeContext context,
            BigInteger sourceProcess,
            PythonSubprocessHandle handle,
            BigInteger targetProcess,
            int desiredAccess,
            bool inherit_handle,
            object DUPLICATE_SAME_ACCESS) {

            if (handle._duplicated) {
                // more ref counting issues - when stderr is set to subprocess.STDOUT we can't close the target handle so we need
                // to track this situation.
                return DuplicateHandle(context, sourceProcess, (BigInteger)handle, targetProcess, desiredAccess, inherit_handle, DUPLICATE_SAME_ACCESS);
            }

            var res = DuplicateHandle(context, sourceProcess, (BigInteger)handle, targetProcess, desiredAccess, inherit_handle, DUPLICATE_SAME_ACCESS);
            res._duplicated = true;
            handle.Close();
            return res;
        }

        public static PythonSubprocessHandle DuplicateHandle(
            CodeContext context,
            BigInteger sourceProcess,
            BigInteger handle,
            BigInteger targetProcess,
            int desiredAccess,
            bool inherit_handle,
            object DUPLICATE_SAME_ACCESS) {

            IntPtr currentProcessIntPtr = new IntPtr((long)sourceProcess);
            IntPtr handleIntPtr = new IntPtr((long)handle);
            IntPtr currentProcess2IntPtr = new IntPtr((long)targetProcess);

            IntPtr lpTargetHandle;
            bool sameAccess = DUPLICATE_SAME_ACCESS != null && Converter.ConvertToBoolean(DUPLICATE_SAME_ACCESS);

            // TODO: handle failures
            DuplicateHandlePI(
                currentProcessIntPtr,
                handleIntPtr,
                currentProcess2IntPtr,
                out lpTargetHandle,
                Converter.ConvertToUInt32(desiredAccess),
                inherit_handle,
                sameAccess ? (uint)DuplicateOptions.DUPLICATE_SAME_ACCESS : (uint)DuplicateOptions.DUPLICATE_CLOSE_SOURCE
            );

            return new PythonSubprocessHandle(lpTargetHandle); //Converter.ConvertToBigInteger( lpTargetHandle.ToInt32());
        }

        public static PythonSubprocessHandle GetCurrentProcess() {
            IntPtr id = GetCurrentProcessPI();
            return new PythonSubprocessHandle(id);
        }

        public static int GetExitCodeProcess(PythonSubprocessHandle hProcess) {
            if (hProcess._isProcess && hProcess._closed) {
                // deal with finalization & resurrection oddness...  see PythonSubprocessHandle finalizer
                return hProcess._exitCode;
            }

            IntPtr hProcessIntPtr = new IntPtr(Converter.ConvertToInt32(hProcess));
            int exitCode = int.MinValue;
            GetExitCodeProcessPI(hProcessIntPtr, out exitCode);
            return exitCode;
        }

        public static string GetModuleFileName(object ignored) {
            // Alternative Managed API: System.Diagnostics.ProcessModule.FileName or System.Reflection.Module.FullyQualifiedName.
            return System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
        }

        public static object GetStdHandle(int STD_OUTPUT_HANDLE) {
            return GetStdHandlePI(STD_OUTPUT_HANDLE).ToPython();
        }

        public static int GetVersion() {
            return GetVersionPI();
        }

        public static bool TerminateProcess(
            PythonSubprocessHandle handle,
            object uExitCode) {

            // Alternative Managed API: System.Diagnostics.Process.Kill()
            IntPtr hProcessIntPtr = new IntPtr(Converter.ConvertToInt32(handle));
            uint uExitCodeUint = Converter.ConvertToUInt32(uExitCode);
            bool result = TerminateProcessPI(
                hProcessIntPtr,
                uExitCodeUint);

            return result;
        }

        public static int WaitForSingleObject(PythonSubprocessHandle handle, int dwMilliseconds) {
            return WaitForSingleObjectPI(handle, dwMilliseconds);
        }

        #endregion

        #region struct's and enum's

        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
        internal struct STARTUPINFO {
            public Int32 cb;
            public string lpReserved;
            public string lpDesktop;
            public string lpTitle;
            public Int32 dwX;
            public Int32 dwY;
            public Int32 dwXSize;
            public Int32 dwYSize;
            public Int32 dwXCountChars;
            public Int32 dwYCountChars;
            public Int32 dwFillAttribute;
            public Int32 dwFlags;
            public Int16 wShowWindow;
            public Int16 cbReserved2;
            public IntPtr lpReserved2;
            public IntPtr hStdInput;
            public IntPtr hStdOutput;
            public IntPtr hStdError;
        }

        [StructLayout(LayoutKind.Sequential)]
        internal struct PROCESS_INFORMATION {
            public IntPtr hProcess;
            public IntPtr hThread;
            public int dwProcessId;
            public int dwThreadId;
        }

        [StructLayout(LayoutKind.Sequential)]
        internal /*class*/ struct SECURITY_ATTRIBUTES {
            public int nLength;
            public IntPtr lpSecurityDescriptor;
            public int bInheritHandle;
        }

        [Flags]
        internal enum DuplicateOptions : uint {
            DUPLICATE_CLOSE_SOURCE = (0x00000001),// Closes the source handle. This occurs regardless of any error status returned.
            DUPLICATE_SAME_ACCESS = (0x00000002), //Ignores the dwDesiredAccess parameter. The duplicate handle has the same access as the source handle.
        }

        #endregion

        #region Privates / PInvokes

        [return: MarshalAs(UnmanagedType.Bool)]
        [DllImport("kernel32.dll", EntryPoint = "CreateProcess", SetLastError = true)]
        private static extern bool CreateProcessPI(string lpApplicationName,
           string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes,
           ref SECURITY_ATTRIBUTES lpThreadAttributes, [MarshalAs(UnmanagedType.Bool)]bool bInheritHandles,
           uint dwCreationFlags, string lpEnvironment, string lpCurrentDirectory,
           [In] ref STARTUPINFO lpStartupInfo,
           out PROCESS_INFORMATION lpProcessInformation);

        [DllImport("kernel32.dll", EntryPoint = "CreatePipe")]
        [return: MarshalAs(UnmanagedType.Bool)]
        private static extern bool CreatePipePI(out IntPtr hReadPipe, out IntPtr hWritePipe,
           ref SECURITY_ATTRIBUTES lpPipeAttributes, uint nSize);

        [DllImport("kernel32.dll", SetLastError = true, EntryPoint = "DuplicateHandle")]
        [return: MarshalAs(UnmanagedType.Bool)]
        private static extern bool DuplicateHandlePI(IntPtr hSourceProcessHandle,
           IntPtr hSourceHandle, IntPtr hTargetProcessHandle, out IntPtr lpTargetHandle,
           uint dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwOptions);

        [DllImport("kernel32.dll", EntryPoint = "GetCurrentProcess")]
        private static extern IntPtr GetCurrentProcessPI();

        [DllImport("kernel32.dll", SetLastError = true, EntryPoint = "GetExitCodeProcess")]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool GetExitCodeProcessPI(IntPtr hProcess, out /*uint*/ int lpExitCode);

        [DllImport("kernel32.dll", SetLastError = true, EntryPoint = "GetStdHandle")]
        private static extern IntPtr GetStdHandlePI(int nStdHandle);

        [DllImport("kernel32.dll", EntryPoint = "GetVersion")]
        [SuppressMessage("Microsoft.Usage", "CA2205:UseManagedEquivalentsOfWin32Api")]
        private static extern int GetVersionPI();

        [return: MarshalAs(UnmanagedType.Bool)]
        [DllImport("kernel32.dll", SetLastError = true, EntryPoint = "CloseHandle")]
        internal static extern bool CloseHandle(IntPtr hObject);

        [DllImport("kernel32.dll", SetLastError = true, EntryPoint = "TerminateProcess")]
        [return: MarshalAs(UnmanagedType.Bool)]
        private static extern bool TerminateProcessPI(IntPtr hProcess, uint uExitCode);

        [DllImport("kernel32", CharSet = CharSet.Ansi,
            SetLastError = true, ExactSpelling = true, EntryPoint = "WaitForSingleObject")]
        internal static extern int WaitForSingleObjectPI(IntPtr hHandle, int dwMilliseconds);

        #endregion

        #region Constants

        public const int CREATE_NEW_CONSOLE = 16;
        public const int CREATE_NEW_PROCESS_GROUP = 512;
        public const int DUPLICATE_SAME_ACCESS = 2;
        public const int INFINITE = -1;
        public const int STARTF_USESHOWWINDOW = 1;
        public const int STARTF_USESTDHANDLES = 256;
        public const int STD_ERROR_HANDLE = -12;
        public const int STD_INPUT_HANDLE = -10;
        public const int STD_OUTPUT_HANDLE = -11;
        public const int SW_HIDE = 0;
        public const int WAIT_OBJECT_0 = 0;
        public const int PIPE = -1;
        public const int STDOUT = -2;

        #endregion

    }

    [PythonType("_subprocess_handle")]
    public class PythonSubprocessHandle {
        private readonly IntPtr _internalHandle;
        internal bool _closed;
        internal bool _duplicated, _isProcess;
        internal int _exitCode;
        private static List<PythonSubprocessHandle> _active = new List<PythonSubprocessHandle>();

        internal PythonSubprocessHandle(IntPtr handle) {
            _internalHandle = handle;
        }

        internal PythonSubprocessHandle(IntPtr handle, bool isProcess) {
            _internalHandle = handle;
            _isProcess = isProcess;
        }

        ~PythonSubprocessHandle() {
            if (_isProcess) {
                lock (_active) {
                    // we need to deal w/ order of finalization and the fact that Popen will resurrect
                    // it's self and want to be able to poll us for exit.  Therefore we can't close until
                    // the process has really exited (and we've captured that exit code).  So we keep
                    // resurrecting ourselves until it finally happens.
                    int insertion = -1;
                    for (int i = 0; i < _active.Count; i++) {
                        if (_active[i] == null) {
                            insertion = i;
                        } else if (_active[i].PollForExit()) {
                            _active[i] = null;
                            insertion = i;
                            if (_active[i] == this) {
                                // we've exited, and we're removed from the list
                                Close();
                                return;
                            }
                        } else if (_active[i] == this) {
                            // we haven't exited
                            return;
                        }
                    }

                    // we're not in the list.
                    if (!PollForExit()) {
                        // resurrect ourselves - this is to account for subprocess.py's resurrection of
                        // handles.  We cannot close our handle until we have been successfully polled
                        // for the end of the process.
                        if (insertion != -1) {
                            _active[insertion] = this;
                        } else {
                            _active.Add(this);
                        }
                        return;
                    } else {
                        Close();
                    }
                }
            }

            Close();
        }

        private bool PollForExit() {
            if (PythonSubprocess.WaitForSingleObjectPI(_internalHandle, 0) == PythonSubprocess.WAIT_OBJECT_0) {
                PythonSubprocess.GetExitCodeProcessPI(_internalHandle, out _exitCode);
                return true;
            }
            return false;
        }

        public void Close() {
            lock (this) {
                if (!_closed) {
                    PythonSubprocess.CloseHandle(_internalHandle);
                    _closed = true;
                    GC.SuppressFinalize(this);
                }
            }
        }

        public object Detach(CodeContext context) {
            lock (this) {
                if (!_closed) {
                    _closed = true;
                    GC.SuppressFinalize(this);
                    return _internalHandle.ToPython();
                }
            }
            return -1;
        }

        public static implicit operator int(PythonSubprocessHandle type) {
            return type._internalHandle.ToInt32(); // ToPython()
        }

        public static implicit operator BigInteger(PythonSubprocessHandle type) {
            return type._internalHandle.ToInt32(); // ToPython()
        }

        public static implicit operator IntPtr(PythonSubprocessHandle type) {
            return type._internalHandle; // ToPython()
        }
    }
}

#endif


text:
#ifndef itkOtsuThresholdImageFilter_h
#define itkOtsuThresholdImageFilter_h

#include "itkHistogramThresholdImageFilter.h"
#include "itkOtsuThresholdCalculator.h"

namespace itk
{

/**
 *\class OtsuThresholdImageFilter
 * \brief Threshold an image using the Otsu Threshold
 *
 * This filter creates a binary thresholded image that separates an
 * image into foreground and background components. The filter
 * computes the threshold using the OtsuThresholdCalculator and
 * applies that threshold to the input image using the
 * BinaryThresholdImageFilter.
 *
 * \author Richard Beare
 * \author Gaetan Lehmann. Biologie du Developpement et de la Reproduction, INRA de Jouy-en-Josas, France.
 *
 * This implementation was taken from the Insight Journal paper:
 * https://hdl.handle.net/10380/3279  or
 * http://www.insight-journal.org/browse/publication/811
 *
 * \sa HistogramThresholdImageFilter
 *
 * \ingroup Multithreaded
 * \ingroup ITKThresholding
 *
 * \sphinx
 * \sphinxexample{Filtering/Thresholding/SeparateGroundUsingOtsu,Separate Foreround And Background Using Otsu Method}
 * \endsphinx
 */

template <typename TInputImage, typename TOutputImage, typename TMaskImage = TOutputImage>
class OtsuThresholdImageFilter : public HistogramThresholdImageFilter<TInputImage, TOutputImage, TMaskImage>
{
public:
  ITK_DISALLOW_COPY_AND_ASSIGN(OtsuThresholdImageFilter);

  /** Standard Self type alias */
  using Self = OtsuThresholdImageFilter;
  using Superclass = HistogramThresholdImageFilter<TInputImage, TOutputImage, TMaskImage>;
  using Pointer = SmartPointer<Self>;
  using ConstPointer = SmartPointer<const Self>;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Runtime information support. */
  itkTypeMacro(OtsuThresholdImageFilter, HistogramThresholdImageFilter);

  using InputImageType = TInputImage;
  using OutputImageType = TOutputImage;
  using MaskImageType = TMaskImage;

  /** Image pixel value type alias. */
  using InputPixelType = typename InputImageType::PixelType;
  using OutputPixelType = typename OutputImageType::PixelType;
  using MaskPixelType = typename MaskImageType::PixelType;

  /** Image related type alias. */
  using InputImagePointer = typename InputImageType::Pointer;
  using OutputImagePointer = typename OutputImageType::Pointer;

  using InputSizeType = typename InputImageType::SizeType;
  using InputIndexType = typename InputImageType::IndexType;
  using InputImageRegionType = typename InputImageType::RegionType;
  using OutputSizeType = typename OutputImageType::SizeType;
  using OutputIndexType = typename OutputImageType::IndexType;
  using OutputImageRegionType = typename OutputImageType::RegionType;
  using MaskSizeType = typename MaskImageType::SizeType;
  using MaskIndexType = typename MaskImageType::IndexType;
  using MaskImageRegionType = typename MaskImageType::RegionType;

  using HistogramType = typename Superclass::HistogramType;
  using CalculatorType = OtsuThresholdCalculator<HistogramType, InputPixelType>;

  /** Image related type alias. */
  static constexpr unsigned int InputImageDimension = InputImageType::ImageDimension;
  static constexpr unsigned int OutputImageDimension = OutputImageType::ImageDimension;

  /** Should the threshold value be mid-point of the bin or the maximum?
   * Default is to return bin maximum. */
  itkSetMacro(ReturnBinMidpoint, bool);
  itkGetConstReferenceMacro(ReturnBinMidpoint, bool);
  itkBooleanMacro(ReturnBinMidpoint);

protected:
  OtsuThresholdImageFilter() { this->SetCalculator(CalculatorType::New()); }
  ~OtsuThresholdImageFilter() override = default;

  void
  GenerateData() override
  {
    auto calc = static_cast<CalculatorType *>(this->GetModifiableCalculator());
    calc->SetReturnBinMidpoint(m_ReturnBinMidpoint);
    this->Superclass::GenerateData();
  }

  void
  VerifyPreconditions() ITKv5_CONST override
  {
    Superclass::VerifyPreconditions();
    if (dynamic_cast<const CalculatorType *>(Superclass::GetCalculator()) == nullptr)
    {
      itkExceptionMacro(<< "Invalid OtsuThresholdCalculator.");
    }
  }

private:
#if defined(ITKV4_COMPATIBILITY)
  bool m_ReturnBinMidpoint{ true };
#else
  bool m_ReturnBinMidpoint{ false };
#endif
};

} // end namespace itk

#endif


text:
use std::process;
use std::error::Error;
use std::fmt;

/// Command line argument parser error types
#[derive(PartialEq, Debug)]
pub enum ClapErrorType {
    /// Error occurs when some possible values were set, but clap found unexpected value
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App, Arg};
    /// let result = App::new("myprog")
    ///     .arg(Arg::with_name("debug").index(1)
    ///         .possible_value("fast")
    ///         .possible_value("slow"))
    ///     .get_matches_from_safe(vec!["", "other"]);
    /// ```
    InvalidValue,
    /// Error occurs when clap found unexpected flag or option
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App, Arg};
    /// let result = App::new("myprog")
    ///     .arg(Arg::from_usage("-f, --flag 'some flag'"))
    ///     .get_matches_from_safe(vec!["", "--other"]);
    /// ```
    InvalidArgument,
    /// Error occurs when clap found unexpected subcommand
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App, Arg, SubCommand};
    /// let result = App::new("myprog")
    ///     .subcommand(SubCommand::with_name("conifg")
    ///         .about("Used for configuration")
    ///         .arg(Arg::with_name("config_file")
    ///             .help("The configuration file to use")
    ///             .index(1)))
    ///     .get_matches_from_safe(vec!["", "other"]);
    /// ```
    InvalidSubcommand,
    /// Error occurs when option does not allow empty values but some was found
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App, Arg};
    /// let result = App::new("myprog")
    ///     .arg(Arg::with_name("debug")
    ///          .empty_values(false))
    ///     .arg(Arg::with_name("color"))
    ///     .get_matches_from_safe(vec!["", "--debug", "--color"]);
    /// ```
    EmptyValue,
    /// Parser inner error
    OptionError,
    /// Parser inner error
    ArgumentError,
    /// Parser inner error
    ValueError,
    /// Error occurs when argument got more values then were expected
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App, Arg};
    /// let result = App::new("myprog")
    ///     .arg(Arg::with_name("debug").index(1)
    ///         .max_values(2))
    ///     .get_matches_from_safe(vec!["", "too", "much", "values"]);
    /// ```
    TooMuchValues,
    /// Error occurs when argument got less values then were expected
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App, Arg};
    /// let result = App::new("myprog")
    ///     .arg(Arg::with_name("debug").index(1)
    ///         .min_values(3))
    ///     .get_matches_from_safe(vec!["", "too", "few"]);
    /// ```
    TooFewValues,
    /// Error occurs when clap find two ore more conflicting arguments
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App, Arg};
    /// let result = App::new("myprog")
    ///     .arg(Arg::with_name("debug")
    ///         .conflicts_with("color"))
    ///     .get_matches_from_safe(vec!["", "--debug", "--color"]);
    /// ```
    ArgumentConflict,
    /// Error occurs when one or more required arguments missing
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App, Arg};
    /// let result = App::new("myprog")
    ///     .arg(Arg::with_name("debug")
    ///         .required(true))
    ///     .get_matches_from_safe(vec![""]);
    /// ```
    MissingRequiredArgument,
    /// Error occurs when required subcommand missing
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App, Arg, AppSettings, SubCommand};
    /// let result = App::new("myprog")
    ///     .setting(AppSettings::SubcommandRequired)
    ///     .subcommand(SubCommand::with_name("conifg")
    ///         .about("Used for configuration")
    ///         .arg(Arg::with_name("config_file")
    ///             .help("The configuration file to use")
    ///             .index(1)))
    ///     .get_matches_from_safe(vec![""]);
    /// ```
    MissingSubcommand,
    /// Occurs when no argument or subcommand has been supplied and
    /// `AppSettings::ArgRequiredElseHelp` was used
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App, Arg, AppSettings, SubCommand};
    /// let result = App::new("myprog")
    ///     .setting(AppSettings::ArgRequiredElseHelp)
    ///     .subcommand(SubCommand::with_name("conifg")
    ///         .about("Used for configuration")
    ///         .arg(Arg::with_name("config_file")
    ///             .help("The configuration file to use")
    ///             .index(1)))
    ///     .get_matches_from_safe(vec![""]);
    /// ```
    MissingArgumentOrSubcommand,
    /// Error occurs when clap find argument while is was not expecting any
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App};
    /// let result = App::new("myprog")
    ///     .get_matches_from_safe(vec!["", "--arg"]);
    /// ```
    UnexpectedArgument,
    /// Error occurs when argument was used multiple times and was not set as multiple.
    ///
    ///
    /// # Example
    ///
    /// ```no_run
    /// # use clap::{App, Arg};
    /// let result = App::new("myprog")
    ///     .arg(Arg::with_name("debug")
    ///         .multiple(false))
    ///     .get_matches_from_safe(vec!["", "--debug", "--debug"]);
    /// ```
    UnexpectedMultipleUsage,
}

/// Command line argument parser error
#[derive(Debug)]
pub struct ClapError {
    /// Formated error message
    pub error: String,
    /// Command line argument parser error type
    pub error_type: ClapErrorType,
}

impl ClapError {
    /// Prints the error to `stderr` and exits with a status of `1`
    pub fn exit(&self) -> ! {
        wlnerr!("{}", self.error);
        process::exit(1);
    }
}

impl Error for ClapError {
    fn description(&self) -> &str {
        &*self.error
    }
}

impl fmt::Display for ClapError {
    fn fmt(&self,
           f: &mut fmt::Formatter)
           -> fmt::Result {
        write!(f, "{}", self.error)
    }
}


text:
/*
 * NaCl Simple/secure ELF loader (NaCl SEL).
 */

#include "native_client/src/include/portability.h"

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

#include "native_client/src/include/elf_constants.h"
#include "native_client/src/include/nacl_elf.h"
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/win/mman.h"
#include "native_client/src/shared/platform/nacl_check.h"
#include "native_client/src/shared/platform/nacl_log.h"
#include "native_client/src/shared/platform/nacl_sync_checked.h"
#include "native_client/src/shared/platform/nacl_time.h"

#include "native_client/src/trusted/service_runtime/include/sys/errno.h"

#include "native_client/src/trusted/service_runtime/arch/sel_ldr_arch.h"
#include "native_client/src/trusted/service_runtime/elf_util.h"
#include "native_client/src/trusted/service_runtime/nacl_app_thread.h"
#include "native_client/src/trusted/service_runtime/nacl_closure.h"
#include "native_client/src/trusted/service_runtime/nacl_debug.h"
#include "native_client/src/trusted/service_runtime/nacl_sync_queue.h"
#include "native_client/src/trusted/service_runtime/nacl_text.h"
#include "native_client/src/trusted/service_runtime/sel_memory.h"
#include "native_client/src/trusted/service_runtime/sel_ldr.h"
#include "native_client/src/trusted/service_runtime/sel_util.h"
#include "native_client/src/trusted/service_runtime/sel_addrspace.h"

#if !defined(SIZE_T_MAX)
# define SIZE_T_MAX     (~(size_t) 0)
#endif

/*
 * Fill from static_text_end to end of that page with halt
 * instruction, which is at least NACL_HALT_LEN in size when no
 * dynamic text is present.  Does not touch dynamic text region, which
 * should be pre-filled with HLTs.
 *
 * By adding NACL_HALT_SLED_SIZE, we ensure that the code region ends
 * with HLTs, just in case the CPU has a bug in which it fails to
 * check for running off the end of the x86 code segment.
 */
void NaClFillEndOfTextRegion(struct NaClApp *nap) {
  size_t page_pad;

  /*
   * NOTE: make sure we are not silently overwriting data.  It is the
   * toolchain's responsibility to ensure that a NACL_HALT_SLED_SIZE
   * gap exists.
   */
  if (0 != nap->data_start &&
      nap->static_text_end + NACL_HALT_SLED_SIZE > nap->data_start) {
    NaClLog(LOG_FATAL, "Missing gap between text and data for halt_sled\n");
  }
  if (0 != nap->rodata_start &&
      nap->static_text_end + NACL_HALT_SLED_SIZE > nap->rodata_start) {
    NaClLog(LOG_FATAL, "Missing gap between text and rodata for halt_sled\n");
  }

  if (NULL == nap->text_shm) {
    /*
     * No dynamic text exists.  Space for NACL_HALT_SLED_SIZE must
     * exist.
     */
    page_pad = (NaClRoundAllocPage(nap->static_text_end + NACL_HALT_SLED_SIZE)
                - nap->static_text_end);
    CHECK(page_pad >= NACL_HALT_SLED_SIZE);
    CHECK(page_pad < NACL_MAP_PAGESIZE + NACL_HALT_SLED_SIZE);
  } else {
    /*
     * Dynamic text exists; the halt sled resides in the dynamic text
     * region, so all we need to do here is to round out the last
     * static text page with HLT instructions.  It doesn't matter if
     * the size of this region is smaller than NACL_HALT_SLED_SIZE --
     * this is just to fully initialize the page, rather than (later)
     * decoding/validating zero-filled memory as instructions.
     */
    page_pad = NaClRoundAllocPage(nap->static_text_end) - nap->static_text_end;
  }

  NaClLog(4,
          "Filling with halts: %08"NACL_PRIxPTR", %08"NACL_PRIxS" bytes\n",
          nap->mem_start + nap->static_text_end,
          page_pad);

  NaClFillMemoryRegionWithHalt((void *)(nap->mem_start + nap->static_text_end),
                               page_pad);

  nap->static_text_end += page_pad;
}

NaClErrorCode NaClAppLoadFile(struct Gio       *gp,
                              struct NaClApp   *nap,
                              enum NaClAbiCheckOption check_abi) {
  NaClErrorCode       ret = LOAD_INTERNAL;
  NaClErrorCode       subret;
  uintptr_t           rodata_end;
  uintptr_t           data_end;
  uintptr_t           max_vaddr;
  struct NaClElfImage *image = NULL;

  /* NACL_MAX_ADDR_BITS < 32 */
  if (nap->addr_bits > NACL_MAX_ADDR_BITS) {
    ret = LOAD_ADDR_SPACE_TOO_BIG;
    goto done;
  }

  nap->stack_size = NaClRoundAllocPage(nap->stack_size);

  /* temporay object will be deleted at end of function */
  image = NaClElfImageNew(gp, &subret);
  if (NULL == image) {
    ret = subret;
    goto done;
  }

#if 0 == NACL_DANGEROUS_DEBUG_MODE_DISABLE_INNER_SANDBOX
  check_abi = NACL_ABI_CHECK_OPTION_CHECK;
#endif

  if (NACL_ABI_CHECK_OPTION_CHECK == check_abi) {
    subret = NaClElfImageValidateAbi(image);
    if (subret != LOAD_OK) {
      ret = subret;
      goto done;
    }
  }

  subret = NaClElfImageValidateElfHeader(image);
  if (LOAD_OK != subret) {
    ret = subret;
    goto done;
  }

  subret = NaClElfImageValidateProgramHeaders(image,
                                              nap->addr_bits,
                                              &nap->static_text_end,
                                              &nap->rodata_start,
                                              &rodata_end,
                                              &nap->data_start,
                                              &data_end,
                                              &max_vaddr);
  if (LOAD_OK != subret) {
    ret = subret;
    goto done;
  }

  if (0 == nap->data_start) {
    if (0 == nap->rodata_start) {
      if (NaClRoundAllocPage(max_vaddr) - max_vaddr < NACL_HALT_SLED_SIZE) {
        /*
         * if no rodata and no data, we make sure that there is space for
         * the halt sled.
         */
        max_vaddr += NACL_MAP_PAGESIZE;
      }
    } else {
      /*
       * no data, but there is rodata.  this means max_vaddr is just
       * where rodata ends.  this might not be at an allocation
       * boundary, and in this the page would not be writable.  round
       * max_vaddr up to the next allocation boundary so that bss will
       * be at the next writable region.
       */
      ;
    }
    max_vaddr = NaClRoundAllocPage(max_vaddr);
  }
  /*
   * max_vaddr -- the break or the boundary between data (initialized
   * and bss) and the address space hole -- does not have to be at a
   * page boundary.
   */
  nap->break_addr = max_vaddr;
  nap->data_end = max_vaddr;

  NaClLog(4, "Values from NaClElfImageValidateProgramHeaders:\n");
  NaClLog(4, "rodata_start = 0x%08"NACL_PRIxPTR"\n", nap->rodata_start);
  NaClLog(4, "rodata_end   = 0x%08"NACL_PRIxPTR"\n", rodata_end);
  NaClLog(4, "data_start   = 0x%08"NACL_PRIxPTR"\n", nap->data_start);
  NaClLog(4, "data_end     = 0x%08"NACL_PRIxPTR"\n", data_end);
  NaClLog(4, "max_vaddr    = 0x%08"NACL_PRIxPTR"\n", max_vaddr);

#if 0 == NACL_DANGEROUS_DEBUG_MODE_DISABLE_INNER_SANDBOX
  nap->bundle_size = NaClElfImageGetBundleSize(image);
  if (nap->bundle_size == 0) {
    ret = LOAD_BAD_ABI;
    goto done;
  }
#else
  /* pick some reasonable default for an un-sandboxed nexe */
  nap->bundle_size = 32;
#endif
  nap->entry_pt = NaClElfImageGetEntryPoint(image);

  NaClLog(2,
          "NaClApp addr space layout:\n");
  NaClLog(2,
          "nap->static_text_end    = 0x%016"NACL_PRIxPTR"\n",
          nap->static_text_end);
  NaClLog(2,
          "nap->dynamic_text_start = 0x%016"NACL_PRIxPTR"\n",
          nap->dynamic_text_start);
  NaClLog(2,
          "nap->dynamic_text_end   = 0x%016"NACL_PRIxPTR"\n",
          nap->dynamic_text_end);
  NaClLog(2,
          "nap->rodata_start       = 0x%016"NACL_PRIxPTR"\n",
          nap->rodata_start);
  NaClLog(2,
          "nap->data_start         = 0x%016"NACL_PRIxPTR"\n",
          nap->data_start);
  NaClLog(2,
          "nap->data_end           = 0x%016"NACL_PRIxPTR"\n",
          nap->data_end);
  NaClLog(2,
          "nap->break_addr         = 0x%016"NACL_PRIxPTR"\n",
          nap->break_addr);
  NaClLog(2,
          "nap->entry_pt           = 0x%016"NACL_PRIxPTR"\n",
          nap->entry_pt);
  NaClLog(2,
          "nap->bundle_size        = 0x%x\n",
          nap->bundle_size);

  if (!NaClAddrIsValidEntryPt(nap, nap->entry_pt)) {
    ret = LOAD_BAD_ENTRY;
    goto done;
  }

  /*
   * Basic address space layout sanity check.
   */
  if (0 != nap->data_start) {
    if (data_end != max_vaddr) {
      NaClLog(LOG_INFO, "data segment is not last\n");
      ret = LOAD_DATA_NOT_LAST_SEGMENT;
      goto done;
    }
  } else if (0 != nap->rodata_start) {
    if (NaClRoundAllocPage(rodata_end) != max_vaddr) {
      /*
       * This should be unreachable, but we include it just for
       * completeness.
       *
       * Here is why it is unreachable:
       *
       * NaClPhdrChecks checks the test segment starting address.  The
       * only allowed loaded segments are text, data, and rodata.
       * Thus unless the rodata is in the trampoline region, it must
       * be after the text.  And NaClElfImageValidateProgramHeaders
       * ensures that all segments start after the trampoline region.
       */
      NaClLog(LOG_INFO, "no data segment, but rodata segment is not last\n");
      ret = LOAD_NO_DATA_BUT_RODATA_NOT_LAST_SEGMENT;
      goto done;
    }
  }
  if (0 != nap->rodata_start && 0 != nap->data_start) {
    if (rodata_end > nap->data_start) {
      NaClLog(LOG_INFO, "rodata_overlaps data.\n");
      ret = LOAD_RODATA_OVERLAPS_DATA;
      goto done;
    }
  }
  if (0 != nap->rodata_start) {
    if (NaClRoundAllocPage(NaClEndOfStaticText(nap)) > nap->rodata_start) {
      ret = LOAD_TEXT_OVERLAPS_RODATA;
      goto done;
    }
  } else if (0 != nap->data_start) {
    if (NaClRoundAllocPage(NaClEndOfStaticText(nap)) > nap->data_start) {
      ret = LOAD_TEXT_OVERLAPS_DATA;
      goto done;
    }
  }

  if (0 != nap->rodata_start &&
      NaClRoundAllocPage(nap->rodata_start) != nap->rodata_start) {
    NaClLog(LOG_INFO, "rodata_start not a multiple of allocation size\n");
    ret = LOAD_BAD_RODATA_ALIGNMENT;
    goto done;
  }
  if (0 != nap->data_start &&
      NaClRoundAllocPage(nap->data_start) != nap->data_start) {
    NaClLog(LOG_INFO, "data_start not a multiple of allocation size\n");
    ret = LOAD_BAD_DATA_ALIGNMENT;
    goto done;
  }

  NaClLog(2, "Allocating address space\n");
  subret = NaClAllocAddrSpace(nap);
  if (LOAD_OK != subret) {
    ret = subret;
    goto done;
  }

  /*
   * NB: mem_map object has been initialized, but is empty.
   * NaClMakeDynamicTextShared does not touch it.
   *
   * NaClMakeDynamicTextShared also fills the dynamic memory region
   * with the architecture-specific halt instruction.  If/when we use
   * memory mapping to save paging space for the dynamic region and
   * lazily halt fill the memory as the pages become
   * readable/executable, we must make sure that the *last*
   * NACL_MAP_PAGESIZE chunk is nonetheless mapped and written with
   * halts.
   */
  NaClLog(2,
          ("Replacing gap between static text and"
           " (ro)data with shareable memory\n"));
  subret = NaClMakeDynamicTextShared(nap);
  if (LOAD_OK != subret) {
    ret = subret;
    goto done;
  }

  /*
   * Make sure the static image pages are marked writable before we try
   * to write them.
   * TODO(ilewis): See if this can be enabled for Win32 as well. (issue 40077)
   */
  NaClLog(2, "Loading into memory\n");
#if NACL_WINDOWS && NACL_ARCH_CPU_X86_64
  ret = NaCl_mprotect((void*) nap->mem_start,
    NaClRoundAllocPage(nap->data_end),
    PROT_READ|PROT_WRITE);
  if (ret) {
      NaClLog(LOG_FATAL, "Couldn't get writeable pages for image. "
                         "Error code 0x%X\n", ret);
  }
#endif
  subret = NaClElfImageLoad(image, gp, nap->addr_bits, nap->mem_start);
  if (LOAD_OK != subret) {
    ret = subret;
    goto done;
  }

  /*
   * NaClFillEndOfTextRegion will fill with halt instructions the
   * padding space after the static text region.
   *
   * Shm-backed dynamic text space was filled with halt instructions
   * in NaClMakeDynamicTextShared.  This extends to the rodata.  For
   * non-shm-backed text space, this extend to the next page (and not
   * allocation page).  static_text_end is updated to include the
   * padding.
   */
  NaClFillEndOfTextRegion(nap);

#if 0 == NACL_DANGEROUS_DEBUG_MODE_DISABLE_INNER_SANDBOX
  NaClLog(2, "Validating image\n");
  subret = NaClValidateImage(nap);
  if (LOAD_OK != subret) {
    ret = subret;
    goto done;
  }
#endif

  NaClLog(2, "Installing trampoline\n");

  NaClLoadTrampoline(nap);

  NaClLog(2, "Installing springboard\n");

  NaClLoadSpringboard(nap);

  NaClLog(2, "Applying memory protection\n");

  /*
   * NaClMemoryProtect also initializes the mem_map w/ information
   * about the memory pages and their current protection value.
   *
   * The contents of the dynamic text region will get remapped as
   * non-writable.
   */
  subret = NaClMemoryProtection(nap);
  if (LOAD_OK != subret) {
    ret = subret;
    goto done;
  }
  NaClLog(2,
          "NaClAppLoadFile done; addr space layout:\n");
  NaClLog(2,
          "nap->static_text_end    = 0x%016"NACL_PRIxPTR"\n",
          nap->static_text_end);
  NaClLog(2,
          "nap->dynamic_text_start = 0x%016"NACL_PRIxPTR"\n",
          nap->dynamic_text_start);
  NaClLog(2,
          "nap->dynamic_text_end   = 0x%016"NACL_PRIxPTR"\n",
          nap->dynamic_text_end);
  NaClLog(2,
          "nap->rodata_start       = 0x%016"NACL_PRIxPTR"\n",
          nap->rodata_start);
  NaClLog(2,
          "nap->data_start         = 0x%016"NACL_PRIxPTR"\n",
          nap->data_start);
  NaClLog(2,
          "nap->data_end           = 0x%016"NACL_PRIxPTR"\n",
          nap->data_end);
  NaClLog(2,
          "nap->break_addr         = 0x%016"NACL_PRIxPTR"\n",
          nap->break_addr);
  NaClLog(2,
          "nap->entry_pt           = 0x%016"NACL_PRIxPTR"\n",
          nap->entry_pt);
  NaClLog(2,
          "nap->bundle_size        = 0x%x\n",
          nap->bundle_size);

  ret = LOAD_OK;
done:
  NaClElfImageDelete(image);
  return ret;
}

int NaClAddrIsValidEntryPt(struct NaClApp *nap,
                           uintptr_t      addr) {
  if (0 != (addr & (nap->bundle_size - 1))) {
    return 0;
  }

  return addr < nap->static_text_end;
}

/*
 * preconditions:
 * argc > 0, argc and argv table is consistent
 * envv may be NULL (this happens on MacOS/Cocoa
 * if envv is non-NULL it is 'consistent', null terminated etc.
 */
int NaClCreateMainThread(struct NaClApp     *nap,
                         int                argc,
                         char               **argv,
                         char const *const  *envv) {
  /*
   * Compute size of string tables for argv and envv
   */
  int                   retval;
  int                   envc;
  size_t                size;
  size_t                ptr_tbl_size;
  int                   i;
  char                  *p;
  char                  *strp;
  size_t                *argv_len;
  size_t                *envv_len;
  struct NaClAppThread  *natp;
  uintptr_t             stack_ptr;

  /*
   * Set an exception handler so Windows won't show a message box if
   * an exception occurs
   */
  WINDOWS_EXCEPTION_TRY;

  retval = 0;  /* fail */
  CHECK(argc > 0);
  CHECK(NULL != argv);

  envc = 0;
  if (NULL != envv) {
    char const *const *pp;
    for (pp = envv; NULL != *pp; ++pp) {
      ++envc;
    }
  }
  envv_len = 0;
  argv_len = malloc(argc * sizeof argv_len[0]);
  envv_len = malloc(envc * sizeof envv_len[0]);
  if (NULL == argv_len) {
    goto cleanup;
  }
  if (NULL == envv_len && 0 != envc) {
    goto cleanup;
  }

  /*
   * Store information for remote query when debugging.
   */
  NaClDebugSetAppInfo(nap);
  NaClDebugSetAppEnvironment(argc, (char const * const *) argv,
                             envc, (char const * const *) envv);
  NaClDebugStart();

  size = 0;

  /*
   * The following two loops cannot overflow.  The reason for this is
   * that they are counting the number of bytes used to hold the
   * NUL-terminated strings that comprise the argv and envv tables.
   * If the entire address space consisted of just those strings, then
   * the size variable would overflow; however, since there's the code
   * space required to hold the code below (and we are not targetting
   * Harvard architecture machines), at least one page holds code, not
   * data.  We are assuming that the caller is non-adversarial and the
   * code does not look like string data....
   */
  for (i = 0; i < argc; ++i) {
    argv_len[i] = strlen(argv[i]) + 1;
    size += argv_len[i];
  }
  for (i = 0; i < envc; ++i) {
    envv_len[i] = strlen(envv[i]) + 1;
    size += envv_len[i];
  }

  /*
   * NaCl modules are ILP32, so the argv, envv pointers, as well as
   * the terminating NULL pointers at the end of the argv/envv tables,
   * are 32-bit values.  We also have the empty auxv to take into
   * account, so that's 6 additional 32-bit values on top of the
   * argv/envv contents.  Note that on nacl64, argc is popped, and
   * is an 8-byte value!
   *
   * The argv and envv pointer tables came from trusted code and is
   * part of memory.  Thus, by the same argument above, adding in
   * (argc+envc+4)*sizeof(void *) cannot possibly overflow the size
   * variable since it is a size_t object.  However, the two more
   * pointers for auxv and the space for argv could cause an overflow.
   * The fact that we used stack to get here etc means that
   * ptr_tb_size could not have overflowed.
   *
   * NB: the underlying OS would have limited the amount of space used
   * for argv and envv -- on linux, it is ARG_MAX, or 128KB -- and
   * hence the overflow check is for obvious auditability rather than
   * for correctness.
   */
  ptr_tbl_size = (argc + envc + 6) * sizeof(uint32_t) + sizeof(int);

  if (SIZE_T_MAX - size < ptr_tbl_size) {
    NaClLog(LOG_WARNING,
            "NaClCreateMainThread: ptr_tb_size cause size of"
            " argv / environment copy to overflow!?!\n");
    retval = 0;
    goto cleanup;
  }
  size += ptr_tbl_size;

  size = (size + NACL_STACK_ALIGN_MASK) & ~NACL_STACK_ALIGN_MASK;

  if (size > nap->stack_size) {
    retval = 0;
    goto cleanup;
  }

  /* write strings and char * arrays to stack */
  stack_ptr = (nap->mem_start + ((uintptr_t) 1U << nap->addr_bits) - size);

  NaClLog(2, "setting stack to : %016"NACL_PRIxPTR"\n", stack_ptr);

  VCHECK(0 == (stack_ptr & NACL_STACK_ALIGN_MASK),
         ("stack_ptr not aligned: %016"NACL_PRIxPTR"\n", stack_ptr));

  p = (char *) stack_ptr;
  strp = p + ptr_tbl_size;

#define BLAT(t, v) do { \
    *(t *) p = (t) v; p += sizeof(t);           \
  } while (0);

  BLAT(nacl_reg_t, argc);

  for (i = 0; i < argc; ++i) {
    BLAT(uint32_t, NaClSysToUser(nap, (uintptr_t) strp));
    NaClLog(2, "copying arg %d  %p -> %p\n",
            i, argv[i], strp);
    strcpy(strp, argv[i]);
    strp += argv_len[i];
  }
  BLAT(uint32_t, 0);

  for (i = 0; i < envc; ++i) {
    BLAT(uint32_t, NaClSysToUser(nap, (uintptr_t) strp));
    NaClLog(2, "copying env %d  %p -> %p\n",
            i, envv[i], strp);
    strcpy(strp, envv[i]);
    strp += envv_len[i];
  }
  BLAT(uint32_t, 0);
  /* Push an empty auxv for glibc support */
  BLAT(uint32_t, 0);
  BLAT(uint32_t, 0);
#undef BLAT

  /* now actually spawn the thread */
  natp = malloc(sizeof *natp);
  if (!natp) {
    goto cleanup;
  }

  /* We are ready to distinguish crashes in trusted and untrusted code. */
  NaClSignalRegisterApp(nap);

  nap->running = 1;

  NaClLog(2, "system stack ptr : %016"NACL_PRIxPTR"\n", stack_ptr);
  NaClLog(2, "  user stack ptr : %016"NACL_PRIxPTR"\n",
          NaClSysToUserStackAddr(nap, stack_ptr));

  /* e_entry is user addr */
  if (!NaClAppThreadAllocSegCtor(natp,
                                 nap,
                                 1,
                                 nap->entry_pt,
                                 NaClSysToUserStackAddr(nap, stack_ptr),
                                 NaClUserToSys(nap, nap->break_addr),
                                 1)) {
    retval = 0;
    goto cleanup;
  }

  /*
   * NB: Hereafter locking is required to access nap.
   */
  retval = 1;
cleanup:
  free(argv_len);
  free(envv_len);

  WINDOWS_EXCEPTION_CATCH;
  return retval;
}

int NaClWaitForMainThreadToExit(struct NaClApp  *nap) {
  struct NaClClosure        *work;

  while (NULL != (work = NaClSyncQueueDequeue(&nap->work_queue))) {
    NaClLog(3, "NaClWaitForMainThreadToExit: got work %08"NACL_PRIxPTR"\n",
            (uintptr_t) work);
    NaClLog(3, " invoking Run fn %08"NACL_PRIxPTR"\n",
            (uintptr_t) work->vtbl->Run);

    (*work->vtbl->Run)(work);
    NaClLog(3, "... done\n");
  }

  NaClLog(3, " taking NaClApp lock\n");
  NaClXMutexLock(&nap->mu);
  NaClLog(3, " waiting for exit status\n");
  while (nap->running) {
    NaClCondVarWait(&nap->cv, &nap->mu);
    NaClLog(3, " wakeup, nap->running %d, nap->exit_status %d\n",
            nap->running, nap->exit_status);
  }
  NaClXMutexUnlock(&nap->mu);
  /*
   * Some thread invoked the exit (exit_group) syscall.
   */

  NaClDebugStop(nap->exit_status);

  return (nap->exit_status);
}

/*
 * stack_ptr is from syscall, so a 32-bit address.
 */
int32_t NaClCreateAdditionalThread(struct NaClApp *nap,
                                   uintptr_t      prog_ctr,
                                   uintptr_t      sys_stack_ptr,
                                   uintptr_t      sys_tdb,
                                   size_t         tdb_size) {
  struct NaClAppThread  *natp;
  uintptr_t             stack_ptr;

  natp = malloc(sizeof *natp);
  if (NULL == natp) {
    NaClLog(LOG_WARNING,
            ("NaClCreateAdditionalThread: no memory for new thread context."
             "  Returning EAGAIN per POSIX specs.\n"));
    return -NACL_ABI_EAGAIN;
  }

  stack_ptr = NaClSysToUserStackAddr(nap, sys_stack_ptr);

  if (0 != ((stack_ptr + sizeof(nacl_reg_t)) & NACL_STACK_ALIGN_MASK)) {
    NaClLog(3,
            ("NaClCreateAdditionalThread:  user thread library provided "
             "an unaligned user stack pointer: 0x%"NACL_PRIxPTR"\n"),
            stack_ptr);
  }

  if (!NaClAppThreadAllocSegCtor(natp,
                                 nap,
                                 0,
                                 prog_ctr,
                                 stack_ptr,
                                 sys_tdb,
                                 tdb_size)) {
    NaClLog(LOG_WARNING,
            ("NaClCreateAdditionalThread: could not allocate thread index."
             "  Returning EAGAIN per POSIX specs.\n"));
    free(natp);
    return -NACL_ABI_EAGAIN;
  }
  return 0;
}


text:
package com.example.tinyl.care4old;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;

public class PhysicianPage extends AppCompatActivity {

    TextView gender;
    TextView adress;
    TextView zip;
    TextView city;
    TextView phone;
    TextView mobilePhone;
    TextView officename;
    TextView mail;
    TextView name;
    TextView firstname;

    private String[] physiData = {"azer","azer","azer","azer","azer","azer","azer","azer","azer","azer"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_physician_page);

        chargeTextFields();
    }

    private void chargeTextFields(){

        gender = (TextView) findViewById(R.id.gender_bdd);
        gender.setText("M");

        adress = (TextView) findViewById(R.id.adress_bdd);
        adress.setText("42, impasse de la réponse");

        zip = (TextView) findViewById(R.id.zip_bdd);
        zip.setText("42442");

        city = (TextView) findViewById(R.id.city_bdd);
        city.setText("Univers");

        phone = (TextView) findViewById(R.id.phone_bdd);
        phone.setText("+42424242424");

        mobilePhone = (TextView) findViewById(R.id.mobile_phone_bdd);
        mobilePhone.setText("+6424242424");

        name = (TextView) findViewById(R.id.firstname_bdd);
        name.setText("+42emergency");

        firstname = (TextView) findViewById(R.id.name_bdd);
        firstname.setText("+42emergency");

        oldFields();
    }
    public void previousPage(View view)
    {
        Intent intent = new Intent(PhysicianPage.this, PatientPagePerso.class);
        startActivity(intent);
        finish();
    }

    public void oldFields(){

        //String Height, Weight, Bmi, Albumin, Crp, VitaminD, Frequency, Pressure, Gir;

        gender.setText(physiData[0]);
        adress.setText(physiData[1]);
        zip.setText(physiData[2]);
        city.setText(physiData[3]);
        phone.setText(physiData[4]);
        mobilePhone.setText(physiData[5]);
        mail.setText(physiData[6]);
        name.setText(physiData[7]);
        firstname.setText(physiData[8]);
        officename.setText(physiData[9]);

    }

}


text:
  <title>The source code</title>
    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />

/**
 * @class Ext.ensible.cal.ReminderField
 * @extends Ext.form.ComboBox
 *
A custom combo used for choosing a reminder setting for an event.

 *
This is pretty much a standard combo that is simply pre-configured for the options needed by the
 * calendar components. The default configs are as follows:

width: 200,
fieldLabel: 'Reminder',
mode: 'local',
triggerAction: 'all',
forceSelection: true,
displayField: 'desc',
valueField: 'value',
noneText: 'None',
atStartTimeText: 'At start time',
reminderValueFormat: '{0} {1} before start'

 *
To customize the descriptions in the dropdown list override the following methods:
 * {@link #getMinutesText}, {@link #getHoursText}, {@link #getDaysText} and {@link #getWeeksText}.

 * @constructor
 * @param {Object} config The config object
 */
Ext.ensible.cal.ReminderField = Ext.extend(Ext.form.ComboBox, {
    width: 200,
    fieldLabel: 'Reminder',
    mode: 'local',
    triggerAction: 'all',
    forceSelection: true,
    displayField: 'desc',
    valueField: 'value',
    noneText: 'None',
    atStartTimeText: 'At start time',
    reminderValueFormat: '{0} {1} before start',

    // the following are all deprecated in favor of the corresponding get* template methods.
    // they are still here only for backwards-compatibility and will be removed in a future release.
    minutesText: 'minutes',
    hourText: 'hour',
    hoursText: 'hours',
    dayText: 'day',
    daysText: 'days',
    weekText: 'week',
    weeksText: 'weeks',

/**
     * Returns the list of reminder values used as the contents of the combo list. This method is provided so that
     * the value list can be easily overridden as needed.
     * @return {Array} A 2-dimensional array of type [{String}, {String}] which contains the value and description
     * respectively of each item in the combo list. By default the value is the number of minutes for the selected
     * time value (e.g., value 120 == '2 hours') with empty string for no value, but these can be set to anything.
     */
    getValueList: function(){
        var me = this,
            fmt = me.reminderValueFormat,
            stringFormat = String.format;

        return [
            ['', me.noneText],
            ['0', me.atStartTimeText],
            ['5', stringFormat(fmt, '5', me.getMinutesText(5))],
            ['15', stringFormat(fmt, '15', me.getMinutesText(15))],
            ['30', stringFormat(fmt, '30', me.getMinutesText(30))],
            ['60', stringFormat(fmt, '1', me.getHoursText(1))],
            ['90', stringFormat(fmt, '1.5', me.getHoursText(1.5))],
            ['120', stringFormat(fmt, '2', me.getHoursText(2))],
            ['180', stringFormat(fmt, '3', me.getHoursText(3))],
            ['360', stringFormat(fmt, '6', me.getHoursText(6))],
            ['720', stringFormat(fmt, '12', me.getHoursText(12))],
            ['1440', stringFormat(fmt, '1', me.getDaysText(1))],
            ['2880', stringFormat(fmt, '2', me.getDaysText(2))],
            ['4320', stringFormat(fmt, '3', me.getDaysText(3))],
            ['5760', stringFormat(fmt, '4', me.getDaysText(4))],
            ['7200', stringFormat(fmt, '5', me.getDaysText(5))],
            ['10080', stringFormat(fmt, '1', me.getWeeksText(1))],
            ['20160', stringFormat(fmt, '2', me.getWeeksText(2))]
        ]
    },

/**
     * Returns the unit text to use for a reminder that has a specified number of minutes
     * prior to the due time (defaults to 'minute' when the passed value === 1, else 'minutes').
     * @param {Number} numMinutes The number of minutes prior to the due time
     * @return {String} The unit text
     */
    getMinutesText: function(numMinutes){
        return numMinutes === 1 ? this.minuteText : this.minutesText;
    },

/**
     * Returns the unit text to use for a reminder that has a specified number of hours
     * prior to the due time (defaults to 'hour' when the passed value === 1, else 'hours').
     * @param {Number} numHours The number of hours prior to the due time
     * @return {String} The unit text
     */
    getHoursText: function(numHours){
        return numHours === 1 ? this.hourText : this.hoursText;
    },

/**
     * Returns the unit text to use for a reminder that has a specified number of days
     * prior to the due time (defaults to 'day' when the passed value === 1, else 'days').
     * @param {Number} numDays The number of days prior to the due time
     * @return {String} The unit text
     */
    getDaysText: function(numDays){
        return numDays === 1 ? this.dayText : this.daysText;
    },

/**
     * Returns the unit text to use for a reminder that has a specified number of weeks
     * prior to the due time (defaults to 'week' when the passed value === 1, else 'weeks').
     * @param {Number} numWeeks The number of weeks prior to the due time
     * @return {String} The unit text
     */
    getWeeksText: function(numWeeks){
        return numWeeks === 1 ? this.weekText : this.weeksText;
    },

    // private
    initComponent: function(){
        Ext.ensible.cal.ReminderField.superclass.initComponent.call(this);
        this.store = this.store || new Ext.data.ArrayStore({
            fields: [this.valueField, this.displayField],
            idIndex: 0,
            data: this.getValueList()
        });
    },

    // inherited docs
    initValue : function(){
        if(this.value !== undefined){
            this.setValue(this.value);
        }
        else{
            this.setValue('');
        }
        this.originalValue = this.getValue();
    }
});

Ext.reg('extensible.reminderfield', Ext.ensible.cal.ReminderField);


text:
<?php

namespace Acme\UsersBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AcmeUsersBundle extends Bundle
{
}


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.qjizho.inspmarker.activity.FeedsActivity">

    <Button
        android:id="@+id/login"
        android:layout_width="200dp"
        android:layout_height="50dp"
        android:layout_centerInParent="true"/>
</RelativeLayout>


text:
var mainSpeed : float = 100.0; //regular speed

var shiftAdd : float = 250.0; //multiplied by how long shift is held.  Basically running

var maxShift : float = 1000.0; //Maximum speed when holdin gshift

var camSens : float = 0.25; //How sensitive it with mouse

private var lastMouse = Vector3(255, 255, 255); //kind of in the middle of the screen, rather than at the top (play)

private var totalRun : float  = 1.0;

var player : GameObject;

function Update () {

    lastMouse = Input.mousePosition - lastMouse ;

    lastMouse = Vector3(-lastMouse.y * camSens, lastMouse.x * camSens, 0 );

    lastMouse = Vector3(player.transform.eulerAngles.x + lastMouse.x , player.transform.eulerAngles.y + lastMouse.y, 0);

    transform.eulerAngles = lastMouse;

    lastMouse =  Input.mousePosition;

    //Mouse & camera angle done.

    //Keyboard commands

    var f : float = 0.0;

    var p = GetBaseInput();

    totalRun = Mathf.Clamp(totalRun * 0.5, 1, 1000);

    p = p * mainSpeed;

    p = p * Time.deltaTime;

    player.transform.Translate( p);
}

private function GetBaseInput() : Vector3 { //returns the basic values, if it's 0 than it's not active.

    var p_Velocity : Vector3;

    if (Input.GetKey (KeyCode.W)){

        p_Velocity += Vector3(0, 0 , 1);

    }

    if (Input.GetKey (KeyCode.S)){
        p_Velocity += Vector3(0, 0 , -1);

    }

    if (Input.GetKey (KeyCode.A)){

        p_Velocity += Vector3(-1, 0 , 0);

    }

    if (Input.GetKey (KeyCode.D)){

        p_Velocity += Vector3(1, 0 , 0);

    }

    if (Input.GetKey (KeyCode.Space)){

        p_Velocity += Vector3(0, 1 , 0);

    }

    if (Input.GetKey (KeyCode.LeftShift)){

        p_Velocity += Vector3(0, -1 , 0);

    }

    return p_Velocity;

}