text:
package im.tny.segvault.disturbances;

import android.content.Context;
import android.content.res.Configuration;

import com.evernote.android.job.JobManager;

/**
 * Created by gabriel on 4/14/17.
 */

public class Application extends androidx.multidex.MultiDexApplication {
    @Override
    public void onCreate() {
        super.onCreate();
        LocaleUtil.updateResources(this);
        StethoUtils.install(this);
        JobManager.create(this).addJobCreator(new OurJobCreator());
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(LocaleUtil.updateResources(base));
    }

    @Override
    public Context getApplicationContext() {
        return LocaleUtil.updateResources(super.getApplicationContext(), false);
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        LocaleUtil.updateResources(this);
    }
}


text:
package com.evolveum.midpoint.model.intest.sync;

import java.io.FileNotFoundException;

import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;

import com.evolveum.icf.dummy.resource.DummySyncStyle;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType;

/**
 * @author semancik
 *
 */
@ContextConfiguration(locations = {"classpath:ctx-model-intest-test-main.xml"})
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
public class TestReconTask extends AbstractSynchronizationStoryTest {

	@Override
	protected boolean isReconciliation() {
		return true;
	}

	@Override
	public void initSystem(Task initTask, OperationResult initResult) throws Exception {
		super.initSystem(initTask, initResult);

		// This should be the default but let's make sure ...
		dummyResourceGreen.setSyncStyle(DummySyncStyle.NONE);
		getDummyResource().setSyncStyle(DummySyncStyle.NONE);
		getDummyResource(RESOURCE_DUMMY_BLUE_NAME).setSyncStyle(DummySyncStyle.NONE);

		allwaysCheckTimestamp = true;

	}

	@Override
	protected void importSyncTask(PrismObject<ResourceType> resource) throws FileNotFoundException {
		if (resource == resourceDummyGreen) {
			importObjectFromFile(TASK_RECONCILE_DUMMY_GREEN_FILENAME);
		} else if (resource == getDummyResourceObject(RESOURCE_DUMMY_BLUE_NAME)) {
			importObjectFromFile(TASK_RECONCILE_DUMMY_BLUE_FILENAME);
		} else if (resource == getDummyResourceObject()) {
			importObjectFromFile(TASK_RECONCILE_DUMMY_FILENAME);
		} else {
			throw new IllegalArgumentException("Unknown resource "+resource);
		}
	}

	@Override
	protected String getSyncTaskOid(PrismObject<ResourceType> resource) {
		if (resource == resourceDummyGreen) {
			return TASK_RECONCILE_DUMMY_GREEN_OID;
		} else if (resource == getDummyResourceObject(RESOURCE_DUMMY_BLUE_NAME)) {
			return TASK_RECONCILE_DUMMY_BLUE_OID;
		} else if (resource == getDummyResourceObject()) {
			return TASK_RECONCILE_DUMMY_OID;
		} else {
			throw new IllegalArgumentException("Unknown resource "+resource);
		}
	}

	protected int getWaitTimeout() {
		return 70000;
	}

	@Override
	protected int getNumberOfExtraDummyUsers() {
		return 1;
	}

}

redpajama_set_name: RedPajamaGithub


text:
module RecombeeApiClient
  require_relative 'request'
  require_relative '../errors'

  ##
  #List all the ratings ever submitted by a given user.
  class ListUserRatings < ApiRequest
    attr_reader :user_id
    attr_accessor :timeout
    attr_accessor :ensure_https

  ##
  # * *Required arguments*
  #   - +user_id+ -> ID of the user whose ratings are to be listed.
  #
    def initialize(user_id)
      @user_id = user_id
      @timeout = 100000
      @ensure_https = false
    end

    # HTTP method
    def method
      :get
    end

    # Values of body parameters as a Hash
    def body_parameters
      p = Hash.new
      p
    end

    # Values of query parameters as a Hash.
    # name of parameter => value of the parameter
    def query_parameters
      params = {}
      params
    end

    # Relative path to the endpoint
    def path
      "/{databaseId}/users/#{@user_id}/ratings/"
    end
  end
end


text:
<?php
/**
 * DomCrawler - Provides methods query and manipulate HTML documents.
 *
 * Crawler's implementation is based on the DOM extension.
 *
 * @see https://symfony.com/doc/current/components/dom_crawler.html
 * @author <farwish@foxmail.com>
 */

use Symfony\Component\DomCrawler\Crawler;

include __DIR__ . '/../../../vendor/autoload.php';

$html = <<<'HTML'
<!DOCTYPE html>

Hello World!

Hello Crawler!

        Hello php.
        DomCrawler

HTML;

$crawler = new Crawler($html);

foreach ($crawler as $domElement) {
    var_dump($domElement->nodeName);    // html
}

// Need CssSelector component.
$text = $crawler->filter('body > p')->eq(0)->text();
var_dump($text);                        // Hello World!

// All traversal methods return a new Crawler instance.
$crawler_siblings = $crawler->filter('body > p')->last()->nextAll()->eq(0);

/* @var Crawler $crawler_siblings */
foreach ($crawler_siblings as $domElement) {
    var_dump("tagName: " . $domElement->tagName);
    var_dump("nodeName: " . $domElement->nodeName);
    var_dump("nodeType: " . $domElement->nodeType);
    var_dump("nodeValue: " . $domElement->nodeValue);
    var_dump("textContent: " . $domElement->textContent);
    var_dump("baseURI: " . $domElement->baseURI);
    var_dump("getLineNo: " . $domElement->getLineNo());
    var_dump("getNodePath: " . $domElement->getNodePath());
    var_dump("namespaceURI: " . $domElement->namespaceURI);
    var_dump("getAttribute: " . $domElement->getAttribute('class'));
}

$link_crawler = $crawler->selectLink('DomCrawler')->eq(0);

var_dump($link_crawler->attr('href'));

/*

string(13) "tagName: span"
string(14) "nodeName: span"
string(11) "nodeType: 1"
string(21) "nodeValue: Hello php."
string(23) "textContent: Hello php."
string(9) "baseURI: "
string(12) "getLineNo: 6"
string(28) "getNodePath: /html/body/span"
string(14) "namespaceURI: "
string(17) "getAttribute: btn"

*/


text:
require 'test_helper'

class LinkTest < Zena::Unit::TestCase

  def test_link_through
    node = secure!(Node) { nodes(:cleanWater) }
    link = Link.find_through(node, links_id(:status_hot_for_cleanWater))
    assert_equal 'hot', link.role
  end

  def test_update_attributes_with_transformations
    login(:lion)
    node = secure!(Node) { nodes(:cleanWater) }
    assert_equal nodes_id(:status), node.find(:first, 'hot')[:id]
    link = Link.find_through(node, links_id(:status_hot_for_cleanWater))
    link.update_attributes_with_transformations('role' => 'hot', 'other_id' => nodes_zip(:lake), 'comment' => 'pop')
    assert_equal 'hot', link.role
    assert_equal nodes_zip(:lake), link.other_zip
    # change propagated to caller node.
    assert_equal 'pop', node.l_comment
    node = secure!(Node) { nodes(:cleanWater) }
    assert_equal nodes_id(:lake), node.find(:first, 'hot')[:id]
  end

  def test_node_zip
    login(:lion)
    node = secure!(Node) { nodes(:zena) }
    assert link = Link.find_through(node, links_id(:opening_in_zena))
    assert_equal nodes_zip(:zena), link.this_zip
    assert_equal nodes_zip(:opening), link.other_zip
  end
end


text:
ITKStrain
=========

.. image:: https://github.com/KitwareMedical/ITKStrain/workflows/Build,%20test,%20package/badge.svg

.. image:: https://img.shields.io/pypi/v/itk-strain.svg
    :target: https://pypi.python.org/pypi/itk-strain
    :alt: PyPI

.. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
    :target: https://github.com/KitwareMedical/ITKStrain/blob/master/LICENSE)
    :alt: License

Overview
--------

This repository contains `ITK <https://itk.org>`_ filters to estimate a
strain tensor field from a displacement field or a spatial transformation.

For more information, see the `Insight Journal article <https://hdl.handle.net/10380/3573>`_::

  McCormick M.
  N-Dimensional Computation of Strain Tensor Images in the Insight Toolkit
  The Insight Journal. January-December. 2017.
  https://hdl.handle.net/10380/3573
  https://insight-journal.org/browse/publication/984

Installation
------------

To install the Python package::

  pip install itk-strain

To build the C++ module, either enable the CMake option in ITK's
build configuration::

  Module_Strain:BOOL=ON

Or, build the module as a separate project against an ITK build tree::

  git clone https://github.com/KitwareMedical/ITKStrain
  mkdir ITKStrain-bulid
  cd ITKStrain-build
  cmake -DITK_DIR=/path/to/ITK-build ../ITKStrain
  cmake --build .

License
-------

This software is distributed under the Apache 2.0 license. Please see the
*LICENSE* file for details.


text:
module ActiveRecordSunspotter
	module Rails
		class Engine < ::Rails::Engine
		end
	end
end


text:
/* eslint-env jasmine */

import path from 'path'
import fs from 'fs'
import {
  unixStylePath,
  cleanPath,
  buildFiles,
  buildDirectories,
  buildSymLinks,
  buildFileSet,
  defaultFileSet
} from '../src/test-file-builder'
import mkdirp from 'mkdirp'
import {Observable} from 'rxjs'
import {bashFileSearch, emptyBashFileSearchResult} from '../src/bash-file-search'
import {concatListItems, getSubscriber, sortedFileList} from './test-helpers'

const LOCAL_PATH = path.join(__dirname, '..', 'glob-test')
const ROOT_PATH = '/tmp/glob-test'

function rootWorkPath (offsetPath) {
  return offsetPath ? path.join(ROOT_PATH, offsetPath) : ROOT_PATH
}

function localWorkPath (offsetPath) {
  return offsetPath ? path.join(LOCAL_PATH, offsetPath) : LOCAL_PATH
}

const writeFileRx = Observable.bindNodeCallback(fs.writeFile)
const mkdirpRx = Observable.bindNodeCallback(mkdirp)

