text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SoDim
{
    public partial class OverlayWindow : Form
    {
        public enum GWL
        {
            ExStyle = -20
        }

        public enum WS_EX
        {
            Transparent = 0x20,
            Layered = 0x80000
        }

        public enum LWA
        {
            ColorKey = 0x1,
            Alpha = 0x2
        }

        [DllImport("user32.dll", EntryPoint = "GetWindowLong")]
        public static extern int GetWindowLong(IntPtr hWnd, GWL nIndex);

        [DllImport("user32.dll", EntryPoint = "SetWindowLong")]
        public static extern int SetWindowLong(IntPtr hWnd, GWL nIndex, int dwNewLong);

        [DllImport("user32.dll", EntryPoint = "SetLayeredWindowAttributes")]
        public static extern bool SetLayeredWindowAttributes(IntPtr hWnd, int crKey, byte alpha, LWA dwFlags);

        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);
            int wl = GetWindowLong(this.Handle, GWL.ExStyle);
            wl = wl | 0x80000 | 0x20;
            SetWindowLong(this.Handle, GWL.ExStyle, wl);
        }

        public void SetOpacity(double opacity)
        {
            byte value = (byte) (255 * opacity);
            SetLayeredWindowAttributes(this.Handle, 0, value, LWA.Alpha);
        }

        public OverlayWindow(Point location, Size size, double opacity)
        {
            InitializeComponent();
            this.Location = location;
            this.Size = size;
            //this.Opacity = opacity;
            SetOpacity(opacity);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.asterix.lang.sqlpp.visitor;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.asterix.common.functions.FunctionSignature;
import org.apache.asterix.lang.common.base.Expression;
import org.apache.asterix.lang.common.clause.WhereClause;
import org.apache.asterix.lang.common.expression.CallExpr;
import org.apache.asterix.lang.common.expression.LiteralExpr;
import org.apache.asterix.lang.common.expression.VariableExpr;
import org.apache.asterix.lang.common.literal.StringLiteral;
import org.apache.asterix.lang.common.statement.DeleteStatement;
import org.apache.asterix.lang.common.statement.Query;
import org.apache.asterix.lang.common.struct.Identifier;
import org.apache.asterix.lang.sqlpp.clause.FromClause;
import org.apache.asterix.lang.sqlpp.clause.FromTerm;
import org.apache.asterix.lang.sqlpp.clause.SelectBlock;
import org.apache.asterix.lang.sqlpp.clause.SelectClause;
import org.apache.asterix.lang.sqlpp.clause.SelectElement;
import org.apache.asterix.lang.sqlpp.clause.SelectSetOperation;
import org.apache.asterix.lang.sqlpp.expression.SelectExpression;
import org.apache.asterix.lang.sqlpp.struct.SetOperationInput;
import org.apache.asterix.lang.sqlpp.visitor.base.AbstractSqlppAstVisitor;
import org.apache.asterix.om.functions.BuiltinFunctions;

/**
 * This class rewrites delete statement to contain a query that specifying
 * what to delete.
 */
public class SqlppDeleteRewriteVisitor extends AbstractSqlppAstVisitor<Void, Void> {

    @Override
    public Void visit(DeleteStatement deleteStmt, Void visitArg) {
        List<Expression> arguments = new ArrayList<>();
        Identifier dataverseName = deleteStmt.getDataverseName();
        Identifier datasetName = deleteStmt.getDatasetName();
        String arg = dataverseName == null ? datasetName.getValue()
                : dataverseName.getValue() + "." + datasetName.getValue();
        LiteralExpr argumentLiteral = new LiteralExpr(new StringLiteral(arg));
        arguments.add(argumentLiteral);
        CallExpr callExpression = new CallExpr(new FunctionSignature(BuiltinFunctions.DATASET), arguments);
        callExpression.setSourceLocation(deleteStmt.getSourceLocation());

        // From clause.
        VariableExpr var = deleteStmt.getVariableExpr();
        FromTerm fromTerm = new FromTerm(callExpression, var, null, null);
        fromTerm.setSourceLocation(var.getSourceLocation());
        FromClause fromClause = new FromClause(Collections.singletonList(fromTerm));
        fromClause.setSourceLocation(var.getSourceLocation());

        // Where clause.
        WhereClause whereClause = null;
        Expression condition = deleteStmt.getCondition();
        if (condition != null) {
            whereClause = new WhereClause(condition);
            whereClause.setSourceLocation(condition.getSourceLocation());
        }

        // Select clause.
        VariableExpr returnExpr = new VariableExpr(var.getVar());
        returnExpr.setIsNewVar(false);
        returnExpr.setSourceLocation(var.getSourceLocation());
        SelectElement selectElement = new SelectElement(returnExpr);
        selectElement.setSourceLocation(deleteStmt.getSourceLocation());
        SelectClause selectClause = new SelectClause(selectElement, null, false);
        selectClause.setSourceLocation(deleteStmt.getSourceLocation());

        // Construct the select expression.
        SelectBlock selectBlock = new SelectBlock(selectClause, fromClause,
                whereClause != null ? Collections.singletonList(whereClause) : null, null, null);
        selectBlock.setSourceLocation(var.getSourceLocation());
        SelectSetOperation selectSetOperation = new SelectSetOperation(new SetOperationInput(selectBlock, null), null);
        selectSetOperation.setSourceLocation(var.getSourceLocation());
        SelectExpression selectExpression = new SelectExpression(null, selectSetOperation, null, null, false);
        selectExpression.setSourceLocation(var.getSourceLocation());
        Query query = new Query(false, false, selectExpression, 0);
        query.setBody(selectExpression);
        query.setSourceLocation(deleteStmt.getSourceLocation());

        // return the delete statement.
        deleteStmt.setQuery(query);
        return null;
    }
}


text:
#include <functional>
#include <vector>
#include <algorithm>
#include <iostream>
#include "unity.h"
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"

static const char* TAG = "cxx";

TEST_CASE("can use new and delete", "[cxx]")
{
    int* int_p = new int(10);
    delete int_p;
    int* int_array = new int[10];
    delete[] int_array;
}

class Base
{
public:
    virtual ~Base() {}
    virtual void foo() = 0;
};

class Derived : public Base
{
public:
    virtual void foo() { }
};

TEST_CASE("can call virtual functions", "[cxx]")
{
    Derived d;
    Base& b = static_cast<Base&>(d);
    b.foo();
}

class NonPOD
{
public:
    NonPOD(int a_) : a(a_) { }
    int a;
};

static int non_pod_test_helper(int new_val)
{
    static NonPOD non_pod(42);
    int ret = non_pod.a;
    non_pod.a = new_val;
    return ret;
}

TEST_CASE("can use static initializers for non-POD types", "[cxx]")
{
    TEST_ASSERT_EQUAL(42, non_pod_test_helper(1));
    TEST_ASSERT_EQUAL(1, non_pod_test_helper(0));
}

TEST_CASE("can call std::function and bind", "[cxx]")
{
    int outer = 1;
    std::function<int(int)> fn = [&outer](int x) -> int {
        return x + outer;
    };
    outer = 5;
    TEST_ASSERT_EQUAL(6, fn(1));

    auto bound = std::bind(fn, outer);
    outer = 10;
    TEST_ASSERT_EQUAL(15, bound());
}

TEST_CASE("can use std::vector", "[cxx]")
{
    std::vector<int> v(10, 1);
    v[0] = 42;
    TEST_ASSERT_EQUAL(51, std::accumulate(std::begin(v), std::end(v), 0));
}

/*
 * This test exercises static initialization guards for two objects.
 * For each object, 4 tasks are created which attempt to perform static initialization.
 * We check that constructor runs only once for each object.
 */

static SemaphoreHandle_t s_slow_init_sem = NULL;

template<int obj>
class SlowInit
{
public:
    SlowInit(int arg) {
        ESP_LOGD(TAG, "init obj=%d start, arg=%d\n", obj, arg);
        vTaskDelay(300/portTICK_PERIOD_MS);
        TEST_ASSERT_EQUAL(-1, mInitBy);
        TEST_ASSERT_EQUAL(0, mInitCount);
        mInitBy = arg;
        ++mInitCount;
        ESP_LOGD(TAG, "init obj=%d done\n", obj);
    }

    static void task(void* arg) {
        int taskId = reinterpret_cast<int>(arg);
        ESP_LOGD(TAG, "obj=%d before static init, task=%d\n", obj, taskId);
        static SlowInit slowinit(taskId);
        ESP_LOGD(TAG, "obj=%d after static init, task=%d\n", obj, taskId);
        xSemaphoreGive(s_slow_init_sem);
        vTaskDelay(10);
        vTaskDelete(NULL);
    }
private:
    static int mInitBy;
    static int mInitCount;
};

template<> int SlowInit<1>::mInitBy = -1;
template<> int SlowInit<1>::mInitCount = 0;
template<> int SlowInit<2>::mInitBy = -1;
template<> int SlowInit<2>::mInitCount = 0;

template<int obj>
static void start_slow_init_task(int id, int affinity)
{
    xTaskCreatePinnedToCore(&SlowInit<obj>::task, "slow_init", 2048,
            reinterpret_cast<void*>(id), 3, NULL, affinity);
}

TEST_CASE("static initialization guards work as expected", "[cxx]")
{
    s_slow_init_sem = xSemaphoreCreateCounting(10, 0);
    TEST_ASSERT_NOT_NULL(s_slow_init_sem);
    // four tasks competing for static initialization of one object
    start_slow_init_task<1>(0, PRO_CPU_NUM);
    start_slow_init_task<1>(1, APP_CPU_NUM);
    start_slow_init_task<1>(2, PRO_CPU_NUM);
    start_slow_init_task<1>(3, tskNO_AFFINITY);

    // four tasks competing for static initialization of another object
    start_slow_init_task<2>(0, PRO_CPU_NUM);
    start_slow_init_task<2>(1, APP_CPU_NUM);
    start_slow_init_task<2>(2, PRO_CPU_NUM);
    start_slow_init_task<2>(3, tskNO_AFFINITY);

    // All tasks should
    for (int i = 0; i < 8; ++i) {
        TEST_ASSERT_TRUE(xSemaphoreTake(s_slow_init_sem, 500/portTICK_PERIOD_MS));
    }
    vSemaphoreDelete(s_slow_init_sem);
}

struct GlobalInitTest
{
    GlobalInitTest() : index(order++) {
    }
    int index;
    static int order;
};

int GlobalInitTest::order = 0;

GlobalInitTest g_init_test1;
GlobalInitTest g_init_test2;
GlobalInitTest g_init_test3;

TEST_CASE("global initializers run in the correct order", "[cxx]")
{
    TEST_ASSERT_EQUAL(0, g_init_test1.index);
    TEST_ASSERT_EQUAL(1, g_init_test2.index);
    TEST_ASSERT_EQUAL(2, g_init_test3.index);
}

struct StaticInitTestBeforeScheduler
{
    StaticInitTestBeforeScheduler()
    {
        static int first_init_order = getOrder();
        index = first_init_order;
    }

    int getOrder()
    {
        return order++;
    }

    int index;
    static int order;
};

int StaticInitTestBeforeScheduler::order = 1;

StaticInitTestBeforeScheduler g_static_init_test1;
StaticInitTestBeforeScheduler g_static_init_test2;
StaticInitTestBeforeScheduler g_static_init_test3;

TEST_CASE("before scheduler has started, static initializers work correctly", "[cxx]")
{
    TEST_ASSERT_EQUAL(1, g_static_init_test1.index);
    TEST_ASSERT_EQUAL(1, g_static_init_test2.index);
    TEST_ASSERT_EQUAL(1, g_static_init_test3.index);
    TEST_ASSERT_EQUAL(2, StaticInitTestBeforeScheduler::order);
}

TEST_CASE("can use iostreams", "[cxx]")
{
    std::cout << "hello world";
}


text:
package vn.vnpt.appbasic;

import org.apache.cordova.Config;
import org.apache.cordova.DroidGap;

import vn.vnpt.workinfo.R;

import android.content.res.Configuration;
import android.os.Bundle;

public class MainActivity extends DroidGap {
		@Override
		public void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
			super.setStringProperty("loadingDialog", "Welcome! please wait a moment...");
		    super.setIntegerProperty("loadUrlTimeoutValue", 5000);
		    // set splash screen and lock orientation
	        if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
	        {
	            super.setIntegerProperty("splashscreen", R.drawable.splashscreen_landscape);
	            //setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
	        }
	        else // ORIENTATION_PORTRAIT and ORIENTATION_UNDEFINED
	        {
	            super.setIntegerProperty("splashscreen", R.drawable.splashscreen_portrait);
	            //setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
	        }
		    //super.setIntegerProperty("splashscreen", R.drawable.splashscreen);
			super.loadUrl(Config.getStartUrl(), 5000);
		}
}


