text:
'use strict';
module App {
    export class RouteConfigurator {

        static IsRouteGranted(route: IAppRoute, inTopMenuOnly: boolean = false): boolean {
            var res = route && !route.isInvisible && (!route.auth || !angular.isArray(route.roles) || (app.$auth && app.$auth.LoggedUser && route.roles.contains(app.$auth.LoggedUser.UserRole)));
            if (app.$rootScope.$selectedMenuItem && res && inTopMenuOnly && route.settings && route.settings.topMenu)
                res = app.$rootScope.$selectedMenuItem === route.settings.topMenu;
            return res;
        }

        private _routes: IAppRoute[] = [];

        constructor(private $routeProvider: ng.route.IRouteProvider, public routes: IAppRoute[]) {

            for (var i = 0; i < routes.length; i++) {
                var r = routes[i];

                if (r) {
                    var template = "";
                    if (!r.templateUrl)
                        r.templateUrl = r.name;

                    if (typeof r.templateUrl === "string") {
                        template = <string>r.templateUrl;
                        if (!template.Contains("/") && !template.EndsWith(".html")) {
                            template = "/app/views/{0}/{0}.html".format(template);
                            r.templateUrl = template;
                        }
                    } else if (typeof r.templateUrl === "function") {
                        template = (<any>(r.templateUrl))();
                    }

                    if (template) {
                        var path = template.ExtractDirectory();
                        var name = template.ExtractOnlyFileName();
                        r.files = [];

                        /*// Lazy load
                        var scriptFileName = path + '/' + name + '.js';
                        var styleFileName = path + '/' + name + '.css';
                        if (!r.files) r.files = [];
                        r.files = r.files.selectMany(f => f.split(',')).select(f => {
                            if (!f.StartsWith('/'))
                                f = path + '/' + f;
                            if (!f.EndsWith('.js'))
                                f = f + '.js';
                            return f;
                        }).toArray();
                        if (!r.files.Contains(scriptFileName))
                            r.files.push(scriptFileName);
                        if (!r.files.Contains(styleFileName))
                            r.files.push(styleFileName);*/

                        if (r.files && r.files.length > 0) {
                            r.resolve = r.resolve || {};
                            r.resolve['lazy'] = [
                                '$ocLazyLoad', '$q', ($ocLazyLoad, $q: ng.IQService) => {
                                    if (r.files && r.files.length > 0)
                                        return $ocLazyLoad.load([{ name: App.app.name, files: r.files, serie: true }]);
                                }
                            ];
                        }

                        r.controller = r.controller || name;
                        r.controllerAs = r.controllerAs || "$";
                    }

                    /*
                    * Если роут имеет URL с параметрами (/:routeParam),
                    * для его корректной работы в итоговый список роутов нужно добавить 2 роута:
                    * 1-й должен содержать URL с параметрами и не содержать объект settings (опции отображения роута как пункта меню),
                    * 2-й не должен содержать URL с параметрами и может содержать/не содержать объект settings
                    */
                    if (r.url.indexOf('/:') !== -1) {
                        // копируем объект роута
                        var routeCopy = angular.copy(r);
                        var settings;

                        // проверяем наличие settings, копируем его и удаляем
                        if (!!r.settings) {
                            settings = angular.copy(r.settings);
                            delete r.settings;
                        }

                        // если settings был скопирован и удален из исходного роута,
                        // добавляем его в копию роута и копию добавляем в исходный список роутов
                        // для его последующей обработки на следующей итерации цикла
                        if (settings) {
                            routeCopy.url = routeCopy.url.split('/:')[0];
                            routes.push(routeCopy);
                        }
                    }

                    r.redirectTo = ($routeParams, $locationPath, $locationSearch) => this.redirectToDefault($routeParams, $locationPath, $locationSearch);
                    $routeProvider.when(r.url, r);
                    this._routes.push(r);
                }
            }

            //$routeProvider.otherwise({ redirectTo: '/' });
            $routeProvider.otherwise({ redirectTo: ($routeParams, $locationPath, $locationSearch) => this.redirectToDefault($routeParams, $locationPath, $locationSearch) });
        }

        redirectToDefault($routeParams?: angular.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any): string {
            var route = this._routes.firstOrDefault(r => r.url === $locationPath);
            if (!route && $locationPath) {
                // такой роут не найден - возможно это роут с параметрами
                var paramsRoutes = this._routes.where(r => r.url.Contains("/:")).select(r => ({route: r, url: r.url.split("/:")[0]})).toArray();
                var locPaths = $locationPath.split("/");
                while (!route && locPaths.length > 1) {
                    locPaths.length--;
                    var locPath = locPaths.join("/");
                    route = paramsRoutes.where(r => r.url === locPath).select(r => r.route).firstOrDefault();
                }
            }
            if (route && RouteConfigurator.IsRouteGranted(route)) {
                if (route.settings && route.settings.topMenu)
                    app.$rootScope.$selectedMenuItem = route.settings.topMenu;

                return $locationPath;
            }
            // try to find route enabled route
            route = this._routes.firstOrDefault(r => r.url === "/");
            if (!RouteConfigurator.IsRouteGranted(route, true)) {
                route = this._routes.where(r => r.settings && r.url && !r.url.StartsWith("/login") && RouteConfigurator.IsRouteGranted(r, true)).orderBy(x => x.settings.topMenu).thenBy(x => x.settings.nav).firstOrDefault();
            }
            if (route) {
                if (route.settings && route.settings.topMenu)
                    app.$rootScope.$selectedMenuItem = route.settings.topMenu;
                return route.url;
            }
            return "/login";
        }

    }

    // Define the routes - since this goes right to an app.constant, no use for a class
    // Could make it a static property of the RouteConfigurator class
    function getRoutes(): IAppRoute[] {
        return Routes;
    }

    // Collect the routes
    app.constant('routes', getRoutes());

    // Configure the routes and route resolvers
    app.config([
        '$routeProvider', 'routes', '$locationProvider',
        ($routeProvider, routes/*, $locationProvider*/) => {
            /*$locationProvider.html5Mode({
                            enabled: true,
                            requireBase: false
            });*/
            return new RouteConfigurator($routeProvider, routes);
        }
    ]);

    //#region - Переход на страницу логина при попытке получить доступ к страницам, требующим авторизации -
    app.run(["$location", "$rootScope", "$route", "config", '$auth', ($location, $rootScope, $route, config: IConfigurations, $auth: IAutenticationService) => {

        $rootScope.$on('$locationChangeStart', (evt, next, current) => {
            if (!$rootScope.$redirectToLogin) {
                $rootScope.$priorLocation = "/";
                if (current) {
                    $rootScope.$priorLocation = current.split('#', 2)[1] || "/";
                }
            } else
                $rootScope.$redirectToLogin = undefined;

            var path = $location.path();
            if (path !== "/" && path.EndsWith("/")) {
                path = path.substring(0, path.length - 1);
            }

            var nextRoute = $route.routes[path];
            if (nextRoute) {
                if (nextRoute.auth) {
                    if (!$auth.IsLoggedIn) {
                        // if page requires authorization but user is not logged in
                        if (current.Contains("/#/login")) {
                            // ignore login page
                            evt.preventDefault();
                            $rootScope.$broadcast(config.events.controllerActivateSuccess);
                        } else {
                            // redirect to login page
                            $rootScope.$priorLocation = path;
                            $rootScope.$redirectToLogin = true;
                            $location.path("/login");
                            $rootScope.$broadcast(config.events.controllerActivateSuccess);
                            evt.preventDefault();
                        }
                    }
                }
            }
        });
    }]);
    //#endregion
}

redpajama_set_name: RedPajamaGithub


text:
"""Certificate chain with 1 intermediate and a trusted root. The intermediate
however is signed using the MD5 hash. Verification is expected to fail because
MD5 is too weak."""

import common

# Self-signed root certificate (used as trust anchor).
root = common.create_self_signed_root_certificate('Root')

# Intermediate.
intermediate = common.create_intermediate_certificate('Intermediate', root)
intermediate.set_signature_hash('md5')

# Target certificate.
target = common.create_end_entity_certificate('Target', intermediate)

chain = [target, intermediate]
trusted = common.TrustAnchor(root, constrained=False)
time = common.DEFAULT_TIME
verify_result = False
errors = """[Context] Processing Certificate
  index: 0
      [Error] Invalid or unsupported signature algorithm
        algorithm: 300D06092A864886F70D0101040500
"""

common.write_test_file(__doc__, chain, trusted, time, verify_result, errors)


text:
#ifndef __PU_SECTION_H__
#define __PU_SECTION_H__

#include "ParticleUniversePrerequisites.h"
#include "ParticleUniverseIElement.h"

namespace ParticleUniverse
{
	/** The Section class is used for parsing. A section is a piece of data between brackets {}.
	*/
	class _ParticleUniverseExport Section
	{
		public:
			IElement* element;
			String elementName;
			String sectionName;

			Section(void) : elementName(BLANK_STRING), sectionName(BLANK_STRING) {};
			virtual ~Section(void) {};
	};

}
#endif


text:
package org.chocosolver.memory;

/**
 * Created by IntelliJ IDEA.
 * User: julien
 * Date: 12 juil. 2007
 * Time: 10:25:05
 */
public interface IStateObject  {
}


text:
2#!/bin/bash

# ======================================================================
# this script takes in a single parameter, the base path of all of
# the submission server files

#     ./grade_students <base_path>

if [ "$#" -ne 2 ]; then
    echo "ERROR: Illegal number of parameters" >&2
    echo "   ./grade_students  absolute_path_to_base_directory  relative_path_of_to_be_graded_directory" >&2
    exit 1
fi

base_path="$1"
TO_BE_GRADED="$2"

# from that directory, we expect:

# a subdirectory for each course
# BASE_PATH/courses/which_semester/course_apple/
# BASE_PATH/courses/which_semester/course_banana/

# a directory within each course for the submissions, further
# subdirectories for each assignment, then subdirectories for each
# user, and finally subdirectories for multiple submissions (version)
# BASE_PATH/courses/which_semester/course_apple/submissions/
# BASE_PATH/courses/which_semester/course_apple/submissions/hw1/
# BASE_PATH/courses/which_semester/course_apple/submissions/hw1/smithj
# BASE_PATH/courses/which_semester/course_apple/submissions/hw1/smithj/1
# BASE_PATH/courses/which_semester/course_apple/submissions/hw1/smithj/2

# input & output files are stored in a similar structure
# BASE_PATH/courses/which_semester/course_apple/test_input/hw1/first.txt
# BASE_PATH/courses/which_semester/course_apple/test_input/hw1/second.txt
# BASE_PATH/courses/which_semester/course_apple/test_output/hw1/solution1.txt
# BASE_PATH/courses/which_semester/course_apple/test_output/hw1/solution2.txt

# each assignment has executables to be run during grading
# BASE_PATH/courses/which_semester/course_apple/bin/hw1/run.out
# BASE_PATH/courses/which_semester/course_apple/bin/hw1/validate.out

# =====================================================================
# The todo list of the most recent (ungraded) submissions have a dummy
# file in this directory:

# BASE_PATH/to_be_graded/which_semester__course_apple__hw1__smithj__1
# BASE_PATH/to_be_graded/which_semester__course_banana__hw2__doej__5

# NOTE ON OUTPUT: cron job stdout/stderr gets emailed
# debugging type output can be sent to stdout, which we'll redirect to /dev/null in the cron job
# all problematic errors should get set to stderr  (>&2)  so that an email will be sent
echo "Grade all submissions in $base_path/$TO_BE_GRADED/"

all_grading_done=false

too_many_processes_count=0

sleep_count=0