describe('test file builder', () => {
  describe('unix style path', () => {
    it('should transform back slash characters to forward slash', () => {
      expect(unixStylePath('a\\b\\c\\file.txt')).toBe('a/b/c/file.txt')
    })
    it('should leave forward slash characters as is', () => {
      expect(unixStylePath('a/b/c/file.txt')).toBe('a/b/c/file.txt')
    })
  })

  describe('work paths', () => {
    it('should be exepected root work path', () => {
      expect(ROOT_PATH).toBe('/tmp/glob-test')
    })
    it('should be exepected work path', () => {
      expect(unixStylePath(LOCAL_PATH)).toBe(unixStylePath(path.join(__dirname, '..', 'glob-test')))
    })
    it('should provide default root work path', () => {
      expect(unixStylePath(rootWorkPath())).toBe('/tmp/glob-test')
    })
    it('should provide offset root work path', () => {
      expect(unixStylePath(rootWorkPath('a/b/c/file.txt'))).toBe('/tmp/glob-test/a/b/c/file.txt')
    })
    it('should provide default local work path', () => {
      let expected = unixStylePath(path.join(__dirname, '..', 'glob-test'))
      expect(unixStylePath(localWorkPath())).toBe(expected)
    })
    it('should provide offset root work path', () => {
      let expected = unixStylePath(path.join(__dirname, '..', 'glob-test', 'a', 'b', 'c', 'file.txt'))
      expect(unixStylePath(localWorkPath('a/b/c/file.txt'))).toBe(expected)
    })
  })

  describe('clean path', () => {
    it('should remove contents of path', (done) => {
      mkdirpRx(localWorkPath('a/b/c'))
        .mergeMap(() => writeFileRx(localWorkPath('a/b/c/file.txt'), 'some content'))
        .mergeMap(() => cleanPath(localWorkPath()))
        .do((path) => {
          expect(unixStylePath(path)).toBe(unixStylePath(localWorkPath()))
        })
        .mergeMap(() => bashFileSearch('**/*', localWorkPath()))
        .do((result) => {
          expect(result).toEqual(emptyBashFileSearchResult)
        })
        .subscribe(getSubscriber(done))
    })
  })

  describe('build files', () => {
    beforeEach((done) => {
      cleanPath(localWorkPath()).subscribe(getSubscriber(done))
    })

    it('should return empty list for undefined file list', (done) => {
      buildFiles(localWorkPath())
        .reduce(concatListItems, [])
        .do((fileList) => {
          expect(fileList).toEqual([])
        })
        .flatMap(() => bashFileSearch('**/*', localWorkPath()))
        .do((actual) => {
          expect(actual).toEqual(emptyBashFileSearchResult)
        })
        .subscribe(getSubscriber(done))
    })

    it('should create single file', (done) => {
      let buildList = [
        'a/b/c/file.txt'
      ]
      let expected = {
        pattern: '**/*',
        matches: [
          'a',
          'a/b',
          'a/b/c',
          'a/b/c/file.txt'
        ]
      }
      buildFiles(localWorkPath(), buildList)
        .reduce(concatListItems, [])
        .do((fileList) => {
          expect(fileList).toEqual(buildList)
        })
        .flatMap(() => bashFileSearch('**/*', localWorkPath()))
        .do((actual) => {
          expect(actual).toEqual(expected)
        })
        .subscribe(getSubscriber(done))
    })

    it('should create multiple files', (done) => {
      let buildList = [
        'a/b/c/one.txt',
        'x/y/z/two.txt',
        'a/three.txt',
        'x/v/four.txt'
      ]
      let expected = {
        pattern: '**/*',
        matches: [
          'a',
          'a/b',
          'a/b/c',
          'a/b/c/one.txt',
          'a/three.txt',
          'x',
          'x/v',
          'x/v/four.txt',
          'x/y',
          'x/y/z',
          'x/y/z/two.txt'
        ]
      }
      buildFiles(localWorkPath(), buildList)
        .reduce(concatListItems, [])
        .do((fileList) => {
          expect(sortedFileList(fileList)).toEqual(sortedFileList(buildList))
        })
        .flatMap(() => bashFileSearch('**/*', localWorkPath()))
        .do((actual) => {
          expect(sortedFileList(actual.matches)).toEqual(sortedFileList(expected.matches))
        })
        .subscribe(getSubscriber(done))
    })
  })

  describe('build directories', () => {
    beforeEach((done) => {
      cleanPath(localWorkPath()).subscribe(getSubscriber(done))
    })

    it('should return empty list for undefined directory list', (done) => {
      buildDirectories(localWorkPath())
        .reduce(concatListItems, [])
        .do((dirList) => {
          expect(dirList).toEqual([])
        })
        .mergeMap(() => bashFileSearch('**/*', localWorkPath()))
        .do((actual) => {
          expect(actual).toEqual(emptyBashFileSearchResult)
        })
        .subscribe(getSubscriber(done))
    })

    it('should create single directory', (done) => {
      let buildList = [
        'a/b/c'
      ]
      let expected = {
        pattern: '**/*',
        matches: [
          'a',
          'a/b',
          'a/b/c'
        ]
      }
      buildDirectories(localWorkPath(), buildList)
        .reduce(concatListItems, [])
        .do((dirList) => {
          expect(dirList).toEqual(buildList)
        })
        .mergeMap(() => bashFileSearch('**/*', localWorkPath()))
        .do((actual) => {
          expect(actual).toEqual(expected)
        })
        .subscribe(getSubscriber(done))
    })

    it('should create multiple directories', (done) => {
      let buildList = [
        'a/b/c',
        'x/y/z',
        'a/x/y/z',
        'x/v'
      ]
      let expected = {
        pattern: '**/*',
        matches: [
          'a',
          'a/b',
          'a/b/c',
          'a/x',
          'a/x/y',
          'a/x/y/z',
          'x',
          'x/y',
          'x/y/z',
          'x/v'
        ]
      }
      buildDirectories(localWorkPath(), buildList)
        .reduce(concatListItems, [])
        .do((dirList) => {
          expect(sortedFileList(dirList)).toEqual(sortedFileList(buildList))
        })
        .flatMap(() => bashFileSearch('**/*', localWorkPath()))
        .do((actual) => {
          expect(sortedFileList(actual.matches)).toEqual(sortedFileList(expected.matches))
        })
        .subscribe(getSubscriber(done))
    })
  })

  describe('build symbolic links', () => {
    beforeEach((done) => {
      cleanPath(localWorkPath()).subscribe(getSubscriber(done))
    })

    it('should return empty list for undefined symlink path list', (done) => {
      buildSymLinks(localWorkPath())
        .reduce(concatListItems, [])
        .do((fileList) => {
          expect(fileList).toEqual([])
        })
        .flatMap(() => bashFileSearch('**/*', localWorkPath()))
        .do((actual) => {
          expect(actual).toEqual(emptyBashFileSearchResult)
        })
        .subscribe(getSubscriber(done))
    })

    it('should create symbolic link', (done) => {
      let links = [
        [ 'a/symlink/a/b/c', 'a/symlink/a' ]
      ]
      let expected = {
        'pattern': '**/*',
        'matches': [
          'a',
          'a/symlink',
          'a/symlink/a',
          'a/symlink/a/b',
          'a/symlink/a/b/c',
          'a/symlink/a/b/c/b'
        ]
      }
      buildSymLinks(localWorkPath(), links)
        .reduce(concatListItems, [])
        .do((symLinkList) => {
          expect(sortedFileList(symLinkList)).toEqual(sortedFileList(links.map((v) => v[0])))
        })
        .flatMap(() => bashFileSearch('**/*', localWorkPath()))
        .do((actual) => {
          expect(sortedFileList(actual.matches)).toEqual(sortedFileList(expected.matches))
        })
        .subscribe(getSubscriber(done))
    })
  })

  describe('build file set', () => {
    beforeEach((done) => {
      cleanPath(localWorkPath())
        .concat(cleanPath(rootWorkPath()))
        .subscribe(getSubscriber(done))
    })

    it('should throw error if rootPath not set', (done) => {
      let testFxn = () => {
        buildFileSet({ localPath: LOCAL_PATH })
          .subscribe(getSubscriber(done))
      }
      expect(testFxn).toThrowError('rootPath not set')
      done()
    })

    it('should throw error if localPath not set', (done) => {
      let testFxn = () => {
        buildFileSet({ rootPath: '/tmp/glob-test' })
          .subscribe(getSubscriber(done))
      }
      expect(testFxn).toThrowError('localPath not set')
      done()
    })

    it('should build empty file set', (done) => {
      buildFileSet({ rootPath: '/tmp/glob-test', localPath: LOCAL_PATH })
        .reduce(concatListItems, [])
        .do((buildList) => {
          expect(buildList).toEqual([])
        })
        .flatMap(() => {
          return Observable.concat(
            bashFileSearch('**/*', localWorkPath()),
            bashFileSearch('**/*', rootWorkPath()))
            .mergeMap((m) => m.matches)
            .reduce(concatListItems, [])
        })
        .do((actual) => {
          expect(actual).toEqual([])
        })
        .subscribe(getSubscriber(done))
    })

    it('should build default file set', (done) => {
      let expectedBuildFiles = defaultFileSet.localFiles
        .concat(defaultFileSet.localDirectories)
        .concat(defaultFileSet.rootFiles)
        .concat(defaultFileSet.rootDirectories)
        .concat(defaultFileSet.symLinks.map((s) => s[0]))
      let expected = [
        'a',
        'a/abcdef',
        'a/abcdef/g',
        'a/abcdef/g/h',
        'a/abcfed',
        'a/abcfed/g',
        'a/abcfed/g/h',
        'a/b',
        'a/b/c',
        'a/b/c/d',
        'a/bc',
        'a/bc/e',
        'a/bc/e/f',
        'a/c',
        'a/c/d',
        'a/c/d/c',
        'a/c/d/c/b',
        'a/cb',
        'a/cb/e',
        'a/cb/e/f',
        'a/symlink',
        'a/symlink/a',
        'a/symlink/a/b',
        'a/symlink/a/b/c',
        'a/symlink/a/b/c/a',
        'asdf',
        'bar',
        'baz',
        'foo',
        'quux',
        'qwer',
        'rewq'
      ]
      buildFileSet(Object.assign({}, defaultFileSet, { localPath: LOCAL_PATH }))
        .reduce(concatListItems, [])
        .do((buildList) => {
          expect(sortedFileList(buildList)).toEqual(sortedFileList(expectedBuildFiles))
        })
        .flatMap(() => {
          return Observable.concat(
            bashFileSearch('**/*', localWorkPath()),
            bashFileSearch('**/*', rootWorkPath()))
            .mergeMap((m) => m.matches)
            .reduce(concatListItems, [])
        })
        .do((actual) => {
          expect(sortedFileList(actual)).toEqual(sortedFileList(expected))
        })
        .subscribe(getSubscriber(done))
    })
  })
})


