text:
"""Module containing shims around Flake8 2.x behaviour.

Previously, users would import :func:`get_style_guide` from ``flake8.engine``.
In 3.0 we no longer have an "engine" module but we maintain the API from it.
"""
import logging
import os.path

from flake8.formatting import base as formatter
from flake8.main import application as app

LOG = logging.getLogger(__name__)

__all__ = ('get_style_guide',)

def get_style_guide(**kwargs):
    r"""Provision a StyleGuide for use.

    :param \*\*kwargs:
        Keyword arguments that provide some options for the StyleGuide.
    :returns:
        An initialized StyleGuide
    :rtype:
        :class:`StyleGuide`
    """
    application = app.Application()
    application.find_plugins()
    application.register_plugin_options()
    application.parse_configuration_and_cli([])
    # We basically want application.initialize to be called but with these
    # options set instead before we make our formatter, notifier, internal
    # style guide and file checker manager.
    options = application.options
    for key, value in kwargs.items():
        try:
            getattr(options, key)
            setattr(options, key, value)
        except AttributeError:
            LOG.error('Could not update option "%s"', key)
    application.make_formatter()
    application.make_notifier()
    application.make_guide()
    application.make_file_checker_manager()
    return StyleGuide(application)

class StyleGuide(object):
    """Public facing object that mimic's Flake8 2.0's StyleGuide.

    .. note::

        There are important changes in how this object behaves compared to
        the StyleGuide object provided in Flake8 2.x.

    .. warning::

        This object should not be instantiated directly by users.

    .. versionchanged:: 3.0.0
    """

    def __init__(self, application):
        """Initialize our StyleGuide."""
        self._application = application
        self._file_checker_manager = application.file_checker_manager

    @property
    def options(self):
        """The parsed options.

        An instance of :class:`optparse.Values` containing parsed options.
        """
        return self._application.options

    @property
    def paths(self):
        """The extra arguments passed as paths."""
        return self._application.paths

    def check_files(self, paths=None):
        """Run collected checks on the files provided.

        This will check the files passed in and return a :class:`Report`
        instance.

        :param list paths:
            List of filenames (or paths) to check.
        :returns:
            Object that mimic's Flake8 2.0's Reporter class.
        :rtype:
            flake8.api.legacy.Report
        """
        self._application.run_checks(paths)
        self._application.report_errors()
        return Report(self._application)

    def excluded(self, filename, parent=None):
        """Determine if a file is excluded.

        :param str filename:
            Path to the file to check if it is excluded.
        :param str parent:
            Name of the parent directory containing the file.
        :returns:
            True if the filename is excluded, False otherwise.
        :rtype:
            bool
        """
        return (self._file_checker_manager.is_path_excluded(filename) or
                (parent and
                    self._file_checker_manager.is_path_excluded(
                        os.path.join(parent, filename))))

    def init_report(self, reporter=None):
        """Set up a formatter for this run of Flake8."""
        if reporter is None:
            return
        if not issubclass(reporter, formatter.BaseFormatter):
            raise ValueError("Report should be subclass of "
                             "flake8.formatter.BaseFormatter.")
        self._application.formatter = None
        self._application.make_formatter(reporter)
        self._application.guide = None
        # NOTE(sigmavirus24): This isn't the intended use of
        # Application#make_guide but it works pretty well.
        # Stop cringing... I know it's gross.
        self._application.make_guide()

    def input_file(self, filename, lines=None, expected=None, line_offset=0):
        """Run collected checks on a single file.

        This will check the file passed in and return a :class:`Report`
        instance.

        :param str filename:
            The path to the file to check.
        :param list lines:
            Ignored since Flake8 3.0.
        :param expected:
            Ignored since Flake8 3.0.
        :param int line_offset:
            Ignored since Flake8 3.0.
        :returns:
            Object that mimic's Flake8 2.0's Reporter class.
        :rtype:
            flake8.api.legacy.Report
        """
        return self.check_files([filename])

class Report(object):
    """Public facing object that mimic's Flake8 2.0's API.

    .. note::

        There are important changes in how this object behaves compared to
        the object provided in Flake8 2.x.

    .. warning::

        This should not be instantiated by users.

    .. versionchanged:: 3.0.0
    """

    def __init__(self, application):
        """Initialize the Report for the user.

        .. warning:: This should not be instantiated by users.
        """
        self._application = application
        self._style_guide = application.guide
        self._stats = self._style_guide.stats

    @property
    def total_errors(self):
        """The total number of errors found by Flake8."""
        return self._application.result_count

    def get_statistics(self, violation):
        """Get the list of occurences of a violation.

        :returns:
            List of occurrences of a violation formatted as:
            {Count} {Error Code} {Message}, e.g.,
            ``8 E531 Some error message about the error``
        :rtype:
            list
        """
        return [
            '{} {} {}'.format(s.count, s.error_code, s.message)
            for s in self._stats.statistics_for(violation)
        ]


text:
define(["sugar-web/activity/activity","sugar-web/datastore"], function (activity, datastore) {

	// Manipulate the DOM only when it is ready.
	require(['domReady!'], function (doc) {

		// Initialize the activity.
		activity.setup();
		var isMobile = (/Android/i.test(navigator.userAgent) || /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent)) && document.location.protocol.substr(0,4) != "http";
		var currentCamera = 0;

		// Compute size of QR Code
		var headerSize = 55 + 40;
		var marginPercent = 20;
		var qrSize = document.getElementById("canvas").parentNode.offsetHeight - headerSize;
		qrSize -= (marginPercent*qrSize)/100;

		// Init QR Code object
		var qrCode = new QRCode("qr-code", {
			width: qrSize,
			height: qrSize,
			colorDark : "#000000",
			colorLight : "#ffffff",
			correctLevel : QRCode.CorrectLevel.H
		});
		var margin = (document.getElementById("canvas").parentNode.offsetWidth - qrSize) / 2;
		document.getElementById("qr-code").style.marginLeft = margin + "px";
		document.getElementById("qr-code").style.marginTop = "20px";

		// Generate Code
		var generateCode = function(text) {
			qrCode.clear();
			qrCode.makeCode(text);
			var text = userText.value.toLowerCase();
			if (text.indexOf("http://") == 0 || text.indexOf("https://") == 0) {
				document.getElementById("user-text").classList.add("text-url");
			} else {
				document.getElementById("user-text").classList.remove("text-url");
			}
		}

		// Process Resize events
		window.addEventListener('resize', function() {
			var windowSize = document.body.clientHeight - headerSize;
			var zoom = windowSize/((qrSize*(100+marginPercent))/100);
			document.getElementById("qr-code").style.zoom = zoom;
			var useragent = navigator.userAgent.toLowerCase();
			if (useragent.indexOf('chrome') == -1) {
				document.getElementById("qr-code").style.MozTransform = "scale("+zoom+")";
				document.getElementById("qr-code").style.MozTransformOrigin = "0 0";
			}
			if (photoInitialized) {
				document.getElementById("outdiv").style.zoom = zoom;
				if (useragent.indexOf('chrome') == -1) {
					document.getElementById("outdiv").style.MozTransform = "scale("+zoom+")";
					document.getElementById("outdiv").style.MozTransformOrigin = "0 0";
				}
			}
		});

		// Get settings
		var userSettings = datastore.localStorage.getValue('sugar_settings');
		var userText = document.getElementById("user-text");
		userText.value = userSettings.name;
		userText.addEventListener('keyup', function() {
			var text = userText.value.toLowerCase();
			if (text.indexOf("http://") == 0 || text.indexOf("https://") == 0) {
				document.getElementById("user-text").classList.add("text-url");
			} else {
				document.getElementById("user-text").classList.remove("text-url");
			}
		});
		userText.addEventListener('click', function() {
			var text = userText.value.toLowerCase();
			if (text.indexOf("http://") == 0 || text.indexOf("https://") == 0) {
				window.open(userText.value);
			}
		});

		// Handle text change
		document.getElementById("generate-button").addEventListener('click', function() {
			generateCode(userText.value);
		});

		// Handle text scan
		var codeScanned = function(code) {
			document.getElementById("outdiv").style.visibility = "hidden";
			document.getElementById("video-stream").style.visibility = "hidden";
			document.getElementById("qr-code").style.visibility = "visible";
			document.getElementById("loading-spinner").style.visibility = "hidden";
			document.getElementById("photo-button").classList.remove("active");
			userText.value = code;
			generateCode(code);
		};

		// Export as PNG image
		document.getElementById("png-button").addEventListener('click', function() {
			var mimetype = 'image/png';
			var inputData = document.getElementById("qr-code").childNodes[1].src;
			var metadata = {
				mimetype: mimetype,
				title: "Image QR Code",
				activity: "org.olpcfrance.MediaViewerActivity",
				timestamp: new Date().getTime(),
				creation_time: new Date().getTime(),
				file_size: 0
			};
			datastore.create(metadata, function() {
				console.log("export done.")
			}, inputData);
		});

		// Full screen
		document.getElementById("fullscreen-button").addEventListener('click', function() {
			if (document.getElementById("photo-button").classList.contains('active')) {
				return;
			}
			document.getElementById("main-toolbar").style.opacity = 0;
			document.getElementById("input-box").style.opacity = 0;
			document.getElementById("canvas").style.top = "0px";
			document.getElementById("unfullscreen-button").style.visibility = "visible";
		});
		document.getElementById("unfullscreen-button").addEventListener('click', function() {
			document.getElementById("main-toolbar").style.opacity = 1;
			document.getElementById("input-box").style.opacity = 1;
			document.getElementById("canvas").style.top = "55px";
			document.getElementById("unfullscreen-button").style.visibility = "hidden";
		});

		// Capture photo
		var photoButton = document.getElementById("photo-button");
		var photoInitialized = false;
		var oldUserText = "";
		photoButton.addEventListener('click', function() {
			// Handle mobile capture
			if (isMobile) {
				document.getElementById("main-toolbar").style.opacity = 0;
				document.getElementById("canvas").style.opacity = 0;
				document.getElementById("close-button").style.visibility = "visible";
				document.getElementById("switchcamera-button").style.visibility = "visible";
				QRScanner.prepare(function(err, status) {
					if (err) {
						console.log("Error "+err);
					} else {
						console.log(status);
						QRScanner.scan(function(err, code) {
							if (err) {
								console.log("Error "+err);
							} else {
								userText.value = code;
								generateCode(code);
							}
							document.getElementById("main-toolbar").style.opacity = 1;
							document.getElementById("canvas").style.opacity = 1;
							document.getElementById("close-button").style.visibility = "hidden";
							document.getElementById("switchcamera-button").style.visibility = "hidden";
						});
						QRScanner.show(function(status) {});
					}
				});
				return;
			}

			// Handle HTML5 capture
			var outdiv = document.getElementById("outdiv");
			var videostream = document.getElementById("video-stream");
			if (!photoButton.classList.contains('active')) {
				document.getElementById("qr-code").style.visibility = "hidden";
				document.getElementById("loading-spinner").style.visibility = "visible";
				oldUserText = userText.value;
				userText.value = "";
				if (!photoInitialized) {
					outdiv.innerHTML = '<video id="video-window" autoplay></video>';
					load(qrSize, margin, codeScanned);
					photoInitialized = true;
				} else {
					outdiv.style.visibility = "visible";
					videostream.style.visibility = "visible";
				}
			} else {
				outdiv.style.visibility = "hidden";
				videostream.style.visibility = "hidden";
				document.getElementById("loading-spinner").style.visibility = "hidden";
				document.getElementById("qr-code").style.visibility = "visible";
				userText.value = oldUserText;
				generateCode(userText.value);
			}
			photoButton.classList.toggle("active");
		});

		// Mobile buttons: Cancel capture, Switch camera
		document.getElementById("close-button").addEventListener('click', function (event) {
			if (isMobile) {
				QRScanner.cancelScan(function(status){});
			}
		});
		document.getElementById("switchcamera-button").addEventListener('click', function (event) {
			if (isMobile) {
				currentCamera = (currentCamera + 1) % 2;
				QRScanner.useCamera(currentCamera, function(err, status){});
			}
		});

		// Handle graph save/world
		var stopButton = document.getElementById("stop-button");
		stopButton.addEventListener('click', function (event) {
			console.log("writing...");
			var data = { userText: (photoButton.classList.contains('active') ? oldUserText : userText.value) };
			var jsonData = JSON.stringify(data);
			activity.getDatastoreObject().setDataAsText(jsonData);
			activity.getDatastoreObject().save(function (error) {
				if (error === null) {
					console.log("write done.");
				} else {
					console.log("write failed.");
				}
			});
		});

		// Initialize code
		generateCode(userSettings.name);
		activity.getDatastoreObject().getMetadata(function(error, mdata) {
			console.log("datastore check");
			var d = new Date().getTime();
			if (Math.abs(d-mdata.creation_time) < 2000) {
				console.log("Time too short");
			} else {
				activity.getDatastoreObject().loadAsText(function(error, metadata, data) {
					if (error==null && data!=null) {
						data = JSON.parse(data);
						userText.value = data.userText;
						generateCode(data.userText);
					}
				});
			}
		});
	});
});