# OUTER LOOP
# will eventually process all submissions
while true; do

    # if no work was done on the last loop...
    if [ "$all_grading_done" = "true" ] ; then
	((sleep_count++))
	 echo "sleep iter $sleep_count: no work"
	if [[ $sleep_count -gt 200 ]] ; then
	    # 5 seconds (sleep) * 12 = 1 minute
	    # 5 seconds (sleep) * 120 = 10 minutes
	    # 5 seconds (sleep) * 200 = 16 minutes
	    # *** plus more time if you actually did any work! ***
	    # if you've been running for at least 16 minutes, quit (will be restarted by a cron once per 15 minutes)
	    break;
	else
	    # sleep for 5 seconds
	    sleep 5
	    # make sure to reset the all_grading_done flag so we check again
	    all_grading_done=false
	    continue;
	fi
    fi

    # check for runaway processes by untrusted (this should never be more that a few, the user limit is 50)
    numprocesses=$(ps -u untrusted | wc -l)
    if [[ $numprocesses -gt 25 ]] ; then
	echo "ERROR: untrusted is running too many processes: " $numprocesses >&2
	((too_many_processes_count++))
	if [[ $too_many_processes_count -gt 10 ]];
	then
	    exit
	fi
	sleep 10
	continue
    fi
    too_many_processes_count=0

    # check for parallel grade_students scripts
    #ps -f -u hwcron | grep grade_students.sh
    #pgrep -u hwcron grade_students
    pgrep_results=$(pgrep -u hwcron grade_students)
    pgrep_results=( $pgrep_results ) # recast as array
    numparallel=${#pgrep_results[@]} # count elements in array
    echo "hwcron is running $numparallel parallel scripts"
    if [[ "$numparallel" -gt 5 ]] ; then
	 echo "hwcron is running too many parallel scripts: " $numparallel
	exit
    fi

    # =====================================================================
    # FIND NEXT ASSIGNMENT TO GRADE (in reverse chronological order)
    # =====================================================================

    # reset this variable
    all_grading_done=true

    for NEXT_TO_GRADE in `cd $base_path/$TO_BE_GRADED && ls -tr`; do

	# skip the active grading tags
	if [ "${NEXT_TO_GRADE:0:8}" == "GRADING_" ]
	then
	    continue
	fi

	 echo "========================================================================"
	 echo "GRADE $NEXT_TO_GRADE"

	STARTTIME=$(date +%s)

	# --------------------------------------------------------------------
        # extract the course, assignment, user, and version from the filename
	# replace the '__' with spaces to allow for looping over list
	with_spaces=${NEXT_TO_GRADE//__/ }
	t=0
	semester="NOSEMESTER"
	course="NOCOURSE"
	assignment="NOASSIGNMENT"
	user="NOUSER"
	version="NOVERSION"
	for thing in $with_spaces; do
	    ((t++))
	    #FIXME replace with switch statement
	    if [ $t -eq 1 ]
	    then
		semester=$thing
	    elif [ $t -eq 2 ]
	    then
		course=$thing
	    elif [ $t -eq 3 ]
	    then
		assignment=$thing
	    elif [ $t -eq 4 ]
	    then
		user=$thing
	    elif [ $t -eq 5 ]
	    then
		version=$thing
	    else
                #FIXME document error handling approach: leave GRADING_ file in $TO_BE_GRADED directory, assume email sent, move to next
		echo "ERROR BAD FORMAT: $NEXT_TO_GRADE" >&2
		continue
	    fi
	done
        # error checking
        # FIXME: error checking could be more significant
	if [ $semester == "NOSEMESTER" ]
	then
	    echo "ERROR IN SEMESTER: $NEXT_TO_GRADE" >&2
	    continue
	fi
	if [ $course == "NOCOURSE" ]
	then
	    echo "ERROR IN COURSE: $NEXT_TO_GRADE" >&2
	    continue
	fi
	if [ $assignment == "NOASSIGNMENT" ]
	then
	    echo "ERROR IN ASSIGNMENT: $NEXT_TO_GRADE" >&2
	    continue
	fi
	if [ $user == "NOUSER" ]
	then
	    echo "ERROR IN USER: $NEXT_TO_GRADE" >&2
	    continue
	fi
	if [ $version == "NOVERSION" ]
	then
	    echo "ERROR IN VERSION: $NEXT_TO_GRADE" >&2
	    continue
	fi

	# --------------------------------------------------------------------
        # check to see if directory exists & is readable
	submission_path=$base_path/courses/$semester/$course/submissions/$assignment/$user/$version
	#echo "check directory '$submission_path'"

	if [ ! -d "$base_path" ]
	then
	    echo "ERROR: directory does not exist '$base_path'" >&2
	    continue
	fi
	if [ ! -d "$base_path/courses" ]
	then
	    echo "ERROR: directory does not exist '$base_path'" >&2
	    continue
	fi
	if [ ! -d "$base_path/courses/$semester" ]
	then
	    echo "ERROR: directory does not exist '$base_path'" >&2
	    continue
	fi
        # note we do not expect these directories to be readable

	if [ ! -d "$base_path/courses/$semester/$course" ]
	then
	    echo "ERROR: directory does not exist '$base_path/courses/$semester/$course'" >&2
	    continue
	fi
	if [ ! -r "$base_path/courses/$semester/$course" ]
	then
	    echo "ERROR: A directory is not readable '$base_path/courses/$semester/$course'" >&2
	    continue
	fi

	if [ ! -d "$base_path/courses/$semester/$course/submissions" ]
	then
	    echo "ERROR: B directory does not exist '$base_path/courses/$semester/$course/submissions'" >&2
	    continue
	fi
	if [ ! -r "$base_path/courses/$semester/$course/submissions" ]
	then
	    echo "ERROR: C directory is not readable '$base_path/courses/$semester/$course/submissions'" >&2
	    continue
	fi

	if [ ! -d "$base_path/courses/$semester/$course/submissions/$assignment" ]
	then
	    echo "ERROR: D directory does not exist '$base_path/courses/$semester/$course/submissions/$assignment'" >&2
	    continue
	fi
	if [ ! -r "$base_path/courses/$semester/$course/submissions/$assignment" ]
	then
	    echo "ERROR: E directory is not readable '$base_path/courses/$semester/$course/submissions/$assignment'" >&2
	    continue
	fi

	if [ ! -d "$base_path/courses/$semester/$course/submissions/$assignment/$user" ]
	then
	    echo "ERROR: F directory does not exist '$base_path/courses/$semester/$course/submissions/$assignment/$user'" >&2
	    continue
	fi
	if [ ! -r "$base_path/courses/$semester/$course/submissions/$assignment/$user" ]
	then
	    echo "ERROR: G directory is not readable '$base_path/courses/$semester/$course/submissions/$assignment/$user'" >&2
	    continue
	fi

	if [ ! -d "$submission_path" ]
	then
	    echo "ERROR: directory does not exist '$submission_path'" >&2
	    # this submission does not exist, remove it from the queue
	    rm -f $base_path/$TO_BE_GRADED/$NEXT_TO_GRADE
	    continue
	fi
	if [ ! -r "$submission_path" ]
	then
	    echo "ERROR: H directory is not readable '$submission_path'" >&2
	    # leave this submission file for next time (hopefully
	    # permissions will be corrected then)
	    #FIXME remove GRADING_ file
	    continue
	fi

	test_code_path="$base_path/courses/$semester/$course/test_code/$assignment"
	test_input_path="$base_path/courses/$semester/$course/test_input/$assignment"
	test_output_path="$base_path/courses/$semester/$course/test_output/$assignment"
	results_path="$base_path/courses/$semester/$course/results/$assignment/$user/$version"
	bin_path="$base_path/courses/$semester/$course/bin"

	# --------------------------------------------------------------------
        # MAKE TEMPORARY DIRECTORY & COPY THE NECESSARY FILES THERE
	tmp=`mktemp -d /tmp/temp.XXXXXXXX`

	submission_time=""
	if [ -e "$submission_path/.submit.timestamp" ]
	then
	    submission_time=`cat $submission_path/.submit.timestamp`
	else
	    echo "ERROR:  $submission_path/.submit.timestamp   does not exist!" >&2
	fi

        # switch to tmp directory
	pushd $tmp > /dev/null

	# --------------------------------------------------------------------
        # COMPILE THE SUBMITTED CODE

        # copy submitted files to a tmp compilation directory
	tmp_compilation=$tmp/TMP_COMPILATION
	mkdir $tmp_compilation
	cp 1>/dev/null  2>&1  -r $submission_path/* $tmp_compilation ||  echo "ERROR: Failed to copy to temporary directory $submission_path" >&2

        # copy any instructor code files to tmp directory
	if [ -d "$test_code_path" ]
	then
	    cp -rf $test_code_path/ "$tmp_compilation" ||  echo "ERROR: Failed to copy to temporary directory $test_code_path" >&2
	    cp -rf $base_path/courses/$semester/$course/config/disallowed_words.txt "$tmp_compilation" ||  echo "ERROR: Failed to copy disallowed_words.txt to temporary directory $test_code_path" >&2
	fi

	pushd $tmp_compilation > /dev/null

	# first delete any submitted .out or .exe executable files
	rm -f *.out *.exe test*.txt

	if [ ! -r "$bin_path/$assignment/compile.out" ]
	then
	    echo "ERROR:  $bin_path/$assignment/compile.out  does not exist/is not readable" >&2
	else

   	    # copy compile.out to the current directory
	    cp -f "$bin_path/$assignment/compile.out" $tmp_compilation/my_compile.out

  	    # give the untrusted user read/write/execute permissions on the tmp directory & files
	    chmod -R go+rwx $tmp
	    # run the compile.out as the untrusted user

	    $base_path/bin/untrusted_runscript $tmp_compilation/my_compile.out >& $tmp/.submit_compile_output.txt

	    compile_error_code="$?"
	    if [[ "$compile_error_code" -ne 0 ]] ;
	    then
		echo "COMPILE FAILURE CODE $compile_error_code"
	    else
		echo "COMPILE OK"
	    fi
	fi

	# return to the main tmp directory
	popd > /dev/null

	# move all executable files from the to the main tmp directory
	# FIXME: not really what we want for the "FILE_EXISTS" command....
	# FIXME: make more general, requires thinking, need to get python files into the running directory too (a hack for now)
        cp  1>/dev/null  2>&1  $tmp_compilation/README*.txt $tmp_compilation/README*.TXT $tmp_compilation/readme*.txt $tmp_compilation/readme*.TXT $tmp_compilation/*.out $tmp_compilation/test*.txt $tmp_compilation/*.py $tmp

    ls $tmp_compilation
    echo "------------------------------------------"
    ls $tmp
	# remove the directory
	rm -rf $tmp_compilation

	# --------------------------------------------------------------------
        # RUN RUNNER

        # copy input files to tmp directory
	if [ -d "$test_input_path" ]
	then
	    cp -rf $test_input_path/* "$tmp" ||  echo "ERROR: Failed to copy to temporary directory $test_input_path" >&2
	fi

	# copy run.out to the tmp directory
	if [ ! -r "$bin_path/$assignment/run.out" ]
	then
	    echo "ERROR:  $bin_path/$assignment/run.out  does not exist/is not readable" >&2
	else

	    cp -f "$bin_path/$assignment/run.out" $tmp/my_run.out

  	    # give the untrusted user read/write/execute permissions on the tmp directory & files
	    chmod -R go+rwx $tmp
	    # run the run.out as the untrusted user
	    $base_path/bin/untrusted_runscript $tmp/my_run.out >& .submit_runner_output.txt

	    runner_error_code="$?"
	    if [[ "$runner_error_code" -ne 0 ]] ;
	    then
		echo "RUNNER FAILURE CODE $runner_error_code"
	    else
		echo "RUNNER OK"
	    fi
	fi

	# --------------------------------------------------------------------
        # RUN VALIDATOR

        # copy output files to tmp directory  (SHOULD CHANGE THIS)
	if [ -d "$test_output_path" ]
	then
	    cp -rf $test_output_path/* "$tmp" ||  echo "ERROR: Failed to copy to temporary directory $test_output_path" >&2
	fi

	if [ ! -r "$bin_path/$assignment/validate.out" ]
	then
	    echo "ERROR:  $bin_path/$assignment/validate.out  does not exist/is not readable" >&2
	    # continue
	else
        # echo "GOING TO RUN valgrind $bin_path/$assignment/validate.out $version $submission_time $runner_error_code"

        if [[ 0 -eq 0 ]] ; then
            echo "$bin_path/$assignment/validate.out" "$assignment" "$user" "$version" "$submission_time"  >& .submit_validator_output.txt
            valgrind "$bin_path/$assignment/validate.out" "$assignment" "$user" "$version" "$submission_time"  >& .submit_validator_output.txt
        else
            echo '$base_path/bin/untrusted_runscript /usr/bin/valgrind "$bin_path/$assignment/validate.out" "$assignment" "$user" "$version" "$submission_time"  >& .submit_validator_output.txt'
            "$base_path/bin/untrusted_runscript" "/usr/bin/valgrind" "$bin_path/$assignment/validate.out" "$assignment" "$user" "$version" "$submission_time"  >& .submit_validator_output.txt
        fi
        # Non-valgrind commands
        # echo ""$bin_path/$assignment/validate.out" "$assignment" "$user" "$version" "$submission_time"  >& .submit_validator_output.txt"
        # "$bin_path/$assignment/validate.out" "$assignment" "$user" "$version" "$submission_time"  >& .submit_validator_output.txt

	    validator_error_code="$?"
	    if [[ "$validator_error_code" -ne 0 ]] ;
	    then
	     echo "VALIDATOR FAILURE CODE $validator_error_code  course=$course  hw=$assignment  user=$user  version=$version" 1>&2

	    else
		echo "VALIDATOR OK"
	    fi
	fi

	# --------------------------------------------------------------------
        # MAKE RESULTS DIRECTORY & COPY ALL THE FILES THERE

        # Get working directory back to bin
	cd "$bin_path"

        # clean out all of the old files if this is a re-run
        rm -rf "$results_path"

        # Make directory structure in results if it doesn't exist
        mkdir -p "$results_path" ||  echo "ERROR: Could not create results path $results_path" >&2
        cp  1>/dev/null  2>&1  $tmp/test*.txt $tmp/.submit* $tmp/submission.json $tmp/test*.json "$results_path"

	# --------------------------------------------------------------------
        # REMOVE TEMP DIRECTORY

	# step out of this directory
	popd > /dev/null
	# and remove the directory
        rm -rf $tmp

	# remove submission & the active grading tag from the todo list
	rm -f $base_path/$TO_BE_GRADED/$NEXT_TO_GRADE
	rm -f $base_path/$TO_BE_GRADED/GRADING_$NEXT_TO_GRADE

	ENDTIME=$(date +%s)
	 echo "finished with $NEXT_TO_GRADE in ~$(($ENDTIME - $STARTTIME)) seconds"

	all_grading_done=false
	break
    done
done

echo "========================================================================"
echo "ALL DONE"


text:
@implementation MTLFMDBMockRepository

+ (NSDictionary *)FMDBColumnsByPropertyKey
{
    return @{
             @"guid": @"guid",
             @"url": @"url",
             @"desc": @"repo_description",
             @"unused": [NSNull null]
             };
}

+ (NSArray *)FMDBPrimaryKeys
{
    return @[@"guid"];
}

+ (NSString *)FMDBTableName {
    return @"repository";
}

@end


text:
require "spec_helper"

describe Bosh::OpenStackCloud::VipNetwork do
  describe "configure" do
    let(:cloud) do
      mock_cloud do |openstack|
        expect(openstack).to receive(:addresses).and_return([address])
      end
    end

    let(:server) { double("server", :id => "i-test") }
    let(:vip_network) { described_class.new("network_b", vip_network_spec) }

    context "no floating IP provided for vip network" do
      let(:vip_network) do
        spec = vip_network_spec
        spec['ip'] = nil
        described_class.new("network_b", spec)
      end

      it "fails" do
        expect {
          vip_network.configure(nil, nil)
        }.to raise_error Bosh::Clouds::CloudError, /No IP provided for vip network/
      end
    end

    context "ip already associated with an instance" do
      let(:address) do
        double("address", :id => "network_b", :ip => "10.0.0.1", :instance_id => "i-test")
      end

      it "adds floating ip to the server for vip network" do
        expect(address).to receive(:server=).with(nil)
        expect(address).to receive(:server=).with(server)

        vip_network.configure(cloud.openstack, server)
      end
    end

    context "ip not already associated with an instance" do
      let(:address) do
        double("address", :id => "network_b", :ip => "10.0.0.1", :instance_id => nil)
      end

      it "adds free floating ip to the server for vip network" do
        expect(address).to_not receive(:server=).with(nil)
        expect(address).to receive(:server=).with(server)

        vip_network.configure(cloud.openstack, server)
      end
    end

    context "no floating IP allocated for vip network" do
      let(:address) do
        double("address", :id => "network_b", :ip => "10.0.0.2")
      end

      it "fails" do
        expect(address).to_not receive(:server=)

        expect {
          vip_network.configure(cloud.openstack, nil)
        }.to raise_error Bosh::Clouds::CloudError, /Floating IP .* not allocated/
      end
    end
  end
end


text:
package org.ofbiz.entity.condition;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.ofbiz.base.lang.IsEmpty;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.EntityFieldNotFoundException;
import org.ofbiz.entity.GenericEntity;
import org.ofbiz.entity.GenericModelException;
import org.ofbiz.entity.config.model.Datasource;
import org.ofbiz.entity.model.ModelEntity;
import org.ofbiz.entity.util.EntityUtil;

/**
 *
Represents the conditions to be used to constrain a query.

 *
An EntityCondition can represent various type of constraints, including:

 *

 *
EntityConditionList: a list of EntityConditions, combined with the operator specified
 *
EntityExpr: for simple expressions or expressions that combine EntityConditions
 *
EntityFieldMap: a map of fields where the field (key) equals the value, combined with the operator specified
 *

 * These can be used in various combinations using the EntityConditionList and EntityExpr objects.
 *
 */
@SuppressWarnings("serial")
public abstract class EntityCondition extends EntityConditionBase implements IsEmpty {

    public static <L,R,LL,RR> EntityExpr makeCondition(L lhs, EntityComparisonOperator<LL,RR> operator, R rhs) {
        return new EntityExpr(lhs, operator, rhs);
    }

    public static <R> EntityExpr makeCondition(String fieldName, R value) {
        return new EntityExpr(fieldName, EntityOperator.EQUALS, value);
    }

    public static EntityExpr makeCondition(EntityCondition lhs, EntityJoinOperator operator, EntityCondition rhs) {
        return new EntityExpr(lhs, operator, rhs);
    }

    @SafeVarargs
    public static <T extends EntityCondition> EntityConditionList<T> makeCondition(EntityJoinOperator operator, T... conditionList) {
        return new EntityConditionList<>(Arrays.<T>asList(conditionList), operator);
    }

    @SafeVarargs
    public static <T extends EntityCondition> EntityConditionList<T> makeCondition(T... conditionList) {
        return new EntityConditionList<>(Arrays.<T>asList(conditionList), EntityOperator.AND);
    }

    public static <T extends EntityCondition> EntityConditionList<T> makeCondition(List<T> conditionList, EntityJoinOperator operator) {
        return new EntityConditionList<>(conditionList, operator);
    }

    public static <T extends EntityCondition> EntityConditionList<T> makeCondition(List<T> conditionList) {
        return new EntityConditionList<>(conditionList, EntityOperator.AND);
    }

    public static <L,R> EntityFieldMap makeCondition(Map<String, ? extends Object> fieldMap, EntityComparisonOperator<L,R> compOp, EntityJoinOperator joinOp) {
        return new EntityFieldMap(fieldMap, compOp, joinOp);
    }

    public static EntityFieldMap makeCondition(Map<String, ? extends Object> fieldMap, EntityJoinOperator joinOp) {
        return new EntityFieldMap(fieldMap, EntityOperator.EQUALS, joinOp);
    }

    public static EntityFieldMap makeCondition(Map<String, ? extends Object> fieldMap) {
        return new EntityFieldMap(fieldMap, EntityOperator.EQUALS, EntityOperator.AND);
    }

    public static <L,R> EntityFieldMap makeCondition(EntityComparisonOperator<L,R> compOp, EntityJoinOperator joinOp, Object... keysValues) {
        return new EntityFieldMap(compOp, joinOp, keysValues);
    }

    public static EntityFieldMap makeCondition(EntityJoinOperator joinOp, Object... keysValues) {
        return new EntityFieldMap(EntityOperator.EQUALS, joinOp, keysValues);
    }

    public static EntityFieldMap makeConditionMap(Object... keysValues) {
        return new EntityFieldMap(EntityOperator.EQUALS, EntityOperator.AND, keysValues);
    }

    public static EntityDateFilterCondition makeConditionDate(String fromDateName, String thruDateName) {
        return new EntityDateFilterCondition(fromDateName, thruDateName);
    }

    public static List<EntityCondition> makeConditionDateList(List<String> filterByFieldNames) { // SCIPIO
        List<EntityCondition> conditions = new ArrayList<>();
        for (int i = 0; i < filterByFieldNames.size();) {
            String fromDateFieldName = filterByFieldNames.get(i++);
            String thruDateFieldName = filterByFieldNames.get(i++);
            conditions.add(new EntityDateFilterCondition(fromDateFieldName, thruDateFieldName));
        }
        return conditions;
    }

    public static List<EntityCondition> makeConditionDateList(Timestamp filterByDateMoment, List<String> filterByFieldNames) { // SCIPIO
        List<EntityCondition> conditions = new ArrayList<>();
        for (int i = 0; i < filterByFieldNames.size();) {
            String fromDateFieldName = filterByFieldNames.get(i++);
            String thruDateFieldName = filterByFieldNames.get(i++);
            if (filterByDateMoment == null) {
                conditions.add(EntityUtil.getFilterByDateExpr(fromDateFieldName, thruDateFieldName));
            } else {
                conditions.add(EntityUtil.getFilterByDateExpr(filterByDateMoment, fromDateFieldName, thruDateFieldName));
            }
        }
        return conditions;
    }

    /**
     * Makes a date range condition with specific range start and end dates on a single field.
     *
SCIPIO: 2.1.0: Added.

     * @param dateFieldName The name of the field containing the entity's date
     * @param rangeStart    The start of the range to filter against
     * @param rangeEnd      The end of the range to filter against
     * @return EntityCondition representing the date range filter
     */
    public static EntityCondition makeDateRangeCondition(String dateFieldName, Timestamp rangeStart, Timestamp rangeEnd) {
        EntityCondition cond = null;
        if (rangeStart != null) {
            cond = EntityCondition.makeCondition(dateFieldName, EntityOperator.GREATER_THAN_EQUAL_TO, rangeStart);
        }
        if (rangeEnd != null) {
            EntityCondition orderThruDateCond = EntityCondition.makeCondition(dateFieldName,
                    EntityOperator.LESS_THAN, rangeEnd);
            cond = (cond != null) ? EntityCondition.makeCondition(cond, orderThruDateCond) : orderThruDateCond;
        }
        return cond;
    }

    /**
     * Combines both conditions using {@link #makeCondition(EntityCondition, EntityJoinOperator, EntityCondition)}}
     * only if both conditions are non-null, otherwise returns the non-null one.
     *
SCIPIO: 2.1.0: Added.

     */
    public static EntityCondition combine(EntityCondition lhs, EntityJoinOperator operator, EntityCondition rhs) {
        if (lhs == null) {
            return rhs;
        } else if (rhs == null) {
            return lhs;
        } else {
            return makeCondition(lhs, operator, rhs);
        }
    }

    /**
     * Combines both conditions using {@link #makeCondition(EntityCondition, EntityJoinOperator, EntityCondition)}}
     * only if both conditions are non-null, otherwise returns the non-null one.
     *
SCIPIO: 2.1.0: Added.

     */
    public static EntityCondition combine(EntityCondition lhs, EntityCondition rhs) {
        if (lhs == null) {
            return rhs;
        } else if (rhs == null) {
            return lhs;
        } else {
            return makeCondition(lhs, EntityOperator.AND, rhs);
        }
    }

    public static EntityWhereString makeConditionWhere(String sqlString) {
        return new EntityWhereString(sqlString);
    }

    /** Combines conditions using AND but skips any null (SCIPIO). */
    public static EntityCondition append(EntityCondition... conditions) {
        EntityCondition cond = conditions[0];
        for(int i = 1; i < conditions.length; i++) {
            if (conditions[i] != null) {
                cond = (cond != null) ? makeCondition(cond, EntityOperator.AND, conditions[i]) : conditions[i];
            }
        }
        return cond;
    }

    /** Combines conditions using AND but skips any null (SCIPIO). */
    public static EntityCondition append(EntityCondition first, EntityCondition second) {
        if (first != null) {
            if (second != null) {
                return EntityCondition.makeCondition(first, EntityOperator.AND, second);
            } else {
                return first;
            }
        } else {
            return second;
        }
    }

    @Override
    public String toString() {
        return makeWhereString(null, new ArrayList<EntityConditionParam>(), null);
    }

    public void accept(EntityConditionVisitor visitor) {
        throw new IllegalArgumentException(getClass().getName() + ".accept not implemented");
    }

    abstract public String makeWhereString(ModelEntity modelEntity, List<EntityConditionParam> entityConditionParams, Datasource datasourceInfo);

    abstract public void checkCondition(ModelEntity modelEntity) throws GenericModelException;

    public boolean entityMatches(GenericEntity entity) {
        return mapMatches(entity.getDelegator(), entity);
    }

    public Boolean eval(GenericEntity entity) {
        return eval(entity.getDelegator(), entity);
    }

    public Boolean eval(Delegator delegator, Map<String, ? extends Object> map) {
        return mapMatches(delegator, map) ? Boolean.TRUE : Boolean.FALSE;
    }

    abstract public boolean mapMatches(Delegator delegator, Map<String, ? extends Object> map);

    abstract public EntityCondition freeze();

    public void visit(EntityConditionVisitor visitor) {
        throw new IllegalArgumentException(getClass().getName() + ".visit not implemented");
    }
}


text:
#include <QApplication>
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QMetaObject>
#include <QMetaProperty>
#include <QScreen>
#include <QStandardPaths>
#include <QWebPage>

#include "phantom.h"

#include "callback.h"
#include "childprocess.h"
#include "consts.h"
#include "repl.h"
#include "system.h"
#include "terminal.h"
#include "webpage.h"
#include "webserver.h"

#include "network/cookiejar.h"

static Phantom* phantomInstance = Q_NULLPTR;

// private:
Phantom::Phantom(QObject* parent)
    : QObject(parent)
    , m_terminated(false)
    , m_returnValue(0)
    , m_filesystem(Q_NULLPTR)
    , m_system(Q_NULLPTR)
    , m_childprocess(Q_NULLPTR)
{
    QStringList args = QApplication::arguments();

    // Prepare the configuration object based on the command line arguments.
    // Because this object will be used by other classes, it needs to be ready ASAP.
    m_settings = new Settings(this);
    m_settings->init(&args);
}

void Phantom::init()
{
    if (m_settings->helpFlag()) {
        Terminal::instance()->cout(QString("%1").arg(m_settings->helpText()));
        Terminal::instance()->cout("Any of the options that accept boolean values ('true'/'false') can also accept 'yes'/'no'.");
        Terminal::instance()->cout("");
        Terminal::instance()->cout("Without any argument, PhantomJS will launch in interactive mode (REPL).");
        Terminal::instance()->cout("");
        Terminal::instance()->cout("Documentation can be found at the web site, http://phantomjs.org.");
        Terminal::instance()->cout("");
        m_terminated = true;
        return;
    }

    if (m_settings->versionFlag()) {
        m_terminated = true;
        Terminal::instance()->cout(QString("%1").arg(PHANTOMJS_VERSION_STRING));
        return;
    }

    if (!m_settings->unknownOption().isEmpty()) {
        Terminal::instance()->cerr(m_settings->unknownOption());
        m_terminated = true;
        return;
    }

    // Initialize the CookieJar
    m_defaultCookieJar = new CookieJar(m_settings->cookiesFile());

    // set the default DPI
    m_defaultDpi = qRound(QApplication::primaryScreen()->logicalDotsPerInch());

    QWebSettings::setOfflineWebApplicationCachePath(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
    if (m_settings->offlineStoragePath().isEmpty()) {
        QWebSettings::setOfflineStoragePath(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
    } else {
        QWebSettings::setOfflineStoragePath(m_settings->offlineStoragePath());
    }
    if (m_settings->offlineStorageDefaultQuota() > 0) {
        QWebSettings::setOfflineStorageDefaultQuota(m_settings->offlineStorageDefaultQuota());
    }

    m_hostPage = new PhantomPage(this);
    m_hostPage->bootstrap();

    // Set up proxy if required
    QString proxyType = m_settings->proxyType();
    if (proxyType != "none") {
        setProxy(m_settings->proxyHost(), m_settings->proxyPort(), proxyType, m_settings->proxyAuthUser(), m_settings->proxyAuthPass());
    }

    // Set output encoding
    Terminal::instance()->setEncoding(m_settings->outputEncoding());

    connect(m_hostPage, &PhantomPage::consoleMessageReceived, this, &Phantom::printConsoleMessage);
    connect(m_hostPage, &PhantomPage::initialized, this, &Phantom::onInitialized);

    m_defaultPageSettings[PAGE_SETTINGS_LOAD_IMAGES] = QVariant::fromValue(m_settings->autoLoadImages());
    m_defaultPageSettings[PAGE_SETTINGS_JS_ENABLED] = QVariant::fromValue(true);
    m_defaultPageSettings[PAGE_SETTINGS_XSS_AUDITING] = QVariant::fromValue(false);
    // TODO
    // m_defaultPageSettings[PAGE_SETTINGS_USER_AGENT] = QVariant::fromValue(m_page->userAgent());
    m_defaultPageSettings[PAGE_SETTINGS_USER_AGENT] = QVariant::fromValue(QString("PhantomJS"));
    m_defaultPageSettings[PAGE_SETTINGS_LOCAL_ACCESS_REMOTE] = QVariant::fromValue(m_settings->localToRemoteUrlAccessEnabled());
    m_defaultPageSettings[PAGE_SETTINGS_WEB_SECURITY_ENABLED] = QVariant::fromValue(m_settings->webSecurityEnabled());
    m_defaultPageSettings[PAGE_SETTINGS_JS_CAN_OPEN_WINDOWS] = QVariant::fromValue(m_settings->javascriptCanOpenWindows());
    m_defaultPageSettings[PAGE_SETTINGS_JS_CAN_CLOSE_WINDOWS] = QVariant::fromValue(m_settings->javascriptCanCloseWindows());
    m_defaultPageSettings[PAGE_SETTINGS_DPI] = QVariant::fromValue(m_defaultDpi);
    // m_page->applySettings(m_defaultPageSettings);

    setLibraryPath(QFileInfo(m_settings->scriptFile()).dir().absolutePath());
}

Phantom::~Phantom() = default;

// public:
Phantom* Phantom::instance()
{
    if (!phantomInstance) {
        phantomInstance = new Phantom();
        phantomInstance->init();
    }
    return phantomInstance;
}

QVariantMap Phantom::defaultPageSettings() const
{
    return m_defaultPageSettings;
}

QString Phantom::outputEncoding() const
{
    return Terminal::instance()->getEncoding();
}

void Phantom::setOutputEncoding(const QString& encoding)
{
    Terminal::instance()->setEncoding(encoding);
}

bool Phantom::execute()
{
    if (m_terminated) {
        return false;
    }

#ifndef QT_NO_DEBUG_OUTPUT
    qDebug() << "Phantom - execute: Configuration";
    const QMetaObject* configMetaObj = m_settings->metaObject();
    for (int i = 0, ilen = configMetaObj->propertyCount(); i < ilen; ++i) {
        qDebug() << "    " << i << configMetaObj->property(i).name() << ":" << m_settings->property(configMetaObj->property(i).name()).toString();
    }

    qDebug() << "Phantom - execute: Script & Arguments";
    qDebug() << "    " << "script:" << m_settings->scriptFile();
    QStringList args = m_settings->scriptArgs();
    for (int i = 0, ilen = args.length(); i < ilen; ++i) {
        qDebug() << "    " << i << "arg:" << args.at(i);
    }
#endif

    if (m_settings->isWebdriverMode()) {
        // Remote WebDriver mode requested
        qDebug() << "Phantom - execute: Starting Remote WebDriver mode";

        if (m_hostPage->executeFromFile(":/ghostdriver/main.js") == QVariant::Invalid) {
            m_returnValue = -1;
            return false;
        }
    }
    else if (m_settings->scriptFile().isEmpty()) {
        // REPL mode requested
        qDebug() << "Phantom - execute: Starting REPL mode";

        // Create the REPL: it will launch itself, no need to store this variable.
        REPL::getInstance(m_hostPage->mainFrame(), this);
    }
    else {
        // Load the User Script
        qDebug() << "Phantom - execute: Starting normal mode";

        if (!QFileInfo::exists(m_settings->scriptFile())) {
            qDebug() << "Phantom - unable to open file" << m_settings->scriptFile();
            m_returnValue = -1;
            return false;
        }

        if (m_settings->debug()) {
            // Debug enabled
            // TODO: Remote debugging

            m_hostPage->executeFromFile(m_settings->scriptFile());
        }
        else {
            m_hostPage->executeFromFile(m_settings->scriptFile());
        }
    }

    return !m_terminated;
}

int Phantom::returnValue() const
{
    return m_returnValue;
}

QString Phantom::libraryPath() const
{
    QString path = m_libraryPath.dir().absolutePath();
    qDebug() << __PRETTY_FUNCTION__ << path;

    return path;
}

void Phantom::setLibraryPath(const QString& libraryPath)
{
    qDebug() << __PRETTY_FUNCTION__ << libraryPath;
    m_libraryPath = QFileInfo(libraryPath);
}

QVariantMap Phantom::version() const
{
    QVariantMap result;
    result["major"] = PHANTOMJS_VERSION_MAJOR;
    result["minor"] = PHANTOMJS_VERSION_MINOR;
    result["patch"] = PHANTOMJS_VERSION_PATCH;
    return result;
}

Settings* Phantom::settings() const
{
    return m_settings;
}

bool Phantom::printDebugMessages() const
{
    return m_settings->printDebugMessages();
}

bool Phantom::areCookiesEnabled() const
{
    return m_defaultCookieJar->isEnabled();
}

void Phantom::setCookiesEnabled(const bool value)
{
    if (value) {
        m_defaultCookieJar->enable();
    } else {
        m_defaultCookieJar->disable();
    }
}

bool Phantom::webdriverMode() const
{
    return m_settings->isWebdriverMode();
}

// public slots:
QObject* Phantom::createCookieJar(const QString& filePath)
{
    return new CookieJar(filePath, this);
}

QObject* Phantom::createWebPage()
{
    WebPage* page = new WebPage(this);
    page->setCookieJar(m_defaultCookieJar);

    // Store pointer to the page for later cleanup
    m_pages.append(page);
    // Apply default settings to the page
    page->applySettings(m_defaultPageSettings);

    // Show web-inspector if in debug mode
    if (m_settings->debug()) {
        page->showInspector(m_settings->remoteDebugPort());
    }

    return page;
}

QObject* Phantom::createWebServer()
{
    WebServer* server = new WebServer(this);
    m_servers.append(server);
    return server;
}

QObject* Phantom::createFilesystem()
{
    if (!m_filesystem) {
        m_filesystem = new FileSystem(this);
    }

    return m_filesystem;
}

QObject* Phantom::createSystem()
{
    if (!m_system) {
        m_system = new System(this);

        QStringList systemArgs;
        systemArgs += m_settings->scriptFile();
        systemArgs += m_settings->scriptArgs();
        m_system->setArgs(systemArgs);
    }

    return m_system;
}

QObject* Phantom::_createChildProcess()
{
    if (!m_childprocess) {
        m_childprocess = new ChildProcess(this);
    }

    return m_childprocess;
}

QObject* Phantom::createCallback()
{
    return new Callback(this);
}

void Phantom::loadModule(const QString& moduleSource, const QString& filename)
{
    if (m_terminated) {
        return;
    }

    QString scriptSource =
        "(function(require, exports, module) {\n" +
        moduleSource +
        "\n}.call({}," +
        "require.cache['" + filename + "']._getRequire()," +
        "require.cache['" + filename + "'].exports," +
        "require.cache['" + filename + "']" +
        "));";
    m_hostPage->execute(scriptSource);
}

bool Phantom::injectJs(const QString& jsFilePath)
{
    QString pre = "";
    qDebug() << "Phantom - injectJs:" << jsFilePath;

    // If in Remote Webdriver Mode, we need to manipulate the PATH, to point it to a resource in `ghostdriver.qrc`
    if (webdriverMode()) {
        pre = ":/ghostdriver/";
        qDebug() << "Phantom - injectJs: prepending" << pre;
    }

    if (m_terminated) {
        return false;
    }

    return m_hostPage->executeFromFile(pre + jsFilePath) != QVariant::Invalid;
}

void Phantom::setProxy(const QString& ip, const qint16& port, const QString& proxyType, const QString& user, const QString& password)
{
    qDebug() << "Set " << proxyType << " proxy to: " << ip << ":" << port;
    if (ip.isEmpty()) {
        QNetworkProxyFactory::setUseSystemConfiguration(true);
    } else {
        QNetworkProxy::ProxyType networkProxyType = QNetworkProxy::HttpProxy;

        if (proxyType == "socks5") {
            networkProxyType = QNetworkProxy::Socks5Proxy;
        }
        // Checking for passed proxy user and password
        if (!user.isEmpty() && !password.isEmpty()) {
            QNetworkProxy proxy(networkProxyType, ip, port, user, password);
            QNetworkProxy::setApplicationProxy(proxy);
        } else {
            QNetworkProxy proxy(networkProxyType, ip, port);
            QNetworkProxy::setApplicationProxy(proxy);
        }
    }
}

QString Phantom::proxy()
{
    QNetworkProxy proxy = QNetworkProxy::applicationProxy();
    if (proxy.hostName().isEmpty()) {
        return QString();
    }
    return proxy.hostName() + ":" + QString::number(proxy.port());
}

int Phantom::remoteDebugPort() const
{
    return m_settings->remoteDebugPort();
}

void Phantom::exit(int code)
{
    if (m_settings->debug()) {
        Terminal::instance()->cout("Phantom::exit() called but not quitting in debug mode.");
    } else {
        doExit(code);
    }
}

void Phantom::debugExit(int code)
{
    doExit(code);
}

QString Phantom::resolveRelativeUrl(QString url, QString base)
{
    QUrl u = QUrl::fromEncoded(url.toLatin1());
    QUrl b = QUrl::fromEncoded(base.toLatin1());

    return b.resolved(u).toEncoded();
}

QString Phantom::fullyDecodeUrl(QString url)
{
    return QUrl::fromEncoded(url.toLatin1()).toDisplayString();
}

// private slots:
void Phantom::printConsoleMessage(const QString& message)
{
    Terminal::instance()->cout(message);
}

void Phantom::onInitialized()
{
    // And load the script
    m_hostPage->executeFromFile(m_settings->scriptFile());
}

bool Phantom::setCookies(const QVariantList& cookies)
{
    // Delete all the cookies from the CookieJar
    m_defaultCookieJar->clearCookies();
    // Add a new set of cookies
    return m_defaultCookieJar->addCookiesFromMap(cookies);
}

QVariantList Phantom::cookies() const
{
    // Return all the Cookies in the CookieJar, as a list of Maps (aka JSON in JS space)
    return m_defaultCookieJar->cookiesToMap();
}

bool Phantom::addCookie(const QVariantMap& cookie)
{
    return m_defaultCookieJar->addCookieFromMap(cookie);
}

bool Phantom::deleteCookie(const QString& cookieName)
{
    if (!cookieName.isEmpty()) {
        return m_defaultCookieJar->deleteCookie(cookieName);
    }
    return false;
}

void Phantom::clearCookies()
{
    m_defaultCookieJar->clearCookies();
}

void Phantom::appendPage(WebPage* webPage)
{
    QPointer<WebPage> p(webPage);
    m_pages.append(p);
}

PhantomPage* Phantom::hostPage() const
{
    return m_hostPage;
}

// private:
void Phantom::doExit(int code)
{
    emit aboutToExit(code);
    m_terminated = true;
    m_returnValue = code;

    // Iterate in reverse order so the first page is the last one scheduled for deletion.
    // The first page is the root object, which will be invalidated when it is deleted.
    // This causes an assertion to go off in BridgeJSC.cpp Instance::createRuntimeObject.
    QListIterator<QPointer<WebPage> > i(m_pages);
    i.toBack();
    while (i.hasPrevious()) {
        const QPointer<WebPage> page = i.previous();

        if (!page) {
            continue;
        }

        // stop processing of JavaScript code by loading a blank page
        page->mainFrame()->setUrl(QUrl(QStringLiteral("about:blank")));
        // delay deletion into the event loop, direct deletion can trigger crashes
        page->deleteLater();
    }
    m_pages.clear();

    m_hostPage->deleteLater();
    QApplication::instance()->exit(code);
}


text:
jpub-maven-plugin
=================

##Introduction

Maven3 plugin that integrates Oracle JPublisher into Maven project lifecycle.
It generates Java classes with methods for every stored procedure you specify from your Oracle Database,
and you do not have to worry about mapping types, including complex types, lists etc..

##Requirments

JPublisher artifacts.
First you have to install JPublisher artifacts in your maven repository.
So download jpublisher distribution from
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
and install it your favorite way in your repository.
I have installed them as:

```
<dependency>
	<groupId>oracle</groupId>
	<artifactId>runtime12</artifactId>
	<version>10.2</version>
</dependency>
<dependency>
	<groupId>oracle</groupId>
	<artifactId>translator</artifactId>
	<version>10.2</version>
</dependency>
```

##Oracle Driver

JPublisher generated classes work only with unwrapped JDBC Driver. This is some kind of problem if you are using for example WebLogic datasource (but as Oracle has bought WebLogic recently, this problem should disappear in near future).
For now you have configure your own datasource using OracleDataSource included in oracle driver.
I made jdbc driver available in my repository as:

```
<dependency>
   <groupId>oracle</groupId>
	<artifactId>ojdbc5</artifactId>
	<version>11.1.0.6.0</version>
</dependency>
<dependency>
	<groupId>oracle</groupId>
	<artifactId>orai18n</artifactId>
	<version>11.1.0.6.0</version>
</dependency>
```

##Plugin usage

To use the plugin you just need to add following configuration to you pom.xml:

```
...
   <build>
      ...
       <plugins>
          ...
            <plugin>
                <groupId>pl.touk.top</groupId>
                <artifactId>jpub-maven-plugin</artifactId>
                <version>2.0.0</version>
                <configuration>
                    <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                    <user>${database.user}/${database.password}</user>
                    <url>${database.url}</url>
                    <sourceDirectory>${project.build.directory}/generated-sources/src</sourceDirectory>
                    <genPackage>pl.touk.myexample.dao.oracle</genPackage>
                    <encoding>UTF-8</encoding>
                    <compile>true</compile>
                    <connscope>method</connscope>
                    <toString>true</toString>
                    <other>-omit_schema_names -datasource=true -connscope=method -compatible=9i
-numbertypes=oracle -input=${project.basedir}/src/main/resources/jpub_object_list</other>
                    <debug>true</debug>
                    <closeConnection>true</closeConnection>
                    <xmx>256m</xmx>
                    <xms>256m</xms>
                    <skip>${skipJPub}</skip>
                </configuration>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                       <groupId>oracle</groupId>
                        <artifactId>ojdbc5</artifactId>
                        <version>11.1.0.6.0</version>
                    </dependency>
                    <dependency>
                        <groupId>oracle</groupId>
                        <artifactId>orai18n</artifactId>
                        <version>11.1.0.6.0</version>
                    </dependency>
                    <dependency>
                        <groupId>oracle</groupId>
                        <artifactId>runtime12</artifactId>
                        <version>10.2</version>
                    </dependency>
                    <dependency>
                        <groupId>oracle</groupId>
                        <artifactId>translator</artifactId>
                        <version>10.2</version>
                    </dependency>
                </dependencies>
            </plugin>
         ...
      </plugins>
     ...
    </build>
```

That will generate Java classes for stored procedures listed in -input=${project.basedir}/src/main/resources/jpub_object_list
All parameters specified in <configuration> section are one to one copy of those you can find in JPublisher documentation.
The only exception is <closeConnection> parameter. Setting it to true will modify generated classes so that after executing any stored procedure used connection will be closed - meaning it will be returned to the pool!

##Datasource configuration

If you are using Spring you can make it as simply as:

```
<bean name="dataSource" class="oracle.jdbc.pool.OracleDataSource">
	<property name="URL" value="${database.url}"/>
	<property name="user" value="${database.user}"/>
	<property name="password" value="${database.password}"/>
	<property name="connectionCachingEnabled" value="true"/>
	<!--<property name="connectionCacheName" value="MYEXAMPLE_CACHE"/>-->
	<property name="implicitCachingEnabled" value="true"/>
	<property name="connectionCacheProperties">
		<props>
			<prop key="MinLimit">5</prop>
			<prop key="ConnectionCachingEnabled">True</prop>
			<prop key="InitialLimit">5</prop>
			<prop key="MaxLimit">5</prop>
			<prop key="ValidateConnection">false</prop>
			<!--<prop key="InactivityTimeout">10</prop>-->
			<prop key="AbandonedConnectionTimeout">180</prop>
			<prop key="ConnectionWaitTimeout">60</prop>
			<!--<prop key="TimeToLiveTimeout">5</prop>-->
			<!--<prop key="PropertyCheckInterval">300</prop>-->
		</props>
	</property>
</bean>
```

##Using generated classes

Oracle decided to make these generated classes NOT thread safe ( that's not bad),
but with a little trick from Spring you can easily overcome this problem.
Spring code snippet below assumes that I have class pl.touk.myexample.dao.oracle.MyExampleStoredProceduresPackage. Generated by JPublisher that contains methods to my stored procedures.
To use it as a bean in spring just do :

```
<bean id="targetMyExample" class="pl.touk.myexample.dao.oracle.MyExampleStoredProceduresPackage" scope="prototype">
	<property name="dataSource" ref="dataSource" />
</bean>

<bean id="threadTargetMyExample" class="org.springframework.aop.target.ThreadLocalTargetSource">
	<property name="targetBeanName" value="targetMyExample"/>
</bean>

<bean id="myExample" class="org.springframework.aop.framework.ProxyFactoryBean">
	<property name="targetSource" ref="threadTargetMyExample"/>
</bean>
```

I know this is not perfect, but it is good enough and it works very well.
Good luck.


text:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="Bootstrap.php" colors="true">
    <testsuites>
        <testsuite name="Application Test Suite">
            <directory>./Application</directory>
        </testsuite>
    </testsuites>
</phpunit>


text:
[![Sauce Test Status](https://saucelabs.com/browser-matrix/AlphaSau.svg)](https://saucelabs.com/u/AlphaSau)

Allowing certain inputs based on a regex pattern, preventing the user from inputting anything invalid.

# What is this for?

It is possible that at some points you may want to restrict your user from entering certain values in your web application. Specifically, fields that conform to a very strict set of values. If you decide that it is a good idea for you to **restrict** what the user can even type in the input, this is the tool for you.

This works similar to a masked input, except that no mask is displayed, and the validation is done against a regular expression, which allows you to permit a complex class of values if that's what you need, or to be very specific if that is your necessity.

# How does it work?

The logic is quite simple:

- Initialization: save regex to be used from the `ng-pattern-restrict` attribute or the `pattern` attribute.
- Wait for user input, and reach on `input` (for any value change), `keyup` (for keyboard entry) or `click` (for text drag and drop, contextual copy-paste, etc).
- If the input matches the regex, save it as the latest valid value. Also save the current user's input caret position on the field.
- If the input does not match the regex, restore the latest valid value and set the user input caret in the same position as it was. The user experience should be as if nothing was typed or changed.

# Installation

```console
bower install ng-pattern-restrict
```

Alternatively, copy the [ng-pattern-restrict.js][srcfile] (or the minified version [ng-pattern-restrict.min.js][srcminfile]) into your project, load it into the browser and use it away.

# Usage

```html
<input type="text" pattern="[0-9]+" ng-pattern-restrict />
```

Should be the same as

```html
<input type="text" ng-pattern-restrict="[0-9]+" pattern="[0-9]+" />
```

## Notes:

- ([#15][ticket15]) **Make sure to use "progressive" regular expressions.** The expressions are validated against the full regular expression. This means that if your regex is `\d\d`, and your textbox is empty, a user will never be able to type anything because the first keypress will not validate and will be reverted. Following the example, the proper regular expression should be `\d{0,2}`.
- **Your regex must validate against empty strings if you want users to be able to remove the value from the textbox.**
- **Make sure AngularJS is compatible with your browser.** It goes without saying, but your browser compatibility with AngularJS will make a huge impact on how well this directive can behave. For example, AngularJS 1.3 with IE 8 won't really play well together, and this directive is restricted by those limitations.

If you still have problems, please make sure to check the [Compatibility notes][compatibility]. There are several issues that really depend on the browsers.

# E2E testing

In order to e2e test you need to execute the following steps:

```console
npm install
./node_modules/protractor/bin/webdriver-manager update

# then, for each time you want to test
npm test
```

That's it. Neat, huh?

Check out the [protractor configuration file][protractor conf] for the set of browsers that you want to test on your system.

## Version list

- [v0.2.0](https://github.com/AlphaGit/ng-pattern-restrict/releases/tag/v0.2.0)
- [v0.1.1](https://github.com/AlphaGit/ng-pattern-restrict/releases/tag/v0.1.1)
- [v0.1.0-alpha.6](https://github.com/AlphaGit/ng-pattern-restrict/releases/tag/0.1.0-alpha.6)
- [v0.1.0-alpha.5](https://github.com/AlphaGit/ng-pattern-restrict/releases/tag/0.1.0-alpha.5)
- [v0.1.0-alpha.4](https://github.com/AlphaGit/ng-pattern-restrict/releases/tag/0.1.0-alpha.4)
- [v0.1.0-alpha.3](https://github.com/AlphaGit/ng-pattern-restrict/releases/tag/0.1.0-alpha.3)
- [v0.1.0-alpha.2](https://github.com/AlphaGit/ng-pattern-restrict/releases/tag/0.1.0-alpha.2)
- [v0.1.0-alpha.1](https://github.com/AlphaGit/ng-pattern-restrict/releases/tag/0.1.0-alpha.1)

[travisci]: https://travis-ci.org/AlphaGit/ng-pattern-restrict
[ticket15]: https://github.com/AlphaGit/ng-pattern-restrict/issues/15
[compatibility]: https://github.com/AlphaGit/ng-pattern-restrict/docs/compatibility.md
[protractor conf]: https://github.com/AlphaGit/ng-pattern-restrict/protractor-conf.js
[srcfile]: https://github.com/AlphaGit/ng-pattern-restrict/src/ng-pattern-restrict.js
[srcminfile]: https://github.com/AlphaGit/ng-pattern-restrict/src/ng-pattern-restrict.min.js


text:
import GHC
import HscTypes
import OccName
import Name

import Linker
import RtClosureInspect hiding ( Closure, getClosureData )

import GhcMonad
import HscTypes
import Id
import Name
import Var hiding ( varName )
import VarSet
import UniqSupply
import TcType
import GHC
import Outputable
import PprTyThing
import MonadUtils
import Exception

import Control.Monad
import Data.List
import Data.Maybe
import Data.IORef

import System.IO
import GHC.Exts

import GHC.Paths ( libdir )

--import Control.Monad.Ghc

force = False
bindThings = False

a = GHC.runGhc (Just libdir) $ do
  x <- return 1
  go emptyTvSubst "x"

tryid str = do
  tythings <- (catMaybes . concat) `liftM`
    mapM (\w -> GHC.parseName w >>=
    mapM GHC.lookupName)
    (words str)
  let ids = [id | AnId id <- tythings]
  return ids

-- Do the obtainTerm--bindSuspensions-computeSubstitution dance
go :: GhcMonad m => TvSubst -> String -> m (TvSubst, Term)
go subst str = do
    ids <- tryid str
    let id = head ids
    let id' = id `setIdType` substTy subst (idType id)
    term_    <- GHC.obtainTermFromId maxBound force id'
    term     <- tidyTermTyVars term_
    term'    <- if bindThings &&
                   False == isUnliftedTypeKind (termType term)
                  then bindSuspensions term
                  else return term
  -- Before leaving, we compare the type obtained to see if it's more specific
  --  Then, we extract a substitution,
  --  mapping the old tyvars to the reconstructed types.
    let reconstructed_type = termType term
    hsc_env <- getSession
    case (improveRTTIType hsc_env (idType id) (reconstructed_type)) of
      Nothing     -> return (subst, term')
      Just subst' -> do { traceOptIf Opt_D_dump_rtti
                            (fsep $ [text "RTTI Improvement for", ppr id,
                             text "is the substitution:" , ppr subst'])
                        ; return (subst `unionTvSubst` subst', term')}

tidyTermTyVars :: GhcMonad m => Term -> m Term
tidyTermTyVars t =
  withSession $ \hsc_env -> do
  let env_tvs      = tyThingsTyVars $ ic_tythings $ hsc_IC hsc_env
      my_tvs       = termTyVars t
      tvs          = env_tvs `minusVarSet` my_tvs
      tyvarOccName = nameOccName . tyVarName
      tidyEnv      = (initTidyOccEnv (map tyvarOccName (varSetElems tvs))
                     , env_tvs `intersectVarSet` my_tvs)
  return$ mapTermType (snd . tidyOpenType tidyEnv) t

-- From ghc/compiler/ghci/Debugger.hs
-- | Give names, and bind in the interactive environment, to all the suspensions
--   included (inductively) in a term
bindSuspensions :: GhcMonad m => Term -> m Term
bindSuspensions t = do
      hsc_env <- getSession
      inScope <- GHC.getBindings
      let ictxt        = hsc_IC hsc_env
          prefix       = "_t"
          alreadyUsedNames = map (occNameString . nameOccName . getName) inScope
          availNames   = map ((prefix++) . show) [(1::Int)..] \\ alreadyUsedNames
      availNames_var  <- liftIO $ newIORef availNames
      (t', stuff)     <- liftIO $ foldTerm (nameSuspensionsAndGetInfos availNames_var) t
      let (names, tys, hvals) = unzip3 stuff
      let ids = [ mkVanillaGlobal name ty
                | (name,ty) <- zip names tys]
          new_ic = extendInteractiveContext ictxt (map AnId ids)
      liftIO $ extendLinkEnv (zip names hvals)
      modifySession $ \_ -> hsc_env {hsc_IC = new_ic }
      return t'
     where

--    Processing suspensions. Give names and recopilate info
        nameSuspensionsAndGetInfos :: IORef [String] ->
                                       TermFold (IO (Term, [(Name,Type,HValue)]))
        nameSuspensionsAndGetInfos freeNames = TermFold
                      {
                        fSuspension = doSuspension freeNames
                      , fTerm = \ty dc v tt -> do
                                    tt' <- sequence tt
                                    let (terms,names) = unzip tt'
                                    return (Term ty dc v terms, concat names)
                      , fPrim    = \ty n ->return (Prim ty n,[])
                      , fNewtypeWrap  =
                                \ty dc t -> do
                                    (term, names) <- t
                                    return (NewtypeWrap ty dc term, names)
                      , fRefWrap = \ty t -> do
                                    (term, names) <- t
                                    return (RefWrap ty term, names)
                      }
        doSuspension freeNames ct ty hval _name = do
          name <- atomicModifyIORef freeNames (\x->(tail x, head x))
          n <- newGrimName name
          return (Suspension ct ty hval (Just n), [(n,ty,hval)])

-- From ghc/compiler/ghci/Debugger.hs
--    Create new uniques and give them sequentially numbered names
newGrimName :: MonadIO m => String -> m Name
newGrimName userName  = do
    us <- liftIO $ mkSplitUniqSupply 'b'
    let unique  = uniqFromSupply us
        occname = mkOccName varName userName
        name    = mkInternalName unique occname noSrcSpan
    return name

traceOptIf :: GhcMonad m => DynFlag -> SDoc -> m ()
traceOptIf flag doc = do
  dflags <- GHC.getSessionDynFlags
  when (dopt flag dflags) $ liftIO $ printForUser stderr alwaysQualify doc


text:
import * as jsonpath from "jsonpath";
export declare type JsonPathComponent = jsonpath.PathComponent;
export declare type JsonPath = JsonPathComponent[];
export declare function parse(jsonPath: string): JsonPath;
export declare function stringify(jsonPath: JsonPath): string;
export declare function paths<T>(obj: T, jsonQuery: string): JsonPath[];
export declare function nodes<T>(obj: T, jsonQuery: string): {
    path: JsonPath;
    value: any;
}[];
export declare function IsPrefix(prefix: JsonPath, path: JsonPath): boolean;
export declare function CreateObject(jsonPath: JsonPath, leafObject: any): any;
export declare function matches(jsonQuery: string, jsonPath: JsonPath): boolean;


text:
<resources>
    <!-- Example customization of dimensions originally defined in res/values/dimens.xml
         (such as screen margins) for screens with more than 820dp of available width. This
         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
    <dimen name="activity_horizontal_margin">64dp</dimen>
    <dimen name="choosing_horizontal_margin">60dp</dimen>
    <dimen name="choosing_vertical_margin">60dp</dimen>
</resources>


text:
using launcher::repositories::FileToRestoreRepository;

using file_system::Path;
using file_system::factories::PathFactory;

using launcher::domain::BackupFolder;
using launcher::domain::FileToRestore;

using settings::domain::Settings;
using settings::repositories::SettingsRepository;

FileToRestoreRepository::FileToRestoreRepository(SettingsRepository& settingsRepository)
	: _settingsRepository(settingsRepository)
{
}

FileToRestoreRepository::~FileToRestoreRepository()
{
}

std::vector<FileToRestore> FileToRestoreRepository::get(const BackupFolder& backupFolder)
{
	const Settings& settings = _settingsRepository.get();

	std::vector<FileToRestore> files;
	PathFactory pathFactory;
	for (settings::domain::FileToBackup pathString : settings.getFilePaths())
	{
		try
		{
			Path path = pathFactory.createPath(pathString.getPath());
			FileToRestore newFile(path, backupFolder, pathString.getLabel());
			files.push_back(newFile);
		}
		catch (core::Exception exception)
		{
			std::cout << "Can not restore file" << std::endl
				<< "\t - " << exception.what() << std::endl;
		}
	}

	return files;
}


text:
"""Copyright 2008 Orbitz WorldWide

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License."""

import imp
import os
import socket
import time
import sys
import calendar
import pytz
from os.path import splitext, basename, relpath
from shutil import move
from tempfile import mkstemp
try:
  import cPickle as pickle
  USING_CPICKLE = True
except:
  import pickle
  USING_CPICKLE = False

try:
  from cStringIO import StringIO
except ImportError:
  from StringIO import StringIO

from django.conf import settings
from graphite.logger import log

# There are a couple different json modules floating around out there with
# different APIs. Hide the ugliness here.
try:
  import json
except ImportError:
  import simplejson as json

if hasattr(json, 'read') and not hasattr(json, 'loads'):
  json.loads = json.read
  json.dumps = json.write
  json.load = lambda file: json.read( file.read() )
  json.dump = lambda obj, file: file.write( json.write(obj) )

def epoch(dt):
  """
  Returns the epoch timestamp of a timezone-aware datetime object.
  """
  return calendar.timegm(dt.astimezone(pytz.utc).timetuple())

def timebounds(requestContext):
  startTime = int(epoch(requestContext['startTime']))
  endTime = int(epoch(requestContext['endTime']))
  now = int(epoch(requestContext['now']))

  return (startTime, endTime, now)

def is_local_interface(host):
  is_ipv6 = False
  if ':' in host:
    try:
      if host.find('[', 0, 2) != -1:
        last_bracket_position  = host.rfind(']')
        last_colon_position = host.rfind(':')
        if last_colon_position > last_bracket_position:
          host = host.rsplit(':', 1)[0]
        host = host.strip('[]')
      socket.inet_pton(socket.AF_INET6, host)
      is_ipv6 = True
    except socket.error:
      host = host.split(':',1)[0]

  try:
    if is_ipv6:
      sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
    else:
      sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    sock.connect( (host, 4242) )
    local_ip = sock.getsockname()[0]
    sock.close()
  except:
    log.exception("Failed to open socket with %s" % host)
    raise

  if local_ip == host:
    return True

  return False

def is_pattern(s):
   return '*' in s or '?' in s or '[' in s or '{' in s

def is_escaped_pattern(s):
  for symbol in '*?[{':
    i = s.find(symbol)
    if i > 0:
      if s[i-1] == '\\':
        return True
  return False

def find_escaped_pattern_fields(pattern_string):
  pattern_parts = pattern_string.split('.')
  for index,part in enumerate(pattern_parts):
    if is_escaped_pattern(part):
      yield index

def load_module(module_path, member=None):
  module_name = splitext(basename(module_path))[0]
  module_file = open(module_path, 'U')
  description = ('.py', 'U', imp.PY_SOURCE)
  module = imp.load_module(module_name, module_file, module_path, description)
  if member:
    return getattr(module, member)
  else:
    return module

def timestamp(datetime):
  "Convert a datetime object into epoch time"
  return time.mktime( datetime.timetuple() )

def deltaseconds(timedelta):
  "Convert a timedelta object into seconds (same as timedelta.total_seconds() in Python 2.7+)"
  return (timedelta.microseconds + (timedelta.seconds + timedelta.days * 24 * 3600) * 10**6) / 10**6

# This whole song & dance is due to pickle being insecure
# The SafeUnpickler classes were largely derived from
# http://nadiana.com/python-pickle-insecure
# This code also lives in carbon.util
if USING_CPICKLE:
  class SafeUnpickler(object):
    PICKLE_SAFE = {
      'copy_reg': set(['_reconstructor']),
      '__builtin__': set(['object', 'list', 'set']),
      'collections': set(['deque']),
      'graphite.render.datalib': set(['TimeSeries']),
      'graphite.intervals': set(['Interval', 'IntervalSet']),
    }

    @classmethod
    def find_class(cls, module, name):
      if not module in cls.PICKLE_SAFE:
        raise pickle.UnpicklingError('Attempting to unpickle unsafe module %s' % module)
      __import__(module)
      mod = sys.modules[module]
      if not name in cls.PICKLE_SAFE[module]:
        raise pickle.UnpicklingError('Attempting to unpickle unsafe class %s' % name)
      return getattr(mod, name)

    @classmethod
    def loads(cls, pickle_string):
      pickle_obj = pickle.Unpickler(StringIO(pickle_string))
      pickle_obj.find_global = cls.find_class
      return pickle_obj.load()

else:
  class SafeUnpickler(pickle.Unpickler):
    PICKLE_SAFE = {
      'copy_reg': set(['_reconstructor']),
      '__builtin__': set(['object', 'list', 'set']),
      'collections': set(['deque']),
      'graphite.render.datalib': set(['TimeSeries']),
      'graphite.intervals': set(['Interval', 'IntervalSet']),
    }

    def find_class(self, module, name):
      if not module in self.PICKLE_SAFE:
        raise pickle.UnpicklingError('Attempting to unpickle unsafe module %s' % module)
      __import__(module)
      mod = sys.modules[module]
      if not name in self.PICKLE_SAFE[module]:
        raise pickle.UnpicklingError('Attempting to unpickle unsafe class %s' % name)
      return getattr(mod, name)

    @classmethod
    def loads(cls, pickle_string):
      return cls(StringIO(pickle_string)).load()

unpickle = SafeUnpickler

def write_index(whisper_dir=None, ceres_dir=None, index=None):
  if not whisper_dir:
    whisper_dir = settings.WHISPER_DIR
  if not ceres_dir:
    ceres_dir = settings.CERES_DIR
  if not index:
    index = settings.INDEX_FILE
  try:
    fd, tmp = mkstemp()
    try:
      tmp_index = os.fdopen(fd, 'wt')
      build_index(whisper_dir, ".wsp", tmp_index)
      build_index(ceres_dir, ".ceres-node", tmp_index)
    finally:
      tmp_index.close()
    move(tmp, index)
  finally:
    try:
      os.unlink(tmp)
    except:
      pass
  return None

def logtime(custom_msg=False):
  def wrap(f):
    def wrapped_f(*args, **kwargs):
      msg = 'completed in'

      t = time.time()
      if custom_msg:
        def set_msg(msg):
          wrapped_f.msg = msg

        kwargs['msg_setter'] = set_msg

      res = f(*args, **kwargs)
      msg = getattr(wrapped_f, 'msg', msg)

      log.info(
        '{module}.{name} :: {msg} {sec:.6}s'.format(
          module=f.__module__,
          name=f.__name__,
          msg=msg,
          sec=time.time() - t,
        )
      )
      return res
    return wrapped_f
  return wrap

@logtime(custom_msg=True)
def build_index(base_path, extension, fd, msg_setter=None):
  t = time.time()
  total_entries = 0
  contents = os.walk(base_path, followlinks=True)
  extension_len = len(extension)
  for (dirpath, dirnames, filenames) in contents:
    path = relpath(dirpath, base_path).replace('/', '.')
    for metric in filenames:
      if metric.endswith(extension):
        metric = metric[:-extension_len]
      else:
        continue
      line = "{0}.{1}\n".format(path, metric)
      total_entries += 1
      fd.write(line)
  fd.flush()
  msg_setter("[IndexSearcher] index rebuild of \"%s\" took" % base_path)
  return None


text:
#include <boost/python.hpp>
#include <iostream>
#include <vector>

#include "types.h"
#include "hahog.cc"
#include "multiview.cc"
#include "akaze.cc"
#include "bundle.h"
#include "openmvs_exporter.h"
#include "depthmap_wrapper.cc"
#include "reconstruction_alignment.h"

#if (PY_VERSION_HEX < 0x03000000)
static void numpy_import_array_wrapper()
#else
static int* numpy_import_array_wrapper()
#endif
{
  /* Initialise numpy API and use 2/3 compatible return */
  import_array();
}

BOOST_PYTHON_MODULE(csfm) {
  using namespace boost::python;

  google::InitGoogleLogging("csfm");
#ifdef USE_BOOST_PYTHON_NUMPY
  boost::python::numpy::initialize();
#else
  boost::python::numeric::array::set_module_and_type("numpy", "ndarray");
#endif
  numpy_import_array_wrapper();

  enum_<DESCRIPTOR_TYPE>("AkazeDescriptorType")
    .value("SURF_UPRIGHT", SURF_UPRIGHT)
    .value("SURF", SURF)
    .value("MSURF_UPRIGHT", MSURF_UPRIGHT)
    .value("MSURF", MSURF)
    .value("MLDB_UPRIGHT", MLDB_UPRIGHT)
    .value("MLDB", MLDB)
  ;

  class_<AKAZEOptions>("AKAZEOptions")
    .def_readwrite("omin", &AKAZEOptions::omin)
    .def_readwrite("omax", &AKAZEOptions::omax)
    .def_readwrite("nsublevels", &AKAZEOptions::nsublevels)
    .def_readwrite("img_width", &AKAZEOptions::img_width)
    .def_readwrite("img_height", &AKAZEOptions::img_height)
    .def_readwrite("soffset", &AKAZEOptions::soffset)
    .def_readwrite("derivative_factor", &AKAZEOptions::derivative_factor)
    .def_readwrite("sderivatives", &AKAZEOptions::sderivatives)
    .def_readwrite("diffusivity", &AKAZEOptions::diffusivity)
    .def_readwrite("dthreshold", &AKAZEOptions::dthreshold)
    .def_readwrite("min_dthreshold", &AKAZEOptions::min_dthreshold)
    .def_readwrite("target_num_features", &AKAZEOptions::target_num_features)
    .def_readwrite("use_adaptive_suppression", &AKAZEOptions::use_adaptive_suppression)
    .def_readwrite("descriptor", &AKAZEOptions::descriptor)
    .def_readwrite("descriptor_size", &AKAZEOptions::descriptor_size)
    .def_readwrite("descriptor_channels", &AKAZEOptions::descriptor_channels)
    .def_readwrite("descriptor_pattern_size", &AKAZEOptions::descriptor_pattern_size)
    .def_readwrite("kcontrast", &AKAZEOptions::kcontrast)
    .def_readwrite("kcontrast_percentile", &AKAZEOptions::kcontrast_percentile)
    .def_readwrite("kcontrast_nbins", &AKAZEOptions::kcontrast_nbins)
    .def_readwrite("use_isotropic_diffusion", &AKAZEOptions::use_isotropic_diffusion)
    .def_readwrite("save_scale_space", &AKAZEOptions::save_scale_space)
    .def_readwrite("save_keypoints", &AKAZEOptions::save_keypoints)
    .def_readwrite("verbosity", &AKAZEOptions::verbosity)
  ;

  def("akaze", csfm::akaze);

  def("hahog", csfm::hahog,
      (boost::python::arg("peak_threshold") = 0.003,
       boost::python::arg("edge_threshold") = 10,
       boost::python::arg("target_num_features") = 0,
       boost::python::arg("use_adaptive_suppression") = false
      )
  );

  def("triangulate_bearings_dlt", csfm::TriangulateBearingsDLT);
  def("triangulate_bearings_midpoint", csfm::TriangulateBearingsMidpoint);

  class_<BundleAdjuster, boost::noncopyable>("BundleAdjuster")
    .def("run", &BundleAdjuster::Run)
    .def("get_perspective_camera", &BundleAdjuster::GetPerspectiveCamera)
    .def("get_brown_perspective_camera", &BundleAdjuster::GetBrownPerspectiveCamera)
    .def("get_fisheye_camera", &BundleAdjuster::GetFisheyeCamera)
    .def("get_equirectangular_camera", &BundleAdjuster::GetEquirectangularCamera)
    .def("get_shot", &BundleAdjuster::GetShot)
    .def("get_point", &BundleAdjuster::GetPoint)
    .def("add_perspective_camera", &BundleAdjuster::AddPerspectiveCamera)
    .def("add_brown_perspective_camera", &BundleAdjuster::AddBrownPerspectiveCamera)
    .def("add_fisheye_camera", &BundleAdjuster::AddFisheyeCamera)
    .def("add_equirectangular_camera", &BundleAdjuster::AddEquirectangularCamera)
    .def("add_shot", &BundleAdjuster::AddShot)
    .def("add_point", &BundleAdjuster::AddPoint)
    .def("add_observation", &BundleAdjuster::AddObservation)
    .def("add_rotation_prior", &BundleAdjuster::AddRotationPrior)
    .def("add_translation_prior", &BundleAdjuster::AddTranslationPrior)
    .def("add_position_prior", &BundleAdjuster::AddPositionPrior)
    .def("add_point_position_prior", &BundleAdjuster::AddPointPositionPrior)
    .def("add_ground_control_point_observation", &BundleAdjuster::AddGroundControlPointObservation)
    .def("set_origin_shot", &BundleAdjuster::SetOriginShot)
    .def("set_unit_translation_shot", &BundleAdjuster::SetUnitTranslationShot)
    .def("set_loss_function", &BundleAdjuster::SetLossFunction)
    .def("set_reprojection_error_sd", &BundleAdjuster::SetReprojectionErrorSD)
    .def("set_max_num_iterations", &BundleAdjuster::SetMaxNumIterations)
    .def("set_num_threads", &BundleAdjuster::SetNumThreads)
    .def("set_linear_solver_type", &BundleAdjuster::SetLinearSolverType)
    .def("set_internal_parameters_prior_sd", &BundleAdjuster::SetInternalParametersPriorSD)
    .def("set_compute_covariances", &BundleAdjuster::SetComputeCovariances)
    .def("get_covariance_estimation_valid", &BundleAdjuster::GetCovarianceEstimationValid)
    .def("set_compute_reprojection_errors", &BundleAdjuster::SetComputeReprojectionErrors)
    .def("brief_report", &BundleAdjuster::BriefReport)
    .def("full_report", &BundleAdjuster::FullReport)
  ;

  class_<BAPerspectiveCamera>("BAPerspectiveCamera")
    .add_property("focal", &BAPerspectiveCamera::GetFocal, &BAPerspectiveCamera::SetFocal)
    .add_property("k1", &BAPerspectiveCamera::GetK1, &BAPerspectiveCamera::SetK1)
    .add_property("k2", &BAPerspectiveCamera::GetK2, &BAPerspectiveCamera::SetK2)
    .def_readwrite("constant", &BAPerspectiveCamera::constant)
    .def_readwrite("focal_prior", &BAPerspectiveCamera::focal_prior)
    .def_readwrite("id", &BAPerspectiveCamera::id)
  ;

  class_<BABrownPerspectiveCamera>("BABrownPerspectiveCamera")
    .add_property("focal_x", &BABrownPerspectiveCamera::GetFocalX, &BABrownPerspectiveCamera::SetFocalX)
    .add_property("focal_y", &BABrownPerspectiveCamera::GetFocalY, &BABrownPerspectiveCamera::SetFocalY)
    .add_property("c_x", &BABrownPerspectiveCamera::GetCX, &BABrownPerspectiveCamera::SetCX)
    .add_property("c_y", &BABrownPerspectiveCamera::GetCY, &BABrownPerspectiveCamera::SetCY)
    .add_property("k1", &BABrownPerspectiveCamera::GetK1, &BABrownPerspectiveCamera::SetK1)
    .add_property("k2", &BABrownPerspectiveCamera::GetK2, &BABrownPerspectiveCamera::SetK2)
    .add_property("p1", &BABrownPerspectiveCamera::GetP1, &BABrownPerspectiveCamera::SetP1)
    .add_property("p2", &BABrownPerspectiveCamera::GetP2, &BABrownPerspectiveCamera::SetP2)
    .add_property("k3", &BABrownPerspectiveCamera::GetK3, &BABrownPerspectiveCamera::SetK3)
    .def_readwrite("focal_x_prior", &BABrownPerspectiveCamera::focal_x_prior)
    .def_readwrite("focal_y_prior", &BABrownPerspectiveCamera::focal_y_prior)
    .def_readwrite("c_x_prior", &BABrownPerspectiveCamera::c_x_prior)
    .def_readwrite("c_y_prior", &BABrownPerspectiveCamera::c_y_prior)
    .def_readwrite("k1_prior", &BABrownPerspectiveCamera::k1_prior)
    .def_readwrite("k2_prior", &BABrownPerspectiveCamera::k2_prior)
    .def_readwrite("p1_prior", &BABrownPerspectiveCamera::p1_prior)
    .def_readwrite("p2_prior", &BABrownPerspectiveCamera::p2_prior)
    .def_readwrite("k3_prior", &BABrownPerspectiveCamera::k3_prior)
    .def_readwrite("constant", &BABrownPerspectiveCamera::constant)
    .def_readwrite("id", &BABrownPerspectiveCamera::id)
  ;

  class_<BAFisheyeCamera>("BAFisheyeCamera")
    .add_property("focal", &BAFisheyeCamera::GetFocal, &BAFisheyeCamera::SetFocal)
    .add_property("k1", &BAFisheyeCamera::GetK1, &BAFisheyeCamera::SetK1)
    .add_property("k2", &BAFisheyeCamera::GetK2, &BAFisheyeCamera::SetK2)
    .def_readwrite("constant", &BAFisheyeCamera::constant)
    .def_readwrite("focal_prior", &BAFisheyeCamera::focal_prior)
    .def_readwrite("id", &BAFisheyeCamera::id)
  ;

  class_<BAShot>("BAShot")
    .add_property("rx", &BAShot::GetRX, &BAShot::SetRX)
    .add_property("ry", &BAShot::GetRY, &BAShot::SetRY)
    .add_property("rz", &BAShot::GetRZ, &BAShot::SetRZ)
    .add_property("tx", &BAShot::GetTX, &BAShot::SetTX)
    .add_property("ty", &BAShot::GetTY, &BAShot::SetTY)
    .add_property("tz", &BAShot::GetTZ, &BAShot::SetTZ)
    .def("get_covariance", &BAShot::GetCovariance)
    .def_readwrite("constant", &BAShot::constant)
    .def_readwrite("camera", &BAShot::camera)
    .def_readwrite("id", &BAShot::id)
  ;

  class_<BAPoint>("BAPoint")
    .add_property("x", &BAPoint::GetX, &BAPoint::SetX)
    .add_property("y", &BAPoint::GetY, &BAPoint::SetY)
    .add_property("z", &BAPoint::GetZ, &BAPoint::SetZ)
    .def_readwrite("constant", &BAPoint::constant)
    .def_readwrite("reprojection_error", &BAPoint::reprojection_error)
    .def_readwrite("id", &BAPoint::id)
  ;

  class_<csfm::OpenMVSExporter>("OpenMVSExporter")
    .def("add_camera", &csfm::OpenMVSExporter::AddCamera)
    .def("add_shot", &csfm::OpenMVSExporter::AddShot)
    .def("add_point", &csfm::OpenMVSExporter::AddPoint)
    .def("export", &csfm::OpenMVSExporter::Export)
  ;

  class_<csfm::DepthmapEstimatorWrapper>("DepthmapEstimator")
    .def("set_depth_range", &csfm::DepthmapEstimatorWrapper::SetDepthRange)
    .def("set_patchmatch_iterations", &csfm::DepthmapEstimatorWrapper::SetPatchMatchIterations)
    .def("set_min_patch_sd", &csfm::DepthmapEstimatorWrapper::SetMinPatchSD)
    .def("add_view", &csfm::DepthmapEstimatorWrapper::AddView)
    .def("compute_patch_match", &csfm::DepthmapEstimatorWrapper::ComputePatchMatch)
    .def("compute_patch_match_sample", &csfm::DepthmapEstimatorWrapper::ComputePatchMatchSample)
    .def("compute_brute_force", &csfm::DepthmapEstimatorWrapper::ComputeBruteForce)
  ;

  class_<csfm::DepthmapCleanerWrapper>("DepthmapCleaner")
    .def("set_same_depth_threshold", &csfm::DepthmapCleanerWrapper::SetSameDepthThreshold)
    .def("set_min_consistent_views", &csfm::DepthmapCleanerWrapper::SetMinConsistentViews)
    .def("add_view", &csfm::DepthmapCleanerWrapper::AddView)
    .def("clean", &csfm::DepthmapCleanerWrapper::Clean)
  ;

  class_<csfm::DepthmapPrunerWrapper>("DepthmapPruner")
    .def("set_same_depth_threshold", &csfm::DepthmapPrunerWrapper::SetSameDepthThreshold)
    .def("add_view", &csfm::DepthmapPrunerWrapper::AddView)
    .def("prune", &csfm::DepthmapPrunerWrapper::Prune)
  ;

  ///////////////////////////////////
  // Reconstruction Aligment
  //
  class_<ReconstructionAlignment>("ReconstructionAlignment")
    .def("run", &ReconstructionAlignment::Run)
    .def("get_shot", &ReconstructionAlignment::GetShot)
    .def("get_reconstruction", &ReconstructionAlignment::GetReconstruction)
    .def("add_shot", &ReconstructionAlignment::AddShot)
    .def("add_reconstruction", &ReconstructionAlignment::AddReconstruction)
    .def("add_relative_motion_constraint", &ReconstructionAlignment::AddRelativeMotionConstraint)
    .def("add_absolute_position_constraint", &ReconstructionAlignment::AddAbsolutePositionConstraint)
    .def("add_common_point_constraint", &ReconstructionAlignment::AddCommonPointConstraint)
    .def("brief_report", &ReconstructionAlignment::BriefReport)
    .def("full_report", &ReconstructionAlignment::FullReport)
  ;

  class_<RAShot>("RAShot")
    .add_property("rx", &RAShot::GetRX, &RAShot::SetRX)
    .add_property("ry", &RAShot::GetRY, &RAShot::SetRY)
    .add_property("rz", &RAShot::GetRZ, &RAShot::SetRZ)
    .add_property("tx", &RAShot::GetTX, &RAShot::SetTX)
    .add_property("ty", &RAShot::GetTY, &RAShot::SetTY)
    .add_property("tz", &RAShot::GetTZ, &RAShot::SetTZ)
    .def_readwrite("id", &RAShot::id)
  ;

  class_<RAReconstruction>("RAReconstruction")
    .add_property("rx", &RAReconstruction::GetRX, &RAReconstruction::SetRX)
    .add_property("ry", &RAReconstruction::GetRY, &RAReconstruction::SetRY)
    .add_property("rz", &RAReconstruction::GetRZ, &RAReconstruction::SetRZ)
    .add_property("tx", &RAReconstruction::GetTX, &RAReconstruction::SetTX)
    .add_property("ty", &RAReconstruction::GetTY, &RAReconstruction::SetTY)
    .add_property("tz", &RAReconstruction::GetTZ, &RAReconstruction::SetTZ)
    .add_property("scale", &RAReconstruction::GetScale, &RAReconstruction::SetScale)
    .def_readwrite("id", &RAReconstruction::id)
  ;

  class_<RARelativeMotionConstraint>("RARelativeMotionConstraint", init<const std::string &, const std::string &, double, double, double, double, double, double>())
    .def_readwrite("reconstruction", &RARelativeMotionConstraint::reconstruction_id)
    .def_readwrite("shot", &RARelativeMotionConstraint::shot_id)
    .add_property("rx", &RARelativeMotionConstraint::GetRX, &RARelativeMotionConstraint::SetRX)
    .add_property("ry", &RARelativeMotionConstraint::GetRY, &RARelativeMotionConstraint::SetRY)
    .add_property("rz", &RARelativeMotionConstraint::GetRZ, &RARelativeMotionConstraint::SetRZ)
    .add_property("tx", &RARelativeMotionConstraint::GetTX, &RARelativeMotionConstraint::SetTX)
    .add_property("ty", &RARelativeMotionConstraint::GetTY, &RARelativeMotionConstraint::SetTY)
    .add_property("tz", &RARelativeMotionConstraint::GetTZ, &RARelativeMotionConstraint::SetTZ)
    .def("set_scale_matrix", &RARelativeMotionConstraint::SetScaleMatrix)
  ;

}


text:
'use strict';
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import {window, workspace, commands, Disposable, ExtensionContext} from 'vscode';
import {HexDocument} from './hexdoc'

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: ExtensionContext) {

    // create a new HexDocument
    let hexDoc = new HexDocument();
    let controller = new HexDocumentController(hexDoc);

    var seekDisposable = commands.registerCommand('extension.hexFind', () => {
        // Check this is a .hex file
        if(window.activeTextEditor.document.languageId != "hex")
        {
            window.showErrorMessage("This command is only available with \".hex\" files.");
            return;
        }

        // Display a message box to the user
        window.showInputBox({prompt: 'Type an adress to find'}).then(val => {
            let address = parseInt(val);
            if(address === NaN || address < 0) {
                window.showErrorMessage("Wrong address format.");
                return;
            }

            // Go to the address
            if (!hexDoc.goToAddress(address)) {
                window.showWarningMessage("The address 0x" + address.toString(16) + " was not found.")
            }
        });
    });

    var repairDisposable = commands.registerCommand('extension.repairHex', () => {
        // Check this is a .hex file
        if(window.activeTextEditor.document.languageId != "hex")
        {
            window.showErrorMessage("This command is only available with \".hex\" files.");
            return;
        }

        // Repair the document
        let nbRep = hexDoc.repair();
        if(nbRep > 0) {
            window.showInformationMessage((nbRep === 1) ? "1 record has been repaired." : nbRep + " records have been repaired");
        } else {
            window.showInformationMessage("Nothing has been done.");
        }
    });

    // Add to a list of disposables which are disposed when this extension is deactivated.
    context.subscriptions.push(repairDisposable);
    context.subscriptions.push(seekDisposable);
    context.subscriptions.push(controller);
    context.subscriptions.push(hexDoc);
}

// this method is called when your extension is deactivated
export function deactivate() {
}

class HexDocumentController {
    private _hexDoc: HexDocument;
    private _disposable: Disposable;

    constructor(hexDoc: HexDocument) {
        this._hexDoc = hexDoc;

        // Start right now by updating the document
        this._hexDoc.updateStatusBar();

        // Subscribe to text change event
        let subscriptions: Disposable[] = [];
        window.onDidChangeActiveTextEditor(this._onEdit, this, subscriptions);
        window.onDidChangeTextEditorSelection(this._onEdit, this, subscriptions);
        workspace.onDidSaveTextDocument(this._onSave, this, subscriptions);

        // Create a combined disposable
        this._disposable = Disposable.from(...subscriptions);
    }

    dispose() {
        this._disposable.dispose();
    }

    private _onEdit() {
        this._hexDoc.updateStatusBar();
    }

    private _onSave() {
        // Check this is an .hex file
        if(window.activeTextEditor.document.languageId === "hex" &&
            workspace.getConfiguration("hex-fmt").get("repairOnSave", false)) {
            // Repair and save if needed
            if(this._hexDoc.repair() > 0)
            {
                window.activeTextEditor.document.save();
            }
        }
    }
}


text:
body {
	font-family: Verdana, san-serif;
	font-size: 100%;
	background: #fff;
	color: #000;
	}

#viewer {
	width: 600px;
	padding: 20px 30px;
	background: #96d2e2;
	float: left;
	}

#pics {
	list-style: none;
	width: 600px;
	margin: 0;
	padding: 20px 30px;
	float: left;
}

#pics li {
	list-style: none;
	display: inline;
}

/* this hides the thumbnail images - they will be shown via jQuery.
   We do this in case a user has JavaScript disabled, in which case
   that user will just see all the photos on one page */
.thumb {
	display: none;
	}

.view {
	padding: 10px 30px;
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `from_doublebigdigit` fn in crate `num_bigint`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, from_doublebigdigit">

    <title>num_bigint::big_digit::from_doublebigdigit - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../normalize.css">
    <link rel="stylesheet" type="text/css" href="../../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../../main.css">

    <link rel="shortcut icon" href="https://rust-num.github.io/num/favicon.ico">

num_bigint::<wbr>big_digit

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options…"
                       type="search">

        </form>

Function num_bigint::<wbr>big_digit::<wbr>from_doublebigdigit

                       [−]

               [src]

pub fn from_doublebigdigit(n: DoubleBigDigit) -> (BigDigit, BigDigit)

Split one DoubleBigDigit into two BigDigits.

Help

Keyboard Shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

+

Collapse/expand all sections

Search Tricks

                    Prefix searches with a type followed by a colon (e.g.
                    fn:) to restrict the search to a given type.

                    Accepted types are: fn, mod,
                    struct, enum,
                    trait, type, macro,
                    and const.

                    Search functions by type signature (e.g.
                    vec -> usize or * -> vec)