text:
<?xml version="1.0" encoding="windows-1251" standalone="yes"?>
<feed xml:base="http://packages.nuget.org/v1/FeedService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Packages</title>
  <id>http://packages.nuget.org/v1/FeedService.svc/Packages</id>
  <updated>2011-09-05T21:39:41Z</updated>
  <link rel="self" title="Packages" href="Packages" />
  <entry>
    <id>http://packages.nuget.org/v1/FeedService.svc/Packages(Id='Ninject',Version='2.0.1.0')</id>
    <title type="text">Ninject</title>
    Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.
    <updated>2011-01-07T07:57:24-08:00</updated>
    <author>
      <name>Nate Kohari, Ian Davis</name>
    </author>
    <link rel="edit-media" title="PublishedPackage" href="Packages(Id='Ninject',Version='2.0.1.0')/$value" />
    <link rel="edit" title="PublishedPackage" href="Packages(Id='Ninject',Version='2.0.1.0')" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Screenshots" type="application/atom+xml;type=feed" title="Screenshots" href="Packages(Id='Ninject',Version='2.0.1.0')/Screenshots" />
    <category term="Gallery.Infrastructure.FeedModels.PublishedPackage" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/zip" src="http://packages.nuget.org/v1/Package/Download/Ninject/2.0.1.0" />
    <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
      <d:Id>Ninject</d:Id>
      <d:Version>2.0.1.0</d:Version>
      <d:Title>Ninject</d:Title>
      <d:Authors>Nate Kohari, Ian Davis</d:Authors>
      <d:PackageType>Packages</d:PackageType>
      <d:Summary>Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.</d:Summary>
      <d:Description>Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.</d:Description>
      <d:Copyright m:null="true"></d:Copyright>
      <d:PackageHashAlgorithm>SHA512</d:PackageHashAlgorithm>
      <d:PackageHash>vpq0qmA8cxONqEH9s1vGBLnTYDAaSYJcQhWvcViL3YnApcL5mGxLmFut0wr+CF6WlH6I2vwLYiU0KuUkKVJLPg==</d:PackageHash>
      <d:PackageSize m:type="Edm.Int64">82127</d:PackageSize>
      <d:Price m:type="Edm.Decimal">0</d:Price>
      <d:RequireLicenseAcceptance m:type="Edm.Boolean">false</d:RequireLicenseAcceptance>
      <d:IsLatestVersion m:type="Edm.Boolean">false</d:IsLatestVersion>
      <d:ReleaseNotes m:null="true"></d:ReleaseNotes>
      <d:Prerelease m:type="Edm.Boolean">false</d:Prerelease>
      <d:VersionRating m:type="Edm.Double">0</d:VersionRating>
      <d:VersionRatingsCount m:type="Edm.Int32">0</d:VersionRatingsCount>
      <d:VersionDownloadCount m:type="Edm.Int32">535</d:VersionDownloadCount>
      <d:Created m:type="Edm.DateTime">2011-01-07T07:57:24.793</d:Created>
      <d:LastUpdated m:type="Edm.DateTime">2011-01-07T07:57:24.793</d:LastUpdated>
      <d:Published m:type="Edm.DateTime">2011-01-07T07:57:25.307</d:Published>
      <d:ExternalPackageUrl m:null="true"></d:ExternalPackageUrl>
      <d:ProjectUrl m:null="true"></d:ProjectUrl>
      <d:LicenseUrl m:null="true"></d:LicenseUrl>
      <d:IconUrl m:null="true"></d:IconUrl>
      <d:Rating m:type="Edm.Double">4.8571428571428568</d:Rating>
      <d:RatingsCount m:type="Edm.Int32">14</d:RatingsCount>
      <d:DownloadCount m:type="Edm.Int32">26235</d:DownloadCount>
      <d:Categories m:null="true"></d:Categories>
      <d:Tags m:null="true"></d:Tags>
      <d:Dependencies></d:Dependencies>
      <d:ReportAbuseUrl>http://nuget.org/Package/ReportAbuse/Ninject/2.0.1.0</d:ReportAbuseUrl>
      <d:GalleryDetailsUrl>http://nuget.org/List/Packages/Ninject/2.0.1.0</d:GalleryDetailsUrl>
    </m:properties>
  </entry>
  <entry>
    <id>http://packages.nuget.org/v1/FeedService.svc/Packages(Id='Ninject',Version='2.1.0.76')</id>
    <title type="text">Ninject</title>
    Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.
    <updated>2011-01-07T07:57:31-08:00</updated>
    <author>
      <name>Nate Kohari, Ian Davis, Remo Gloor, Joe Wasson, Daniel Marbach</name>
    </author>
    <link rel="edit-media" title="PublishedPackage" href="Packages(Id='Ninject',Version='2.1.0.76')/$value" />
    <link rel="edit" title="PublishedPackage" href="Packages(Id='Ninject',Version='2.1.0.76')" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Screenshots" type="application/atom+xml;type=feed" title="Screenshots" href="Packages(Id='Ninject',Version='2.1.0.76')/Screenshots" />
    <category term="Gallery.Infrastructure.FeedModels.PublishedPackage" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/zip" src="http://packages.nuget.org/v1/Package/Download/Ninject/2.1.0.76" />
    <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
      <d:Id>Ninject</d:Id>
      <d:Version>2.1.0.76</d:Version>
      <d:Title>Ninject</d:Title>
      <d:Authors>Nate Kohari, Ian Davis, Remo Gloor, Joe Wasson, Daniel Marbach</d:Authors>
      <d:PackageType>Packages</d:PackageType>
      <d:Summary>Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.</d:Summary>
      <d:Description>Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.</d:Description>
      <d:Copyright m:null="true"></d:Copyright>
      <d:PackageHashAlgorithm>SHA512</d:PackageHashAlgorithm>
      <d:PackageHash>tTAFlKiyijmzzpc86l7cMSBxIxifuQ51Xaqe7yUlCebt3RwL84VQgLK6S8ooTaiIuBVssx2PCTX20WCrvQggbg==</d:PackageHash>
      <d:PackageSize m:type="Edm.Int64">1284126</d:PackageSize>
      <d:Price m:type="Edm.Decimal">0</d:Price>
      <d:RequireLicenseAcceptance m:type="Edm.Boolean">false</d:RequireLicenseAcceptance>
      <d:IsLatestVersion m:type="Edm.Boolean">false</d:IsLatestVersion>
      <d:ReleaseNotes m:null="true"></d:ReleaseNotes>
      <d:Prerelease m:type="Edm.Boolean">false</d:Prerelease>
      <d:VersionRating m:type="Edm.Double">0</d:VersionRating>
      <d:VersionRatingsCount m:type="Edm.Int32">0</d:VersionRatingsCount>
      <d:VersionDownloadCount m:type="Edm.Int32">2887</d:VersionDownloadCount>
      <d:Created m:type="Edm.DateTime">2011-01-07T07:57:31.4</d:Created>
      <d:LastUpdated m:type="Edm.DateTime">2011-01-07T07:57:31.4</d:LastUpdated>
      <d:Published m:type="Edm.DateTime">2011-01-07T07:57:31.9</d:Published>
      <d:ExternalPackageUrl m:null="true"></d:ExternalPackageUrl>
      <d:ProjectUrl m:null="true"></d:ProjectUrl>
      <d:LicenseUrl m:null="true"></d:LicenseUrl>
      <d:IconUrl m:null="true"></d:IconUrl>
      <d:Rating m:type="Edm.Double">4.8571428571428568</d:Rating>
      <d:RatingsCount m:type="Edm.Int32">14</d:RatingsCount>
      <d:DownloadCount m:type="Edm.Int32">26235</d:DownloadCount>
      <d:Categories m:null="true"></d:Categories>
      <d:Tags m:null="true"></d:Tags>
      <d:Dependencies></d:Dependencies>
      <d:ReportAbuseUrl>http://nuget.org/Package/ReportAbuse/Ninject/2.1.0.76</d:ReportAbuseUrl>
      <d:GalleryDetailsUrl>http://nuget.org/List/Packages/Ninject/2.1.0.76</d:GalleryDetailsUrl>
    </m:properties>
  </entry>
  <entry>
    <id>http://packages.nuget.org/v1/FeedService.svc/Packages(Id='Ninject',Version='2.2.0.0')</id>
    <title type="text">Ninject</title>
    Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.
    <updated>2011-02-18T03:06:40-08:00</updated>
    <author>
      <name>Nate Kohari, Ian Davis, Remo Gloor, Joe Wasson, Daniel Marbach</name>
    </author>
    <link rel="edit-media" title="PublishedPackage" href="Packages(Id='Ninject',Version='2.2.0.0')/$value" />
    <link rel="edit" title="PublishedPackage" href="Packages(Id='Ninject',Version='2.2.0.0')" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Screenshots" type="application/atom+xml;type=feed" title="Screenshots" href="Packages(Id='Ninject',Version='2.2.0.0')/Screenshots" />
    <category term="Gallery.Infrastructure.FeedModels.PublishedPackage" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/zip" src="http://packages.nuget.org/v1/Package/Download/Ninject/2.2.0.0" />
    <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
      <d:Id>Ninject</d:Id>
      <d:Version>2.2.0.0</d:Version>
      <d:Title>Ninject</d:Title>
      <d:Authors>Nate Kohari, Ian Davis, Remo Gloor, Joe Wasson, Daniel Marbach</d:Authors>
      <d:PackageType>Packages</d:PackageType>
      <d:Summary>Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.</d:Summary>
      <d:Description>Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.</d:Description>
      <d:Copyright m:null="true"></d:Copyright>
      <d:PackageHashAlgorithm>SHA512</d:PackageHashAlgorithm>
      <d:PackageHash>8+wvyhBYAfrFwZ3B9GjTvQ7gLqkomH2xm7N2QinC3WypwSDWZp1lqCFsQoOpIK/1AeU4JDHVn99mHFx9JIM8Yw==</d:PackageHash>
      <d:PackageSize m:type="Edm.Int64">835878</d:PackageSize>
      <d:Price m:type="Edm.Decimal">0</d:Price>
      <d:RequireLicenseAcceptance m:type="Edm.Boolean">true</d:RequireLicenseAcceptance>
      <d:IsLatestVersion m:type="Edm.Boolean">false</d:IsLatestVersion>
      <d:ReleaseNotes m:null="true"></d:ReleaseNotes>
      <d:Prerelease m:type="Edm.Boolean">false</d:Prerelease>
      <d:VersionRating m:type="Edm.Double">0</d:VersionRating>
      <d:VersionRatingsCount m:type="Edm.Int32">0</d:VersionRatingsCount>
      <d:VersionDownloadCount m:type="Edm.Int32">2118</d:VersionDownloadCount>
      <d:Created m:type="Edm.DateTime">2011-02-18T02:43:55.063</d:Created>
      <d:LastUpdated m:type="Edm.DateTime">2011-02-18T03:06:40.89</d:LastUpdated>
      <d:Published m:type="Edm.DateTime">2011-02-18T03:06:43.063</d:Published>
      <d:ExternalPackageUrl m:null="true"></d:ExternalPackageUrl>
      <d:ProjectUrl>http://ninject.org</d:ProjectUrl>
      <d:LicenseUrl>https://github.com/ninject/ninject/blob/master/LICENSE.txt</d:LicenseUrl>
      <d:IconUrl m:null="true"></d:IconUrl>
      <d:Rating m:type="Edm.Double">4.8571428571428568</d:Rating>
      <d:RatingsCount m:type="Edm.Int32">14</d:RatingsCount>
      <d:DownloadCount m:type="Edm.Int32">26235</d:DownloadCount>
      <d:Categories m:null="true"></d:Categories>
      <d:Tags m:null="true"></d:Tags>
      <d:Dependencies></d:Dependencies>
      <d:ReportAbuseUrl>http://nuget.org/Package/ReportAbuse/Ninject/2.2.0.0</d:ReportAbuseUrl>
      <d:GalleryDetailsUrl>http://nuget.org/List/Packages/Ninject/2.2.0.0</d:GalleryDetailsUrl>
    </m:properties>
  </entry>
  <entry>
    <id>http://packages.nuget.org/v1/FeedService.svc/Packages(Id='Ninject',Version='2.2.1.0')</id>
    <title type="text">Ninject</title>
    Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.
    <updated>2011-04-13T15:28:18-07:00</updated>
    <author>
      <name>Ninject Project Contributors</name>
    </author>
    <link rel="edit-media" title="PublishedPackage" href="Packages(Id='Ninject',Version='2.2.1.0')/$value" />
    <link rel="edit" title="PublishedPackage" href="Packages(Id='Ninject',Version='2.2.1.0')" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Screenshots" type="application/atom+xml;type=feed" title="Screenshots" href="Packages(Id='Ninject',Version='2.2.1.0')/Screenshots" />
    <category term="Gallery.Infrastructure.FeedModels.PublishedPackage" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/zip" src="http://packages.nuget.org/v1/Package/Download/Ninject/2.2.1.0" />
    <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
      <d:Id>Ninject</d:Id>
      <d:Version>2.2.1.0</d:Version>
      <d:Title>Ninject</d:Title>
      <d:Authors>Ninject Project Contributors</d:Authors>
      <d:PackageType>Packages</d:PackageType>
      <d:Summary>Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.</d:Summary>
      <d:Description>Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.