redpajama_set_name: RedPajamaGithub


text:
layout: page
title: About
---

Built By Moroccan Devs is a showcase of awesome and inspirational projects built by Moroccan developers.
It's built and maintained by [@arkhamdev](https://twitter.com/arkhamdev) and [@thekroniker](https://twitter.com/thekroniker).

## Submissions
We only accept submissions from Moroccans, people who's primary hot beverage is mint tea, and we only select high quality and beautiful examples of projects, web apps, desktop or mobile, built by Moroccans. All submissions must follow the instructions on the _How to submit_ section below.

## How to submit
To submit a site suggestion, [open an issue](https://github.com/arkhamdev/built-by-moroccan-devs/issues/new) or create a pull request. Make sure the screenshot is 1000x800 and please double check that everything looks good before submitting. It's also a good idea to run the screenshot through an image optimizer like [TinyPNG](https://tinypng.com/) before including it. This will help keep the website fast and the repository small as possible.

## About the site
Inspired by [Built With Ember](http://builtwithember.io/). It's built with [Jekyll](http://jekyllrb.com), developed on [GitHub](https://github.com/arkhamdev/built-by-moroccan-devs), and is hosted on [GitHub Pages](https://pages.github.com).


text:
#include "../trait/bound.hpp"
#include "../trait/container.hpp"
#include "../trait/component.hpp"
#include "../trait/index.hpp"
#include "../../generic/model.hpp"

 namespace color
  {
   namespace fix
    {
     namespace _internal
      {

       template< typename category_name >
        struct overburn
         {
          public:
            typedef category_name  category_type;

            typedef ::color::trait::index<category_type>  index_trait_type;
            typedef ::color::trait::bound< category_type >       bound_type;
            typedef ::color::trait::component<category_type>     component_trait_type;
            typedef ::color::trait::container< category_type >   container_trait_type;

            typedef typename ::color::model<category_type>  model_type;

            typedef typename component_trait_type::instance_type  component_type;

            typedef typename index_trait_type::instance_type  index_type;

            static model_type & process( model_type &result )
             {
              for( index_type index = 0; index < container_trait_type::size(); index ++ )
               {
                if( result.get( index ) <  bound_type::minimum( index ) )
                 {
                  result.set( index, bound_type::minimum( index ) );
                  continue;
                 }
                if(  bound_type::maximum( index ) < result.get( index ) )
                 {
                  result.set( index, bound_type::maximum( index ) );
                  continue;
                 }
               }
              return result;
             }

            static model_type & process(  model_type & result, model_type const& right )
             {
              for( index_type index = 0; index < container_trait_type::size(); index ++ )
               {
                if( right.get( index ) <  bound_type::minimum( index ) )
                 {
                  result.set( index, bound_type::minimum( index ) );
                  continue;
                 }
                if(  bound_type::maximum( index ) < right.get( index ) )
                 {
                  result.set( index, bound_type::maximum( index ) );
                  continue;
                 }
                result.set( index, right.get( index ) );
               }
              return result;
             }

         };

       }

     template< typename category_name >
      ::color::model<category_name> & overburn
       (
         ::color::model<category_name>      & result
       )
       {
        return ::color::fix::_internal::overburn<category_name>::process( result );
       }

     template< typename category_name >
      ::color::model<category_name> & overburn
       (
         ::color::model<category_name>      & result
        ,::color::model<category_name> const& right
       )
       {
        return ::color::fix::_internal::overburn<category_name>::process( result, right );
       }

    }
  }

#endif


text:
CLASS({
  package: 'foam.documentation',
  name: 'DocModelInheritanceTracker',
  documentation: 'Stores inheritance information for a Model',
  documentation: function() { /*

Stores inheritance information for a $$DOC{ref:'Model'}. One
      instance per extending $$DOC{ref:'Model'} is stored in the
      this.featureDAO (starting with the data of
      $$DOC{ref:'DocModelView'}, and following the .extendsModel chain.

See $$DOC{ref:'DocModelView'}.

  */},

  ids: ['model'],

  properties: [
    {
      name: 'model',
      documentation: 'The model name.',
      documentation: "The $$DOC{ref:'Model'} name."
    },
    {
      name: 'inheritanceLevel',
      documentation: 'The inheritance level of model.',
      documentation: "The inheritance level of $$DOC{ref:'.model'} (0 = root, no extendsModel specified)",
      defaultValue: 0
    },
  ]
});


text:
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts]

var a = 10;
export default a;

//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts]
import defaultBinding, * as nameSpaceBinding  from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0";
var x: number = defaultBinding;

//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_0.js]
var a = 10;
export default a;
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_1.js]
import defaultBinding from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0";
var x = defaultBinding;

//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_0.d.ts]
declare var a: number;
export default a;
//// [es6ImportDefaultBindingFollowedWithNamespaceBinding_1.d.ts]


text:
const Gists = require('..');
const gists = new Gists(require('../test/support/auth'));

/**
 * Get a gist
 */

gists.get('5854601')
  .then(res => console.log(res))
  .catch(console.error);


text:
'use strict';

angular.module('conferenceBuddyApp').controller('UserController',
['$scope', '$location', 'ConferenceService', 'UserService', 'DialogService', 'ROUTES',
    function($scope, $location, conferenceService, userService, dialogService, ROUTES) {

    $scope.step = 1;
    $scope.user = {};

    checkRegistrationLink();

    $scope.showRegistration = function() {
        $scope.step++;
    };

    $scope.register = function() {
        userService.register($scope.user).then(function() {
            $scope.step++;
        }).catch(function(err) {
            dialogService.showError('Backend Error', 'Failed to register at the backend', 'HTTP-Status:' + err.status);
            $scope.step--;
        });
    };

    conferenceService.load().then(function(conference) {
        $scope.conference = conference;
    }).catch(function(err) {
        dialogService.showError('Backend Error', 'Failed to load conference data from the backend', 'HTTP-Status:' + err.status);
    });

    function checkRegistrationLink() {
        var url = $location.url();
      var pos = url.lastIndexOf('?');
        if (pos > -1) {
            var userToken = url.substr(pos + 1);
            userService.validate(userToken).then(function() {
                $location.url(ROUTES.MYTRACK);
            }).catch(function(err) {
                $location.url(ROUTES.REGISTER);
            });
        }
    }

}]);


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

import SWIG.StateType;
import agent.lldb.lldb.DebugProcessInfo;

public class LldbProcessReplacedEvent extends AbstractLldbEvent<DebugProcessInfo> {

	public LldbProcessReplacedEvent(DebugProcessInfo info) {
		super(info);
	}

	@Override
	public StateType newState() {
		// NB: it's very tempting to relay the info we have, but
		//   doing so fouls up a lot of the tests because the stopped
		//   message arrives ahead of breakpointHit

		//DebugProcessInfo pinfo = (DebugProcessInfo) getInfo();
		//return pinfo.process.GetState();
		return null;
	}

}


text:
date

if [ -z "$EE_DIR" ]; then
	echo 'Please set $EE_DIR'
	exit 1
fi

set -ex

cd $EE_DIR

# Reset EE directory to baseline
git checkout -f master
git pull origin master
composer install
# Run composer update and capture to untracked log file
composer update --no-progress --no-interaction |& tee vendor/update.log
UPDATE=$(cat vendor/update.log | col -b)

# We only care to proceed when there are changes
if [ -z "$(git status -s)" ]; then
	echo 'No updates available'
	exit 0;
fi

# Create a dated branch and commit the changes
DATE=$(date +%Y-%m-%d)
BRANCH="update-deps-$DATE"
git branch -f $BRANCH master
git checkout $BRANCH
git add .
MESSAGE="Update Composer dependencies ($DATE)