text:
class CTK_EXPORT ctkPopupWidgetPrivate
  : public ctkBasePopupWidgetPrivate
{
  Q_OBJECT
  Q_DECLARE_PUBLIC(ctkPopupWidget);
public:
  typedef ctkBasePopupWidgetPrivate Superclass;
  ctkPopupWidgetPrivate(ctkPopupWidget& object);
  ~ctkPopupWidgetPrivate();

  virtual void init();

  // Return the widget if the mouse cursor is above any of the focus widgets or their
  // children.
  // If the cursor is above a child widget, install the event filter to listen
  // when the cursor leaves the widget.
  virtual QWidget* mouseOver();

  virtual bool eventFilter(QObject* obj, QEvent* event);

  void temporarilyHiddenOn();
  void temporarilyHiddenOff();

  bool isHidingCandidate(QWidget* widget)const;

public Q_SLOTS:
  void updateVisibility();
  void onApplicationDeactivate();

protected:
  bool Active;
  bool AutoShow;
  int  ShowDelay;
  bool AutoHide;
  int  HideDelay;
};

#endif


text:
(function () {
  'use strict';

  angular
      .module('aMarket', [
        'ngRoute'
      ])
      .config(config)
      .controller('DashboardCtrl', DashboardCtrl)
      .controller('AutoMarketCtrl', AutoMarketCtrl);

  config.inject = ['$routeProvider'];

  function config($routeProvider) {
    $routeProvider
        .when('/dashboard', {
          templateUrl: './dashboard.html',
          controller: DashboardCtrl
        })
        .when('/automarket/:automarketId', {
          templateUrl: './automarket.html',
          controller: AutoMarketCtrl
        })
        .when('/auto/:autoId', {
          templateUrl: './auto.html',
          controller: AutoCtrl
        })
        .otherwise({
          redirectTo: '/dashboard'
        });
  }

  function DashboardCtrl($scope, $http, $location) {
    $scope.automarkets = [];
    $scope.isAddAutomarket = false;

    getAautomarkets();
    function getAautomarkets() {
      $http.get('/api/automarket')
          .then(function (automarkets) {
            $scope.automarkets = automarkets.data;
          }, function (err) {
            console.log(err);
          });
    }

    $scope.showAddAutomarket = function () {
      $scope.isAddAutomarket = !$scope.isAddAutomarket;
    };

    $scope.createAutomarket = function (automarket) {
      $http.post('/api/automarket', { automarket: automarket })
          .then(function () {
            $scope.showAddAutomarket();
            getAautomarkets();
          }, function (err) {
            console.log(err);
          });
    };

    $scope.editAutomarket = function (automarket) {
      $scope.newAutomarket = automarket;
      if (!$scope.isAddAutomarket) {
        $scope.showAddAutomarket();
      }
    };

    $scope.removeAutomarket = function (id) {
      $http.delete('/api/automarket/' + id)
          .then(function () {
            getAautomarkets();
          }, function (err) {
            console.log(err);
          });
    };

    $scope.goToAutomarketPage = function (autoId) {
      $location.path('automarket/' + autoId);
    }
  }

  function AutoMarketCtrl($scope, $http, $routeParams, $location) {
    $scope.isAddPerosnal = false;
    $scope.automarketId = $routeParams.automarketId;

    getAutomarket($scope.automarketId);
    function getAutomarket(automarketId) {
      $scope.newPersonal = { name: '', description: '' };

      $http.get('/api/automarket/' + automarketId)
          .then(function (automarket) {
            $scope.automarket = automarket.data;
          }, function (err) {
            console.log(err);
          })
    }

    $scope.removeMember = function (memberId) {
      $http.delete('/api/member/' + memberId)
          .then(function () {
            getAutomarket($scope.automarketId);
          }, function (err) {
            console.log(err);
          });
    };

    $scope.removeAuto = function (autoId) {
      $http.delete('/api/auto/' + autoId)
          .then(function () {
            getAutomarket($scope.automarketId);
          }, function (err) {
            console.log(err);
          });
    };

    $scope.showAddPersonal = function () {
      $scope.isAddPerosnal = !$scope.isAddPerosnal;
    };

    $scope.showAddAuto = function () {
      $scope.isAddAuto = !$scope.isAddAuto;
    };

    $scope.addPersonal = function (personal) {
      $http.post('/api/member', {
        personal: personal,
        automarketId: $scope.automarketId
      })
          .then(function () {
            $scope.showAddPersonal();
            getAutomarket($scope.automarketId);
          }, function (err) {
            console.log(err);
          })
    };

    $scope.addAuto = function (auto) {
      $http.post('/api/auto', {
        auto: auto,
        automarketId: $scope.automarketId
      })
          .then(function () {
            $scope.showAddAuto();
            getAutomarket($scope.automarketId);
          }, function (err) {
            console.log(err);
          })
    };

    $scope.goToAutoPage = function (autoId) {
      $location.path('/auto/' + autoId);
    }
  }

  function AutoCtrl($scope, $http, $routeParams) {
    $scope.autoId = $routeParams.autoId;
    $scope.isAddShares = $scope.isBuyAuto = false;

    getAuto($scope.autoId);
    function getAuto(autoId) {
      $http.get('/api/auto/' + autoId)
          .then(function (auto) {
            $scope.auto = auto.data;
          }, function (err) {
            console.log(err);
          })
    }

    $scope.showAddShares = function () {
      $scope.isAddShares = !$scope.isAddShares;
    };

    $scope.addShares = function (shares) {
      $http.post('/api/shares', {
        shares: shares,
        autoId: $scope.autoId
      })
          .then(function () {
            $scope.showAddShares();
            getAuto($scope.autoId);
          }, function (err) {
            console.log(err);
          })
    };

    $scope.removeShares = function (sharesId) {
      $http.delete('/api/shares/' + sharesId)
          .then(function () {
            getAuto($scope.autoId);
          }, function (err) {
            console.log(err);
          })
    };

    $scope.showBuyAuto = function () {
      $scope.isBuyAuto = !$scope.isBuyAuto;
    };

    $scope.buyAuto = function () {
      var today = new Date();
      var buyPrice = $scope.auto.price;

      for(var i in $scope.auto.shares) {
        if (new Date($scope.auto.shares[i].start) <= today && today <= new Date($scope.auto.shares[i].end)) {
          buyPrice = buyPrice * (100 - $scope.auto.shares[i].percentage) / 100;
        }
      }
      $scope.auto.buyPrice = buyPrice;
      $http.put('/api/auto/'+ $scope.auto._id, { auto: $scope.auto })
          .then(function () {
            $scope.showBuyAuto();
            getAuto($scope.autoId);
          }, function (err) {
            console.log(err);
          })
    }
  }
})();


text:
<?php
	//starting the session
	session_start();

// 	Allow for errors
	error_reporting(E_ALL);
	ini_set('display_errors', '1');

// 	Connect to the database NOTE: Hostgator may need another connection route than 'localhost'
	$mysqli = new mysqli("quikshop.co","cx300_cen3031","[cEn..3031!]","cx300_quikshop");

// 	Various Includes
	header("access-control-allow-origin: *");
	header("access-control-allow-methods: GET, POST, OPTIONS");
	header("access-control-allow-credentials: true");
	header("access-control-allow-headers: Content-Type, *");
	header("Content-type: application/json");

// 	Parse the log in form if the user has filled it out and pressed "Log In"
	if (isset($_POST["username"]) && isset($_POST["password"])) {

//	Assign the passed entry to variables
    $username = mysqli_real_escape_string($mysqli,$_POST['username']);
    $password = mysqli_real_escape_string($mysqli,$_POST['password']);

// This is the actual SQL query, read it left to right. Only return 1 row. Save as "sql"
	$sql = "SELECT * FROM Users WHERE email='$username' LIMIT 1";
// Call the database, save the result in the variable RESULT
     $result = $mysqli->query($sql) or die( $mysqli->error );
	 $row = " ";
// If there was a response, perform more actions, else return "error"
     if($result)
     {
		$row = mysqli_fetch_assoc($result);	// Gather the data (row in DB) that was found when the DB was queried
		$hashedPW = $row['password'];	// Get the value listed in the passHash field, save to a local PHP variable: hashedPW
		$userIdResponse = $row['userID'];	// Get the value listed in the userId field, save to local PHP variable: userIdResponse

		/*Response Array is what is returned. It is built dynamically and does not need to
		be initialized to an inital size. These simply add a slot and assign a value */
		$response_array['userID'] = $userIdResponse;
		$response_array['email'] = $username;

		$check = $mysqli->query("SELECT * FROM Logins WHERE userID='$userIdResponse';");
		if (mysqli_num_rows($check) == 0) {
			$sql="INSERT INTO Logins(userID) VALUES('$userIdResponse')";
			$result = $mysqli->query($sql) or die( $mysqli->error );
			if($result)
			{
				$result3 = $mysqli->query("SELECT cartID FROM Logins WHERE userID='$userIdResponse';");
				$row3 = mysqli_fetch_assoc($result3);
				$response_array['cartID'] = $row3['cartID'];
				$_SESSION['cartID'] = $row3['cartID'];

			}
		}
		else {
		$result2 = $mysqli->query("SELECT cartID FROM Logins WHERE userID='$userIdResponse';");
		$row2 = mysqli_fetch_assoc($result2);
		$response_array['cartID'] = $row2['cartID'];
		$_SESSION['cartID'] = $row2['cartID'];

		}
     }
     else
     {
		$response_array['status'] = 'error';
		$response_array['reason'] = 'ERROR: Query Was Unsuccessful';
     }

    /* PHP function to see if "password" (from the calling program) matches the value
we have in the database. We use a PHP function because we store the hashed value
the same sting can have basically unlimited hashes so the function handles matching
we never see the plaintext value (unless we drop variables to console which we
shouldn't once these are working */

     if (password_verify($password, $hashedPW))
     {
		$_SESSION['userID'] = $userIdResponse;

			if($row['adminStore'] != NULL || $row['empStore'] != NULL ){

				$response_array['customer'] = false;
			}else{

				$response_array['customer'] = true;
			}

		$response_array['status'] = 'success'; // The program uses the value of "status" to know to move to logged in state or not
     }
     else
     {
     $response_array['status'] = 'error';
     $response_array['reason'] = 'ERROR: Password was Incorrect';
     }

// 	Encode the response in JSON, it is automatically passed back to the caller. Also echo this to the console
		echo json_encode($response_array);

	}