Release Notes:
Version 2.2.1.0
---------------
- Bug Fix: For classes that have several virtual indexers and at least one of them overridden an ambiguous match exception was thrown when they were injected.</d:Description>
      <d:Copyright>Copyright 2011 by Ninject Project Contributors</d:Copyright>
      <d:PackageHashAlgorithm>SHA512</d:PackageHashAlgorithm>
      <d:PackageHash>xSJQg1gPBUzPKPgamUH4VhuVWGJd42BV0Ifg/gtgdxTXBwREzXMzYq/DimPDV5KzfOyQjFoBzuacud3cjCezgA==</d:PackageHash>
      <d:PackageSize m:type="Edm.Int64">791908</d:PackageSize>
      <d:Price m:type="Edm.Decimal">0</d:Price>
      <d:RequireLicenseAcceptance m:type="Edm.Boolean">true</d:RequireLicenseAcceptance>
      <d:IsLatestVersion m:type="Edm.Boolean">false</d:IsLatestVersion>
      <d:ReleaseNotes m:null="true"></d:ReleaseNotes>
      <d:Prerelease m:type="Edm.Boolean">false</d:Prerelease>
      <d:VersionRating m:type="Edm.Double">4.7142857142857144</d:VersionRating>
      <d:VersionRatingsCount m:type="Edm.Int32">7</d:VersionRatingsCount>
      <d:VersionDownloadCount m:type="Edm.Int32">5377</d:VersionDownloadCount>
      <d:Created m:type="Edm.DateTime">2011-03-01T19:33:45.973</d:Created>
      <d:LastUpdated m:type="Edm.DateTime">2011-04-13T15:28:18.163</d:LastUpdated>
      <d:Published m:type="Edm.DateTime">2011-04-13T15:28:40.13</d:Published>
      <d:ExternalPackageUrl m:null="true"></d:ExternalPackageUrl>
      <d:ProjectUrl>http://www.ninject.org/</d:ProjectUrl>
      <d:LicenseUrl>https://github.com/ninject/ninject/raw/master/LICENSE.txt</d:LicenseUrl>
      <d:IconUrl>/Media/Default/Packages/Ninject/2.2.1.0/Ninject2.png</d:IconUrl>
      <d:Rating m:type="Edm.Double">4.8571428571428568</d:Rating>
      <d:RatingsCount m:type="Edm.Int32">14</d:RatingsCount>
      <d:DownloadCount m:type="Edm.Int32">26235</d:DownloadCount>
      <d:Categories m:null="true"></d:Categories>
      <d:Tags xml:space="preserve"> Ninject IoC DI </d:Tags>
      <d:Dependencies></d:Dependencies>
      <d:ReportAbuseUrl>http://nuget.org/Package/ReportAbuse/Ninject/2.2.1.0</d:ReportAbuseUrl>
      <d:GalleryDetailsUrl>http://nuget.org/List/Packages/Ninject/2.2.1.0</d:GalleryDetailsUrl>
    </m:properties>
  </entry>
  <entry>
    <id>http://packages.nuget.org/v1/FeedService.svc/Packages(Id='Ninject',Version='2.2.1.4')</id>
    <title type="text">Ninject</title>
    Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.
    <updated>2011-05-07T12:15:12-07:00</updated>
    <author>
      <name>Ninject Project Contributors</name>
    </author>
    <link rel="edit-media" title="PublishedPackage" href="Packages(Id='Ninject',Version='2.2.1.4')/$value" />
    <link rel="edit" title="PublishedPackage" href="Packages(Id='Ninject',Version='2.2.1.4')" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Screenshots" type="application/atom+xml;type=feed" title="Screenshots" href="Packages(Id='Ninject',Version='2.2.1.4')/Screenshots" />
    <category term="Gallery.Infrastructure.FeedModels.PublishedPackage" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/zip" src="http://packages.nuget.org/v1/Package/Download/Ninject/2.2.1.4" />
    <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
      <d:Id>Ninject</d:Id>
      <d:Version>2.2.1.4</d:Version>
      <d:Title>Ninject</d:Title>
      <d:Authors>Ninject Project Contributors</d:Authors>
      <d:PackageType>Packages</d:PackageType>
      <d:Summary>Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.</d:Summary>
      <d:Description>Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.</d:Description>
      <d:Copyright>Copyright 2011 by Ninject Project Contributors</d:Copyright>
      <d:PackageHashAlgorithm>SHA512</d:PackageHashAlgorithm>
      <d:PackageHash>rqU4j0u3q0Do7bb5CKxClux4M0hquBe4mbhdRa/pN9HcxJMTOZRL2kd0SQQNGFeb54cZkGdZ+ZfsJTIMd6ibvg==</d:PackageHash>
      <d:PackageSize m:type="Edm.Int64">1268964</d:PackageSize>
      <d:Price m:type="Edm.Decimal">0</d:Price>
      <d:RequireLicenseAcceptance m:type="Edm.Boolean">true</d:RequireLicenseAcceptance>
      <d:IsLatestVersion m:type="Edm.Boolean">true</d:IsLatestVersion>
      <d:ReleaseNotes m:null="true"></d:ReleaseNotes>
      <d:Prerelease m:type="Edm.Boolean">false</d:Prerelease>
      <d:VersionRating m:type="Edm.Double">5</d:VersionRating>
      <d:VersionRatingsCount m:type="Edm.Int32">7</d:VersionRatingsCount>
      <d:VersionDownloadCount m:type="Edm.Int32">15316</d:VersionDownloadCount>
      <d:Created m:type="Edm.DateTime">2011-05-05T00:31:13.27</d:Created>
      <d:LastUpdated m:type="Edm.DateTime">2011-05-07T12:15:12.667</d:LastUpdated>
      <d:Published m:type="Edm.DateTime">2011-05-07T12:15:17.15</d:Published>
      <d:ExternalPackageUrl m:null="true"></d:ExternalPackageUrl>
      <d:ProjectUrl>http://www.ninject.org/</d:ProjectUrl>
      <d:LicenseUrl>https://github.com/ninject/ninject/raw/master/LICENSE.txt</d:LicenseUrl>
      <d:IconUrl>/Media/Default/Packages/Ninject/2.2.1.4/Ninject-Logo100.png</d:IconUrl>
      <d:Rating m:type="Edm.Double">4.8571428571428568</d:Rating>
      <d:RatingsCount m:type="Edm.Int32">14</d:RatingsCount>
      <d:DownloadCount m:type="Edm.Int32">26235</d:DownloadCount>
      <d:Categories m:null="true"></d:Categories>
      <d:Tags xml:space="preserve"> Ninject ioc di </d:Tags>
      <d:Dependencies></d:Dependencies>
      <d:ReportAbuseUrl>http://nuget.org/Package/ReportAbuse/Ninject/2.2.1.4</d:ReportAbuseUrl>
      <d:GalleryDetailsUrl>http://nuget.org/List/Packages/Ninject/2.2.1.4</d:GalleryDetailsUrl>
    </m:properties>
  </entry>
</feed>


text:
<?php
if(!file_exists("config.php"))
{
	header("location: ./install.php");
	die;
}

if (!empty($_GET["file"]))
{
	$f = $_GET["file"];

	$f = str_replace(".php","",$f);

	// remote file inclusion attempt fix
	if (strpos($f,".")!==false)
		die("+1 for you");

	$f = "demos/$f.php";

	if (!file_exists($f))
		die("+1 for you");

	$code = file_get_contents($f);

	// removed db settings
	$code = preg_replace("/mysql_connect(.*)/i","mysql_connect('localhost','user','pass');",$code);

	highlight_string($code);
	echo "
 ";
	die;
}
?>
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>PHP Grid Control Demos | www.phpgrid.org</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

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

          PHP Grid Control Demos

              www.phpgrid.org

Home

Demos

FAQ

Docs

Contact

	<?php
	function dirToArray($dir)
	{
		$result = array();
		$cdir = scandir($dir);
		foreach ($cdir as $key => $value)
		{
		  if (!in_array($value,array(".","..","temp")) && strpos($value,"_") === false)
		  {
			 if (is_dir($dir . DIRECTORY_SEPARATOR . $value))
			 {
				$result[$value] = dirToArray($dir . DIRECTORY_SEPARATOR . $value);
			 }
			 else
			 {
				$result[] = $value;
			 }
		  }
		}

		return $result;
	}
	$samples = dirToArray("demos");

	if (!isset($_GET["filter"]))
		$_GET["filter"] = "free";

	?>

					<?php
					foreach($samples as $k=>$v)
					{
						if (is_numeric($k)) continue;
						$folder = ucwords($k);

						$show = 0;
						foreach($v as $f)
						{
							if (!(filesize("demos/$k/$f") < 10))
								$show = 1;
						}

						if ($show == 0 && $_GET["filter"] == "free")
							continue;

						?>

						<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion_menu" href="#collapse<?php echo $k?>">
						  <?php echo $folder;?>

						<div id="collapse<?php echo $k?>" class="accordion-body collapse">

								<?php
								foreach($v as $f)
								{
									$fname = str_replace(".php","",$f);
									$fname = str_replace("-"," ",$fname);
									$fname = ucwords($fname);

									//file_put_contents("demos/$k/$f","");

									$ver = "";
									if (filesize("demos/$k/$f") < 10)
									{
										if ($_GET["filter"] == "free")
											continue;

										$url = "http://www.phpgrid.org/demo/demos/$k/$f";
										$fname .= " *";
										$ver .= "jQuery('#div_version').html('(*) Available in Licensed Version. Currently loaded from www.phpgrid.org');";
										$ver .= "jQuery('#span_version').show();";
									}
									else
									{
										$url = "demos/$k/$f";
										$ver .= "jQuery('#span_version').hide();";
									}

									echo " $fname
";
								}
								?>

						<?php
					}
					?>

			<select name="filter" style="width:177px" onchange="location.href='?filter='+this.value;">
		    	<option value="free" <? echo ($_GET["filter"] == "free")?"selected":"";?>>Filter: Free Features</option>
		    	<option value="all" <? echo ($_GET["filter"] == "all")?"selected":"";?>>Filter: All Features</option>
		    </select>

		  	* Advance features are available in Licensed Version.

		  		Get License Today!

Demo

Code

Technical Support

For technical support query, ask at our Support Center

© www.phpgrid.org 2010-<?php echo date("Y");?>


text:
'use strict';