\`\`\`
$UPDATE
\`\`\`"
git commit -m "$MESSAGE"

# Push and pull request
git push origin $BRANCH
hub pull-request -m "$MESSAGE"


text:
ServiceHost
===========

ServiceHost utility to make it easier to set up WcfService as stand alone applications.


text:
  /**
 * Created by Harish.
 */
 package org.sparkline.etl

import org.apache.spark.sql.SQLContext

package object functions {

  def register(sqlContext: SQLContext) : Unit = {
    DateTimeFunctions.registerFunctions(sqlContext)
    CollectionFunctions.registerFunctions(sqlContext)
    UserAgentFunctions.registerFunctions(sqlContext)
    GeoIpFunctions.registerFunctions(sqlContext)
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using ALinq.Mapping;

namespace ALinq.SqlClient
{
    internal class SqlStoredProcedureCall : SqlUserQuery
    {
          // Fields
        private readonly MetaFunction function;

        // Methods
        internal SqlStoredProcedureCall(MetaFunction function, SqlExpression projection, IEnumerable<SqlExpression> args,
                                        Expression source)
            : base(SqlNodeType.StoredProcedureCall, projection, args, source)
        {
            if (function == null)
            {
                throw Error.ArgumentNull("function");
            }
            this.function = function;
        }

        // Properties
        internal MetaFunction Function
        {
            get
            {
                return function;
            }
        }

    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta charset="utf-8" />
    <title>Grimoire dashboard (proposal)</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="/css/bootstrap.min.css" rel="stylesheet">

    <link href="/css/font-awesome-4.0.3/css/font-awesome.min.css" rel="stylesheet">

    <link href="/css/jasny-bootstrap.min.css" rel="stylesheet" media="screen">

    <link href="/css/bitergia.css" rel="stylesheet">

         -

        <form action="contributor.html" class="navbar-form navbar-right hidden-xs" role="search" style="margin-right: 25px;">

            <input type="text" class="form-control" placeholder="company, person, issue, etc.">

          <button type="submit" class="btn btn-default"> Search</button>
        </form>

            © 2012-2014


text:
from os import path
from setuptools import setup

# read the contents of your README file
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md')) as f:
    long_description = f.read()

setup(
    name='retrylib',
    packages=['retrylib'],
    version='1.2.5',
    description="Smart retry library",
    author="Sergey Bunatyan",
    author_email="sergey.bunatian@gmail.com",
    url="https://github.com/sbunatyan/retrylib",
    download_url="https://github.com/sbunatyan/retrylib/tree/1.2.5",
    keywords=["retry", "retries"],
    license="Apache License 2.0",
    install_requires=["requests", "six"],
    long_description=long_description,
    long_description_content_type='text/markdown'

)


text:
class CUIStatic;
class CUI3tButton;
class CUIFrameWindow;
class CUIListBox;
class CUIXml;

class CUIChangeMap : public CUIDialogWnd
{
public:
	using CUIDialogWnd::Init;

					CUIChangeMap			();
			void	Init					(CUIXml& xml_doc);

	virtual bool	OnKeyboard				(int dik, EUIMessages keyboard_action);
	virtual void	SendMessage				(CUIWindow* pWnd, s16 msg, void* pData = 0);

	void 			OnBtnOk					();
	void 			OnBtnCancel				();
	void 			OnItemSelect			();

protected:
			void	FillUpList				();

	CUIStatic*		bkgrnd;
	CUIStatic*		header;
	CUIStatic*		map_pic;
	CUIStatic*		map_frame;
	CUIFrameWindow* frame;
	CUIFrameWindow* lst_back;
	CUIListBox*		lst;

	CUI3tButton*	btn_ok;
	CUI3tButton*	btn_cancel;

	u32				m_prev_upd_time;
	u32				selected_item;
	xr_vector<shared_str> maps;
};


text:
\section{Conclusion}\label{sec:conclusion}

We have discussed TensorFlow, a novel open source deep learning library based on
computational graphs. Its ability to perform fast automatic gradient
computation, its inherent support for distributed computation and specialized
hardware as well as its powerful visualization tools make it a very welcome
addition to the field of machine learning. Its low-level programming interface
gives fine-grained control for neural net construction, while abstraction
libraries such as TFLearn allow for rapid prototyping with TensorFlow.  In the
context of other deep learning toolkits such as Theano or Torch, TensorFlow adds
new features and improves on others. Its performance was inferior in comparison
at first, but is improving with new releases of the library.

We note that very little investigation has been done in literature to evaluate
TensorFlow's qualities with respect to distributed execution. We esteem this one
of its principle strong points and thus encourage in-depth study by the academic
community in the future.

TensorFlow has gained great popularity and strong support in the open-source
community with many third-party contributions, making Google's move a sensible
decision already. We believe, however, that it will not only benefit its parent
company, but the greater scientific community as a whole; opening new doors to
faster, larger-scale artificial intelligence.

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../paper"
%%% End:


text:
using System;
using System.Linq;

namespace NuSign
{
    public class IntegrityEntry : IEquatable<IntegrityEntry>
    {
        public string FilePath
        {
            get;
            set;
        }

        public string HashAlgorithm
        {
            get;
            set;
        }

        public byte[] HashValue
        {
            get;
            set;
        }

        public override bool Equals(object obj)
        {
            return Equals(obj as IntegrityEntry);
        }

        public bool Equals(IntegrityEntry other)
        {
            // For the sake of simplicity let's pretend this object is immutable

            if (other == null)
                return false;

            return this.FilePath.Equals(other.FilePath) && this.HashAlgorithm.Equals(other.HashAlgorithm) && this.HashValue.SequenceEqual(other.HashValue);
        }

        public override int GetHashCode()
        {
            // For the sake of simplicity let's pretend this object is immutable

            int hash = 13;

            hash = (hash * 7) + this.FilePath.GetHashCode();
            hash = (hash * 7) + this.HashAlgorithm.GetHashCode();
            hash = (hash * 7) + this.HashValue.GetHashCode();

            return hash;
        }
    }
}


text:
package liquibase.database.core;

import static org.easymock.classextension.EasyMock.*;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;

import liquibase.database.AbstractJdbcDatabaseTest;
import liquibase.database.Database;
import liquibase.database.jvm.JdbcConnection;
import liquibase.exception.DatabaseException;

import static org.junit.Assert.*;
import org.junit.Test;

/**
 * Tests for {@link MSSQLDatabase}
 */
public class MSSQLDatabaseTest extends AbstractJdbcDatabaseTest {

    public MSSQLDatabaseTest() throws Exception {
        super(new MSSQLDatabase());
    }

    @Override
    protected String getProductNameString() {
        return "Microsoft SQL Server";
    }

    @Override
    @Test
    public void supportsInitiallyDeferrableColumns() {
        assertFalse(getDatabase().supportsInitiallyDeferrableColumns());
    }

    @Override
    @Test
    public void getCurrentDateTimeFunction() {
        assertEquals("GETDATE()", getDatabase().getCurrentDateTimeFunction());
    }

    @Test
    public void getDefaultDriver() {
        Database database = new MSSQLDatabase();

        assertEquals("com.microsoft.sqlserver.jdbc.SQLServerDriver", database.getDefaultDriver("jdbc:sqlserver://localhost;databaseName=liquibase"));

        assertNull(database.getDefaultDriver("jdbc:oracle:thin://localhost;databaseName=liquibase"));
    }

    @Override
    @Test
    public void escapeTableName_noSchema() {
        Database database = new MSSQLDatabase();
        assertEquals("[tableName]", database.escapeTableName(null, null, "tableName"));
    }

    @Override
    @Test
    public void escapeTableName_withSchema() {
        Database database = new MSSQLDatabase();
        assertEquals("[schemaName].[tableName]", database.escapeTableName("catalogName", "schemaName", "tableName"));
    }

    @Test
    public void changeDefaultSchema() throws DatabaseException {
        Database database = new MSSQLDatabase();
        assertNull(database.getDefaultSchemaName());

        database.setDefaultSchemaName("myschema");
        assertEquals("myschema", database.getDefaultSchemaName());
    }

    private Database getADatabaseWithCollation( final String collation ) throws DatabaseException, SQLException {
		Database database = getDatabase();
		JdbcConnection connection = createMock(JdbcConnection.class);
		expect(connection.getConnectionUserName()).andReturn("user").anyTimes();
		expect(connection.getURL()).andReturn("URL").anyTimes();
		expect(connection.getAutoCommit()).andReturn(getDatabase().getAutoCommitMode()).anyTimes();
    expect(connection.getCatalog()).andReturn("catalog").anyTimes();

		Connection sqlConnection = createMock(Connection.class);
		Statement statement = createMock(Statement.class);
		ResultSet resultSet = createMock(ResultSet.class);
		ResultSetMetaData metadata = createMock(ResultSetMetaData.class);

		expect(connection.getUnderlyingConnection()).andReturn(sqlConnection).anyTimes();
		expect( sqlConnection.createStatement()).andReturn(statement);
		expect( statement.executeQuery("SELECT CONVERT([sysname], DATABASEPROPERTYEX(N'catalog', 'Collation'))")).andReturn(resultSet);
		expect( resultSet.next() ).andReturn(true);
		expect( resultSet.getMetaData() ).andReturn(metadata);
		expect( metadata.getColumnCount() ).andReturn(1);
		expect( resultSet.getString(1)).andReturn(collation);
		expect( resultSet.next() ).andReturn(false);

		connection.attached(database);
		replay(connection, sqlConnection, statement, resultSet, metadata);
		database.setConnection(connection);
		return database;
    }

    @Test
    public void caseSensitiveBinaryCollation() throws Exception {
    	Database database =  getADatabaseWithCollation("Latin1_General_BIN");
    	assertTrue( "Should be case sensitive", database.isCaseSensitive() );
    }

    @Test
    public void caseSensitiveCICollation() throws Exception {
    	Database database = getADatabaseWithCollation("Latin1_General_CI_AI");
    	assertFalse( "Should be case insensitive", database.isCaseSensitive() );
    }
    @Test
    public void caseSensitiveCSCollation() throws Exception {
    	Database database =getADatabaseWithCollation("Latin1_General_CS_AI");
    	assertTrue( "Should be case sensitive", database.isCaseSensitive() );
    }

    @Test
    public void testEscapeDataTypeName() {
        Database database = getDatabase();
        assertEquals("[MySchema].[MyUDT]", database.escapeDataTypeName("MySchema.MyUDT"));
        assertEquals("[MySchema].[MyUDT]", database.escapeDataTypeName("MySchema.[MyUDT]"));
        assertEquals("[MySchema].[MyUDT]", database.escapeDataTypeName("[MySchema].MyUDT"));
        assertEquals("[MySchema].[MyUDT]", database.escapeDataTypeName("[MySchema].[MyUDT]"));
    }

    @Test
    public void testUnescapeDataTypeName() {
        Database database = getDatabase();
        assertEquals("MySchema.MyUDT", database.unescapeDataTypeName("MySchema.MyUDT"));
        assertEquals("MySchema.MyUDT", database.unescapeDataTypeName("MySchema.[MyUDT]"));
        assertEquals("MySchema.MyUDT", database.unescapeDataTypeName("[MySchema].MyUDT"));
        assertEquals("MySchema.MyUDT", database.unescapeDataTypeName("[MySchema].[MyUDT]"));
    }

    @Test
    public void testUnescapeDataTypeString() {
        Database database = getDatabase();
        assertEquals("int", database.unescapeDataTypeString("int"));
        assertEquals("int", database.unescapeDataTypeString("[int]"));
        assertEquals("decimal(19, 2)", database.unescapeDataTypeString("decimal(19, 2)"));
        assertEquals("decimal(19, 2)", database.unescapeDataTypeString("[decimal](19, 2)"));
    }
}


text:
"""
Created on Wed Feb  4 22:53:02 2015

@author: adam
"""

# import wget
import zipfile
import string

url = "http://www.pythonchallenge.com/pc/def/channel.zip"

# zipped = wget.download(url)

unzipped = zipfile.ZipFile("channel.zip", "r")

nothing = '90052'
nextline = unzipped.read(nothing + '.txt')
comments = ""

while "Next" in nextline:
    nothing = nextline.lstrip(string.letters + ' ')
    nextline = unzipped.read(nothing + '.txt')
    # turns out I need comments too
    comments += unzipped.getinfo(nothing + '.txt').comment

# print nextline

print comments


text:
PreviewArea::PreviewArea(QWidget * a_pParent) : QScrollArea(a_pParent)
  , m_pPreviewLabel(nullptr)
  , m_pScrollNavigator(nullptr)
  , m_draggingPreview(false)
  , m_lastCursorPos(0, 0)
  , m_lastPreviewLabelPos(0, 0)
{
  m_pPreviewLabel = new QLabel(this);
  m_pPreviewLabel->setPixmap(QPixmap());
  m_pPreviewLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
  QScrollArea::setWidget(m_pPreviewLabel);
  setWidgetResizable(true);

  m_pScrollNavigator = new ScrollNavigator(this);
  int scrollFrameWidth = frameWidth();
  m_pScrollNavigator->move(pos() +
    QPoint(scrollFrameWidth, scrollFrameWidth));
  m_pScrollNavigator->setVisible(false);

  setMouseTracking(true);
  m_pPreviewLabel->setMouseTracking(true);
}

// END OF PreviewArea::PreviewArea(QWidget * a_pParent)
//==============================================================================

PreviewArea::~PreviewArea()
{

}

// END OF PreviewArea::~PreviewArea()
//==============================================================================

void PreviewArea::setPixmap(const QPixmap & a_pixmap, qreal a_devicePixelRatio)
{
  m_pPreviewLabel->setPixmap(a_pixmap);
  m_pixmapWidth = a_pixmap.width();
  m_pixmapHeight = a_pixmap.height();
#if (QT_VERSION_MAJOR < 6)
  m_devicePixelRatio = 1;
#else
  m_devicePixelRatio = a_devicePixelRatio;
#endif
}

// END OF void PreviewArea::setPixmap(const QPixmap & a_pixmap)
//==============================================================================

void PreviewArea::checkMouseOverPreview(const QPoint & a_globalMousePos)
{
  if(!m_pPreviewLabel->underMouse())
    return;

  QPoint imagePoint = m_pPreviewLabel->mapFromGlobal(a_globalMousePos);

  int pixmapWidth = this->pixmapWidth();
  int pixmapHeight = this->pixmapHeight();

  if((imagePoint.x() < 0) || (imagePoint.y() < 0) ||
     (imagePoint.x() * m_devicePixelRatio >= pixmapWidth) ||
     (imagePoint.y() * m_devicePixelRatio >= pixmapHeight))
    return;

  float normX = imagePoint.x() * m_devicePixelRatio / pixmapWidth;
  float normY = imagePoint.y() * m_devicePixelRatio / pixmapHeight;

  emit signalMouseOverPoint(normX, normY);
}

// END OF void PreviewArea::checkMouseOverPreview(
//		const QPoint & a_globalMousePos)
//==============================================================================

void PreviewArea::slotScrollLeft()
{
  horizontalScrollBar()->setValue(0);
}

// END OF void PreviewArea::slotScrollLeft()
//==============================================================================

void PreviewArea::slotScrollRight()
{
  QCoreApplication::processEvents();
  QScrollBar * pHorizontalScrollbar = horizontalScrollBar();
  pHorizontalScrollbar->setValue(pHorizontalScrollbar->maximum());
}

// END OF void PreviewArea::slotScrollRight()
//==============================================================================

void PreviewArea::slotScrollTop()
{
  verticalScrollBar()->setValue(0);
}

// END OF void PreviewArea::slotScrollTop()
//==============================================================================

void PreviewArea::slotScrollBottom()
{
  QCoreApplication::processEvents();
  QScrollBar * pVerticalScrollbar = verticalScrollBar();
  pVerticalScrollbar->setValue(pVerticalScrollbar->maximum());
}

// END OF void PreviewArea::slotScrollBottom()
//==============================================================================

void PreviewArea::resizeEvent(QResizeEvent * a_pEvent)
{
  QScrollArea::resizeEvent(a_pEvent);
  emit signalSizeChanged();
}

// END OF void PreviewArea::resizeEvent(QResizeEvent * a_pEvent)
//==============================================================================

void PreviewArea::keyPressEvent(QKeyEvent * a_pEvent)
{
  if(a_pEvent->modifiers() != Qt::NoModifier)
  {
    QScrollArea::keyPressEvent(a_pEvent);
    return;
  }

  int key = a_pEvent->key();
  int wantedKeys[] = {Qt::Key_Left, Qt::Key_Right, Qt::Key_Up, Qt::Key_Down,
    Qt::Key_PageUp, Qt::Key_PageDown, Qt::Key_Home, Qt::Key_End};
  int * pKeysEnd = wantedKeys + sizeof(wantedKeys) / sizeof(*wantedKeys);
  if(pKeysEnd != std::find(wantedKeys, pKeysEnd, key))
  {
    a_pEvent->ignore();
    return;
  }

  QScrollArea::keyPressEvent(a_pEvent);
}

// END OF void PreviewArea::keyPressEvent(QKeyEvent * a_pEvent)
//==============================================================================

void PreviewArea::wheelEvent(QWheelEvent * a_pEvent)
{
  if(a_pEvent->modifiers() == Qt::ControlModifier)
  {
    emit signalCtrlWheel(a_pEvent->angleDelta());
    a_pEvent->ignore();
    return;
  }

  QScrollArea::wheelEvent(a_pEvent);
}

// END OF void PreviewArea::wheelEvent(QWheelEvent * a_pEvent)
//==============================================================================

void PreviewArea::mousePressEvent(QMouseEvent * a_pEvent)
{
  if(a_pEvent->buttons() == Qt::LeftButton)
  {
    m_draggingPreview = true;
    m_lastCursorPos = a_pEvent->globalPos();
    m_lastPreviewLabelPos = m_pPreviewLabel->pos();
    m_pScrollNavigator->setVisible(true);
    drawScrollNavigator();
    a_pEvent->accept();
    return;
  }

  QScrollArea::mousePressEvent(a_pEvent);
}

// END OF void PreviewArea::mousePressEvent(QMouseEvent * a_pEvent)
//==============================================================================

void PreviewArea::mouseMoveEvent(QMouseEvent * a_pEvent)
{
  if((a_pEvent->buttons() & Qt::LeftButton) && m_draggingPreview)
  {
    QPoint newCursorPos = a_pEvent->globalPos();
    QPoint posDifference = newCursorPos - m_lastCursorPos;
    QPoint newPreviewLabelPos = m_lastPreviewLabelPos +
      posDifference;

    horizontalScrollBar()->setValue(-newPreviewLabelPos.x());
    verticalScrollBar()->setValue(-newPreviewLabelPos.y());

    drawScrollNavigator();
    a_pEvent->accept();
    return;
  }

  QPoint globalPoint = a_pEvent->globalPos();
  checkMouseOverPreview(globalPoint);

  QScrollArea::mouseMoveEvent(a_pEvent);
}

// END OF void PreviewArea::mouseMoveEvent(QMouseEvent * a_pEvent)
//==============================================================================

void PreviewArea::mouseReleaseEvent(QMouseEvent * a_pEvent)
{
  Qt::MouseButton releasedButton = a_pEvent->button();
  if(releasedButton == Qt::LeftButton)
  {
    m_draggingPreview = false;
    m_pScrollNavigator->setVisible(false);
    a_pEvent->accept();
    return;
  }
  else if(releasedButton == Qt::MiddleButton)
    emit signalMouseMiddleButtonReleased();
  else if(releasedButton == Qt::RightButton)
    emit signalMouseRightButtonReleased();

  QScrollArea::mouseReleaseEvent(a_pEvent);
}

// END OF void PreviewArea::mouseReleaseEvent(QMouseEvent * a_pEvent)
//==============================================================================

void PreviewArea::drawScrollNavigator()
{
  int contentsWidth = this->pixmapWidth();
  int contentsHeight = this->pixmapHeight();
  int viewportX = -m_pPreviewLabel->x();
  int viewportY = -m_pPreviewLabel->y();
  int viewportWidth = viewport()->width();
  int viewportHeight = viewport()->height();

  m_pScrollNavigator->draw(contentsWidth, contentsHeight, viewportX,
    viewportY, viewportWidth, viewportHeight);
}

// END OF void PreviewArea::drawScrollNavigator()
//==============================================================================


text:
<?php

class Profiles extends Admin_Controller {

    function __construct() {
        parent::__construct();
        $this->load->model(array('admin/profile'));
    }

public function index() {
        $profiles = $this->profile->get_all();

        $data['profiles'] = $profiles;
        $data['page'] = $this->config->item('ci_my_admin_template_dir_admin') . "profiles_list";
        $this->load->view($this->_container, $data);
    }

    public function create() {
        if ($this->input->post('prof_name')) {
            $data = $this->storeinputs();
            $this->profile->insert($data);
            redirect('/admin/profiles', 'refresh');
        }
        $data['page'] = $this->config->item('ci_my_admin_template_dir_admin') . "profiles_create";
        $this->load->view($this->_container, $data);
    }

    public function edit($id) {
        if ($this->input->post('prof_name')) {
            $data = $this->storeinputs();
            $this->profile->update($data, $id);
            redirect('/admin/profiles', 'refresh');
        }

        $profile = $this->profile->get($id);

        $data['profile'] = $profile;
        $data['page'] = $this->config->item('ci_my_admin_template_dir_admin') . "profiles_edit";
        $this->load->view($this->_container, $data);
    }

    public function delete($id){
        $this->profile->delete($id);
        redirect('/admin/profiles', 'refresh');
    }

    public function profiles_list(){
        $data = $this->profile->get_all();
        print_r($data);
    }
    private function storeinputs(){
            $data['prof_name'] = $this->input->post('prof_name');
            $data['prof_email'] = $this->input->post('prof_email');
            return $data;
    }
}


text:
from gwt.ui.HorizontalSlider import (
    DOM,
    Factory,
    HorizontalSlider,
    VerticalSlider,
)


text:
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
package org.openqa.selenium.remote;

import java.util.Map;

public class RemoteStatus {

  private Map<String, Object> status;
  private Map<String, Object> buildInfo;
  private Map<String, Object> osInfo;

  public RemoteStatus(Map<String, Object> status) {
    this.status = status;
    buildInfo = (Map<String, Object>) status.get("build");
    osInfo = (Map<String, Object>) status.get("os");
  }

  /** @return The release label. */
  public String getReleaseLabel() {
    return (String) buildInfo.get("version");
  }

  /** @return The build revision. */
  public String getBuildRevision() {
    return (String) buildInfo.get("revision");
  }

  /** @return The build time. */
  public String getBuildTime() {
    return (String) buildInfo.get("time");
  }

  /** @return The operating system architecture. */
  public String getOsArch() {
    return (String) osInfo.get("arch");
  }

  /** @return The operating system name. */
  public String getOsName() {
    return (String) osInfo.get("name");
  }

  /** @return The operating system version. */
  public String getOsVersion() {
    return (String) osInfo.get("version");
  }

  public String toString() {
    return String.format("Build info: version: '%s', revision: '%s', time: '%s'\n"
                          + "OS info: arch: '%s', name: '%s', version: '%s'",
        getReleaseLabel(), getBuildRevision(), getBuildTime(),
        getOsArch(), getOsName(), getOsVersion());
  }

}


text:
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.components.autofill_assistant.guided_browsing.qr_code.camera_scan;

import android.content.Context;
import android.hardware.Camera.ErrorCallback;
import android.hardware.Camera.PreviewCallback;
import android.view.View;
import android.widget.FrameLayout;

import org.chromium.components.autofill_assistant.guided_browsing.LayoutUtils;
import org.chromium.components.autofill_assistant.guided_browsing.R;
import org.chromium.ui.widget.ChromeImageButton;

/**
 * Manages the Android View representing the QR Code Camera scan panel.
 */
class AssistantQrCodeCameraScanView {
    /** Interface used to delegate various user interactions to the coordinator. */
    public interface Delegate {
        /** Called when user cancels the QR Code Scanning */
        void onScanCancelled();
    }

    private final Context mContext;
    private final PreviewCallback mCameraPreviewCallback;
    private final ErrorCallback mCameraErrorCallback;
    private final AssistantQrCodeCameraScanView.Delegate mViewDelegate;

    private final View mRootView;
    // Will be used to update the main body of the view based on state.
    private final FrameLayout mBodyView;
    private final View mCameraPermissionView;
    private final AssistantQrCodeCameraPreviewOverlay mCameraPreviewOverlay;

    private boolean mHasCameraPermission;
    private boolean mIsOnForeground;
    private AssistantQrCodeCameraPreview mCameraPreview;

    /**
     * The AssistantQrCodeCameraScanView constructor.
     */
    public AssistantQrCodeCameraScanView(Context context, View cameraPermissionView,
            PreviewCallback cameraPreviewCallback, ErrorCallback cameraErrorCallback,
            AssistantQrCodeCameraScanView.Delegate delegate) {
        mContext = context;
        mCameraPreviewCallback = cameraPreviewCallback;
        mCameraErrorCallback = cameraErrorCallback;
        mViewDelegate = delegate;

        mBodyView = new FrameLayout(context);
        mRootView = createRootView();
        mCameraPermissionView = cameraPermissionView;
        mCameraPreviewOverlay = new AssistantQrCodeCameraPreviewOverlay(context);
    }

    public View getRootView() {
        return mRootView;
    }

    public AssistantQrCodeCameraPreviewOverlay getCameraPreviewOverlay() {
        return mCameraPreviewOverlay;
    }

    /**
     * Creates the root view for the QR Code Camera Scan Dialog.
     */
    private View createRootView() {
        View dialogView = LayoutUtils.createInflater(mContext).inflate(
                R.layout.autofill_assistant_qr_code_dialog, /* root= */ null);

        ChromeImageButton closeButton = dialogView.findViewById(R.id.close_button);
        closeButton.setOnClickListener(v -> { mViewDelegate.onScanCancelled(); });

        FrameLayout layout = dialogView.findViewById(R.id.qr_code_view);
        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
                FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
        layout.addView(mBodyView, params);

        return dialogView;
    }

    /**
     * Updates the state of the view based on the updated value of |isOnForeground|.
     *
     * @param isOnForeground Indicates whether this component UI is currently on foreground.
     */
    public void onForegroundChanged(Boolean isOnForeground) {
        mIsOnForeground = isOnForeground;
        if (!mIsOnForeground && mCameraPreview != null) {
            mCameraPreview.stopCamera();
        } else {
            displayUpdatedView();
        }
    }

    /**
     * Updates the state of the view based on the updated value of |hasCameraPermission|.
     *
     * @param hasCameraPermission Indicates whether this component UI has camera permission or not.
     */
    public void onPermissionsChanged(boolean hasCameraPermission) {
        mHasCameraPermission = hasCameraPermission;
        displayUpdatedView();
    }

    /**
     * Update the view based on various state parameters:
     * - app is in the foreground
     * - user has given camera permission
     * - user can be prompted for camera permission.
     */
    private void displayUpdatedView() {
        // The scan tab is not in the foreground so don't do any rendering.
        if (!mIsOnForeground) {
            return;
        }

        if (mHasCameraPermission && mCameraPreview != null) {
            mCameraPreview.startCamera();
        } else if (mHasCameraPermission && mCameraPreview == null) {
            displayCameraPreview();
        } else {
            displayCameraPermissionView();
        }
    }

    /**
     * Displays the camera preview with overlay. Caller should check that we already have the
     * camera permissions.
     */
    public void displayCameraPreview() {
        mBodyView.removeAllViews();
        stopCamera();

        mCameraPreview = new AssistantQrCodeCameraPreview(
                mContext, mCameraPreviewCallback, mCameraErrorCallback);
        mBodyView.addView(mCameraPreview);
        mBodyView.addView(mCameraPreviewOverlay);

        mCameraPreview.startCamera();
    }

    /**
     * Displays the permission dialog. Caller should check that the user can be prompted and hasn't
     * permanently denied permission.
     */
    private void displayCameraPermissionView() {
        mBodyView.removeAllViews();
        mBodyView.addView(mCameraPermissionView);
    }

    /**
     * Stop the camera.
     */
    public void stopCamera() {
        if (mCameraPreview != null) {
            mCameraPreview.stopCamera();
            mCameraPreview = null;
        }
    }
}


text:
/* fluid_midishare.c
 *
 * Author: Stephane Letz  (letz@grame.fr)  Grame
 *
 * Interface to Grame's MidiShare drivers (www.grame.fr/MidiShare)
 * 21/12/01 : Add a compilation flag (MIDISHARE_DRIVER) for driver or application mode
 * 29/01/02 : Compilation on MacOSX, use a task for typeNote management
 * 03/06/03 : Adapdation for FluidSynth API
 * 18/03/04 : In appplication mode, connect MidiShare to the fluidsynth client (fluid_midishare_open_appl)
 */

#include "config.h"

#if MIDISHARE_SUPPORT

#include "fluid_midi.h"
#include "fluid_mdriver.h"
#include <MidiShare.h>

/* constants definitions    */
#define MidiShareDrvRef		127

#if defined(MACINTOSH) && defined(MACOS9)
#define MSHSlotName		"\pfluidsynth"
#define MSHDriverName	"\pfluidsynth"
#else
#define MSHSlotName		"fluidsynth"
#define MSHDriverName	"fluidsynth"
#endif

typedef struct {
  fluid_midi_driver_t driver;
  int status;
  short refnum;
  MidiFilterPtr filter;
  #if defined(MACINTOSH) && defined(MACOS9)
  	UPPRcvAlarmPtr upp_alarm_ptr;
  	UPPDriverPtr   upp_wakeup_ptr;
  	UPPDriverPtr   upp_sleep_ptr;
  	UPPTaskPtr     upp_task_ptr;
  #endif
  SlotRefNum	slotRef;
} fluid_midishare_midi_driver_t;

fluid_midi_driver_t* new_fluid_midishare_midi_driver(fluid_settings_t* settings,
						   handle_midi_event_func_t handler,
						   void* data);

int delete_fluid_midishare_midi_driver(fluid_midi_driver_t* p);
int fluid_midishare_midi_driver_status(fluid_midi_driver_t* p);

static void fluid_midishare_midi_driver_receive(short ref);
static int fluid_midishare_open_appl (fluid_midishare_midi_driver_t* dev);
static int fluid_midishare_open_driver (fluid_midishare_midi_driver_t* dev);
static void fluid_midishare_close_driver (fluid_midishare_midi_driver_t* dev);
static void fluid_midishare_close_appl (fluid_midishare_midi_driver_t* dev);

/*
 * new_fluid_midishare_midi_driver
 */
fluid_midi_driver_t*
new_fluid_midishare_midi_driver(fluid_settings_t* settings,
				handle_midi_event_func_t handler,
				void* data)
{
  fluid_midishare_midi_driver_t* dev;
  int i;

  /* not much use doing anything */
  if (handler == NULL) {
    FLUID_LOG(FLUID_ERR, "Invalid argument");
    return NULL;
  }

  /* allocate the device */
  dev = FLUID_NEW(fluid_midishare_midi_driver_t);
  if (dev == NULL) {
    FLUID_LOG(FLUID_ERR, "Out of memory");
    return NULL;
  }
  FLUID_MEMSET(dev, 0, sizeof(fluid_midishare_midi_driver_t));
  dev->driver.handler = handler;
  dev->driver.data = data;

  /* register to MidiShare as Application or Driver */
  #if defined(MIDISHARE_DRIVER)
  	if (!fluid_midishare_open_driver(dev)) goto error_recovery;
  #else
  	if (!fluid_midishare_open_appl(dev)) goto error_recovery;
  #endif

  /*MidiSetInfo(dev->refnum, dev->router->synth); */
  MidiSetInfo(dev->refnum, dev);
  dev->filter = MidiNewFilter();
  if (dev->filter == 0) {
    FLUID_LOG(FLUID_ERR, "Can not allocate MidiShare filter");
    goto error_recovery;
  }

  for (i = 0 ; i < 256; i++) {
  	MidiAcceptPort(dev->filter, i, 1); /* accept all ports */
  	MidiAcceptType(dev->filter, i, 0); /* reject all types */
  }

  for (i = 0 ; i < 16; i++) {
  	MidiAcceptChan(dev->filter, i, 1); /* accept all chan */
  }

  /* accept only the following types */
  MidiAcceptType(dev->filter, typeNote, 1);
  MidiAcceptType(dev->filter, typeKeyOn, 1);
  MidiAcceptType(dev->filter, typeKeyOff, 1);
  MidiAcceptType(dev->filter, typeCtrlChange, 1);
  MidiAcceptType(dev->filter, typeProgChange, 1);
  MidiAcceptType(dev->filter, typePitchWheel, 1);

  /* set the filter */
  MidiSetFilter(dev->refnum, dev->filter);

  dev->status = FLUID_MIDI_READY;
  return (fluid_midi_driver_t*) dev;

 error_recovery:
  delete_fluid_midishare_midi_driver((fluid_midi_driver_t*) dev);
  return NULL;
}

/*
 * delete_fluid_midishare_midi_driver
 */
int delete_fluid_midishare_midi_driver(fluid_midi_driver_t* p)
{
  fluid_midishare_midi_driver_t* dev;

  dev = (fluid_midishare_midi_driver_t*) p;
  if (dev == NULL) {
    return FLUID_OK;
  }

  if (dev->filter) MidiFreeFilter(dev->filter);

  #if defined(MIDISHARE_DRIVER)
  	 fluid_midishare_close_driver(dev);
  #else
  	 fluid_midishare_close_appl(dev);
  #endif

  #if defined(MACINTOSH) && defined(MACOS9)
  	DisposeRoutineDescriptor(dev->upp_alarm_ptr);
  	DisposeRoutineDescriptor(dev->upp_wakeup_ptr);
  	DisposeRoutineDescriptor(dev->upp_sleep_ptr);
  	DisposeRoutineDescriptor(dev->upp_task_ptr);
  #endif

  dev->status = FLUID_MIDI_DONE;

  FLUID_FREE(dev);
  return FLUID_OK;
}

/*
 * fluid_midishare_midi_driver_status
 */
int fluid_midishare_midi_driver_status(fluid_midi_driver_t* p)
{
  fluid_midishare_midi_driver_t* dev = (fluid_midishare_midi_driver_t*) p;
  return dev->status;
}

/*
 * fluid_midishare_keyoff_task
 */
static void fluid_midishare_keyoff_task (long date, short ref, long a1, long a2, long a3)
{
	fluid_midishare_midi_driver_t* dev = (fluid_midishare_midi_driver_t*)MidiGetInfo(ref);
	fluid_midi_event_t new_event;
  	MidiEvPtr e =(MidiEvPtr)a1;

	fluid_midi_event_set_type(&new_event, NOTE_OFF);
	fluid_midi_event_set_channel(&new_event, Chan(e));
	fluid_midi_event_set_pitch(&new_event, Pitch(e));
	fluid_midi_event_set_velocity(&new_event, Vel(e)); /* release vel */

	/* and send it on its way to the router */
	(*dev->driver.handler)(dev->driver.data, &new_event);

	MidiFreeEv(e);
}

/*
 * fluid_midishare_midi_driver_receive
 */
static void fluid_midishare_midi_driver_receive(short ref)
{
	fluid_midishare_midi_driver_t* dev = (fluid_midishare_midi_driver_t*)MidiGetInfo(ref);
	fluid_midi_event_t new_event;
	MidiEvPtr e;

	while ((e = MidiGetEv(ref))){

	    switch (EvType (e)){

		case typeNote:
		      /* Copy the data to fluid_midi_event_t */
		      fluid_midi_event_set_type(&new_event, NOTE_ON);
		      fluid_midi_event_set_channel(&new_event, Chan(e));
		      fluid_midi_event_set_pitch(&new_event, Pitch(e));
		      fluid_midi_event_set_velocity(&new_event, Vel(e));

		      /* and send it on its way to the router */
		      (*dev->driver.handler)(dev->driver.data, &new_event);

		      #if defined(MACINTOSH) && defined(MACOS9)
		      	MidiTask(dev->upp_task_ptr, MidiGetTime()+Dur(e), ref, (long)e, 0, 0);
		      #else
		      	MidiTask(fluid_midishare_keyoff_task, MidiGetTime()+Dur(e), ref, (long)e, 0, 0);
		      #endif
		      break;

		    case typeKeyOn:
		      /* Copy the data to fluid_midi_event_t */
		      fluid_midi_event_set_type(&new_event, NOTE_ON);
		      fluid_midi_event_set_channel(&new_event, Chan(e));
		      fluid_midi_event_set_pitch(&new_event, Pitch(e));
		      fluid_midi_event_set_velocity(&new_event, Vel(e));

		      /* and send it on its way to the router */
		      (*dev->driver.handler)(dev->driver.data, &new_event);

		      MidiFreeEv(e);
		      break;

		    case typeKeyOff:
		      /* Copy the data to fluid_midi_event_t */
		      fluid_midi_event_set_type(&new_event, NOTE_OFF);
		      fluid_midi_event_set_channel(&new_event, Chan(e));
		      fluid_midi_event_set_pitch(&new_event, Pitch(e));
		      fluid_midi_event_set_velocity(&new_event, Vel(e)); /* release vel */

		      /* and send it on its way to the router */
		      (*dev->driver.handler)(dev->driver.data, &new_event);

		      MidiFreeEv(e);
		      break;

		    case typeCtrlChange:
		      /* Copy the data to fluid_midi_event_t */
		      fluid_midi_event_set_type(&new_event, CONTROL_CHANGE);
		      fluid_midi_event_set_channel(&new_event, Chan(e));
		      fluid_midi_event_set_control(&new_event, MidiGetField(e,0));
		      fluid_midi_event_set_value(&new_event, MidiGetField(e,1));

		      /* and send it on its way to the router */
		      (*dev->driver.handler)(dev->driver.data, &new_event);

		      MidiFreeEv(e);
		      break;

		    case typeProgChange:
		      /* Copy the data to fluid_midi_event_t */
		      fluid_midi_event_set_type(&new_event, PROGRAM_CHANGE);
		      fluid_midi_event_set_channel(&new_event, Chan(e));
		      fluid_midi_event_set_program(&new_event, MidiGetField(e,0));

		      /* and send it on its way to the router */
		      (*dev->driver.handler)(dev->driver.data, &new_event);

		      MidiFreeEv(e);
		      break;

		    case typePitchWheel:
		      /* Copy the data to fluid_midi_event_t */
		      fluid_midi_event_set_type(&new_event, PITCH_BEND);
		      fluid_midi_event_set_channel(&new_event, Chan(e));
		      fluid_midi_event_set_value(&new_event, ((MidiGetField(e,0)
							      + (MidiGetField(e,1) << 7))
							      - 8192));

		      /* and send it on its way to the router */
		      (*dev->driver.handler)(dev->driver.data, &new_event);

		      MidiFreeEv(e);
		      break;
		 }
	  }
}

/*
 * fluid_midishare_wakeup
 */
 static void fluid_midishare_wakeup (short r)
{
	MidiConnect (MidiShareDrvRef, r, true);
	MidiConnect (r, MidiShareDrvRef, true);
}

/*
 * fluid_midishare_sleep
 */
 static void fluid_midishare_sleep (short r){}

/*
 * fluid_midishare_open_driver
 */
static int fluid_midishare_open_driver (fluid_midishare_midi_driver_t* dev)
{
	/* gcc wanted me to use {0,0} to initialize the reserved[2] fields */
	TDriverInfos infos = { MSHDriverName, 100, 0, { 0, 0 } };
	TDriverOperation op = { fluid_midishare_wakeup, fluid_midishare_sleep, { 0, 0, 0 } };

	/* register to MidiShare */
	#if defined(MACINTOSH) && defined(MACOS9)
		dev->upp_wakeup_ptr = NewDriverPtr(fluid_midishare_wakeup);
		dev->upp_sleep_ptr = NewDriverPtr(fluid_midishare_sleep);

		op.wakeup = (WakeupPtr)dev->upp_wakeup_ptr;
		op.sleep = (SleepPtr)dev->upp_sleep_ptr;

		dev->refnum = MidiRegisterDriver(&infos, &op);
		if (dev->refnum < 0) {
			FLUID_LOG(FLUID_ERR, "Can not open MidiShare Application client");
			return 0;
		}
		dev->slotRef = MidiAddSlot (dev->refnum, MSHSlotName, MidiOutputSlot);
		dev->upp_alarm_ptr = NewRcvAlarmPtr(fluid_midishare_midi_driver_receive);
		dev->upp_task_ptr = NewTaskPtr(fluid_midishare_keyoff_task);
		MidiSetRcvAlarm(dev->refnum, dev->upp_alarm_ptr);
	#else
		dev->refnum = MidiRegisterDriver(&infos, &op);
		if (dev->refnum < 0) {
			FLUID_LOG(FLUID_ERR, "Can not open MidiShare Application client");
			return 0;
		}
		dev->slotRef = MidiAddSlot (dev->refnum, MSHSlotName, MidiOutputSlot);
		MidiSetRcvAlarm(dev->refnum, fluid_midishare_midi_driver_receive);
	#endif
	return 1;
}

/*
 * fluid_midishare_close_driver
 */
static void fluid_midishare_close_driver (fluid_midishare_midi_driver_t* dev)
{
	if (dev->refnum > 0) MidiUnregisterDriver(dev->refnum);
}

/*
 * fluid_midishare_open_appl
 */
static int fluid_midishare_open_appl (fluid_midishare_midi_driver_t* dev)
{
	/* register to MidiShare */
	#if defined(MACINTOSH) && defined(MACOS9)
		dev->refnum = MidiOpen(MSHDriverName);
		if (dev->refnum < 0) {
			FLUID_LOG(FLUID_ERR, "Can not open MidiShare Driver client");
			return 0;
		}
		dev->upp_alarm_ptr = NewRcvAlarmPtr(fluid_midishare_midi_driver_receive);
		dev->upp_task_ptr = NewTaskPtr(fluid_midishare_keyoff_task);
		MidiSetRcvAlarm(dev->refnum, dev->upp_alarm_ptr);
	#else
		dev->refnum = MidiOpen(MSHDriverName);
		if (dev->refnum < 0) {
			FLUID_LOG(FLUID_ERR, "Can not open MidiShare Driver client");
			return 0;
		}
		MidiSetRcvAlarm(dev->refnum, fluid_midishare_midi_driver_receive);
		MidiConnect(0,dev->refnum,true);
	#endif
  	return 1;
}

/*
 * fluid_midishare_close_appl
 */
static void fluid_midishare_close_appl (fluid_midishare_midi_driver_t* dev)
{
	if (dev->refnum > 0) MidiClose(dev->refnum);
}

#endif /* MIDISHARE_SUPPORT */


text:
package model

// Score ...
type Score struct {
	SeasonID   string
	SeasonName string
	Score      float64
}

// Sug ...
type Sug struct {
	Item     *Item
	SeasonID int64
	Score    int64
}


text:
<?php
namespace Michaels\Manager\Test;

use Michaels\Manager\Test\Stubs\ChainsNestedItemsTraitStub;

class ChainsNestedItemsTest extends \PHPUnit_Framework_TestCase {

    private $manager;
    private $testData;

    public function setup()
    {
        $this->testData = [
            'one' => [
                'two' => [
                    'three' => 'three-value'
                ],
                'two_b' => 'two_b-value'
            ]
        ];

        $this->manager = new ChainsNestedItemsTraitStub();
        $this->manager->initManager($this->testData);
    }

    public function testGetSingleItem()
    {
        $this->manager->add('key', 'value');

        $this->assertEquals('value', $this->manager->key, 'failed to return a single item through magic method');
    }

    public function testGetThroughNestedMagicMethods()
    {
        $expectedA = $this->testData['one']['two']['three'];
        $actualA = $this->manager->one()->two()->three;

        $expectedB = $this->testData['one']['two_b'];
        $actualB = $this->manager->one()->two_b;

        $expectedC = $this->testData['one'];
        $actualC = $this->manager->one;

        $this->assertEquals($expectedA, $actualA, 'failed to retrieve first nested value');
        $this->assertEquals($expectedB, $actualB, 'failed to retrieve second nested value');
        $this->assertEquals($expectedC, $actualC, 'failed to retrieve third nested value');
    }

    public function testDoesntSetLevelForValidMethodCall() {
        $this->manager->someMethod();
        $this->manager->one = "one";
        $this->assertEquals("one", $this->manager->get('one'));
        $this->assertEquals("one", $this->manager->one);
        $this->assertFalse($this->manager->has('someMethod'));
    }

    public function testAddTopLevelItemThroughMagicMethod(){
        $this->manager->one = "one";
        $this->assertEquals("one", $this->manager->get('one'));
        $this->assertEquals("one", $this->manager->one);
    }

    public function testAddNestedItemThroughMagicMethod() {
        $this->manager->one()->two()->three = "three";
        $this->assertEquals("three", $this->manager->get('one.two.three'));
        $this->assertEquals("three", $this->manager->one()->two()->three);
    }

    public function testAddNestedItemToArrayThroughMagicMethod() {
        $this->manager->one()->two = [];
        $this->manager->one()->two()->three()->four = "four";

        $this->assertEquals("four", $this->manager->get('one.two.three.four'));
        $this->assertEquals("four", $this->manager->one()->two()->three()->four);

        $this->manager->five()->six = [
            'seven' => [
                'eight' => 'eight',
            ]
        ];
        $this->manager->five()->six()->seven()->nine = "nine";

        $this->assertEquals("eight", $this->manager->get('five.six.seven.eight'));
        $this->assertEquals("nine", $this->manager->five()->six()->seven()->nine);
    }

    public function testUpdateNestedItemThroughMagicMethod() {
        $this->manager->one()->two = [];
        $this->manager->one()->two()->three()->four = "four";

        $this->manager->one()->two()->three()->four = "new-four";

        $this->assertEquals("new-four", $this->manager->get('one.two.three.four'), "failed to update property");
    }

    public function testDeleteNestedItemThroughMagicMethod() {
        $this->manager->one()->two = 'two';
        $this->manager->one()->three = 'three';

        $this->manager->one()->three()->drop();
        $this->assertFalse($this->manager->has('one.three'), 'failed to remove property');
        $this->assertTrue($this->manager->has('one.two'), 'removed wrong property');
    }
}


text:
package org.apache.hadoop.hive.serde2.objectinspector.primitive;

import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
import org.apache.hadoop.io.NullWritable;

/**
 * A JavaVoidObjectInspector inspects a Java Void Object.
 */
public class JavaVoidObjectInspector extends
    AbstractPrimitiveJavaObjectInspector implements VoidObjectInspector {

  JavaVoidObjectInspector() {
    super(TypeInfoFactory.voidTypeInfo);
  }

  @Override
  public Object getPrimitiveWritableObject(Object o) {
    return NullWritable.get();
  }

}


text:
<!DOCTYPE html>

<meta charset="utf-8"/>
<title>direction/unicode-bidi: default direction, isolate-override</title>

<link rel="author" title="Richard Ishida" href='mailto:ishida@w3.org'/>
<link rel="help" href='http://www.w3.org/TR/css-writing-modes-3/#text-direction'/>
<link rel="match" href='reference/bidi-isolate-override-012.html'/>
<meta name="assert" content='unicode-bidi: When no direction is set, isolate-override will apply ltr ordering to text within its scope.'/>

Test passes if the two boxes are identical.

> abcd > אבגד >

> abcd > אבגד >


text:
package com.geeksaga.flow.store.orientdb;

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;
import com.orientechnologies.orient.server.OServer;
import com.orientechnologies.orient.server.OServerMain;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.orient.OrientGraph;
import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;

/**
 * @author geeksaga
 */
public class OrientDBEmbeddable
{
    public static final String sun_boot_class_path = System.getProperty("sun.boot.class.path");
    public static final String line_separator = System.getProperty("line.separator");
    public static final String path_separator = System.getProperty("path.separator");

    private static String flowPath = null;

    public static void main(String[] args) throws Exception
    {
        OServer server = OServerMain.create();
        //        server.startup(OrientDBEmbedServer.class.getResourceAsStream("db.xml"));
        server.startup(new File("src/main/resources/db.xml")); // test

        System.out.println(sun_boot_class_path);

        server.activate();

        test();

        server.shutdown();
    }

    public static void test()
    {

        //        ODatabaseDocumentTx db = new ODatabaseDocumentTx("local:petshop").open("admin", "admin");
        //
        //        // CREATE A NEW DOCUMENT AND FILL IT
        //        ODocument doc = new ODocument("Person");
        //        doc.field( "name", "Luke" );
        //        doc.field( "surname", "Skywalker" );
        //        doc.field( "city", new ODocument("City").field("name","Rome").field("country", "Italy") );
        //
        //        // SAVE THE DOCUMENT
        //        doc.save();
        //
        //        db.close();

        //        new OrientGraph("local:flow").create();

        //        ODatabaseDocumentTx db = new ODatabaseDocumentTx ("plocal:./databases/flowtemp").create();

        OrientGraphFactory factory = new OrientGraphFactory("plocal:./databases/flowtemp").setupPool(1, 10);

        ODatabaseDocumentTx db = factory.getDatabase();//new ODatabaseDocumentTx ("plocal:./databases/flowtemp").open("admin", "admin");

        //OClass c = db.getMetadata().getSchema().createClass("Person");
        OClass c = db.getMetadata().getSchema().getClass("Person2");
        //c.createIndex("PersonName", OClass.INDEX_TYPE.UNIQUE, "name");

        //        c.createProperty("name", OType.STRING);
        //        c.createProperty("surname", OType.STRING);
        //        c.createProperty("city", OType.LINK);

        System.out.println(c.count());
        ODocument doc = new ODocument(c);
        doc.field("name", "Luke");
        doc.field("surname", "Skywalker");
        doc.field("city", new ODocument("City").field("name", "Rome").field("country", "Italy"));
        doc.save();

        System.out.println(doc.getClassName());
        System.out.println(doc.getSize());
        System.out.println(doc.getSchemaClass());
        System.out.println(doc.getVersion());
        System.out.println(doc.getDatabase());

        System.out.println(db.getName());

        System.out.println(db.countClass("Person"));

        for (ODocument document : db.browseClass("Person"))
        {
            System.out.println(document);
            System.out.println(String.valueOf(document.field("name")));
        }

        List<ODocument> result = db.query(new OSQLSynchQuery<ODocument>("select * from Person where name = 'Luke' and name like 'L%'"));

        for (ODocument document : result)
        {
            System.out.println(document);
        }

        db.close();

        OrientGraph graph = new OrientGraph("plocal:./databases/flowtemp");
        try
        {
            Vertex luca = graph.addVertex(null);
            luca.setProperty("name", "Luca");
            Vertex geek = graph.addVertex(null);
            geek.setProperty("name", "GeekSaga");
            graph.addEdge(null, luca, geek, "dev");
            graph.commit();

            System.out.println("===============");
            System.out.println(graph.query());//"CREATE CLASS geeksaga.flow.jar");

            for (Vertex v : graph.query().has("name").vertices())
            {
                System.out.println(v.getId());
                System.out.println(String.valueOf(v.getProperty("name")));
            }

            System.out.println(graph.query().has("name").vertices());

            //        OGraphDatabase odb = ((OrientGraph)graph).getRawGraph();

            //        OGraphDatabase odb = new OGraphDatabase("local:flow").create();
            //        TransactionalGraph graph = new OrientGraph(odb);
        }
        catch (Exception e)
        {
            e.printStackTrace();

            graph.rollback();
        }

        graph.shutdown();
    }

    public static String getConfigPath()
    {
        if (flowPath == null)
        {
            String path = sun_boot_class_path;

            try
            {
                int x = path.indexOf("geeksaga.flow.jar");
                if (x > -1)
                {
                    String path_sep = path_separator;
                    int x1 = path.lastIndexOf(path_sep, x);

                    if (x1 < 0)
                    {
                        flowPath = path.substring(0, x);
                    }
                    else
                    {
                        flowPath = path.substring(x1 + 1, x);
                    }
                }
            }
            catch (Exception exception)
            {
                // Logger.info(exception);
            }
        }

        return flowPath;
    }

    public void loadJarFile(File file, String name)
    {
        if (file != null && file.exists())
        {
            JarFile jfile = null;
            try
            {
                jfile = new JarFile(file);
                ZipEntry ent = jfile.getEntry(name);
                if (ent != null)
                {
                    InputStream fin = jfile.getInputStream(ent);

                    try
                    {
                        //                        load(fin);
                        fin.close();
                    }
                    finally
                    {
                        fin = null;
                    }
                }
            }
            catch (Throwable e)
            {
                e.printStackTrace();
            }
            finally
            {
                try
                {
                    if (jfile != null)
                    {
                        jfile.close();
                        jfile = null;
                    }
                }
                catch (IOException e)
                {
                }
            }
        }
    }
}


text:
//
// AppleCSPUtils.h - CSP-wide utility functions
//

#ifndef	_H_APPLE_CSP_UTILS
#define _H_APPLE_CSP_UTILS

#include "cspdebugging.h"
#include <Security/cssmtype.h>
#include <security_utilities/alloc.h>
#include <security_cdsa_utilities/context.h>

#ifdef	__cplusplus
extern "C" {
#endif

/* Key type */
typedef enum {
	CKT_Session,
	CKT_Private,
	CKT_Public
} cspKeyType;

/* Key storage type returned from cspParseKeyAttr() */
typedef enum {
	 CKS_Ref,
	 CKS_Data,
	 CKS_None
} cspKeyStorage;

#define KEY_ATTR_RETURN_MASK	(CSSM_KEYATTR_RETURN_DATA |		\
								 CSSM_KEYATTR_RETURN_REF  |		\
								 CSSM_KEYATTR_RETURN_NONE)

/*
 * Validate key attribute bits per specified key type.
 *
 * Used to check requested key attributes for new keys and for validating
 * incoming existing keys. For checking key attributes for new keys,
 * assumes that KEYATTR_RETURN_xxx bits have been checked elsewhere
 * and stripped off before coming here.
 */
void cspValidateKeyAttr(
	cspKeyType 	keyType,
	uint32 		keyAttr);

/*
 * Perform sanity check of incoming key attribute bits for a given
 * key type, and return a malKeyStorage value.
 *
 * Called from any routine which generates a new key. This specifically
 * excludes WrapKey().
 */
cspKeyStorage cspParseKeyAttr(
	cspKeyType 	keyType,
	uint32 		keyAttr);

/*
 * Validate key usage bits for specified key type.
 */
void cspValidateKeyUsageBits (
	cspKeyType	keyType,
	uint32		keyUsage);

/*
 * Validate existing key's usage bits against intended use.
 */
void cspValidateIntendedKeyUsage(
	const CSSM_KEYHEADER	*hdr,
	CSSM_KEYUSE				intendedUsage);

/*
 * Set up a key header.
 */
void setKeyHeader(
	CSSM_KEYHEADER &hdr,
	const Guid &myGuid,
	CSSM_ALGORITHMS alg,
	CSSM_KEYCLASS keyClass,
	CSSM_KEYATTR_FLAGS attrs,
	CSSM_KEYUSE use);

/*
 * Ensure that indicated CssmData can handle 'length' bytes
 * of data. Malloc the Data ptr if necessary.
 */
void setUpCssmData(
	CssmData			&data,
	size_t				length,
	Allocator		&allocator);

void setUpData(
	CSSM_DATA			&data,
	size_t				length,
	Allocator		&allocator);

void freeCssmData(
	CssmData			&data,
	Allocator		&allocator);

void freeData(
	CSSM_DATA			*data,
	Allocator		&allocator,
	bool				freeStruct);		// free the CSSM_DATA itself

/*
 * Copy source to destination, mallocing destination if necessary.
 */
void copyCssmData(
	const CssmData		&src,
	CssmData			&dst,
	Allocator		&allocator);

void copyData(
	const CSSM_DATA		&src,
	CSSM_DATA			&dst,
	Allocator		&allocator);

/*
 * Compare two CSSM_DATAs, return CSSM_TRUE if identical.
 */
CSSM_BOOL cspCompareCssmData(
	const CSSM_DATA 	*data1,
	const CSSM_DATA 	*data2);

/*
 * This takes care of mallocing the and KeyLabel field.
 */
void copyCssmHeader(
	const CssmKey::Header	&src,
	CssmKey::Header			&dst,
	Allocator			&allocator);

/*
 * Given a wrapped key, infer its raw format.
 * This is a real kludge; it only works as long as each {algorithm, keyClass}
 * maps to exactly one format.
 */
CSSM_KEYBLOB_FORMAT inferFormat(
	const CssmKey	&wrappedKey);

/*
 * Given a key and a Context, obtain the optional associated
 * CSSM_ATTRIBUTE_{PUBLIC,PRIVATE,SYMMETRIC}_KEY_FORMAT attribute as a
 * CSSM_KEYBLOB_FORMAT.
 */
CSSM_KEYBLOB_FORMAT requestedKeyFormat(
	const Context 	&context,
	const CssmKey	&key);

/* stateless function to calculate SHA-1 hash of a blob */

#define SHA1_DIGEST_SIZE	20
void cspGenSha1Hash(
	const void 		*inData,
	size_t			inDataLen,
	void			*out);			// caller mallocs, digest goes here

void cspVerifyKeyTimes(
	const CSSM_KEYHEADER &hdr);

#ifdef	__cplusplus
}
#endif

#endif	//  _H_APPLE_CSP_UTILS


text:
% simple dummy predicate to test Zahed's goal from Java:

gen( [t(_,_,_),t(_,_,_)], ok).


text:
<?php

namespace Illuminate\Routing\Events;

class Routing
{
    /**
     * The request instance.
     *
     * @var \Illuminate\Http\Request
     */
    public $request;

    /**
     * Create a new event instance.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return void
     */
    public function __construct($request)
    {
        $this->request = $request;
    }
}


text:
require "spec_helper"

RSpec.feature "The root specialist-publisher page", type: :feature do
  context "when logged in as a GDS editor" do
    before do
      stub_publishing_api_has_content([], hash_including(document_type: CmaCase.document_type))
      stub_publishing_api_has_content([], hash_including(document_type: AaibReport.document_type))
      log_in_as_editor(:gds_editor)
    end

    it "grants access to view all finders including pre-production" do
      visit "/"

      click_link("AAIB Reports", match: :first)

      count = Dir["lib/documents/schemas/*.json"].length
      expect(page).to have_css(".dropdown-menu:nth-of-type(1) li", count:)
    end

    it "selects and navigates to cma case finder" do
      visit "/"

      expect(page).to have_selector("h1", text: "AAIB Reports")

      click_link("AAIB Reports", match: :first)

      expect(page).to have_text("CMA Cases")

      click_link("CMA Cases")

      expect(page).to have_text("Add another CMA Case")
    end

    it "has expected finders" do
      visit "/"

      click_link("AAIB Reports", match: :first)

      expect(page).to have_text("AAIB Reports")
      expect(page).to have_text("Asylum Support Decisions")
      expect(page).to have_text("Business Finance Support Schemes")
      expect(page).to have_text("CMA Cases")
      expect(page).to have_text("Countryside Stewardship Grants")
      expect(page).to have_text("Drug Safety Updates")
      expect(page).to have_text("EAT Decisions")
      expect(page).to have_text("ESI Funds")
      expect(page).to have_text("ET Decisions")
      expect(page).to have_text("EU Withdrawal Act 2018 statutory instruments")
      expect(page).to have_text("Export health certificates")
      expect(page).to have_text("International Development Funds")
      expect(page).to have_text("MAIB Reports")
      expect(page).to have_text("Medical Safety Alerts")
      expect(page).to have_text("Protected Geographical Food and Drink Name")
      expect(page).to have_text("RAIB Reports")
      expect(page).to have_text("Research for Development Outputs")
      expect(page).to have_text("Residential Property Tribunal Decisions")
      expect(page).to have_text("Service Standard Reports")
      expect(page).to have_text("Tax Tribunal Decisions")
      expect(page).to have_text("UK Market Conformity Assessment Bodies")
      expect(page).to have_text("UTAAC Decisions")
    end
  end

  context "when logged in as a CMA editor" do
    before do
      stub_publishing_api_has_content([], hash_including(document_type: CmaCase.document_type))
      log_in_as_editor(:cma_editor)
    end

    it "displays only the CMA Cases finder" do
      visit "/"

      expect(page).to have_selector("h1", text: "CMA Cases")

      expect(page).to have_text("CMA Cases")

      expect(page).to have_css(".navbar-nav li a", count: 2)

      click_link("CMA Cases")

      expect(page).to have_content("Add another CMA Case")
    end
  end
end


text:
    <x-jet-section-title>
        <x-slot name="title">{{ __('Manage Users') }}</x-slot>
        <x-slot name="description">
            {{ __('Manage user details, create new users, impersonate users, or delete users.') }}
        </x-slot>
    </x-jet-section-title>

            @if (session()->has('createdUser'))

The a user for {{ session()->get('createdUser')['name'] }}, they can sign in using their email and
                        the generated password.

Email: {{ session()->get('createdUser')['email'] }}

Pass: {{ session()->get('createdUser')['password'] }}

            @endif

                    <x-jet-input id="search"
                                 type="text"
                                 class="block w-full placeholder-gray-500 focus:z-10"
                                 wire:model.500ms="search"
                                 placeholder="Search..." />

                <x-jet-button wire:click="$set('displayingCreateNewUser', true)" class="text-xs">
                    {{ __('Create user') }}
                </x-jet-button>

            @if ($users->isEmpty())

Found no users matching the "{{ $search }}" query.

            @else

Name

Email

Actions

                        @foreach ($users as $user)
                            @livewire('control-panel.user-management-entity', ['user' => $user], key($user->id))
                        @endforeach

                {{ $users->links() }}
            @endif

    <x-jet-dialog-modal wire:model="displayingCreateNewUser">
        <x-slot name="title">
            {{ __('Create User') }}
        </x-slot>

        <x-slot name="content">

{{ __('Enter account details for the user below.') }}

{{ __('A random password will be generated for the account once its created.') }}

                <x-jet-label for="userDetails_name" value="{{ __('Name') }}" />
                <x-jet-input id="userDetails_name" type="text" class="mt-1 block w-full" min="1" wire:model.defer="userDetails.name" />
                <x-jet-input-error for="userDetails.name" class="mt-2" />

                <x-jet-label for="email" value="{{ __('Email') }}" />
                <x-jet-input id="email" type="text" class="mt-1 block w-full" min="1" wire:model.defer="userDetails.email" />
                <x-jet-input-error for="userDetails.email" class="mt-2" />

        </x-slot>

        <x-slot name="footer">
            <x-jet-button class="ml-2" wire:click="createNewUser" wire:loading.attr="disabled">
                {{ __('Create User') }}
            </x-jet-button>

            <x-jet-secondary-button wire:click="$set('displayingCreateNewUser', false)" wire:loading.attr="disabled">
                {{ __('Close') }}
            </x-jet-secondary-button>
        </x-slot>
    </x-jet-dialog-modal>