// 	Close the connection
	$mysqli->close();
?>


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using static System.Configuration.ConfigurationManager;

namespace app
{
    public class Tsvreader
    {
        private string _extractInfoPath;
        private string _outputPath;

        public Tsvreader()
        {

            ExtractInfoPath = Properties.Settings.Default.ExtractInfoPath;
            OutputPath = Properties.Settings.Default.OutputPath;

        }

        public void Run(string registerDate, string inputFilePath)
        {
            if (!File.Exists(inputFilePath))
            {
                 Output = inputFilePath + "は存在しません";
                return;
            }
            RegisterDate = registerDate;
            InputFilePath = inputFilePath;

            const string command = "java";
            var psInfo = new ProcessStartInfo
            {
                FileName = command,
                Arguments =
                    $@"-jar {ExtractInfoPath} {RegisterDate} ""{InputFilePath}"" ""{OutputPath}""",
                CreateNoWindow = true,
                UseShellExecute = false,
                RedirectStandardOutput = true,
                RedirectStandardError = true
            };

            var p = Process.Start(psInfo);
            if (p == null) return;
            var output = p.StandardError.ReadToEnd();
            p.WaitForExit();
            Output = output.Replace("\r\r\n", "\n");
        }

        public string InputFilePath { get; set; }

        public string RegisterDate { get; set; }

        public string OutputPath
        {
            get { return _outputPath; }
            set
            {
                _outputPath = value;
                Properties.Settings.Default.OutputPath = value;
                Properties.Settings.Default.Save();
            }
        }

        public string ExtractInfoPath
        {
            get { return _extractInfoPath; }
            set
            {
                _extractInfoPath = value;
                Properties.Settings.Default.ExtractInfoPath = value;
                Properties.Settings.Default.Save();
            }
        }

        public string Output { get; set; }
    }
}


text:
import axios from 'axios';
import { ajaxErr } from '../lib/ajax';

let prefix = "";
if (!process.env.BROWSER) {
	//SSR
	console.log("process.env.ENABLE_SSL", process.env.ENABLE_SSL);
	prefix = (process.env.ENABLE_SSL=="1"?"https://":"http://") + "localhost";
	if(process.env.DOCKERMODE == "true"){
		prefix = (process.env.ENABLE_SSL=="1"?"https://":"http://") + process.env.NGINX_HOST;
	}
}

class PortfolioApi {
	static getAllPortfolio() {
		return axios({
			method: 'get',
			url: prefix + '/api/works.json',
			dataType: 'JSON'
		}).then((response) => {
			return response.data;
		}).catch(function (error) {
			let err = new ajaxErr(error);
			throw (err);
		});
	}
	static getRecentsWorks() {
		return axios({
			method: 'get',
			url: prefix + '/api/recentWorks.json',
			dataType: 'JSON'
		}).then((response) => {
			return response.data;
		}).catch(function (error) {
			let err = new ajaxErr(error);
			throw (err);
		});
	}
	static getF2eWorks() {
		return axios({
			method: 'get',
			url: prefix + '/api/f2eWorks.json',
			dataType: 'JSON'
		}).then((response) => {
			return response.data;
		}).catch(function (error) {
			let err = new ajaxErr(error);
			throw (err);
		});
	}
	static getDetails(id) {
		return axios({
			method: 'get',
			url: `/api/work/${id}/details.json`,
			dataType: 'JSON'
		}).then((response) => {
			return response.data;
		}).catch(function (error) {
			let err = new ajaxErr(error);
			throw (err);
		});
	}
	static getGraphicDesign() {
		return axios({
			method: 'get',
			url: prefix + '/api/graphicDesign.json',
			dataType: 'JSON'
		}).then((response) => {
			return response.data;
		}).catch(function (error) {
			let err = new ajaxErr(error);
			throw (err);
		});
	}
}

export default PortfolioApi;


text:
<?xml version="1.0" encoding="UTF-8"?>
<Tokens version="1.0">
	<File path="Constants/AWSCognitoIdentityProviderStatusType.html">

		<Token>
			<TokenIdentifier>//apple_ref/c/tdef/AWSCognitoIdentityProviderStatusType</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>AWSCognitoIdentityProviderModel.h</DeclaredIn>

			<NodeRef refid="1407"/>
		</Token>

        <Token>
            <TokenIdentifier>//apple_ref/c/econst/AWSCognitoIdentityProviderStatusTypeUnknown</TokenIdentifier>
            <Abstract type="html"></Abstract>
            <Declaration>AWSCognitoIdentityProviderStatusTypeUnknown</Declaration>

            <DeclaredIn>AWSCognitoIdentityProviderModel.h</DeclaredIn>

            <NodeRef refid="1407"/>
        </Token>

        <Token>
            <TokenIdentifier>//apple_ref/c/econst/AWSCognitoIdentityProviderStatusTypeEnabled</TokenIdentifier>
            <Abstract type="html"></Abstract>
            <Declaration>AWSCognitoIdentityProviderStatusTypeEnabled</Declaration>

            <DeclaredIn>AWSCognitoIdentityProviderModel.h</DeclaredIn>

            <NodeRef refid="1407"/>
        </Token>

        <Token>
            <TokenIdentifier>//apple_ref/c/econst/AWSCognitoIdentityProviderStatusTypeDisabled</TokenIdentifier>
            <Abstract type="html"></Abstract>
            <Declaration>AWSCognitoIdentityProviderStatusTypeDisabled</Declaration>

            <DeclaredIn>AWSCognitoIdentityProviderModel.h</DeclaredIn>

            <NodeRef refid="1407"/>
        </Token>

	</File>
</Tokens>


text:
using Google.Api.Ads.AdWords.Lib;
using Google.Api.Ads.AdWords.Util.Reports.v201809;
using Google.Api.Ads.AdWords.v201809;

using System;

namespace Google.Api.Ads.AdWords.Examples.CSharp.v201809
{
    /// <summary>
    /// This code example retrieves all the disapproved ads in a given campaign
    /// using AWQL. See https://developers.google.com/adwords/api/docs/guides/awql
    /// for AWQL documentation.
    /// </summary>
    public class GetAllDisapprovedAdsWithAwql : ExampleBase
    {
        /// <summary>
        /// Main method, to run this code example as a standalone application.
        /// </summary>
        /// <param name="args">The command line arguments.</param>
        public static void Main(string[] args)
        {
            GetAllDisapprovedAdsWithAwql codeExample = new GetAllDisapprovedAdsWithAwql();
            Console.WriteLine(codeExample.Description);
            try
            {
                long campaignId = long.Parse("INSERT_CAMPAIGN_ID_HERE");
                codeExample.Run(new AdWordsUser(), campaignId);
            }
            catch (Exception e)
            {
                Console.WriteLine("An exception occurred while running this code example. {0}",
                    ExampleUtilities.FormatException(e));
            }
        }

        /// <summary>
        /// Returns a description about the code example.
        /// </summary>
        public override string Description
        {
            get
            {
                return "This code example retrieves all the disapproved ads in a given campaign " +
                    "using AWQL. See https://developers.google.com/adwords/api/docs/guides/awql " +
                    "for AWQL documentation.";
            }
        }