class Individual {
    constructor(scene, config, row, col, rowOffset, colOffset, boxSize, color) {
        this.age = 0;
        this.config = config;
        this.maxAge = config.age;
        this.minEnergy = config.minEnergy;
        this.maxEnergy = config.maxEnergy;
        this.metabolism = config.metabolism;
        this.view = Math.round(Utils.gaussianRandom(config.meanView, config.stdView));
        this.cubeSize = config.cubeSize;
        this.energy = this.minEnergy + ((this.maxEnergy - this.minEnergy) / 2);
        this.reproduction = false;
        this.foodRate = config.foodRate;
        this.pollutionProduction = config.pollutionProduction;

        this.build3DObject(color);
        this.scene = scene;
        this.scene.add(this.element);
        this.element.translateX(row * boxSize + rowOffset);
        this.element.translateY(col * boxSize + colOffset);
        this.boxSize = boxSize;
        this.row = row;
        this.col = col;
        this.moved = false;
    }

    checkFoodRate() {
        let currentRate = (this.energy - this.minEnergy) / (this.maxEnergy - this.minEnergy);
        this.reproduction = currentRate > this.foodRate;
    }

    isDeath() {
        return this.age === this.maxAge || this.energy < this.minEnergy;
    }

    kill(grid) {
        this.scene.remove(this.element);
        grid[this.row][this.col].individual = undefined;
    }

    iterate(grid) {
        if(this.moved) {
            return;
        }

        if(this.isDeath()) {
            this.kill(grid);
            return;
        }

        this.checkFoodRate();
        let offset = this.move(grid);
        let i = offset[0], j = offset[1];
        let newRow = this.row + i, newCol = this.col + j;

        let rowCondition = 0 <= newRow && newRow < grid.length;
        let colCondition = 0 <= newCol && newCol < grid[0].length;

        if(rowCondition && colCondition && grid[this.row + i][this.col + j].individual === undefined) {
            let prevRow = this.row;
            let prevCol = this.col;
            let ind = grid[this.row][this.col].individual;
            this.row = newRow;
            this.col = newCol;
            grid[this.row][this.col].individual = ind;
            grid[prevRow][prevCol].individual = undefined;
            this.translate3DObject(i, j);
        }

        if(this.reproduction) {
            //this.reproduce(grid);
        } else {
            this.eat(grid);
        }

        this.energy -= this.metabolism;
        this.age++;
        this.moved = true;
    }

    reproduce(grid) {}

    eat(grid) {}

    move(grid) {
        return [0, 0];
    }

    build3DObject(color) {
        var cubeMaterial = new THREE.MeshLambertMaterial({
            color: color
        });

        this.element = new THREE.Mesh(new THREE.BoxGeometry(this.cubeSize, this.cubeSize, this.cubeSize), cubeMaterial);
    }

    translate3DObject(i, j) {
        //console.log(i, j, this.boxSize);
        this.element.translateX(i * this.boxSize);
        this.element.translateY(j * this.boxSize);
    }
}


text:
package codefights;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;

/**
 * misc.Solution for CodeFights weekly challenges
 * https://codefights.com/challenge/mMdsrajm7T9H87Noc/main
 *
 * TODO: check the list below
 * - Improve command solution by using adjacency matrices / list (avoid brute-force)
 * - Improve quick tests
 * - Clean up code
 * @author Nhan Nguyen.
 */
public class LabyrinthNavigation {

    public int labyrinthNavigation(String[] labyrinth, int[] start, int[] dest) {
        return new BFScout(labyrinth, start, dest).minimalSequence();
    }

    private static class BFScout {
        private static final int[] zero = {0, 0};
        private final int rowNum;
        private final int colNum;
        private final int rowDelta;
        private final int colDelta;
        private String[] matrix;
        private int[] start;
        private int[] dest;
        private Queue<String> bfsQueue = new LinkedList<>();

        private BFScout(String[] labyrinth, int[] start, int[] dest) {
            this.start = start;
            this.dest = dest;
            this.matrix = labyrinth;
            this.rowNum = matrix.length;
            this.colNum = matrix[0].length();
            this.rowDelta = dest[0] - start[0];
            this.colDelta = dest[1] - start[1];
        }

        private int minimalSequence() {
            bfsQueue.add("U");
            bfsQueue.add("L");
            bfsQueue.add("D");
            bfsQueue.add("R");
            while (!bfsQueue.isEmpty()) {
                String seq = bfsQueue.remove();
                if (testSeq(seq)) {
                    System.out.println(seq);
                    return seq.length();
                }
            }
            //timeout
            return -1;
        }

        private boolean testSeq(String seq) {
            Result rs = quickEval(seq);
            if (rs.isBlock()) {
                return false;
            }
            if (rs.isInvalid()) {
                generateSeq(seq);
                return false;
            }
            // run the cycle command once to check if it hit

            int[] pos = Arrays.copyOf(start, start.length);

            // run until hitting the boundaries or blocked cell
            int idx = 0;
            while ((0 <= pos[0] && pos[0] < rowNum) && (0 <= pos[1] && pos[1] < colNum)) {

                if (isBlocked(pos)) {
                    generateSeq(seq);
                    return false;
                }

                if (Arrays.equals(pos, dest)) {
                    return true;
                }

                move(String.valueOf(seq.charAt(idx)), pos);

                idx = (++idx == seq.length()) ? 0 : idx;
            }

            generateSeq(seq);
            return false;
        }

        private int[] move(String seq, int[] pos) {
            for (char i : seq.toCharArray()) {
                switch (i) {
                    case 'U':
                        pos[0]--;
                        break;
                    case 'D':
                        pos[0]++;
                        break;
                    case 'L':
                        pos[1]--;
                        break;
                    case 'R':
                        pos[1]++;
                        break;
                }
            }
            return pos;
        }

        private Result quickEval(String seq) {
            int[] pos = Arrays.copyOf(start, start.length);
            int[] cycle = cycleEval(seq);

            if (Math.abs(cycle[0]) >= matrix.length || Math.abs(cycle[1]) >= matrix[0].length()) {
                return Result.BLOCKED;
            }

            for (char c : seq.toCharArray()) {

                move(String.valueOf(c), pos);

                if (!((0 <= pos[0] && pos[0] < rowNum) && (0 <= pos[1] && pos[1] < colNum))) {
                    return Result.BLOCKED;
                }

                if (isBlocked(pos)) {
                    return Result.BLOCKED;
                }

                if (Arrays.equals(pos, dest)) {
                    return Result.OK;
                }
            }

            return !Arrays.equals(cycle, zero)
                    && !((rowDelta * cycle[0] <= 0) && (colDelta * cycle[1] <= 0)) ? Result.OK : Result.INVALID;
        }

        private boolean isBlocked(int[] location) {
            return matrix[location[0]].charAt(location[1]) == '*';
        }

        private int[] cycleEval(String seq) {
            int[] rs = {0, 0};
            return move(seq, rs);
        }

        private void generateSeq(String seq) {
            bfsQueue.add(seq.concat("U"));
            bfsQueue.add(seq.concat("L"));
            bfsQueue.add(seq.concat("R"));
            bfsQueue.add(seq.concat("D"));
        }

        private enum Result {
            OK,
            INVALID,
            BLOCKED;

            boolean isBlock() {
                return this == BLOCKED;
            }

            boolean isInvalid() {
                return this == INVALID;
            }
        }
    }
}


text:
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Html;
using Microsoft.Extensions.Localization;
using OrchardCore.ContentManagement;
using OrchardCore.DisplayManagement;
using OrchardCore.DisplayManagement.Descriptors;
using OrchardCore.DisplayManagement.Shapes;

namespace OrchardCore.Lucene
{
    public class SearchShapesTableProvider : IShapeTableProvider
    {
        public void Discover(ShapeTableBuilder builder)
        {
            builder.Describe("Search__Form")
                .OnDisplaying(context =>
                {
                    dynamic searchForm = context.Shape;
                });

            builder.Describe("Search__Results")
                .OnDisplaying(context =>
                {
                    dynamic searchResults = context.Shape;
                });
        }
    }

    public class SearchShapes : IShapeAttributeProvider
    {
        private readonly IStringLocalizer S;

        public SearchShapes(IStringLocalizer<SearchShapes> localizer)
        {
            S = localizer;
        }

        [Shape]
        public Task<IHtmlContent> SearchForm(Shape Shape, dynamic DisplayAsync, string Terms)
        {
            Shape.Metadata.Type = "Search__Form";
            return DisplayAsync(Shape);
        }

        [Shape]
        public Task<IHtmlContent> SearchResults(Shape Shape, dynamic DisplayAsync, IEnumerable<ContentItem> ContentItems)
        {
            Shape.Metadata.Type = "Search__Results";
            return DisplayAsync(Shape);
        }
    }
}


text:
<LINK REL="stylesheet" HREF="../static/styles.css">

<TITLE>ChannelGroup::get3DDistanceFilter</TITLE>

Firelight Technologies FMOD Studio API

ChannelGroup::get3DDistanceFilter

Retrieve the settings for the 3D distance filter properties for a Channel or Channel Group.

C++ Syntax

FMOD_RESULT ChannelGroup::get3DDistanceFilter(
  bool *custom,
  float *customLevel,
  float *centerFreq
);

C Syntax

FMOD_RESULT FMOD_ChannelGroup_Get3DDistanceFilter(
  FMOD_CHANNELGROUP *channelgroup,
  FMOD_BOOL *custom,
  float *customLevel,
  float *centerFreq
);

C# Syntax

RESULT ChannelGroup.get3DDistanceFilter(
  out bool custom,
  out float customLevel,
  out float centerFreq
);

Parameters

custom

Address of a variable to receive the enabled/disabled state of the FMOD distance rolloff calculation.  Default = false.

customLevel

Address of a variable to receive the manual user attenuation, where 1.0 = no attenuation and 0 = complete attenuation.  Default = 1.0.

centerFreq

Address of a variable to receive center frequency in hz for the high-pass filter used to simulate distance attenuation, from 10.0 to 22050.0.  Default = 1500.0.

Return Values

If the function succeeds then the return value is FMOD_OK.

If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.

See Also

ChannelControl::set3DDistanceFilter

Version 1.08.02 Built on Apr 14, 2016


text:
'use strict';

var SERVER_MATCH = /^([^:]+):\/\/(\w+:{0,1}\w*@)?(\{?[\w\.-]*\}?)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,
    PATH_MATCH = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/,
    DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
var $locationMinErr = minErr('$location');

/**
 * Encode path using encodeUriSegment, ignoring forward slashes
 *
 * @param {string} path Path to encode
 * @returns {string}
 */
function encodePath(path) {
  var segments = path.split('/'),
      i = segments.length;

  while (i--) {
    segments[i] = encodeUriSegment(segments[i]);
  }

  return segments.join('/');
}

function matchUrl(url, obj) {
  var match = SERVER_MATCH.exec(url);

  obj.$$protocol = match[1];
  obj.$$host = match[3];
  obj.$$port = int(match[5]) || DEFAULT_PORTS[match[1]] || null;
}

function matchAppUrl(url, obj) {
  var match = PATH_MATCH.exec(url);

  obj.$$path = decodeURIComponent(match[1]);
  obj.$$search = parseKeyValue(match[3]);
  obj.$$hash = decodeURIComponent(match[5] || '');

  // make sure path starts with '/';
  if (obj.$$path && obj.$$path.charAt(0) != '/') obj.$$path = '/' + obj.$$path;
}

function composeProtocolHostPort(protocol, host, port) {
  return protocol + '://' + host + (port == DEFAULT_PORTS[protocol] ? '' : ':' + port);
}

/**
 *
 * @param {string} begin
 * @param {string} whole
 * @param {string} otherwise
 * @returns {string} returns text from whole after begin or otherwise if it does not begin with expected string.
 */
function beginsWith(begin, whole, otherwise) {
  return whole.indexOf(begin) == 0 ? whole.substr(begin.length) : otherwise;
}

function stripHash(url) {
  var index = url.indexOf('#');
  return index == -1 ? url : url.substr(0, index);
}

function stripFile(url) {
  return url.substr(0, stripHash(url).lastIndexOf('/') + 1);
}

/* return the server only (scheme://host:port) */
function serverBase(url) {
  return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));
}

/**
 * LocationHtml5Url represents an url
 * This object is exposed as $location service when HTML5 mode is enabled and supported
 *
 * @constructor
 * @param {string} appBase application base URL
 * @param {string} basePrefix url path prefix
 */
function LocationHtml5Url(appBase, basePrefix) {
  this.$$html5 = true;
  basePrefix = basePrefix || '';
  var appBaseNoFile = stripFile(appBase);
  /**
   * Parse given html5 (regular) url string into properties
   * @param {string} newAbsoluteUrl HTML5 url
   * @private
   */
  this.$$parse = function(url) {
    var parsed = {}
    matchUrl(url, parsed);
    var pathUrl = beginsWith(appBaseNoFile, url);
    if (!isString(pathUrl)) {
      throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url, appBaseNoFile);
    }
    matchAppUrl(pathUrl, parsed);
    extend(this, parsed);
    if (!this.$$path) {
      this.$$path = '/';
    }

    this.$$compose();
  };

  /**
   * Compose url and update `absUrl` property
   * @private
   */
  this.$$compose = function() {
    var search = toKeyValue(this.$$search),
        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';

    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
    this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/'
  };

  this.$$rewrite = function(url) {
    var appUrl, prevAppUrl;

    if ( (appUrl = beginsWith(appBase, url)) !== undefined ) {
      prevAppUrl = appUrl;
      if ( (appUrl = beginsWith(basePrefix, appUrl)) !== undefined ) {
        return appBaseNoFile + (beginsWith('/', appUrl) || appUrl);
      } else {
        return appBase + prevAppUrl;
      }
    } else if ( (appUrl = beginsWith(appBaseNoFile, url)) !== undefined ) {
      return appBaseNoFile + appUrl;
    } else if (appBaseNoFile == url + '/') {
      return appBaseNoFile;
    }
  }
}

/**
 * LocationHashbangUrl represents url
 * This object is exposed as $location service when developer doesn't opt into html5 mode.
 * It also serves as the base class for html5 mode fallback on legacy browsers.
 *
 * @constructor
 * @param {string} appBase application base URL
 * @param {string} hashPrefix hashbang prefix
 */
function LocationHashbangUrl(appBase, hashPrefix) {
  var appBaseNoFile = stripFile(appBase);

  matchUrl(appBase, this);

  /**
   * Parse given hashbang url into properties
   * @param {string} url Hashbang url
   * @private
   */
  this.$$parse = function(url) {
    var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url);
    var withoutHashUrl = withoutBaseUrl.charAt(0) == '#'
        ? beginsWith(hashPrefix, withoutBaseUrl)
        : (this.$$html5)
          ? withoutBaseUrl
          : '';

    if (!isString(withoutHashUrl)) {
      throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url, hashPrefix);
    }
    matchAppUrl(withoutHashUrl, this);
    this.$$compose();
  };

  /**
   * Compose hashbang url and update `absUrl` property
   * @private
   */
  this.$$compose = function() {
    var search = toKeyValue(this.$$search),
        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';

    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
    this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');
  };

  this.$$rewrite = function(url) {
    if(stripHash(appBase) == stripHash(url)) {
      return url;
    }
  }
}

/**
 * LocationHashbangUrl represents url
 * This object is exposed as $location service when html5 history api is enabled but the browser
 * does not support it.
 *
 * @constructor
 * @param {string} appBase application base URL
 * @param {string} hashPrefix hashbang prefix
 */
function LocationHashbangInHtml5Url(appBase, hashPrefix) {
  this.$$html5 = true;
  LocationHashbangUrl.apply(this, arguments);

  var appBaseNoFile = stripFile(appBase);

  this.$$rewrite = function(url) {
    var appUrl;

    if ( appBase == stripHash(url) ) {
      return url;
    } else if ( (appUrl = beginsWith(appBaseNoFile, url)) ) {
      return appBase + hashPrefix + appUrl;
    } else if ( appBaseNoFile === url + '/') {
      return appBaseNoFile;
    }
  }
}

LocationHashbangInHtml5Url.prototype =
  LocationHashbangUrl.prototype =
  LocationHtml5Url.prototype = {

  /**
   * Are we in html5 mode?
   * @private
   */
  $$html5: false,

  /**
   * Has any change been replacing ?
   * @private
   */
  $$replace: false,

  /**
   * @ngdoc method
   * @name ng.$location#absUrl
   * @methodOf ng.$location
   *
   * @description
   * This method is getter only.
   *
   * Return full url representation with all segments encoded according to rules specified in
   * {@link http://www.ietf.org/rfc/rfc3986.txt RFC 3986}.
   *
   * @return {string} full url
   */
  absUrl: locationGetter('$$absUrl'),

  /**
   * @ngdoc method
   * @name ng.$location#url
   * @methodOf ng.$location
   *
   * @description
   * This method is getter / setter.
   *
   * Return url (e.g. `/path?a=b#hash`) when called without any parameter.
   *
   * Change path, search and hash, when called with parameter and return `$location`.
   *
   * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)
   * @param {string=} replace The path that will be changed
   * @return {string} url
   */
  url: function(url, replace) {
    if (isUndefined(url))
      return this.$$url;

    var match = PATH_MATCH.exec(url);
    if (match[1]) this.path(decodeURIComponent(match[1]));
    if (match[2] || match[1]) this.search(match[3] || '');
    this.hash(match[5] || '', replace);

    return this;
  },

  /**
   * @ngdoc method
   * @name ng.$location#protocol
   * @methodOf ng.$location
   *
   * @description
   * This method is getter only.
   *
   * Return protocol of current url.
   *
   * @return {string} protocol of current url
   */
  protocol: locationGetter('$$protocol'),

  /**
   * @ngdoc method
   * @name ng.$location#host
   * @methodOf ng.$location
   *
   * @description
   * This method is getter only.
   *
   * Return host of current url.
   *
   * @return {string} host of current url.
   */
  host: locationGetter('$$host'),

  /**
   * @ngdoc method
   * @name ng.$location#port
   * @methodOf ng.$location
   *
   * @description
   * This method is getter only.
   *
   * Return port of current url.
   *
   * @return {Number} port
   */
  port: locationGetter('$$port'),

  /**
   * @ngdoc method
   * @name ng.$location#path
   * @methodOf ng.$location
   *
   * @description
   * This method is getter / setter.
   *
   * Return path of current url when called without any parameter.
   *
   * Change path when called with parameter and return `$location`.
   *
   * Note: Path should always begin with forward slash (/), this method will add the forward slash
   * if it is missing.
   *
   * @param {string=} path New path
   * @return {string} path
   */
  path: locationGetterSetter('$$path', function(path) {
    return path.charAt(0) == '/' ? path : '/' + path;
  }),

  /**
   * @ngdoc method
   * @name ng.$location#search
   * @methodOf ng.$location
   *
   * @description
   * This method is getter / setter.
   *
   * Return search part (as object) of current url when called without any parameter.
   *
   * Change search part when called with parameter and return `$location`.
   *
   * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or hash object. Hash object
   *    may contain an array of values, which will be decoded as duplicates in the url.
   * @param {string=} paramValue If `search` is a string, then `paramValue` will override only a
   *    single search parameter. If the value is `null`, the parameter will be deleted.
   *
   * @return {string} search
   */
  search: function(search, paramValue) {
    switch (arguments.length) {
      case 0:
        return this.$$search;
      case 1:
        if (isString(search)) {
          this.$$search = parseKeyValue(search);
        } else if (isObject(search)) {
          this.$$search = search;
        } else {
          throw $locationMinErr('isrcharg', 'The first argument of the `$location#search()` call must be a string or an object.');
        }
        break;
      default:
        if (paramValue == undefined || paramValue == null) {
          delete this.$$search[search];
        } else {
          this.$$search[search] = paramValue;
        }
    }

    this.$$compose();
    return this;
  },

  /**
   * @ngdoc method
   * @name ng.$location#hash
   * @methodOf ng.$location
   *
   * @description
   * This method is getter / setter.
   *
   * Return hash fragment when called without any parameter.
   *
   * Change hash fragment when called with parameter and return `$location`.
   *
   * @param {string=} hash New hash fragment
   * @return {string} hash
   */
  hash: locationGetterSetter('$$hash', identity),

  /**
   * @ngdoc method
   * @name ng.$location#replace
   * @methodOf ng.$location
   *
   * @description
   * If called, all changes to $location during current `$digest` will be replacing current history
   * record, instead of adding new one.
   */
  replace: function() {
    this.$$replace = true;
    return this;
  }
};

function locationGetter(property) {
  return function() {
    return this[property];
  };
}

function locationGetterSetter(property, preprocess) {
  return function(value) {
    if (isUndefined(value))
      return this[property];

    this[property] = preprocess(value);
    this.$$compose();

    return this;
  };
}

/**
 * @ngdoc object
 * @name ng.$location
 *
 * @requires $browser
 * @requires $sniffer
 * @requires $rootElement
 *
 * @description
 * The $location service parses the URL in the browser address bar (based on the
 * {@link https://developer.mozilla.org/en/window.location window.location}) and makes the URL
 * available to your application. Changes to the URL in the address bar are reflected into
 * $location service and changes to $location are reflected into the browser address bar.
 *
 * **The $location service:**
 *
 * - Exposes the current URL in the browser address bar, so you can
 *   - Watch and observe the URL.
 *   - Change the URL.
 * - Synchronizes the URL with the browser when the user
 *   - Changes the address bar.
 *   - Clicks the back or forward button (or clicks a History link).
 *   - Clicks on a link.
 * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).
 *
 * For more information see {@link guide/dev_guide.services.$location Developer Guide: Angular
 * Services: Using $location}
 */

/**
 * @ngdoc object
 * @name ng.$locationProvider
 * @description
 * Use the `$locationProvider` to configure how the application deep linking paths are stored.
 */