        /// <summary>
        /// Runs the code example.
        /// </summary>
        /// <param name="user">The AdWords user.</param>
        /// <param name="campaignId">Id of the campaign for which disapproved ads
        /// are retrieved.</param>
        public void Run(AdWordsUser user, long campaignId)
        {
            using (AdGroupAdService adGroupAdService =
                (AdGroupAdService) user.GetService(AdWordsService.v201809.AdGroupAdService))
            {
                // Get all the disapproved ads for this campaign.
                SelectQuery query = new SelectQueryBuilder()
                    .Select(Ad.Fields.Id, AdGroupAd.Fields.PolicySummary)
                    .Where(AdGroup.Fields.CampaignId).Equals(campaignId)
                    .Where(AdGroupAdPolicySummary.Fields.CombinedApprovalStatus)
                    .Equals(ApprovalStatus.DISAPPROVED.ToString())
                    .OrderByAscending(Ad.Fields.Id)
                    .DefaultLimit()
                    .Build();

                AdGroupAdPage page = new AdGroupAdPage();
                int disapprovedAdsCount = 0;

                try
                {
                    do
                    {
                        // Get the disapproved ads.
                        page = adGroupAdService.query(query);

                        // Display the results.
                        if (page != null && page.entries != null)
                        {
                            foreach (AdGroupAd adGroupAd in page.entries)
                            {
                                AdGroupAdPolicySummary policySummary = adGroupAd.policySummary;
                                disapprovedAdsCount++;
                                Console.WriteLine(
                                    "Ad with ID {0} and type '{1}' was disapproved with the " +
                                    "following policy topic entries: ", adGroupAd.ad.id,
                                    adGroupAd.ad.AdType);
                                // Display the policy topic entries related to the ad disapproval.
                                foreach (PolicyTopicEntry policyTopicEntry in policySummary
                                    .policyTopicEntries)
                                {
                                    Console.WriteLine("  topic id: {0}, topic name: '{1}'",
                                        policyTopicEntry.policyTopicId,
                                        policyTopicEntry.policyTopicName);
                                    // Display the attributes and values that triggered the policy
                                    // topic.
                                    if (policyTopicEntry.policyTopicEvidences != null)
                                    {
                                        foreach (PolicyTopicEvidence evidence in policyTopicEntry
                                            .policyTopicEvidences)
                                        {
                                            Console.WriteLine("    evidence type: {0}",
                                                evidence.policyTopicEvidenceType);
                                            if (evidence.evidenceTextList != null)
                                            {
                                                for (int i = 0;
                                                    i < evidence.evidenceTextList.Length;
                                                    i++)
                                                {
                                                    Console.WriteLine(
                                                        "      evidence text[{0}]: {1}", i,
                                                        evidence.evidenceTextList[i]);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        query.NextPage(page);
                    } while (query.HasNextPage(page));

                    Console.WriteLine("Number of disapproved ads found: {0}", disapprovedAdsCount);
                }
                catch (Exception e)
                {
                    throw new System.ApplicationException("Failed to get disapproved ads.", e);
                }
            }
        }
    }
}


text:
from msrest.service_client import ServiceClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.compute_policies_operations import ComputePoliciesOperations
from .operations.firewall_rules_operations import FirewallRulesOperations
from .operations.storage_accounts_operations import StorageAccountsOperations
from .operations.data_lake_store_accounts_operations import DataLakeStoreAccountsOperations
from .operations.account_operations import AccountOperations
from .operations.locations_operations import LocationsOperations
from .operations.operations import Operations
from . import models

class DataLakeAnalyticsAccountManagementClientConfiguration(AzureConfiguration):
    """Configuration for DataLakeAnalyticsAccountManagementClient
    Note that all parameters used to create this instance are saved as instance
    attributes.

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: Get subscription credentials which uniquely
     identify Microsoft Azure subscription. The subscription ID forms part of
     the URI for every service call.
    :type subscription_id: str
    :param str base_url: Service URL
    """

    def __init__(
            self, credentials, subscription_id, base_url=None):

        if credentials is None:
            raise ValueError("Parameter 'credentials' must not be None.")
        if subscription_id is None:
            raise ValueError("Parameter 'subscription_id' must not be None.")
        if not base_url:
            base_url = 'https://management.azure.com'

        super(DataLakeAnalyticsAccountManagementClientConfiguration, self).__init__(base_url)

        self.add_user_agent('azure-mgmt-datalake-analytics/{}'.format(VERSION))
        self.add_user_agent('Azure-SDK-For-Python')

        self.credentials = credentials
        self.subscription_id = subscription_id

class DataLakeAnalyticsAccountManagementClient(object):
    """Creates an Azure Data Lake Analytics account management client.

    :ivar config: Configuration for client.
    :vartype config: DataLakeAnalyticsAccountManagementClientConfiguration

    :ivar compute_policies: ComputePolicies operations
    :vartype compute_policies: azure.mgmt.datalake.analytics.account.operations.ComputePoliciesOperations
    :ivar firewall_rules: FirewallRules operations
    :vartype firewall_rules: azure.mgmt.datalake.analytics.account.operations.FirewallRulesOperations
    :ivar storage_accounts: StorageAccounts operations
    :vartype storage_accounts: azure.mgmt.datalake.analytics.account.operations.StorageAccountsOperations
    :ivar data_lake_store_accounts: DataLakeStoreAccounts operations
    :vartype data_lake_store_accounts: azure.mgmt.datalake.analytics.account.operations.DataLakeStoreAccountsOperations
    :ivar account: Account operations
    :vartype account: azure.mgmt.datalake.analytics.account.operations.AccountOperations
    :ivar locations: Locations operations
    :vartype locations: azure.mgmt.datalake.analytics.account.operations.LocationsOperations
    :ivar operations: Operations operations
    :vartype operations: azure.mgmt.datalake.analytics.account.operations.Operations

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: Get subscription credentials which uniquely
     identify Microsoft Azure subscription. The subscription ID forms part of
     the URI for every service call.
    :type subscription_id: str
    :param str base_url: Service URL
    """

    def __init__(
            self, credentials, subscription_id, base_url=None):

        self.config = DataLakeAnalyticsAccountManagementClientConfiguration(credentials, subscription_id, base_url)
        self._client = ServiceClient(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = '2016-11-01'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.compute_policies = ComputePoliciesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.firewall_rules = FirewallRulesOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.storage_accounts = StorageAccountsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.data_lake_store_accounts = DataLakeStoreAccountsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.account = AccountOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.locations = LocationsOperations(
            self._client, self.config, self._serialize, self._deserialize)
        self.operations = Operations(
            self._client, self.config, self._serialize, self._deserialize)


text:
import unittest
from bulbs.config import Config
from bulbs.tests import BulbsTestCase, bulbs_test_suite
from bulbs.neo4jserver import Graph, Neo4jClient, NEO4J_URI, \
   VertexIndexProxy, EdgeIndexProxy, ExactIndex
from bulbs.tests import GremlinTestCase

config = Config(NEO4J_URI)
BulbsTestCase.client = Neo4jClient(config)
BulbsTestCase.vertex_index_proxy = VertexIndexProxy
BulbsTestCase.edge_index_proxy = EdgeIndexProxy
BulbsTestCase.index_class = ExactIndex
BulbsTestCase.graph = Graph(config)

def test_suite():
    suite = bulbs_test_suite()
    #suite.addTest(unittest.makeSuite(RestTestCase))
    suite.addTest(unittest.makeSuite(GremlinTestCase))
    return suite

if __name__ == '__main__':
    unittest.main(defaultTest='test_suite')


text:
import httplib
import json
import sys

from ...third_party import googlemaps_convert

class RenderGoogleDirections(object):
    def __init__(self, api_key):
        self.api_key = api_key

        self.locations = []

    def request(self, start_location, end_location, mode="driving"):
        """Make a request to the API. locations are tuples of (lat, lon) format.

        Possible modes are 'driving', 'bicycling', 'walking', 'transit'.
        """

        host = "maps.googleapis.com"

        start_param = str(start_location[0]) + "," + str(start_location[1])
        end_param = str(end_location[0]) + "," + str(end_location[1])

        api_url = "/maps/api/directions/json?origin={1}&destination={2}&mode={3}&key={0}"
        url = api_url.format(self.api_key, start_param, end_param, mode)

        # Assumes everything goes just peachy.

        conn = httplib.HTTPSConnection(host)
        conn.request("GET", url)
        res = conn.getresponse()
        response_data = res.read()

        self.data = json.loads(response_data)
        self.steps = []

        try:
            # TOOD Ensure we're getting all the routes and legs if necessary.
            self.steps = self.data["routes"][0]["legs"][0]["steps"]
        except Exception as err:
            sys.stderr.write("Google driving directions didn't load properly for some reason. For now, just try again.")
            sys.stderr.write(err)
            sys.stderr.write(self.data)

        conn.close()

        self.get_locations()

    def render(self, lonToX, latToY, pgraphics):
        s = pgraphics.createShape()
        s.beginShape()

        def vertex(location):
            x = lonToX(float(location['lng']))
            y = latToY(float(location['lat']))
            s.vertex(x, y)

        for loc in self.locations:
            vertex(loc)

        s.endShape(LINES)
        pgraphics.shape(s, 0, 0)

    def draw(self):
        pass

    def get_locations(self):
        for step in self.steps:
            self.add_location(step['start_location'])

            # Decoded polyline here.
            if 'polyline' in step:
                polyline = step['polyline']
                if 'points' in polyline:
                    points_str = str(polyline['points'])
                    if len(points_str) > 0:
                        path = googlemaps_convert.decode_polyline(points_str)
                        for loc in path:
                            self.add_location(loc)

            self.add_location(step['end_location'])

    def add_location(self, loc):
        self.locations.append(loc)


text:
REM %1 should be the location of openssl
REM %2 should be the domain you are writing a key for

%1 genrsa -out test.key 2048
%1 req -new -key test.key -out %2.csr
%1 x509 -req -in %2.csr -signkey test.key -out %2.crt


text:
League:
<select [value]="league" (change)="league = $event.target.value">
  <option>League A</option>
  <option>League B</option>
</select>

  {{ team.name }} {{ team | winPercentage | percent }}


text:
/*
  Copyright (c) 2005 Eliot Dresselhaus

  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.
*/

#ifndef included_clib_unix_h
#define included_clib_unix_h

#include <vppinfra/error.h>

/* Number of bytes in a Unix file. */
clib_error_t *unix_file_n_bytes (char *file, uword * result);

/* Read file contents into given buffer. */
clib_error_t *unix_file_read_contents (char *file, u8 * result,
				       uword n_bytes);

/* Read and return contents of Unix file. */
clib_error_t *unix_file_contents (char *file, u8 ** result);

/* As above but for /proc file system on Linux. */
clib_error_t *unix_proc_file_contents (char *file, u8 ** result);

#endif /* included_clib_unix_h */

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */


text:
package cn.featherfly.conversion.core.bp;
import java.time.LocalDateTime;

import cn.featherfly.conversion.core.format.LocalDateTimeFormatConvertor;

/**
 * <p>
 * LocalDateTime[]转换器
 * </p>
 *
 * @author 钟冀
 */
public class LocalDateTimeBeanPropertyArrayFormatConvertor extends BeanPropertyArrayFormatConvertor<LocalDateTime[], LocalDateTime> {

    /**
     */
    public LocalDateTimeBeanPropertyArrayFormatConvertor() {
        super(new LocalDateTimeFormatConvertor());
    }
}


text:
<component name="ProjectDictionaryState">
  <dictionary name="Henrik Samuelsson">
    <words>
      <w>clockwidget</w>
      <w>samdide</w>
    </words>
  </dictionary>
</component>


text:
if (typeof(berjon) == "undefined") berjon = {};
berjon.simpleNode = function (ns, doc) {
    // XXX need to default the xml prefix
    if (!ns) ns = {};
    if (!doc) doc = document;
    this.ns = ns;
    this.doc = doc;
};
berjon.calls = {};
berjon.simpleNode.prototype = {

    // --- NODE CREATION ---
    element:    function (name, attr, parent, content) {
        if (!attr) attr = {};
        var nmSt = this._nameToQName(name, false);
        var el = this.doc.createElementNS(nmSt.ns, name);
        for (var k in attr) this._setAttr(el, k, attr[k]);
        if (parent) parent.appendChild(el);
        if (content) {
            if (content instanceof Array) for (var i = 0; i < content.length; i++) el.appendChild(content[i]);
            else this.text(content, el);
        }
        return el;
    },

    text:    function (txt, parent) {
        var tn = this.doc.createTextNode(txt);
        if (parent) parent.appendChild(tn);
        return tn;
    },

    comment:    function (txt, parent) {
        var cmt = this.doc.createComment(txt);
        if (parent) parent.appendChild(cmt);
        return cmt;
    },

    pi:    function (target, data, parent) {
        var pi = this.doc.createProcessingInstruction(target, data);
        if (parent) parent.appendChild(pi);
        return pi;
    },

    documentFragment:    function (parent, content) {
        var df = this.doc.createDocumentFragment();
        if (content) {
            if (content instanceof Array) for (var i = 0; i < content.length; i++) df.appendChild(content[i]);
            else this.text(content, df);
        }
        if (parent) parent.appendChild(df);
        return df;
    },

    // --- FINDING STUFF ---
    findNodes:    function (xpath, context) {
        if (!context) context = this.doc;
        var ns = this.ns;
        var snap = this.doc.evaluate(xpath,
                                     context,
                                     function (pfx) { return ns[pfx] || null; },
                                     XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
                                     null);
        var res = [];
        for (var i = 0; i < snap.snapshotLength; i++) res.push(snap.snapshotItem(i));
        return res;
    },

    // --- MANIPULATION ---
    copyChildren:   function (from, to) {
        while (from.childNodes.length) to.appendChild(from.firstChild);
    },

    copyAttr:   function (from, to) {
        for (var i = 0; i < from.attributes.length; i++) {
            var at = from.attributes[i];
            to.setAttributeNS(at.namespaceURI, at.name, at.value);
        }
    },

    renameEl:   function (el, name) {
        // we remove, copy, then insert instead of just replacing because it's a *lot*
        // faster if the copyChildren operation is done while the node is not being displayed
        var folSib = el.nextSibling;
        var par = el.parentNode;
        if (par) par.removeChild(el);
        var newEl = this.element(name);
        this.copyAttr(el, newEl);
        this.copyChildren(el, newEl);
        // if (el.parentNode) el.parentNode.replaceChild(newEl, el);
        if (par) par.insertBefore(newEl, folSib);
        return newEl;
    },

    // --- ID MANAGEMENT ---
    makeID: function (el, pfx, txt) {
        if (el.hasAttribute("id")) return el.getAttribute("id");
        var id = "";
        if (!txt) {
            if (el.hasAttribute("title")) txt = el.getAttribute("title");
            else                          txt = el.textContent;
        }
        txt = txt.replace(/^\s+/, "");
        txt = txt.replace(/\s+$/, "");
        id += txt;
        id = id.toLowerCase();
        if (id.length == 0) id = "generatedID";
        id = this.sanitiseID(id);
        if (pfx) id = pfx + "-" + id;
        id = this.idThatDoesNotExist(id);
        el.setAttribute("id", id);
        return id;
    },

    sanitiseID:    function (id) {
        id = id.split(/[^-.0-9a-zA-Z_]/).join("-");
        id = id.replace(/^-+/g, "");
        id = id.replace(/-+$/, "");
        if (id.length > 0 && /^[^a-z]/.test(id)) id = "x" + id;
        if (id.length == 0) id = "generatedID";
        return id;
    },

    idCache: {},
    idThatDoesNotExist:    function (id) {
        var inc = 1;
        if (this.doc.getElementById(id) || this.idCache[id]) {
            while (this.doc.getElementById(id + "-" + inc) || this.idCache[id + "-" + inc]) inc++;
            id = id + "-" + inc;
        }
        // XXX disable caching for now
        // this.idCache[id] = true;
        return id;
    },

    // --- CLASS HANDLING ---
    hasClass:    function (el, cl) {
        return this.listClasses(el).indexOf(cl) >= 0;
    },

    addClass:    function (el, cl) {
        var ls = this.listClasses(el);
        if (ls.indexOf(cl) >= 0) return;
        ls.push(cl);
        this.setClassList(el, ls);
    },

    removeClass:    function (el, cl) {
        var ls = this.listClasses(el);
        var idx = ls.indexOf(cl);
        if (idx < 0) return;
        ls.splice(idx, 1);
        this.setClassList(el, ls);
    },

    listClasses:    function (el) {
        if (el.hasAttribute("class")) {
            return el.getAttribute("class").split(/\s+/);
        }
        else return [];
    },

    setClassList:    function (el, ls) {
        el.setAttribute("class", ls.join(" "));
    },

    // --- HELPERS ---
    _nameToQName:    function (name, isAttr) {
        var matches = /^(.+):(.+)$/.exec(name);
        var pfx, ns, ln;
        if (matches) {
            pfx = matches[1];
            ln = matches[2];
            if (!this.ns[pfx]) throw "No namespace declared for prefix '" + pfx + "'";
            ns = this.ns[pfx];
        }
        else {
            if (isAttr) ns = null;
            else        ns = this.ns[""];
            ln = name;
        }
        return { ns: ns, ln: ln };
    },

    _setAttr:    function (el, name, value) {
        var nmSt = this._nameToQName(name, true);
        el.setAttributeNS(nmSt.ns, nmSt.ln, value);
    }
};


text:
<!DOCTYPE html>

<form name="input" action="html_form_action.asp" method="get">
	First name: <input type="text" name="FirstName" value="Mickey">

	Last name: <input type="text" name="LastName" value="Mouse">

<input type="submit" value="Submit">
</form>

If you click the "Submit" button, the form-data will be sent to a page called "html_form_action.asp".


text:
import {ArtifactoryDao} from '../artifactory_dao';

export class PermissionsDao extends ArtifactoryDao {

    constructor($resource, RESOURCE,artifactoryNotificationsInterceptor)
    {
        super($resource, RESOURCE, artifactoryNotificationsInterceptor);

        this.setUrl(RESOURCE.API_URL + RESOURCE.TARGET_PERMISSIONS + '/:action/:name');

        this.setCustomActions({
            getAll: {
                method: 'GET',
                isArray: true,
                params: {action: 'crud'}
            },
            getAllUsersAndGroups: {
                method: 'GET',
                params: {action: 'allUsersGroups'}
            },
            getPermission: {
                method: 'GET',
                params: {name: '@name', action: 'crud'}
            },
            deletePermission: {
                method: 'POST',
                params: {action:'deleteTargetPermissions'},
                notifications: true
            },
            update: {
                method: 'PUT',
                params: {name: '@name'}
            },
            create: {
                method: 'POST',
                notifications: true
            }
        });
    }
}


text:
var fs = require('fs');

fs.readFile('example.txt', function(err, data) {
  if(err) {
    console.log(err);
  } else {
    //Now we can do stuff with the data in the file
    console.log(data.toString());
  }
});


text:
.. detan documentation master file

Index
=====

Modules
-------

.. toctree::
   :maxdepth: 2

   detan

.. include:: ../README.rst

Indices and tables
------------------

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
<?php

/**
 * @file
 * Definition of Drupal\views\Tests\Plugin\ArgumentValidatorTest.
 */

namespace Drupal\views\Tests\Plugin;

use Drupal\views\Tests\ViewUnitTestBase;
use Drupal\views\Views;

/**
 * Tests Views argument validators.
 *
 * @group views
 */
class ArgumentValidatorTest extends ViewUnitTestBase {

  /**
   * Views used by this test.
   *
   * @var array
   */
  public static $testViews = array('test_view_argument_validate_numeric');

  function testArgumentValidateNumeric() {
    $view = Views::getView('test_view_argument_validate_numeric');
    $view->initHandlers();
    $this->assertFalse($view->argument['null']->validateArgument($this->randomString()));
    // Reset safed argument validation.
    $view->argument['null']->argument_validated = NULL;
    $this->assertTrue($view->argument['null']->validateArgument(12));
  }

}


text:
package fr.ritaly.dungeonmaster.item;

import org.apache.commons.lang.Validate;

/**
 * Factory of items. This factory provides factory methods more convenient to
 * use than the constructors of item classes.
 *
 * @author Francois RITALY
 */
public class ItemFactory {

	private static final ItemFactory FACTORY = new ItemFactory();

	private ItemFactory() {
	}

	public static ItemFactory getFactory() {
		return FACTORY;
	}

	/**
	 * Creates and returns a new item with the given type.
	 *
	 * @param type
	 *            the type of item to create. Can't be null.
	 * @return a new item.
	 */
	public Item newItem(final Item.Type type) {
		Validate.notNull(type, "The given item type is null");

		return type.newItem();
	}
}


text:
package main

import (
	"net/http"

	"fmt"
	uuid "github.com/satori/go.uuid"
	"golang.org/x/crypto/bcrypt"
	"html/template"
)

type user struct {
	UserName string
	Password []byte
	First    string
	Last     string
}

var tpl *template.Template

var dbUsers = map[string]user{}     // User ID, user
var dbSession = map[string]string{} // Session ID, User ID (email)

func init() {
	tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
}

func main() {
	http.HandleFunc("/", index)
	http.HandleFunc("/signup", signup)
	http.HandleFunc("/bar", bar)
	http.Handle("/favicon.ico", http.NotFoundHandler())
	http.ListenAndServe(":8080", nil)
}

func index(w http.ResponseWriter, r *http.Request) {
	u := getUser(w, r)
	tpl.ExecuteTemplate(w, "index.gohtml", u)
}

func signup(w http.ResponseWriter, r *http.Request) {

	if alreadyLogedIn(r) {
		http.Redirect(w, r, "/", http.StatusSeeOther)
		return
	}

	// Process the form
	if r.Method == http.MethodPost {
		e := r.FormValue("username")
		p := r.FormValue("password")
		f := r.FormValue("first")
		l := r.FormValue("last")

		// Is user name already taken, user has already signed up ?
		if _, ok := dbUsers[e]; ok {
			http.Error(w, "Username Already taken", http.StatusForbidden)
			return
		}

		// Create new Session
		id := uuid.NewV4()
		c := &http.Cookie{
			Name:     "session",
			Value:    id.String(),
			HttpOnly: true,
			Path:     "/",
		}
		http.SetCookie(w, c) // Setting the Cookie

		dbSession[c.Value] = e

		// Hash the password
		ps, err := bcrypt.GenerateFromPassword([]byte(p), bcrypt.MinCost)
		if err != nil {
			http.Error(w, "Internal server error", http.StatusInternalServerError)
			return
		}

		// Store the User
		u := user{e, ps, f, l}
		dbUsers[e] = u
		fmt.Println("User Created ", u)

		// Done need to redirect to main page
		http.Redirect(w, r, "/", http.StatusSeeOther)
		return
	}

	tpl.ExecuteTemplate(w, "signup.gohtml", nil)
}

func bar(w http.ResponseWriter, r *http.Request) {

	if !alreadyLogedIn(r) {
		http.Redirect(w, r, "/", http.StatusSeeOther)
		return
	}
	u := getUser(w, r)
	tpl.ExecuteTemplate(w, "bar.gohtml", u)
}


text:
//
//  UrlSchemeTesterViewController.m
//  GetSocialInternalDemo
//
//  Copyright © 2020 GetSocial BV. All rights reserved.
//

#import "UrlSchemeTesterViewController.h"
#import "UISimpleAlertViewController.h"

@interface UrlSchemeTesterViewController ()

@property(weak, nonatomic) IBOutlet UITextField *urlInput;

@end

@implementation UrlSchemeTesterViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (IBAction)generateUrl:(id)sender
{
    BOOL result = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.urlInput.text]];
    if (!result)
    {
        [[[UISimpleAlertViewController alloc] initWithTitle:@"Error"
                                                    message:@"Failed to open the URL."
                                          cancelButtonTitle:@"Close"
                                          otherButtonTitles:nil] showWithDismissHandler:nil];
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
'use strict'
let Bn = require('../../lib/bn')
let Br = require('../../lib/br')
let Interp = require('../../lib/interp')
let Script = require('../../lib/script')
let Tx = require('../../lib/tx')
let TxOut = require('../../lib/tx-out')
let TxOutMap = require('../../lib/tx-out-map')
let TxVerifier = require('../../lib/tx-verifier')
let asink = require('asink')

module.exports.testTxVerifierPartial = function testTxVerifierPartial (it, txValid, txInvalid, mod = 0) {
  let c = 0
  txValid.forEach(function (vector, i) {
    if (vector.length === 1) {
      return
    }
    c++
    if ((c + mod) % 4) {
      return
    }
    it('should verify txValid vector ' + c, function () {
      let inputs = vector[0]
      let txhex = vector[1]
      let flags = Interp.getFlags(vector[2])

      let txOutMap = new TxOutMap()
      inputs.forEach(function (input) {
        let txOutNum = input[1]
        if (txOutNum === -1) {
          txOutNum = 0xffffffff // bitcoind casts -1 to an unsigned int
        }
        let txOut = TxOut.fromProperties(new Bn(0), new Script().fromBitcoindString(input[2]))
        let txHashBuf = new Br(new Buffer(input[0], 'hex')).readReverse()
        txOutMap.add(txHashBuf, txOutNum, txOut)
      })

      let tx = new Tx().fromBuffer(new Buffer(txhex, 'hex'))
      let verified = TxVerifier.verify(tx, txOutMap, flags)
      verified.should.equal(true)
    })

    it('should async verify txValid vector ' + c, function () {
      return asink(function * () {
        let inputs = vector[0]
        let txhex = vector[1]
        let flags = Interp.getFlags(vector[2])

        let txOutMap = new TxOutMap()
        inputs.forEach(function (input) {
          let txOutNum = input[1]
          if (txOutNum === -1) {
            txOutNum = 0xffffffff // bitcoind casts -1 to an unsigned int
          }
          let txOut = TxOut.fromProperties(new Bn(0), new Script().fromBitcoindString(input[2]))
          let txHashBuf = new Br(new Buffer(input[0], 'hex')).readReverse()
          txOutMap.add(txHashBuf, txOutNum, txOut)
        })

        let tx = new Tx().fromBuffer(new Buffer(txhex, 'hex'))
        let verified = yield TxVerifier.asyncVerify(tx, txOutMap, flags)
        verified.should.equal(true)
      }, this)
    })
  })

  c = 0
  txInvalid.forEach(function (vector, i) {
    if (vector.length === 1) {
      return
    }
    c++
    if ((c + mod) % 4) {
      return
    }
    it('should unverify txInvalid vector ' + c, function () {
      let inputs = vector[0]
      let txhex = vector[1]
      let flags = Interp.getFlags(vector[2])

      let txOutMap = new TxOutMap()
      inputs.forEach(function (input) {
        let txOutNum = input[1]
        if (txOutNum === -1) {
          txOutNum = 0xffffffff // bitcoind casts -1 to an unsigned int
        }
        let txOut = TxOut.fromProperties(new Bn(0), new Script().fromBitcoindString(input[2]))
        let txHashBuf = new Br(new Buffer(input[0], 'hex')).readReverse()
        txOutMap.add(txHashBuf, txOutNum, txOut)
      })

      let tx = new Tx().fromBuffer(new Buffer(txhex, 'hex'))

      let verified = TxVerifier.verify(tx, txOutMap, flags)
      verified.should.equal(false)
    })

    it('should async unverify txInvalid vector ' + c, function () {
      return asink(function * () {
        let inputs = vector[0]
        let txhex = vector[1]
        let flags = Interp.getFlags(vector[2])

        let txOutMap = new TxOutMap()
        inputs.forEach(function (input) {
          let txOutNum = input[1]
          if (txOutNum === -1) {
            txOutNum = 0xffffffff // bitcoind casts -1 to an unsigned int
          }
          let txOut = TxOut.fromProperties(new Bn(0), new Script().fromBitcoindString(input[2]))
          let txHashBuf = new Br(new Buffer(input[0], 'hex')).readReverse()
          txOutMap.add(txHashBuf, txOutNum, txOut)
        })

        let tx = new Tx().fromBuffer(new Buffer(txhex, 'hex'))

        let verified = yield TxVerifier.asyncVerify(tx, txOutMap, flags)
        verified.should.equal(false)
      }, this)
    })
  })
}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller.cameraManagement;

import geometry.geom2d.Point2D;

import com.jme3.input.InputManager;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.AnalogListener;
import com.jme3.renderer.Camera;

/**
 *
 * @author Benoît
 */
public abstract class CameraManager implements AnalogListener, ActionListener{
    protected final Camera cam;

    protected String[] mappings;

    public CameraManager(Camera cam) {
        this.cam = cam;
    }

    public Point2D getCamCorner(){
    	return new Point2D(cam.getWidth(), cam.getHeight());
    }

    public abstract void unregisterInputs(InputManager inputManager);
    public abstract void registerInputs(InputManager inputManager);
    public abstract void activate();
    public abstract void desactivate();

}


text:
SilexPhpTemplating
==================

Silex Service Provider for the Symfony 2 PHP Templating engine.


text:
'use strict'

const video = document.querySelector('#camera-stream');
const outputCanvas = document.querySelector('#output-canvas');
const outputContext = outputCanvas.getContext('2d');

// Efficiently compute the median of a large stream of numbers
// from a limited range. For streams of even length, the lower
// value is returned (rather than the average) to ensure it's
// always an integer.
function BucketMedian() {
    this.count = 0;
    this.values = [];
    this.add = function(value) {
        if (this.values[value])
            this.values[value]++;
        else
            this.values[value]=1;
        this.count++;
    }
    this.getMedian = function() {
        let c = 0;
        for (const [i, value] of this.values.entries()) {
            if (value) {
                c += value;
                if (c >= this.count / 2)
                    return i;
            }
        }
        return 0;
    }
}
const getMedianRGB = (frame, width, height, inset) => {
    let r = new BucketMedian();
    let g = new BucketMedian();
    let b = new BucketMedian();

    for (let y = Math.round(height*inset); y < height - Math.round(height*inset); y++) {
        for (let x = Math.round(width*inset); x < width - Math.round(width*inset); x++) {
        let idx = y * width * 4 + x * 4;
        r.add(frame.data[idx]);
        g.add(frame.data[idx + 1]);
        b.add(frame.data[idx + 2]);
        }
    }

    return {
        r: r.getMedian(),
        g: g.getMedian(),
        b: b.getMedian(),
    };
};

const clamp = (val, min, max) => {
    if (val > max)
        return max;
    if (val < min)
        return min;
    return val;
}

const scale = (val, around) => {
    const scaleFactor = 5;
    return clamp((val - around) * scaleFactor + around, 0, 255);
}

const processFrame = () => {
  const { videoWidth: width, videoHeight: height } = video;

  if (width && height) {
    outputCanvas.width = width;
    outputCanvas.height = height;
    outputContext.drawImage(video, 0, 0, width, height);

    const windowWidthFraction = 0.5;
    const windowAspectRatio = 4;
    const measureInset = 0.1;
    const lineWidth = 3;

    outputContext.lineWidth = lineWidth;
    outputContext.strokeStyle = 'yellow';
    const windowWidth = Math.round(width * windowWidthFraction);
    const windowX = Math.round((width - windowWidth) / 2);
    const windowHeight = Math.round(windowWidth / windowAspectRatio);
    const windowY = Math.round((height - windowHeight) / 2);
    outputContext.strokeRect(
        windowX - lineWidth/2, windowY - lineWidth/2,
        windowWidth + lineWidth, windowHeight + lineWidth);

    const windowData = outputContext.getImageData(windowX, windowY, windowWidth, windowHeight);

    const median = getMedianRGB(windowData, windowWidth, windowHeight, measureInset);

    for (let y = 0; y < windowHeight; y++) {
        for (let x = 0; x < windowWidth; x++) {
            const idx = y * windowWidth * 4 + x * 4;
            windowData.data[idx] = scale(windowData.data[idx], median.r);
            windowData.data[idx+1] = scale(windowData.data[idx+1], median.g);
            windowData.data[idx+2] = scale(windowData.data[idx+2], median.b);
        }
    }
    outputContext.putImageData(windowData, windowX, windowY);
  }

  window.requestAnimationFrame(processFrame);
};

const constraints = {
    video: {
      width: window.innerWidth,
      height: window.innerHeight,
    },
  };

navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
  video.srcObject = stream;
  video.play();
}).catch(function (err) {
  console.error(err);
});

video.addEventListener('play', function () {
  window.requestAnimationFrame(processFrame);
});


text:
//Problem 3. Compare char arrays

//Write a program that compares two char arrays lexicographically (letter by letter).

using System;
using System.Linq;

class CompareTwoCharArrays
{
    static void Main()
    {
        Console.Write("Please, enter a lenght for the first array: ");
        int firstArrayLenght = int.Parse(Console.ReadLine());
        char[] firstArray = FillArray(firstArrayLenght);

        Console.Write("Please, enter a lenght for the first array: ");
        int secondArrayLenght = int.Parse(Console.ReadLine());
        char[] secondArray = FillArray(secondArrayLenght);

        if (firstArrayLenght == secondArrayLenght)
        {
            Array.Sort(firstArray);
            Array.Sort(secondArray);

            for (int i = 0; i < firstArray.Length; i++)
            {
                if (firstArray[i] != secondArray[i])
                {
                    Console.WriteLine("Not equal!");
                    return;
                }
            }

            Console.WriteLine("Equal!");
        }
        else
        {
            Console.WriteLine("Not equal!");
        }

    }

    private static char[] FillArray(int arrayLenght)
    {
        char[] array = new char[arrayLenght];
        for (int i = 0; i < arrayLenght; i++)
        {
            Console.Write("First array[{0}] = ", i);
            array[i] = char.Parse(Console.ReadLine());
        }

        return array;
    }
}


text:
package com.twitter.finagle.client

import com.twitter.conversions.time._
import com.twitter.finagle._
import com.twitter.finagle.factory.TimeoutFactory
import com.twitter.finagle.filter.{ExceptionSourceFilter, MonitorFilter}
import com.twitter.finagle.loadbalancer.{
  DefaultBalancerFactory, LoadBalancerFactory, WeightedLoadBalancerFactory}
import com.twitter.finagle.service.{
  ExpiringService, FailFastFactory, FailureAccrualFactory, TimeoutFilter}
import com.twitter.finagle.stats.{ClientStatsReceiver, NullStatsReceiver, StatsReceiver}
import com.twitter.finagle.tracing._
import com.twitter.finagle.transport.Transport
import com.twitter.finagle.util.{
  DefaultMonitor, DefaultTimer, LoadedReporterFactory, ReporterFactory}
import com.twitter.util.{Duration, Monitor, Timer, Var}
import java.net.{SocketAddress, InetSocketAddress}

object DefaultClient {
  private val defaultFailureAccrual: ServiceFactoryWrapper =
    FailureAccrualFactory.wrapper(5, 5.seconds)(DefaultTimer.twitter)
}

/**
 * A default client implementation that does load balancing and
 * connection pooling. The only required argument is a binder,
 * responsible for binding concrete endpoints (named by
 * SocketAddresses).
 *
 * @param name A name identifying the client.
 *
 * @param endpointer A function used to create a ServiceFactory
 * to a concrete endpoint.
 *
 * @param pool The pool used to cache idle service (connection).
 *
 * @param maxIdletime The maximum time for which any `Service` is
 * permitted to be idle.
 *
 * @param maxLifetime The maximum lifetime for any `Service`
 *
 * @param requestTimeout The maximum time that any request is allowed
 * to take.
 *
 * @param failFast When enabled, installs a fail-fast module. See
 * [[com.twitter.finagle.service.FailFastFactory]]
 *
 * @param failureAccrual A failure accruing mechanism. Used to
 * gauge the health of the ServiceFactory. By default this uses
 * [[com.twitter.finagle.client.DefaultClient.defaultFailureAccrual]]
 *
 * @param serviceTimeout The maximum amount of time allowed for
 * acquiring a service. Defaults to infinity.
 */
case class DefaultClient[Req, Rep](
  name: String,
  endpointer: (SocketAddress, StatsReceiver) => ServiceFactory[Req, Rep],
  pool: StatsReceiver => Transformer[Req, Rep] = DefaultPool[Req, Rep](),
  maxIdletime: Duration = Duration.Top,
  maxLifetime: Duration = Duration.Top,
  requestTimeout: Duration = Duration.Top,
  failFast: Boolean = true,
  failureAccrual: Transformer[Req, Rep] = { factory: ServiceFactory[Req, Rep] =>
    DefaultClient.defaultFailureAccrual andThen factory
  },
  serviceTimeout: Duration = Duration.Top,
  timer: Timer = DefaultTimer.twitter,
  statsReceiver: StatsReceiver = ClientStatsReceiver,
  hostStatsReceiver: StatsReceiver = NullStatsReceiver,
  tracer: Tracer  = DefaultTracer,
  monitor: Monitor = DefaultMonitor,
  reporter: ReporterFactory = LoadedReporterFactory,
  loadBalancer: WeightedLoadBalancerFactory = DefaultBalancerFactory,
  newTraceInitializer: Stack.Simple[ServiceFactory[Req, Rep]] = TraceInitializerFilter.clientModule[Req, Rep]
) extends Client[Req, Rep] { outer =>

  private[this] def transform(stack: Stack[ServiceFactory[Req, Rep]]) = {
    val stk = stack
      .replace(FailureAccrualFactory.role, failureAccrual)
      .replace(StackClient.Role.pool, pool(statsReceiver))
      .replace(TraceInitializerFilter.role, newTraceInitializer)

    if (!failFast) stk.remove(FailFastFactory.role) else stk
  }

  private[this] val clientStack = transform(StackClient.newStack[Req, Rep])
  private[this] val endpointStack = transform(StackClient.endpointStack[Req, Rep])

  private[this] val params = Stack.Params.empty +
    param.Label(name) +
    param.Timer(timer) +
    param.Monitor(monitor) +
    param.Stats(statsReceiver) +
    param.Tracer(tracer) +
    param.Reporter(reporter) +
    LoadBalancerFactory.HostStats(hostStatsReceiver) +
    LoadBalancerFactory.Param(loadBalancer) +
    TimeoutFactory.Param(serviceTimeout) +
    TimeoutFilter.Param(requestTimeout) +
    ExpiringService.Param(maxIdletime, maxLifetime)

  private[this] case class Client(stack: Stack[ServiceFactory[Req, Rep]] = clientStack,
    params: Stack.Params = params)
      extends StdStackClient[Req, Rep, Client] {

    protected def copy1(
      stack: Stack[ServiceFactory[Req, Rep]] = this.stack,
      params: Stack.Params = this.params) = copy(stack, params)

    protected type In = Req
    protected type Out = Rep
    // The default client forces users to compose these two as part of
    // the `endpointer`. We ignore them and instead override the
    // endpointer directly.
    private[this] val unimpl = new Exception("unimplemented")
    def newTransporter() = throw unimpl
    protected def newDispatcher(transport: Transport[In, Out]) = throw unimpl

    override protected val endpointer = new Stack.Simple[ServiceFactory[Req, Rep]] {
      val role = com.twitter.finagle.stack.Endpoint
      val description = "Send requests over the wire"
      def make(next: ServiceFactory[Req, Rep])(implicit params: Stack.Params) = {
        val param.Stats(sr) = get[param.Stats]
        val Transporter.EndpointAddr(addr) = get[Transporter.EndpointAddr]
        outer.endpointer(addr, sr)
      }
    }
  }

  private[this] val underlying = Client()

  def newClient(dest: Name, label: String) =
    underlying.newClient(dest, label)

  // These are kept around to not break the API. They probably should
  // have been private[finagle] to begin with.
  val newStack: Name => ServiceFactory[Req, Rep] = newClient(_, name)
  val newStack0: Var[Addr] => ServiceFactory[Req, Rep] = va => {
    clientStack.make(params + LoadBalancerFactory.Dest(va))
  }
  val bindStack: SocketAddress => ServiceFactory[Req, Rep] = sa => {
    endpointStack.make(params + Transporter.EndpointAddr(sa))
  }
}


text:
from libpepper.vals.basic_types.pepvariable import PepVariable

def _has_default( type_and_name ):
    return ( len( type_and_name ) == 3 )

def execution_environment( arg_types_and_names, args, known, env ):
    newenv = env.clone_deeper()

    i = 0
    while i < len( arg_types_and_names ):
        type_and_name = arg_types_and_names[i]
        name = type_and_name[1]

        if i < len( args ):
            val = args[i]
        else:
            assert _has_default( type_and_name )
            val = type_and_name[2]

        if known:
            val = val#.evaluate( env )
        else:
            if i < len( args ):
                tp = args[i].evaluated_type( newenv )

                # TODO: imports here to avoid circular deps
                from libpepper.vals.types import PepUserClass
                from libpepper.vals.types import PepConstructingUserClass

                # TODO: this seems like a hack to me.  Can we make
                #       the evaluated type of args[i] just be the
                #       right type (PepConstructingUserClass) already?
                #       If so, we probably do it in cpprenderer.add_def_init.
                if (
                    tp.__class__ == PepUserClass and
                    type_and_name[0].__class__ == PepConstructingUserClass
                ):
                    tp = PepConstructingUserClass( tp )

            else:
                tp  = type_and_name[0]
            val = PepVariable( tp.evaluate( env ), name.name() )

        newenv.namespace[name.name()] = val
        i += 1

    return newenv


text:
(function () {

    function boot () {

        var settings = window._CCSettings;
        window._CCSettings = undefined;

        if ( !settings.debug ) {
            // retrieve minified raw assets
            var rawAssets = settings.rawAssets;
            var assetTypes = settings.assetTypes;
            for (var mount in rawAssets) {
                var entries = rawAssets[mount];
                for (var uuid in entries) {
                    var entry = entries[uuid];
                    var type = entry[1];
                    if (typeof type === 'number') {
                        entry[1] = assetTypes[type];
                    }
                }
            }
        }

        // init engine
        var canvas;

        if (cc.sys.isBrowser) {
            canvas = document.getElementById('GameCanvas');
        }

        function setLoadingDisplay () {
            // Loading splash scene
            var splash = document.getElementById('splash');
            var progressBar = splash.querySelector('.progress-bar span');
            var currentResCount = cc.loader.getResCount();
            cc.loader.onProgress = function (completedCount, totalCount, item) {
                var percent = 100 * (completedCount - currentResCount) / (totalCount - currentResCount);
                if (progressBar) {
                    progressBar.style.width = percent.toFixed(2) + '%';
                }
            };
            splash.style.display = 'block';

            cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () {
                splash.style.display = 'none';
            });
        }

        var onStart = function () {
            cc.view.resizeWithBrowserSize(true);
            // UC browser on many android devices have performance issue with retina display
            if (cc.sys.os !== cc.sys.OS_ANDROID || cc.sys.browserType !== cc.sys.BROWSER_TYPE_UC) {
                cc.view.enableRetina(true);
            }
            //cc.view.setDesignResolutionSize(settings.designWidth, settings.designHeight, cc.ResolutionPolicy.SHOW_ALL);
            cc.view.enableAutoFullScreen(cc.sys.isMobile && cc.sys.browserType !== cc.sys.BROWSER_TYPE_BAIDU);

            if (cc.sys.isBrowser) {
                setLoadingDisplay();
            }

            if (settings.orientation === 'landscape') {
                cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE);
            }
            else if (settings.orientation === 'portrait') {
                cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT);
            }

            // init assets
            cc.AssetLibrary.init({
                libraryPath: 'res/import',
                rawAssetsBase: 'res/raw-',
                rawAssets: settings.rawAssets,
                packedAssets: settings.packedAssets
            });

            var launchScene = settings.launchScene;

            // load scene
            if (cc.runtime) {
                cc.director.setRuntimeLaunchScene(launchScene);
            }
            cc.director.loadScene(launchScene, null,
                function () {
                    if (cc.sys.isBrowser) {
                        // show canvas
                        canvas.style.visibility = '';
                        var div = document.getElementById('GameDiv');
                        if (div) {
                            div.style.backgroundImage = '';
                        }
                    }

                    // play game
                    // cc.game.resume();

                    console.log('Success to load scene: ' + launchScene);
                }
            );
        };

        // jsList
        var jsList = settings.jsList;
        var bundledScript = settings.debug ? 'project.dev.js' : 'project.js';
        if (jsList) {
            jsList.push(bundledScript);
        }
        else {
            jsList = [bundledScript];
        }

        // anysdk scripts
        if (cc.sys.isNative && cc.sys.isMobile) {
            jsList = jsList.concat(['jsb_anysdk.js', 'jsb_anysdk_constants.js']);
        }

        jsList = jsList.map(function (x) { return 'src/' + x; });

        var option = {
            //width: width,
            //height: height,
            id: 'GameCanvas',
            scenes: settings.scenes,
            debugMode: settings.debug ? cc.DebugMode.INFO : cc.DebugMode.ERROR,
            showFPS: settings.debug,
            frameRate: 60,
            jsList: jsList,
            groupList: settings.groupList,
            collisionMatrix: settings.collisionMatrix
        };

        cc.game.run(option, onStart);
    }

    if (cc.sys.isBrowser) {
        window.onload = boot;
    }
    else if (cc.sys.isNative) {
        require('src/settings.js');
        require('src/jsb_polyfill.js');

        boot();
    }

})();


text:
if [ ! -f ${NAGIOS_HOME}/etc/htpasswd.users ] ; then
  htpasswd -c -b -s ${NAGIOS_HOME}/etc/htpasswd.users ${NAGIOSADMIN_USER} ${NAGIOSADMIN_PASS}
  chown -R nagios.nagios ${NAGIOS_HOME}/etc/htpasswd.users
fi

/etc/init.d/nagios start
/etc/init.d/apache2 start

# Everything is run in the background
# We could create a fancy init here but the hack below is better.
# http://kimh.github.io/blog/en/docker/gotchas-in-writing-dockerfile-en/#hack_to_run_container_in_the_background
tail -f /dev/null


text:
#include <algorithm>
#include <cstring>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>

#include "ncurses.h"
#include "term.h"

#include "Color.h"
#include "Player.h"
#include "Playlist.h"
#include "PlaylistController.h"
#include "PlaylistWindow.h"
#include "SettingsController.h"
#include "SettingsWindow.h"
#include "Show.h"
#include "ShowsWindow.h"
#include "Window.h"

#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>

using std::cerr;
using std::get;
using std::string;
using std::tuple;
using std::vector;

void draw();
void drawwin();
bool input();
string* strinput(const char* prepend);
void switchwin(const string& name);

Color colormanager;
Player player;
PlaylistController plc;
SettingsController sc;
Window* dispwin;
// No stupid polymorphism games to stick the windows into a vector
tuple<
  PlaylistWindow,
	ShowsWindow,
	SettingsWindow
> windows;

// Macros to make it easy to change window ordering
#define PLAYLISTWINDOW 0
#define SHOWSWINDOW 1
#define SETTINGSWINDOW 2

vector<string> winnames; // Since there is no good way to iterate over a tuple
auto winsel = winnames.begin();

int main( int argc, char **argv) {

	{
		boost::filesystem::path config_file, data_dir;
		namespace po = boost::program_options;

		po::options_description desc( "Arguments:" );
		desc.add_options()
			( "help", "Display this message." )
			( "config", po::value<std::string>(),
			 	"The location of the configuration file, default $XDG_CONFIG_HOME" )
			( "data_dir", po::value<std::string>(),
				"The location to store the database, default $XDG_DATA_HOME" )
		;

		po::variables_map vm;
		po::store( po::parse_command_line( argc, argv, desc ), vm );
		po::notify( vm );

		if( vm.count("help") ) {
			std::cout << desc << '\n';
			return 0;
		}

		if( vm.count( "config" ) )
			config_file =  vm["config"].as<std::string>();
		else
			config_file = "";
		if( vm.count( "data_dir" ) )
			data_dir = vm["data_dir"].as<std::string>();
		else
			data_dir = "";

		sc.load(config_file, data_dir);
	}

	if(!plc.loaddb()) {
		cerr << "Failed to read database\n";
		return 1;
	}

	// Setup ncurses
	setlocale(LC_ALL, "");

	initscr();
	cbreak();
	noecho();
	keypad( stdscr, TRUE );
	curs_set(0);

	// Setup colors
	colormanager.init();
	colormanager.add("red", COLOR_RED, COLOR_BLACK);
	colormanager.add("blue", COLOR_BLUE, COLOR_BLACK);

	// Setup windows
	int cols, rows;
	getmaxyx( stdscr, rows, cols );
	windows = decltype(windows) (
		PlaylistWindow( newwin( rows-2, 0, 1, 0 ), colormanager, player ),
		ShowsWindow   ( newwin( rows-2, 0, 1, 0 ), colormanager ),
		SettingsWindow( newwin( rows-2, 0, 1, 0 ), colormanager )
	);

	// Window titlebar
	winnames = {
		"Playlist",
		"Shows",
		"Edit",
		"Settings"
	};

	// initial window to display
	dispwin = &get<SHOWSWINDOW>(windows);
	winsel = winnames.begin() + SHOWSWINDOW;

	//TODO: deal with conf loading later
	player.setplayer("mplayer ");
	player.setarguments(" -vo vdpau ");
	player.setlatearguments(" &> /dev/null ");

	// draw() must come before drawwin()
	draw();
	drawwin();
	while(input());

	endwin();

	plc.savedb();

	return 0;
}

/*
	Draws stdscr.
*/
void draw() {
	move(0,0);
#if __GNUC__ <= 4 && __GNUC_MINOR__ < 6
	size_t size = winnames.size();
	for(size_t i = 0; i < size; ++i) {
		if(winnames[i] == *winsel) {
			attron(COLOR_PAIR(colormanager.find("blue")));
			printw("%s ", winnames[i].c_str());
			attroff(COLOR_PAIR(colormanager.find("blue")));
		}
		else
			printw("%s ", winnames[i].c_str());
	}
#else
	for(string &n : winnames) {
		if(n == *winsel) {
			attron(COLOR_PAIR(colormanager.find("blue")));
			printw("%s ", n.c_str());
			attroff(COLOR_PAIR(colormanager.find("blue")));
		}
		else
			printw("%s ", n.c_str());
	}
#endif
	refresh();
}

/*
	Draws a given window.
*/
void drawwin() {
	dispwin->drawit();
}

/*
	Control inputs (up/down/add, etc).
*/
bool input() {
	int in = getch();
	string* s;

	switch (in) {
		case KEY_ENTER:
		case 'q':
			return 0;
			break;

		case ':':
			s = strinput(":");
			if(s->length())
			{} //TODO: interpret command
			delete(s);
			break;

		case '1':
			switchwin("Playlist");
			break;
		case '2':
			switchwin("Shows");
			break;
		case '3':
			switchwin("Edit");
			break;
		case '4':
			switchwin("Settings");
			break;
		case 's':
			plc.savedb();
			break;
		case KEY_RESIZE:
			draw();
			dispwin->resize();
			break;

		case ERR:
			break;
		default:
			dispwin->control(in);
	}

	drawwin();
	return 1;
}

/*
	Gets string input, location is the bottom of the given window.
*/
string* strinput(const char* prepend) {
	nocbreak();
	echo();
	curs_set(1);

	int rows, cols;
	getmaxyx( stdscr, rows, cols);

	char cstr[cols];
	memset(cstr, 0, cols);

	mvwprintw(stdscr, rows-1, 0, "%s", prepend);
	wgetnstr (stdscr, cstr,   cols-1);

	wmove    (stdscr, rows-1, 0);
	wclrtoeol(stdscr);

	string* str = new string(cstr);

	curs_set(0);
	cbreak();
	noecho();
	return str;
}

/*
	Switches to the window with the given name.
	@param name The name of the window to switch to.
*/
void switchwin(const string& name) {
	if(name == "Playlist") {
		dispwin = &get<PLAYLISTWINDOW>(windows);
		dispwin->selected();
		winsel = winnames.begin() + PLAYLISTWINDOW;
	}
	else if(name == "Shows") {
		dispwin = &get<SHOWSWINDOW>(windows);
		dispwin->selected();
		winsel = winnames.begin() + SHOWSWINDOW;
	}
	else if(0 && name == "Edit") {
		//dispwin = &get<EDITWINDOW>(windows);
		//dispwin->selected();
		//winsel = winnames.begin() + EDITWINDOW;
	}
	else if(name == "Settings") {
		dispwin = &get<SETTINGSWINDOW>(windows);
		dispwin->selected();
		winsel = winnames.begin() + SETTINGSWINDOW;
	}
	draw();
}


text:
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">

  <title>{% if page.title %}{{ page.title }} // {{ site.title }}{% else %}{{ site.title }}{% endif %}</title>

  {% if page.stylesheets %}
    {% for stylesheet_url in page.stylesheets %}
      <link rel="stylesheet" href="{{ stylesheet_url | absolute_url }}?{{site.time | date: '%s%N'}}">
    {% endfor %}
  {% endif %}

  <link rel="manifest" href="/manifest.json">

  {% seo %}

  <meta name="twitter:card" content="summary" />

  {% if page.image %}
    <meta property="og:image" content="{{ page.image | absolute_url }}">
    <meta name="twitter:image" content="{{ page.image | absolute_url }}">
  {% else %}
    <meta property="og:image" content="{{ site.image | absolute_url }}">
    <meta name="twitter:image" content="{{ site.image | absolute_url }}">
  {% endif %}

  {% if page.robots %}
    <meta name="robots" content="{{page.robots}}" />
  {% endif %}

  {% include head/icons.html %}
  {% include head/dns-prefetch.html %}

  {% include head/critical-path.html %}

  <!--[if IE]>
    <link rel="stylesheet" href="{{ "/assets/styles/main.css" | absolute_url }}?{{site.time | date: '%s%N'}}">
  <![endif]-->

  <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->

  {% if jekyll.environment == "production" %}
    {% include head/gtm.html %}
  {% endif %}

  {% if site.tags != "" %}
    {% include head/collecttags.html %}
  {% endif %}
</head>


text:
<?PHP

include "../includes/common.php";

$mentor_path = "/home1/uberbots/mail/uberbots.org/mentor.forwarder/new";

$handle = opendir($mentor_path);

while (false !== ($file = readdir($handle))) {
    if($file!="."&&$file!=".."){
		if($fileHandler = fopen($mentor_path."/".$file,'r'))
			$contents = fread($fileHandler,100000);
		else
			echo "file could not be read/opened ";

		fclose($fileHandler);

		preg_match("%Subject: (.+)%",$contents,$subject);

		preg_match("%From: (.+)%",$contents,$from);

		$firstLine = strpos($contents,"\n\n");

		$contents = substr($contents,$firstLine);

		//$contents = str_replace("\n  ","",$contents);

		//get emails

		$emails = "\nBcc: ";

		$query = $db->sql_query("SELECT `user_email` FROM `phpbb_users` WHERE `group_id` = '12' AND `user_allow_pm` = '1'");

		while($row=$db->sql_fetchrow($query)){
			$emails.=$row['user_email']."; ";
			}

		echo $emails;

		mail("",$subject[0],$contents,$from[0].$emails);

		unlink($mentor_path."/".$file);

		}
    }

closedir($handle);
?>


text:
import tools.gxemul, tools.sim
import os

def export_test(test_name, options):
    uncached_gxemul_log    = open(os.path.join("gxemul_log", test_name + '_gxemul.log'), 'rt')
    uncached_gxemul_status = tools.gxemul.MipsStatus(uncached_gxemul_log)
    cached_gxemul_log      = open(os.path.join("gxemul_log", test_name + '_gxemul_cached.log'), 'rt')
    cached_gxemul_status   = tools.gxemul.MipsStatus(cached_gxemul_log)

    new_name=options.name if options.name else test_name
    attrs = ""
    if test_name.find('tlb') != -1:
        attrs=attrs + "@attr('tlb')"
    print """from beritest_tools import BaseBERITestCase
from nose.plugins.attrib import attr
import os
import tools.sim
expected_uncached=["""
    for reg in xrange(len(tools.gxemul.MIPS_REG_NUM2NAME)):
        print "    0x%x," % uncached_gxemul_status[reg]
    print """  ]
expected_cached=["""
    for reg in xrange(len(tools.gxemul.MIPS_REG_NUM2NAME)):
        print "    0x%x," % cached_gxemul_status[reg]
    print """  ]
class %(testname)s(BaseBERITestCase):
  %(attrs)s
  def test_registers_expected(self):
    cached=bool(int(os.getenv('CACHED',False)))
    expected=expected_cached if cached else expected_uncached
    for reg in xrange(len(tools.sim.MIPS_REG_NUM2NAME)):
      self.assertRegisterExpected(reg, expected[reg])
""" % {'attrs':attrs, 'testname':new_name}

if __name__=="__main__":
    from optparse import OptionParser
    parser = OptionParser(usage="Usage: %prog [options] test_name")
    parser.add_option("-d", "--test-dir",help="Directory to put the exported test.", default="tests/fuzz_regressions")
    parser.add_option("-n", "--name",help="New name for the test (optional but recommended).", default="")
    (options, args) = parser.parse_args()
    if len(args) != 1:
        raise Exception("Please give exactly one test name.")
    test_name=args[0]
    export_test(test_name, options)


text:
package org.hisp.dhis.commons.util;

import org.apache.commons.lang3.StringEscapeUtils;

/**
 * Utility class for encoding.
 *
 * @author Lars Helge Overland
 */
public class Encoder
{
    /**
     * HTML-escapes the String representation of the given Object.
     * @param object the Object.
     * @return an HTML-escaped String representation.
     */
    public String htmlEncode( Object object )
    {
        return object != null ? StringEscapeUtils.escapeHtml4( String.valueOf( object ) ) : null;
    }

    /**
     * HTML-escapes the given String.
     * @param object the String.
     * @return an HTML-escaped representation.
     */
    public String htmlEncode( String object )
    {
        return StringEscapeUtils.escapeHtml4( object );
    }

    /**
     * XML-escapes the given String.
     * @param object the String.
     * @return an XML-escaped representation.
     */
    public String xmlEncode( String object )
    {
        return StringEscapeUtils.escapeXml11( object );
    }

    /**
     * JavaScript-escaped the given String.
     * @param object the String.
     * @return a JavaScript-escaped representation.
     */
    public String jsEncode( String object )
    {
        return StringEscapeUtils.escapeEcmaScript( object );
    }

    /**
     * Escaped the given JSON content using Java String rules.
     *
     * Assumes " is used as quote char and not used inside values and does
     * not escape '.
     *
     * @param object the String.
     * @return the escaped representation.
     */
    public String jsonEncode( String object )
    {
        return StringEscapeUtils.escapeJava( object );
    }

    /**
     * JavaScript-escaped the given String.
     *
     * @param object the object.
     * @param quoteChar the quote char.
     * @return the escaped representation.
     *
     * See {@link #jsEncode(String)}.
     * @deprecated quoteChar is ignored.
     */
    @Deprecated
    public String jsEscape( String object, String quoteChar )
    {
        return jsEncode( object );
    }
}


text: Remember, remember the <time datetime="1605-11-05">5th of November</time>


text:
package com.noctarius.snowcast.impl.operations.clientcodec;

import com.hazelcast.spi.EventRegistration;
import com.noctarius.snowcast.impl.NodeSequencerService;

class ClientRegisterChannelOperation
        extends AbstractClientRequestOperation {

    private String registrationId;

    ClientRegisterChannelOperation(String sequencerName, MessageChannel messageChannel) {
        super(sequencerName, messageChannel);
    }

    @Override
    public void run() {
        NodeSequencerService sequencerService = getService();
        EventRegistration registration = sequencerService.registerClientChannel(getSequencerName(), getMessageChannel());
        registrationId = registration.getId();
    }

    @Override
    public Object getResponse() {
        return registrationId;
    }
}