function $LocationProvider(){
  var hashPrefix = '',
      html5Mode = false;

  /**
   * @ngdoc property
   * @name ng.$locationProvider#hashPrefix
   * @methodOf ng.$locationProvider
   * @description
   * @param {string=} prefix Prefix for hash part (containing path and search)
   * @returns {*} current value if used as getter or itself (chaining) if used as setter
   */
  this.hashPrefix = function(prefix) {
    if (isDefined(prefix)) {
      hashPrefix = prefix;
      return this;
    } else {
      return hashPrefix;
    }
  };

  /**
   * @ngdoc property
   * @name ng.$locationProvider#html5Mode
   * @methodOf ng.$locationProvider
   * @description
   * @param {boolean=} mode Use HTML5 strategy if available.
   * @returns {*} current value if used as getter or itself (chaining) if used as setter
   */
  this.html5Mode = function(mode) {
    if (isDefined(mode)) {
      html5Mode = mode;
      return this;
    } else {
      return html5Mode;
    }
  };

  this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement',
      function( $rootScope,   $browser,   $sniffer,   $rootElement) {
    var $location,
        LocationMode,
        baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''
        initialUrl = $browser.url(),
        appBase;

    if (html5Mode) {
      appBase = serverBase(initialUrl) + (baseHref || '/');
      LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;
    } else {
      appBase = stripHash(initialUrl);
      LocationMode = LocationHashbangUrl;
    }
    $location = new LocationMode(appBase, '#' + hashPrefix);
    $location.$$parse($location.$$rewrite(initialUrl));

    $rootElement.on('click', function(event) {
      // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)
      // currently we open nice url link and redirect then

      if (event.ctrlKey || event.metaKey || event.which == 2) return;

      var elm = jqLite(event.target);

      // traverse the DOM up to find first A tag
      while (lowercase(elm[0].nodeName) !== 'a') {
        // ignore rewriting if no A tag (reached root element, or no parent - removed from document)
        if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;
      }

      var absHref = elm.prop('href');
      var rewrittenUrl = $location.$$rewrite(absHref);

      if (absHref && !elm.attr('target') && rewrittenUrl && !event.isDefaultPrevented()) {
        event.preventDefault();
        if (rewrittenUrl != $browser.url()) {
          // update location manually
          $location.$$parse(rewrittenUrl);
          $rootScope.$apply();
          // hack to work around FF6 bug 684208 when scenario runner clicks on links
          window.angular['ff-684208-preventDefault'] = true;
        }
      }
    });

    // rewrite hashbang url <> html5 url
    if ($location.absUrl() != initialUrl) {
      $browser.url($location.absUrl(), true);
    }

    // update $location when $browser url changes
    $browser.onUrlChange(function(newUrl) {
      if ($location.absUrl() != newUrl) {
        if ($rootScope.$broadcast('$locationChangeStart', newUrl, $location.absUrl()).defaultPrevented) {
          $browser.url($location.absUrl());
          return;
        }
        $rootScope.$evalAsync(function() {
          var oldUrl = $location.absUrl();

          $location.$$parse(newUrl);
          afterLocationChange(oldUrl);
        });
        if (!$rootScope.$$phase) $rootScope.$digest();
      }
    });

    // update browser
    var changeCounter = 0;
    $rootScope.$watch(function $locationWatch() {
      var oldUrl = $browser.url();
      var currentReplace = $location.$$replace;

      if (!changeCounter || oldUrl != $location.absUrl()) {
        changeCounter++;
        $rootScope.$evalAsync(function() {
          if ($rootScope.$broadcast('$locationChangeStart', $location.absUrl(), oldUrl).
              defaultPrevented) {
            $location.$$parse(oldUrl);
          } else {
            $browser.url($location.absUrl(), currentReplace);
            afterLocationChange(oldUrl);
          }
        });
      }
      $location.$$replace = false;

      return changeCounter;
    });

    return $location;

    function afterLocationChange(oldUrl) {
      $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl);
    }
}];
}


text:
"""
implementations of debugging commands to execute on a YubiHSM

"""
# Copyright (c) 2011, Yubico AB
# All rights reserved.

import struct

__all__ = [
    # constants
    # functions
    # classes
    'YHSM_Cmd_Monitor_Exit',
]

import pyhsm.defines
from pyhsm.cmd import YHSM_Cmd

class YHSM_Cmd_Monitor_Exit(YHSM_Cmd):
    """
    Send magics to stick in debug mode, and get it to exit to configuration mode again.
    """
    def __init__(self, stick, payload=''):
        #define YHSM_MONITOR_EXIT        0x7f    // Exit to monitor (no response sent)
        #define YHSM_MONITOR_EXIT_MAGIC  0xbaadbeef
        #typedef struct {
        #  uint32_t magic;                     // Magic number for trigger
        #  uint32_t magicInv;                  // 1st complement of magic
        #} YHSM_MONITOR_EXIT_REQ;

        packed = struct.pack('<II', 0xbaadbeef, 0xffffffff - 0xbaadbeef)
        YHSM_Cmd.__init__(self, stick, pyhsm.defines.YSM_MONITOR_EXIT, packed)


text:
package org.apache.phoenix.end2end.index;

import org.junit.Test;

//TODO: re-enable once PHOENIX-4273 is fixed
public abstract class MutableIndexSplitForwardScanIT extends MutableIndexSplitIT {

    public MutableIndexSplitForwardScanIT(boolean localIndex, boolean multiTenant) {
        super(localIndex, multiTenant);
    }

    @Test
    public void testSplitDuringIndexScan() throws Exception {
        testSplitDuringIndexScan(false);
    }

}


text:
<registry>
    <record name='plone.displayed_types' interface='Products.CMFPlone.interfaces.controlpanel.INavigationSchema' field='displayed_types'>
        <value purge='false'>
            <element>jpl.mcl.site.knowledge.participatingsitefolder</element>
            <element>jpl.mcl.site.knowledge.groupfolder</element>
            <element>jpl.mcl.site.sciencedata.sciencedatafolder</element>
        </value>
    </record>
</registry>


text:
package com.ibm.mobilefirst.mobileedge.connectors.BLE;

/**
 * Created by valentid on 04/08/2016.
 */
public interface BLEFilter{
    boolean filter(BLEDevice.ScannedDevice scanRecord);
}


text:
require 'bundler/setup'
require_relative './build_helper'

RSpec.configure do |config|
  config.before(:all) do
    BuildHelper.build
  end
end

require File.expand_path('./lib/tinyforth')


text:
package 'apache2' do
  package_name node['apache']['package']
  default_release node['apache']['default_release'] unless node['apache']['default_release'].nil?
end

%w(sites-available sites-enabled mods-available mods-enabled conf-available conf-enabled).each do |dir|
  directory "#{node['apache']['dir']}/#{dir}" do
    mode '0755'
    owner 'root'
    group node['apache']['root_group']
  end
end

%w(default default.conf 000-default 000-default.conf).each do |site|
  link "#{node['apache']['dir']}/sites-enabled/#{site}" do
    action :delete
    not_if { site == "#{node['apache']['default_site_name']}.conf" && node['apache']['default_site_enabled'] }
  end

  file "#{node['apache']['dir']}/sites-available/#{site}" do
    action :delete
    backup false
    not_if { site == "#{node['apache']['default_site_name']}.conf" && node['apache']['default_site_enabled'] }
  end
end

directory "#{node['apache']['dir']}/conf.d" do
  action :delete
  recursive true
end

directory node['apache']['log_dir'] do
  mode '0755'
  recursive true
end

# perl is needed for the a2* scripts
package node['apache']['perl_pkg']

%w(a2ensite a2dissite a2enmod a2dismod a2enconf a2disconf).each do |modscript|
  link "/usr/sbin/#{modscript}" do
    action :delete
    only_if { ::File.symlink?("/usr/sbin/#{modscript}") }
  end

  template "/usr/sbin/#{modscript}" do
    source "#{modscript}.erb"
    mode '0700'
    owner 'root'
    group node['apache']['root_group']
    action :create
  end
end

unless platform_family?('debian')
  cookbook_file '/usr/local/bin/apache2_module_conf_generate.pl' do
    source 'apache2_module_conf_generate.pl'
    mode '0755'
    owner 'root'
    group node['apache']['root_group']
  end

  execute 'generate-module-list' do
    command "/usr/local/bin/apache2_module_conf_generate.pl #{node['apache']['lib_dir']} #{node['apache']['dir']}/mods-available"
    action :nothing
  end

  # enable mod_deflate for consistency across distributions
  include_recipe 'apache2::mod_deflate'
end

if platform_family?('freebsd')

  directory "#{node['apache']['dir']}/Includes" do
    action :delete
    recursive true
  end

  directory "#{node['apache']['dir']}/extra" do
    action :delete
    recursive true
  end
end

if platform_family?('suse')

  directory "#{node['apache']['dir']}/vhosts.d" do
    action :delete
    recursive true
  end

  %w(charset.conv default-vhost.conf default-server.conf default-vhost-ssl.conf errors.conf listen.conf mime.types mod_autoindex-defaults.conf mod_info.conf mod_log_config.conf mod_status.conf mod_userdir.conf mod_usertrack.conf uid.conf).each do |file|
    file "#{node['apache']['dir']}/#{file}" do
      action :delete
      backup false
    end
  end
end

%W(
  #{node['apache']['dir']}/ssl
  #{node['apache']['cache_dir']}
).each do |path|
  directory path do
    mode '0755'
    owner 'root'
    group node['apache']['root_group']
  end
end

directory node['apache']['lock_dir'] do
  mode '0755'
  if node['platform_family'] == 'debian' && node['apache']['version'] == '2.2'
    owner node['apache']['user']
  else
    owner 'root'
  end
  group node['apache']['root_group']
end

# Set the preferred execution binary - prefork or worker
template "/etc/sysconfig/#{node['apache']['package']}" do
  source 'etc-sysconfig-httpd.erb'
  owner 'root'
  group node['apache']['root_group']
  mode '0644'
  notifies :restart, 'service[apache2]', :delayed
  only_if  { platform_family?('rhel', 'fedora', 'suse') }
end

template "#{node['apache']['dir']}/envvars" do
  source 'envvars.erb'
  owner 'root'
  group node['apache']['root_group']
  mode '0644'
  notifies :reload, 'service[apache2]', :delayed
  only_if  { platform_family?('debian') }
end

template 'apache2.conf' do
  if platform_family?('rhel', 'fedora', 'arch', 'freebsd')
    path "#{node['apache']['conf_dir']}/httpd.conf"
  elsif platform_family?('debian')
    path "#{node['apache']['conf_dir']}/apache2.conf"
  elsif platform_family?('suse')
    path "#{node['apache']['conf_dir']}/httpd.conf"
  end
  action :create
  source 'apache2.conf.erb'
  owner 'root'
  group node['apache']['root_group']
  mode '0644'
  notifies :reload, 'service[apache2]', :delayed
end

%w(security charset).each do |conf|
  apache_conf conf do
    enable true
  end
end

apache_conf 'ports' do
  enable false
  conf_path node['apache']['dir']
end

if node['apache']['version'] == '2.4'
  if node['apache']['mpm_support'].include?(node['apache']['mpm'])
    include_recipe "apache2::mpm_#{node['apache']['mpm']}"
  else
    Chef::Log.warn("apache2: #{node['apache']['mpm']} module is not supported and must be handled separately!")
  end
end

node['apache']['default_modules'].each do |mod|
  module_recipe_name = mod =~ /^mod_/ ? mod : "mod_#{mod}"
  include_recipe "apache2::#{module_recipe_name}"
end

if node['apache']['default_site_enabled']
  web_app node['apache']['default_site_name'] do
    template 'default-site.conf.erb'
    enable node['apache']['default_site_enabled']
  end
end

apache_service_name = node['apache']['service_name']

service 'apache2' do
  service_name apache_service_name
  case node['platform_family']
  when 'rhel'
    restart_command "/sbin/service #{apache_service_name} restart && sleep 1" if node['apache']['version'] == '2.2'
    reload_command "/sbin/service #{apache_service_name} graceful"
  when 'debian'
    provider Chef::Provider::Service::Debian
  when 'arch'
    service_name apache_service_name
  end
  supports [:start, :restart, :reload, :status]
  action [:enable, :start]
  only_if "#{node['apache']['binary']} -t", :environment => { 'APACHE_LOG_DIR' => node['apache']['log_dir'] }, :timeout => 10
end


text:
<?php

namespace PHPCI\Service;

use PHPCI\Model\User;
use PHPCI\Store\UserStore;

class UserService
{
    /**
     * @var \PHPCI\Store\UserStore
     */
    protected $store;

    /**
     * @param UserStore $store
     */
    public function __construct(UserStore $store)
    {
        $this->store = $store;
    }

    public function createUser($name, $emailAddress, $password, $isAdmin = false)
    {
        $user = new User();
        $user->setName($name);
        $user->setEmail($emailAddress);
        $user->setHash(password_hash($password, PASSWORD_DEFAULT));
        $user->setIsAdmin(($isAdmin ? 1 : 0));

        return $this->store->save($user);
    }

    public function updateUser(User $user, $name, $emailAddress, $password = null, $isAdmin = null)
    {
        $user->setName($name);
        $user->setEmail($emailAddress);

        if (!empty($password)) {
            $user->setHash(password_hash($password, PASSWORD_DEFAULT));
        }

        if (!is_null($isAdmin)) {
            $user->setIsAdmin(($isAdmin ? 1 : 0));
        }

        return $this->store->save($user);
    }

    public function deleteUser(User $user)
    {
        return $this->store->delete($user);
    }
}


text:
import logging
import httplib
from datetime import datetime
import calendar

import httplib2

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("eg_pull")

def parse_datetime(str) :
  if str == None :
    return None
  try :
    return datetime.strptime(str, "%Y-%m-%d %H:%M:%S")
  except ValueError :
    try :
      return datetime.strptime(str, "%Y-%m-%dT%H:%M:%S")
    except ValueError :
      return datetime.strptime(str, "%Y-%m-%d")
def get_ts(dt):
    return calendar.timegm(dt.utctimetuple())

#
# basic fetch implementation of http://egauge.net/docs/egauge-xml-api.pdf
#
def egauge_fetch_data(egauge_url, from_time, to_time, username=None, password=None, seconds=False):
  """
  curl -v --digest  -uuser
  'http://egauge2592.egaug.es/cgi-bin/egauge-show?f=1337716679&m&C'

  params
  f: from unix timestamp
  t: to unix tsimestmp
  seconds: fetch 1second granularity data, default is 1 minute
  egauge needs digest authentication
  """
  # f - The timestamp of the first row to be returned
  # t - The timestamp of the last row to be returned
  # The data is in decending order

  gw_url = "http://"+egauge_url+"/cgi-bin/egauge-show"

  if from_time and to_time:
    params = "?f=" + str(to_time) + "&t=" + str(from_time) + "&C"
    if seconds:
      params += "&S"
    else:
      params += "&m"
  else:
    logger.info("-f and -t both are mandatory.")
    return None, None

  logger.info( "Fetching :%s%s "% (gw_url, params))

  # If the DB has value 'NULL' then that maps to 'None' in python object.
  # It gives exception for httplib API's, so set it to "" empty string if they are 'None'
  if username == None:
    username = "owner"
  if password == None:
    password = "default"

  try:
    req = httplib2.Http(timeout=15)
    req.add_credentials(username, password)   # Digest Authentication
    response, content = req.request (gw_url + params, headers={'Connection': 'Keep-Alive', 'accept-encoding': 'gzip'})
    if response['status'] == '401':
      logger.info("Unauthorized request!")
    elif response['status'] == '400':
      logger.info( "Bad Request!")
    elif response['status'] == '500':
      logger.info("Internal Error!")
    elif response['status'] == '408':
      logger.info("Request timeout!")
    elif response['status'] == '404':
      logger.info("device not found. Probably it is not up")

    if response['status'] != '200':
      return None, None
  except httplib.IncompleteRead as e:
    raise(e)
  except Exception as e:
    print e
    return None, None
  return response, content

#
# sample run
#
# python ./egauge_pull_lib.py egauge4077.egaug.es 2012-12-25 2012-12-26
#
if __name__ == "__main__":
    from optparse import OptionParser
    parser = OptionParser(usage="usage: %prog device_url from_date to_date [options]")
    parser.add_option("--seconds", default=False, action="store_true",
                    help="will try to fetch seconds data if specified")
    parser.add_option( "--username")
    parser.add_option( "--password")
    (options, args) = parser.parse_args()

    if len(args)<3:
        parser.print_help()
        exit(2)

    device_url = args[0]
    from_str = args[1]
    to_str = args[2]

    from_ts = get_ts(parse_datetime(from_str))
    to_ts = get_ts(parse_datetime(to_str))

    #status, data = egauge_fetch_data('egauge4077.egaug.es',
    #            1356512726,1356612726)

    status, data = egauge_fetch_data(device_url, from_ts, to_ts,
            username=options.username, password=options.password,
            seconds=options.seconds)

    print data


text:
package no.ntnu.okse.core.messaging;

import no.ntnu.okse.core.subscription.Publisher;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import java.time.LocalDateTime;
import java.time.temporal.TemporalUnit;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.concurrent.TimeUnit;

import static org.testng.Assert.*;

public class MessageTest {

    Message m;
    Publisher p;

    @BeforeMethod
    public void setUp() throws Exception {
        p = new Publisher("test/sub", "0.0.0.0", 8080, "Test");
        m = new Message("test", "test/sub", p, "Test");
    }

    @AfterMethod
    public void tearDown() throws Exception {
        m = null;
        p = null;
    }

    @Test
    public void testGetMessageID() throws Exception {
        HashSet<String> ids = new HashSet<>();
        assertNotNull(m.getMessageID());
        // Hex regex
        assertTrue(m.getMessageID().matches("-?[0-9a-fA-F]+"));
        // Do a mass test and check for colliding ID's
        for (int i = 0; i < 1337; i++) {
            setUp();
            ids.add(m.getMessageID());
            tearDown();
        }
        assertEquals(ids.size(), 1337);
    }

    @Test
    public void testGetMessage() throws Exception {
        assertNotNull(m.getMessage());
        assertEquals(m.getMessage(), "test");
    }

    @Test
    public void testGetTopic() throws Exception {
        assertEquals(m.getTopic(), "test/sub");
    }

    @Test
    public void testGetPublisher() throws Exception {
        assertNotNull(m.getPublisher());
        assertEquals(m.getPublisher().getTopic(), "test/sub");
        assertEquals(m.getPublisher().getOriginProtocol(), "Test");
    }

    @Test
    public void testMessageSentFromRegisteredPublisher() throws Exception {
        assertNotNull(m.getPublisher());
        assertTrue(m.messageSentFromRegisteredPublisher());
        p = null;
        m = new Message("test", "test/sub", p, "Test");
        assertNull(m.getPublisher());
        assertFalse(m.messageSentFromRegisteredPublisher());
    }

    @Test
    public void testSetOriginProtocol() throws Exception {
        m.setOriginProtocol("OKSE");
        assertEquals(m.getOriginProtocol(), "OKSE");
    }

    @Test
    public void testGetOriginProtocol() throws Exception {
        assertEquals(m.getOriginProtocol(), "Test");
    }

    @Test
    public void testGetCreationTime() throws Exception {
        assertTrue(m.getCreationTime() instanceof LocalDateTime);
        assertTrue(m.getCreationTime().isBefore(LocalDateTime.now().plusSeconds(1)));
    }

    @Test
    public void testIsProcessed() throws Exception {
        assertFalse(m.isProcessed());
    }

    @Test
    public void testSetProcessed() throws Exception {
        m.setProcessed();
        assertTrue(m.isProcessed());
    }

    @Test
    public void testSetAttribute() throws Exception {
        m.setAttribute("flag", "value");
        assertEquals(m.getAttribute("flag"), "value");
        assertNull(m.getAttribute("FLAG"));
    }

    @Test
    public void testGetAttribute() throws Exception {
        assertNull(m.getAttribute("flag"));
        m.setAttribute("flag", "value");
        assertEquals(m.getAttribute("flag"), "value");
    }

    @Test
    public void testGetCompletionTime() throws Exception {
        LocalDateTime completed = m.setProcessed();
        assertTrue(completed.equals(m.getCompletionTime()));
    }

    @Test
    public void testSetSystemMessage() throws Exception {
        assertFalse(m.isSystemMessage());
        m.setSystemMessage(true);
        assertTrue(m.isSystemMessage());
    }

    @Test
    public void testIsSystemMessage() throws Exception {
        assertFalse(m.isSystemMessage());
        m.setSystemMessage(true);
        assertTrue(m.isSystemMessage());
    }

    @Test
    public void testToString() throws Exception {
        assertNotNull(m.toString());
        assertTrue(m.toString() instanceof String);
    }
}


text:
module Gitlab
  module Metrics
    module Methods
      extend ActiveSupport::Concern

      included do
        @@_metric_provider_mutex ||= Mutex.new
        @@_metrics_provider_cache = {}
      end

      class_methods do
        def reload_metric!(name)
          @@_metrics_provider_cache.delete(name)
        end

        private

        def define_metric(type, name, opts = {}, &block)
          if respond_to?(name)
            raise ArgumentError, "method #{name} already exists"
          end

          define_singleton_method(name) do
            # inlining fetch_metric method to avoid method call overhead when instrumenting hot spots
            @@_metrics_provider_cache[name] || init_metric(type, name, opts, &block)
          end
        end

        def fetch_metric(type, name, opts = {}, &block)
          @@_metrics_provider_cache[name] || init_metric(type, name, opts, &block)
        end

        def init_metric(type, name, opts = {}, &block)
          options = ::Gitlab::Metrics::Methods::MetricOptions.new(opts)
          options.evaluate(&block)

          if disabled_by_feature(options)
            synchronized_cache_fill(name) { NullMetric.instance }
          else
            synchronized_cache_fill(name) { build_metric!(type, name, options) }
          end
        end

        def synchronized_cache_fill(key)
          @@_metric_provider_mutex.synchronize do
            @@_metrics_provider_cache[key] ||= yield
          end
        end

        def disabled_by_feature(options)
          options.with_feature && !::Feature.enabled?(options.with_feature)
        end

        def build_metric!(type, name, options)
          case type
          when :gauge
            ::Gitlab::Metrics.gauge(name, options.docstring, options.base_labels, options.multiprocess_mode)
          when :counter
            ::Gitlab::Metrics.counter(name, options.docstring, options.base_labels)
          when :histogram
            ::Gitlab::Metrics.histogram(name, options.docstring, options.base_labels, options.buckets)
          when :summary
            raise NotImplementedError, "summary metrics are not currently supported"
          else
            raise ArgumentError, "uknown metric type #{type}"
          end
        end
      end
    end
  end
end