text:
(function() {
  function foo(x) {
    x = Math.floor(x);
    x = Math.max(x, -0);
    return 1 / Math.abs(x);
  }

  %PrepareFunctionForOptimization(foo);
  assertEquals(Infinity, foo(-0));
  assertEquals(Infinity, foo(-0));
  %OptimizeFunctionOnNextCall(foo);
  assertEquals(Infinity, foo(-0));
})();

// Test that NumberAbs properly passes the kIdentifyZeros truncation
// for Signed32 \/ MinusZero inputs.
(function() {
  function foo(x) {
    return Math.abs(x * -2);
  }

  %PrepareFunctionForOptimization(foo);
  assertEquals(2, foo(-1));
  assertEquals(4, foo(-2));
  %OptimizeFunctionOnNextCall(foo);
  assertEquals(2, foo(-1));
  assertEquals(4, foo(-2));
  assertOptimized(foo);
  // Now `foo` should stay optimized even if `x * -2` would produce `-0`.
  assertEquals(0, foo(0));
  assertOptimized(foo);
})();

// Test that NumberAbs properly passes the kIdentifyZeros truncation
// for Unsigned32 \/ MinusZero inputs.
(function() {
  function foo(x) {
    x = x | 0;
    return Math.abs(Math.max(x * -2, 0));
  }

  %PrepareFunctionForOptimization(foo);
  assertEquals(2, foo(-1));
  assertEquals(4, foo(-2));
  %OptimizeFunctionOnNextCall(foo);
  assertEquals(2, foo(-1));
  assertEquals(4, foo(-2));
  assertOptimized(foo);
  // Now `foo` should stay optimized even if `x * -2` would produce `-0`.
  assertEquals(0, foo(0));
  assertOptimized(foo);
})();

// Test that NumberAbs properly passes the kIdentifyZeros truncation
// for OrderedNumber inputs.
(function() {
  function foo(x) {
    x = x | 0;
    return Math.abs(Math.min(x * -2, 2 ** 32));
  }

  %PrepareFunctionForOptimization(foo);
  assertEquals(2, foo(-1));
  assertEquals(4, foo(-2));
  %OptimizeFunctionOnNextCall(foo);
  assertEquals(2, foo(-1));
  assertEquals(4, foo(-2));
  assertOptimized(foo);
  // Now `foo` should stay optimized even if `x * -2` would produce `-0`.
  assertEquals(0, foo(0));
  assertOptimized(foo);
})();


text:
This package contains the main classes to run the Design Explorer tool in RapidSmith.
See
    Technical Report and Documentation for more information.

redpajama_set_name: RedPajamaGithub


text:
// Allows the use of cout without having to state the class we are using
using namespace std;

int main()
{
	// Get the input file
	ifstream inputFile("stapler.in");

	// Will store the number of cases based on the input file
	int numberOfCases;

	// Store the number of cases that the input file has
	inputFile >> numberOfCases;

	// Run through each input case
	for(int i = 1; i <= numberOfCases; i++)
	{
		// Print the title for the input case
		cout << "Battle #" << i << ":\n";

		// This will store the number of piles of paper in the input case
		int numberOfPiles;

		// Store the number of piles
		inputFile >> numberOfPiles;

		// Will store the sum of the piles of paper
		int total = 0;

		// Run through all the piles
		for(int j = 0; j < numberOfPiles; j++)
		{
			// Stores the number of pages for this pile
			int numberOfPages;

			// Get the number of pages
			inputFile >> numberOfPages;

			// Add this to the total number of pages
			total += numberOfPages;
		}

		// Print the number of pages
		cout << "The Stapler must face " << total << " pages\n";

		// Determine if the stapler will be able to save the day
		if(total < 31)
		{
			cout << "The Stapler saves the day!\n\n";
		}
		else
		{
			cout << "Foiled again!\n\n";
		}
	}

	return 0;
}


text:
//
//  TCTVShowJSBridge.m
//  Technicolor
//
//  Created by Steve Streza on 12/13/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "TCTVShowJSBridge.h"
#import "TCCoreUtils.h"

#import "TCTVShow.h"

#import "TCTVShowJSObject.h"

@implementation TCTVShowJSBridge

+ (NSArray *) objectPropertyNames{ // for KVO.  Note that property access goes through KVO
//	NSLog(@"objectPropertyNames");
    return [NSArray arrayWithObjects: @"allShows",@"allEpisodes",nil];
}

+ (BOOL) canWriteProperty: (NSString *) propertyName{
	return NO;
}

+ (NSArray *) objectFunctionNames{
//	NSLog(@"ObjectFunctionNames");
	return [NSArray arrayWithObjects: @"createShow",@"createEpisode", @"showNamed",@"fileForPath",nil];
}

+ (NSString *) constructorName{
//	NSLog(@"constructorName");
	return @"TVShowBridge";
}

- (void) awakeFromConstructor: (NSArray *) arguments{
	storeContext = [[TCCoreUtils newStoreContext] retain];
}

-(void)dealloc{
	[storeContext commitEditing];
	[storeContext release];

	[super dealloc];
}

#pragma mark Accessors

-(NSArray *)allShows{
	NSArray *allShows = [TCTVShow allShows:NO];
	NSMutableArray *showSet = [NSMutableArray arrayWithCapacity:allShows.count];
	for(TCTVShow *show in allShows){
		TCTVShowJSObject *object = [self bridgeObject:[TCTVShowJSObject class] withConstructorArguments:nil];
		[object _setShow:show];

		[showSet addObject:object];
	}
	return showSet;
}

-(NSArray *)allEpisodes{
	return [NSArray arrayWithObjects:@"Woo!",nil];
}

#pragma mark JavaScript call handlers

- (id) jsxobjcCallCreateShow: (NSArray *) args{
	NSLog(@"Whee!");
	return nil;
}

- (id) jsxobjcCallCreateEpisode: (NSArray *) args{
	NSLog(@"Barf!");
	return nil;
}

-(id) jsxobjcCallFileForPath: (NSArray *)args{
	switch (args.count) {
		case 0:
			return nil;
			break;
		case 1:
			return [self videoFileObjectForPath:[args objectAtIndex:0]];
			break;
		default:
			return nil;
			break;
	}
}

-(TCVideoFileJSObject *)videoFileObjectForPath:(NSString *)path{
	TCVideoFile *videoFile = [TCVideoFile videoFileForPath:path];

	TCVideoFileJSObject *vfObject = [self bridgeObject:[TCVideoFileJSObject class]
							  withConstructorArguments:nil];
	[vfObject _setVideoFile:videoFile];

	return vfObject;
}

-(id) jsxobjcCallShowNamed: (NSArray *)args{
	TCTVShow *show = [TCTVShow showWithName:[args objectAtIndex:0] inContext:storeContext];

	TCTVShowJSObject *object = [self bridgeObject:[TCTVShowJSObject class] withConstructorArguments:nil];
	[object _setShow:show];

	return object;
/*
	NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
						  [show valueForKey:@"showName"], @"showName",
						  [show valueForKey:@"numberOfSeasons"], @"numberOfSeasons",
						  nil];

	return dict;
 */
}

@end


text:
Third Party Dependencies
========================

This document is about dependencies that are required to build applications
using `libtock-rs`. These dependencies are not contained in the libtock-rs
repository, but are used by libtock-rs when libtock-rs is used as a dependency
of an application. Dependencies required to run `libtock-rs`' tests (such as
`make`) are outside the scope of this document.

## Unaudited Required Dependencies

`libtock-rs` has the following required build dependencies, none of which are
currently audited:

* The Rust toolchain, including
  [`cargo`](https://github.com/rust-lang/cargo),
  [`rustc`](https://github.com/rust-lang/rust/tree/master/src/rustc), and
  [`libcore`](https://github.com/rust-lang/rust/tree/master/src/libcore). The
  specific toolchain version used is specified by the `rust-toolchain` file at
  the root of the repository.
* [`syn`](https://crates.io/crates/syn), pulled in by `libtock_codegen`.
* [`quote`](https://crates.io/crates/quote), pulled in by `libtock_codegen`.
* [`proc-macro2`](https://crates.io/crates/proc-macro2), pulled in by
  `libtock_codegen`.

## Avoiding Optional Dependencies

To avoid pulling in optional dependencies, users should use `libtock_core`
instead of `libtock`. `libtock_core` is in the `core/` directory.


text:
class RTTIRegisteredControl;
class SectionContainer;
class Command;

using namespace Poly;

// Displays all properties of given object.
// If any property has its own properties then SectionContainer is created.
class RTTIInspectorWidget : public PolyWidget
{
	Q_OBJECT

public:
	RTTIInspectorWidget(QWidget* parent);

	// Sets current object, if debug flag is true then all properties are displayed and can be edited by
	// user even when property is not serialized.
	void SetObject(RTTIBase* obj, bool debug);

	// Update inspector view from object.
	void UpdateInspector();

	// Destroys everything and creates again
	void ReloadInspector(bool debug = false);

signals:
	void ControlObjectUpdated(Command* c);

private:
	void ControlObjectUpdatedSlot(Command* c);

	// Add SectionContainer.
	SectionContainer* AddChild(RTTIBase* obj, const RTTI::Property& prop, bool debug);

	// Add control.
	void AddItem(QGridLayout* parent, int row, void* ptr, const RTTI::Property& prop);

	RTTIBase* Object;

	QGridLayout* Layout;

	Dynarray<RTTIRegisteredControl*> Fields;
	Dynarray<QLabel*> Labels;
	Dynarray<SectionContainer*> Sections;
};


text:
[![Build Status](https://travis-ci.org/matt-major/do-wrapper.svg?branch=master)](https://travis-ci.org/matt-major/do-wrapper)
[![Dependencies](https://david-dm.org/matt-major/do-wrapper.svg)](https://www.npmjs.com/package/do-wrapper)
[![Downloads](https://img.shields.io/npm/dm/do-wrapper.svg)](https://www.npmjs.com/package/do-wrapper)

### Install

```do-wrapper``` is available on ```npm``` and as such, can be installed through ```npm``` with ease.

To install ```do-wrapper``` and add it to your ```package.json``` file, use the following command:

```sh
$ npm install --save do-wrapper
```

### Documentation

All methods are documented with jsDocs and can be built in to web-page based documentation by running the command below.

```sh
$ npm run doc
```

### Usage

In order to use ```do-wrapper``` you will need to generate an API key on the DigitalOcean website. Once you have this, add the library to your project with the following command:

```sh
$ npm install --save do-wrapper
```

Once installed you need to instantiate a new copy of ```do-wrapper``` in your application, like so:

```js
var DigitalOcean = require('do-wrapper'),
    api = new DigitalOcean('[api_key]', [per_page_size]);
```
*Note: replace [api_key] and [per_page_size] with your API key and desired page size.*

You can now test that your API key is correct and that everything is working by checking for your account information:
```js
api.account(function (err, res, body) {
  console.log(body);
});
```

If you get back a response similar to the below, success!

```json
{
  "account": {
    "droplet_limit": 5,
    "email": "do-wrapper@do-wrapper.com",
    "uuid": "57e96b88ed1511e490ec1681e6b88ec1",
    "email_verified": true
  }
}
```

*Note: I've replaced my actual information with some dummy values...*

### Issues

Please raise an issue on GitHub with as much information as possible and the steps to replicate (if possible).

### License
The MIT License (MIT)

Copyright (c) 2015 Matt Major

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


text:
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;

/**
 * Pharmacie
 *
 * @ORM\Table(name="pharmacie")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\PharmacieRepository")
 */
class Pharmacie
{
    public function __construct()
    {
        $this->created = new \DateTime();
    }

    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=255)
     */
    private $nom;

    /**
     * @var string
     *
     * @ORM\Column(name="adresse", type="string", length=255)
     */
    private $adresse;

    /**
     * @var string
     *
     * @ORM\Column(name="ville", type="string", length=255)
     */
    private $ville;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created", type="datetime")
     */
    private $created;

    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PharmacieGroupe")
     * @ORM\JoinColumn(name="groupe_id", referencedColumnName="id")
     */
    private $pharmacieGroupe;

    /**
     * @ORM\OneToOne(targetEntity="Application\Sonata\MediaBundle\Entity\Media",cascade={"all"})
     */
    private $image;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nom
     *
     * @param string $nom
     * @return Pharmacie
     */
    public function setNom($nom)
    {
        $this->nom = $nom;

        return $this;
    }

    /**
     * Get nom
     *
     * @return string
     */
    public function getNom()
    {
        return $this->nom;
    }

    /**
     * Set adresse
     *
     * @param string $adresse
     * @return Pharmacie
     */
    public function setAdresse($adresse)
    {
        $this->adresse = $adresse;

        return $this;
    }

    /**
     * Get adresse
     *
     * @return string
     */
    public function getAdresse()
    {
        return $this->adresse;
    }

    /**
     * Set ville
     *
     * @param string $ville
     * @return Pharmacie
     */
    public function setVille($ville)
    {
        $this->ville = $ville;

        return $this;
    }

    /**
     * Get ville
     *
     * @return string
     */
    public function getVille()
    {
        return $this->ville;
    }

    /**
     * Set created
     *
     * @param \DateTime $created
     * @return Pharmacie
     */
    public function setCreated($created)
    {
        $this->created = $created;

        return $this;
    }

    /**
     * Get created
     *
     * @return \DateTime
     */
    public function getCreated()
    {
        return $this->created;
    }

    /**
     * Set pharmacieGroupe
     *
     * @param \AppBundle\Entity\PharmacieGroupe $pharmacieGroupe
     *
     * @return Pharmacie
     */
    public function setPharmacieGroupe(\AppBundle\Entity\PharmacieGroupe $pharmacieGroupe = null)
    {
        $this->pharmacieGroupe = $pharmacieGroupe;

        return $this;
    }

    /**
     * Get pharmacieGroupe
     *
     * @return \AppBundle\Entity\PharmacieGroupe
     */
    public function getPharmacieGroupe()
    {
        return $this->pharmacieGroupe;
    }

    public function __toString()
    {
        return $this->getNom() ? $this->getNom() : '';
    }

    /**
     * Set image
     *
     * @param string $image
     *
     * @return Pharmacie
     */
    public function setImage($image)
    {
        $this->image = $image;

        return $this;
    }

    /**
     * Get image
     *
     * @return string
     */
    public function getImage()
    {
        return $this->image;
    }
}


text:
#include "kernel/instantiate.h"
#include "library/placeholder.h"
#include "library/explicit.h"
#include "library/choice.h"
#include "library/vm/vm.h"
#include "library/vm/vm_expr.h"
#include "library/vm/vm_name.h"
#include "library/vm/vm_list.h"
#include "library/vm/vm_option.h"
#include "frontends/lean/util.h"
#include "frontends/lean/structure_instance.h"

namespace lean {
vm_obj pexpr_of_expr(vm_obj const & e) {
    return to_obj(mk_as_is(to_expr(e)));
}

vm_obj pexpr_is_placeholder(vm_obj const & e) {
    return mk_vm_bool(is_placeholder(to_expr(e)));
}

vm_obj pexpr_mk_placeholder() {
    return to_obj(mk_expr_placeholder());
}

vm_obj pexpr_mk_explicit(vm_obj const & e) {
    return to_obj(mk_explicit(to_expr(e)));
}

vm_obj pexpr_mk_field_macro(vm_obj const & e, vm_obj const & fname) {
    return to_obj(mk_field_notation(to_expr(e), to_name(fname)));
}

vm_obj pexpr_is_choice_macro(vm_obj const & e) {
    return mk_vm_bool(is_choice(to_expr(e)));
}

vm_obj pexpr_mk_structure_instance(vm_obj const & info) {
    name struct_name;
    buffer<name> field_names;
    buffer<expr> field_values;
    buffer<expr> sources;
    if (!is_none(cfield(info, 0))) {
        struct_name = to_name(get_some_value(cfield(info, 0)));
    }
    to_buffer_name(cfield(info, 1), field_names);
    to_buffer_expr(cfield(info, 2), field_values);
    to_buffer_expr(cfield(info, 3), sources);
    return to_obj(mk_structure_instance(struct_name, field_names, field_values, sources));
}

vm_obj pexpr_get_structure_instance_info(vm_obj const & e) {
    if (!is_structure_instance(to_expr(e))) {
        return mk_vm_none();
    }
    auto info = get_structure_instance_info(to_expr(e));
    optional<name> opt_struct_name;
    if (info.m_struct_name) {
        opt_struct_name = info.m_struct_name;
    }
    return mk_vm_some(mk_vm_constructor(0, to_obj(opt_struct_name), to_obj(info.m_field_names),
                                        to_obj(info.m_field_values), to_obj(info.m_sources)));
}

void initialize_vm_pexpr() {
    DECLARE_VM_BUILTIN(name({"pexpr", "of_expr"}),        pexpr_of_expr);
    DECLARE_VM_BUILTIN(name({"pexpr", "is_placeholder"}), pexpr_is_placeholder);
    DECLARE_VM_BUILTIN(name({"pexpr", "mk_placeholder"}), pexpr_mk_placeholder);

    DECLARE_VM_BUILTIN(name("pexpr", "mk_explicit"),      pexpr_mk_explicit);
    DECLARE_VM_BUILTIN(name("pexpr", "mk_field_macro"),   pexpr_mk_field_macro);

    DECLARE_VM_BUILTIN(name("pexpr", "is_choice_macro"),  pexpr_is_choice_macro);

    DECLARE_VM_BUILTIN(name("pexpr", "mk_structure_instance"), pexpr_mk_structure_instance);
    DECLARE_VM_BUILTIN(name("pexpr", "get_structure_instance_info"), pexpr_get_structure_instance_info);
}

void finalize_vm_pexpr() {
}
}


text:
require "rails_helper"

module Wobauth
  RSpec.describe MembershipsController, type: :routing do
    routes { Wobauth::Engine.routes }

    describe "routing" do

      it "routes to #index" do
        expect(:get => "/memberships").to route_to(controller: "wobauth/memberships", action: "index")
      end

      it "routes to #new" do
        expect(:get => "/memberships/new").to route_to(controller: "wobauth/memberships", action: "new")
      end

      it "routes to #show" do
        expect(:get => "/memberships/1").to route_to(controller: "wobauth/memberships", action: "show", :id => "1")
      end

      it "routes to #edit" do
        expect(:get => "/memberships/1/edit").to route_to(controller: "wobauth/memberships", action: "edit", :id => "1")
      end

      it "routes to #create" do
        expect(:post => "/memberships").to route_to(controller: "wobauth/memberships", action: "create")
      end

      it "routes to #update via PUT" do
        expect(:put => "/memberships/1").to route_to(controller: "wobauth/memberships", action: "update", :id => "1")
      end

      it "routes to #update via PATCH" do
        expect(:patch => "/memberships/1").to route_to(controller: "wobauth/memberships", action: "update", :id => "1")
      end

      it "routes to #destroy" do
        expect(:delete => "/memberships/1").to route_to(controller: "wobauth/memberships", action: "destroy", :id => "1")
      end

    end
  end
end


text:
/**
 * Store Module
 * @module store
 */

var fs = require("fs");
var _ = require("lodash");
var B = require("hope-base");
var Store = require("./lib/store.js");
var check = B.check;

// search the js file in lib/impl,
// and return them as a type array
function get_store_type_list() {
  var ret = [];
  var p = B.path.join(__dirname, "lib/impl");
  var files = fs.readdirSync(p);
  files.forEach(function(file) {
    if (B.path.ext(file) === ".js") {
      ret.push(B.path.base(file, ".js"));
    }
  });
  return ret;
}

var store_type_list = get_store_type_list();

// check if the type is in the store_type_list
function is_supported_type(type)
{
  return (_.indexOf(store_type_list, type) !== -1);
}

/**
 * Create a store based on type
 * @param  {String} type  the type of store
 * @param {Object} config other config infos of store
 * @return {Promise}       resolve: the store object
 */
exports.create_store$ = function(type, config)
{
  var s;//derived store
  return Promise.resolve()
  .then(function() {
    check(is_supported_type(type), "store", "the type is not supported", type, store_type_list);
    var S_derived = require("./lib/impl/" + type + ".js"); // the specific class of store
    B.type.should_impl(S_derived, Store);
    s = new S_derived(config);
    return s.init$();
  }).then(function() {
    return s;
  });
};

/**
 * show the suported type
 * @return {Array}   array of types
 */
exports.list_supported_type = function() {
  return store_type_list;
};

/**
 * one exception reason
 * @constant
 * @type {String}
 */
exports.EXC_INVALID_KEY = Store.INVALID_KEY;

/**
 *
 * Return an error object which has origianl_args and finished_args
 * it will happen when we using batch_xxx methods
 * @param  {String} message       error message
 * @param  {Array} original_args
 * @param  {Array} finished_args
 * @return {Object}               Promise reject error object
 */
exports.new_batch_error = Store.new_batch_error;

/**
 * Factories for assemble
 * @type {Object}
 */
exports.$factories = {
  Store: exports.create_store$
};


text:
package org.fusesource.hawtdispatch.internal;

import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;

import org.fusesource.hawtdispatch.BaseRetained;
import org.fusesource.hawtdispatch.Suspendable;
import org.fusesource.hawtdispatch.Task;

/**
 *
 * @author Hiram Chirino
 */
public class BaseSuspendable extends Task implements Suspendable {

    protected final AtomicBoolean startup = new AtomicBoolean(true);
    protected final AtomicInteger suspended = new AtomicInteger();

    public boolean isSuspended() {
        return suspended.get() > 0;
    }

    public void resume() {
        if (suspended.decrementAndGet() == 0) {
            if (startup.compareAndSet(true, false)) {
                onStartup();
            } else {
                onResume();
            }
        }
    }

    public void suspend() {
        if (suspended.getAndIncrement() == 0) {
            onSuspend();
        }
    }

    protected void onStartup() {
    }

    protected void onSuspend() {
    }

    protected void onResume() {
    }

    @Override
    public void run() {
    }
}


text:
package com.qinyadan.monitor.protocol.support;

public enum CallType {

    LOCAL('L'), SYNC('S'), ASYNC('A');

    private char value;

    CallType(char value) {
        this.value = value;
    }

    public static CallType convert(String id) {
        char v = id.charAt(0);
        switch (v) {
            case 'L':
                return LOCAL;
            case 'S':
                return SYNC;
            case 'A':
                return ASYNC;
            default:
                throw new IllegalStateException("Failed to convert callType[" + id + "]");
        }
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }
}


text:
export * from './ReviewChangesContext'
export * from './types'
export * from './useReviewChanges'


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">

<title>Java Rich Internet Applications Guide</title>
<link rel="stylesheet" type="text/css" href="../../../technotes/css/guide.css" />

Documentation Contents

Java Rich Internet Applications Guide

This guide covers the following topics:

Java Rich Internet Applications Development and Deployment

Rich Internet Applications Decision Guide

Migrating Java Applets to Java Web Start Applications

Java Rich Internet Applications Deployment Advice

Customizing the Rich Internet Application Loading Experience

Properties That Affect the Behavior of Rich Internet Applications

Packaging a Java App for Distribution on a Mac

Applet Developer's Guide

Java Plug-in and Applet Architecture

Applet Deployment

Using applet, object and embed Tags

Applet Status And Event Handlers

Codebase Determination

Networking

Proxy Configuration

Deploying JAR Files Compressed with Pack200

Compression Formats for Network Deployment

Java Control Panel

Deployment Configuration File and Properties

Java Console

Tracing and Logging

Security

Rich Internet Application Deployment Process

Browser Keystores

Mixing Privileged Code and Sandbox Code Ensuring Application and Applet Security

Signed JNLP Files

Verification of RSA Signed Applets in Java Plug-in

Signing Applets Using RSA Certificates

Deploying RSA-Signed Applets in Java Plug-in

JAR File Manifest Attributes for Security

Preventing RIAs from Being Repurposed

Security Dialogs

Deployment Rule Set

Exception Site List

Enhancements and Other Features

Rich Internet Applications - Development, Deployment, and Runtime Enhancements

Java Rich Internet Applications Enhancement in JDK 8

Java Rich Internet Applications Enhancement in JDK 7

Protocol Support: HTTP, HTTPS, FTP, GOPHER, SOCKS, and NTLM

Multi-Version Support

System-Wide Repository

Applet Persistence API

Special Applet Attributes

Pack200 and Version Download

Deploying JavaFX Applications, see the Java SE Deployment Guide

Copyright
© 1993, 2015, Oracle and/or its affiliates. All rights
reserved.

Contact
Us


text:
use std::io::{IoResult, IoError, InvalidInput};
use std::io::net::udp::UdpSocket;
use std::io::net::ip::{SocketAddr, IpAddr};

use std::rand::random;

use protocol::{Mode, Packet};

pub fn random_ephemeral_port() -> u16 {
    let min = 49152;
    let max = 65535;
    random::<u16>() % (max - min) + min
}

pub fn receive_packet(socket: &mut UdpSocket, mode: Mode, buf: &mut [u8]) -> IoResult<(SocketAddr, Packet)> {
    let (len, addr) = try!(socket.recvfrom(buf));
    debug!("[{}] Got {} bytes: {}", addr.to_str(), len, buf.slice_to(len).to_str());
    let packet_bytes = buf.slice_to(len);
    match Packet::decode(mode, packet_bytes) {
        Ok(packet) => {
            info!("[{}] Got packet {}", addr.to_str(), packet.to_str());
            Ok((addr, packet))
        },
        Err(err) => {
            warn!("[{}] Error decoding packet: {}", addr.to_str(), err);
            debug!("[{}] Packet bytes: {}", addr.to_str(), packet_bytes.to_str());
            Err(err)
        }
    }
}

pub fn send_packet(socket: &mut UdpSocket, addr: &SocketAddr, mode: Mode, p: &Packet) -> IoResult<()> {
    match Packet::encode(mode, p) {
        Ok(packet_bytes) => {
            try!(socket.sendto(packet_bytes.as_slice(), *addr));
            info!("[{}] Sent packet: {}", addr.to_str(), p.to_str());
            Ok(())
        },
        Err(err) => {
            error!("[{}] Encoding packet failed with '{}': {}", addr.to_str(), err, p.to_str());
            Err(IoError {
                kind: InvalidInput,
                desc: "Error encoding packet",
                detail: None
            })
        }
    }

}

pub fn bind_socket(addr: IpAddr) -> IoResult<UdpSocket> {
    let rand_port = random_ephemeral_port();
    UdpSocket::bind(SocketAddr {
        ip: addr,
        port: rand_port
    })
}

pub fn socket_reader(us: UdpSocket, mode: Mode, packet_size: uint) -> Receiver<(SocketAddr, Packet)> {
    let (snd, rcv) = channel();
    spawn(proc() {
        let mut socket = us;
        let mut buf = Vec::from_elem(packet_size, 0u8);
        loop {
            match receive_packet(&mut socket, mode, buf.as_mut_slice()) {
                Ok(res) => snd.send(res),
                Err(err) => warn!("Error occured while reading: {}", err)
            }
        }
    });
    rcv
}

pub fn socket_writer(us: UdpSocket, mode: Mode) -> Sender<(SocketAddr, Packet)> {
    let (snd, rcv) = channel::<(SocketAddr, Packet)>();
    spawn(proc() {
        let mut socket = us;
        loop {
            match rcv.recv_opt() {
                Ok((addr, packet)) => {
                    let res = send_packet(&mut socket, &addr, mode, &packet);
                    if res.is_err() {
                        info!("Error occured while writing: {}", res.unwrap_err())
                    }
                },
                Err(_) => {
                    info!("Closing writer");
                    return
                }
            }
        }
    });
    snd
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Class tl.GUI.TGUIHorizontalView</title>
<meta name="date" content="2013-05-17">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
tl.GUI.TGUIHorizontalView

No usage of tl.GUI.TGUIHorizontalView

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
package eu.monnetproject.lemon;

import eu.monnetproject.lemon.model.LemonElement;
import eu.monnetproject.lemon.model.LemonElementOrPredicate;
import eu.monnetproject.lemon.model.Lexicon;
import eu.monnetproject.lemon.model.MorphPattern;
import java.io.Reader;
import java.net.URI;
import java.util.Collection;
import java.util.Iterator;

/**
 * Interface that contains a set of lexica and manages the URIs for all elements of the model.
 * The seperation of URIs and the structure of the lemon model is intended to allow for models
 * to be created quickly as individual elements frequently have stereotypical URIs.
 * @author John McCrae
 */
public interface LemonModel {

	/** The URI for lemon */
	static final String MONNET_LEMON_URI = "http://www.monnet-project.eu/lemon#";
	static final String NEW_LEMON_URI = "http://lemon-model.net/lemon#";
	/**
	 * Get the set of lexica contained by this model
	 * @return The set of lexica
	 */
	Collection<Lexicon> getLexica();

	/**
	 * Get the base URI of the model. If this is not clear return the prefix of the first lexicon object
	 * @return The base URI, or null if the model has no context
	 */
	URI getContext();

	/**
	 * Get the factory for making new elements
	 */
	LemonFactory getFactory();

	/**
	 * Add a (new blank) lexicon
	 */
	Lexicon addLexicon(URI uri, String language);

	/**
	 * Remove a lexicon from the repository. Note this does not remove any entries or
	 * other information contained in the lexicon, this must be done manually
	 */
	void removeLexicon(Lexicon lexicon);

        /**
         * Remove a lexicon and all entries
         * @param lexicon The lexicon
         * @param lingOnto The linguistic ontology used for links in the lexicon. If this
         * is incorrect it may result in links being followed that are not in the model
         * resulting in to many entries being deleted
         */
        void purgeLexicon(Lexicon lexicon, LinguisticOntology lingOnto);

        /**
         * Import a lexicon from another model
         * @param lexicon The lexicon
         * @param lingOnto The linguistic ontology used for links in the lexicon. If this
         * is incorrect it may result in links being followed that are not in the model
         * resulting in to many entries being imported
         */
        void importLexicon(Lexicon lexicon, LinguisticOntology lingOnto);

	/**
	 * Return all elements in the lemon model matching some certain SPARQL query
	 * @param target The class of the target
	 * @param sparqlQuery The query in sparql, must be a select query returning a single variable
	 * @return A Collection of elements matching the given query
	 */
	<Elem extends LemonElementOrPredicate> Iterator<Elem> query(Class<Elem> target, String sparqlQuery);

	/**
	 * Merge two elements
	 * @param from The element to be removed
	 * @param to The element to be preserved
	 */
	<Elem extends LemonElement> void merge(Elem from, Elem to);

        /**
         * Add a pattern to the model
         * @param pattern The pattern
         */
        void addPattern(MorphPattern pattern);

        /**
         * Get all patterns now in the model
         * @return The set of patterns
         */
        Collection<MorphPattern> getPatterns();
}


text:
<?php
/**
 * Contains EWSType_FreeBusyResponseType.
 */

/**
 * Represents the free/busy information for a single mailbox user.
 *
 * @package php-ews\Types
 */
class EWSType_FreeBusyResponseType extends EWSType
{
    /**
     * Contains availability information for a specific user.
     *
     * @since Exchange 2007
     *
     * @var EWSType_FreeBusyView
     */
    public $FreeBusyView;

    /**
     * Provides descriptive information about the response status.
     *
     * @since Exchange 2007
     *
     * @var EWSType_ResponseMessageType
     */
    public $ResponseMessage;
}


text:
export PATH="${HOMEBREW_PREFIX}/opt/coreutils/libexec/gnubin:${PATH}"
export MANPATH="${HOMEBREW_PREFIX}/opt/coreutils/libexec/gnuman:${MANPATH}"

# From `brew install grep`:
# ==> Pouring grep-3.3.mojave.bottle.2.tar.gz
# ==> Caveats
# All commands have been installed with the prefix "g".
# If you need to use these commands with their normal names, you
# can add a "gnubin" directory to your PATH from your bashrc like:
export PATH="${HOMEBREW_PREFIX}/opt/grep/libexec/gnubin:$PATH"

# From `brew install python` (or, because `python` is dependency of `ffmpeg`)
# ==> Pouring python-3.7.3.mojave.bottle.1.tar.gz
# ==> Caveats
# Python has been installed as
#   /usr/local/bin/python3
#
# Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
# `python3`, `python3-config`, `pip3` etc., respectively, have been installed into
#   /usr/local/opt/python/libexec/bin
#
# If you need Homebrew's Python 2.7 run
#   brew install python@2
#
# You can install Python packages with
#   pip3 install <package>
# They will install into the site-package directory
#   /usr/local/lib/python3.7/site-packages
#
# See: https://docs.brew.sh/Homebrew-and-Python
export PATH="${HOMEBREW_PREFIX}/opt/python/libexec/bin:$PATH"

# From `brew install openssl` (or, because `openssl` is dependency of `ffmpeg`)
# ==> Caveats
# A CA file has been bootstrapped using certificates from the SystemRoots
# keychain. To add additional certificates (e.g. the certificates added in
# the System keychain), place .pem files in
#   /usr/local/etc/openssl/certs
#
# and run
#   /usr/local/opt/openssl/bin/c_rehash
#
# openssl is keg-only, which means it was not symlinked into /usr/local,
# because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.
#
# If you need to have openssl first in your PATH run:
#   echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
#
# For compilers to find openssl you may need to set:
#   export LDFLAGS="-L/usr/local/opt/openssl/lib"
#   export CPPFLAGS="-I/usr/local/opt/openssl/include"
# export PATH="/usr/local/opt/openssl/bin:$PATH"

# From `brew install openssl@1.1`
# A CA file has been bootstrapped using certificates from the system
# keychain. To add additional certificates, place .pem files in
#   /usr/local/etc/openssl@1.1/certs
#
# and run
#   /usr/local/opt/openssl@1.1/bin/c_rehash
#
# openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
# because openssl/libressl is provided by macOS so don't link an incompatible version.
#
# If you need to have openssl@1.1 first in your PATH run:
#   echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.bash_profile
#
# For compilers to find openssl@1.1 you may need to set:
#   export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
#   export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
export PATH="${HOMEBREW_PREFIX}/opt/openssl@1.1/bin:$PATH"

# From `brew install readline` (or, because `readline` is dependency of `ffmpeg`)
# ==> Pouring readline-8.0.0_1.mojave.bottle.tar.gz
# ==> Caveats
# readline is keg-only, which means it was not symlinked into /usr/local,
# because macOS provides the BSD libedit library, which shadows libreadline.
# In order to prevent conflicts when programs look for libreadline we are
# defaulting this GNU Readline installation to keg-only.
#
# For compilers to find readline you may need to set:
#   export LDFLAGS="-L/usr/local/opt/readline/lib"
#   export CPPFLAGS="-I/usr/local/opt/readline/include"

# From `brew install sqlite`
# ==> Pouring sqlite-3.28.0.mojave.bottle.tar.gz
# ==> Caveats
# sqlite is keg-only, which means it was not symlinked into /usr/local,
# because macOS provides an older sqlite3.
#
# If you need to have sqlite first in your PATH run:
#   echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile
#
# For compilers to find sqlite you may need to set:
#   export LDFLAGS="-L/usr/local/opt/sqlite/lib"
#   export CPPFLAGS="-I/usr/local/opt/sqlite/include"
export PATH="${HOMEBREW_PREFIX}/opt/sqlite/bin:$PATH"

# From `brew install ruby` (or, because `ruby` is a dependency of `vim`)
# ==> ruby
# By default, binaries installed by gem will be placed into:
#   /usr/local/lib/ruby/gems/2.6.0/bin
#
# You may want to add this to your PATH.
#
# ruby is keg-only, which means it was not symlinked into /usr/local,
# because macOS already provides this software and installing another version in
# parallel can cause all kinds of trouble.
#
# If you need to have ruby first in your PATH run:
#   echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
#
# For compilers to find ruby you may need to set:
#   export LDFLAGS="-L/usr/local/opt/ruby/lib"
#   export CPPFLAGS="-I/usr/local/opt/ruby/include"
export PATH="${HOMEBREW_PREFIX}/opt/ruby/bin:$PATH"

# From `brew cask install mactex`
# Not explicitly stated in the install, but you need to add its bin
# folder to the PATH:
if [ -d /Library/TeX/texbin ]; then
   export PATH="/Library/TeX/texbin:$PATH"
fi

# From `brew install openjdk`
# ==> Pouring openjdk-13.0.2+8_2.mojave.bottle.tar.gz
# ==> Caveats
# For the system Java wrappers to find this JDK, symlink it with
#   sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
#
# openjdk is keg-only, which means it was not symlinked into /usr/local,
# because it shadows the macOS `java` wrapper.
#
# If you need to have openjdk first in your PATH run:
#   echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> ~/.bash_profile
#
# For compilers to find openjdk you may need to set:
#   export CPPFLAGS="-I/usr/local/opt/openjdk/include"
#
# ==> Summary
# 🍺  /usr/local/Cellar/openjdk/13.0.2+8_2: 631 files, 314.6MB
export PATH="${HOMEBREW_PREFIX}/opt/openjdk/bin:$PATH"

# From `brew install gnu-sed`
# ==> Pouring gnu-sed-4.8.mojave.bottle.tar.gz
# ==> Caveats
# GNU "sed" has been installed as "gsed".
# If you need to use it as "sed", you can add a "gnubin" directory
# to your PATH from your bashrc like:
#
#     PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
PATH="${HOMEBREW_PREFIX}/opt/gnu-sed/libexec/gnubin:$PATH"

## -- Kevin's Additions ------------------------------------------------

# From `brew cask install mactex`
# Not explicitly stated in the install, but you need to add its bin
# folder to the PATH:
if [ -d /Library/TeX/texbin ]; then
   export PATH="/Library/TeX/texbin:$PATH"
fi

# WSL Yarn added to PATH https://github.com/yarnpkg/yarn/issues/5353
if [ -d ~/.yarn/bin ]; then
   export PATH="$(yarn global bin):$PATH"
fi


text:
<?php

namespace Emonkak\Collection\Tests;

use Emonkak\Collection\Collection;
use Emonkak\Collection\Provider\ArrayProvider;

class ArrayCollectionTest extends AbstractCollectionTest
{
    /**
     * @expectedException \OverflowException
     */
    public function testRepeatThrowsOverflowException()
    {
        Collection::repeat('foo');
    }

    /**
     * @expectedException \OverflowException
     */
    public function testIterateThrowsOverflowException()
    {
        Collection::iterate(2, function($x) { return $x * $x; });
    }

    /**
     * @dataProvider provideCollectionFactory
     * @expectedException \OverflowException
     */
    public function testCycleThrowsOverflowException($factory)
    {
        $factory([1, 2])->cycle();
    }

    protected function getCollectionProvider()
    {
        return ArrayProvider::getInstance();
    }
}


text:
"use strict" ;

const tree = require( 'tree-kit' ) ;
const xterm256 = require( './xterm-256color.js' ) ;
const xtermGeneric = require( './xterm.generic.js' ) ;

// Fail-safe xterm-compatible.

// So far, we derivate from xterm-256color and then just add specific things (owned properties)
// of xterm.generic.js, thus we achieve a clean inheritance model without duplicated code.

module.exports = {
	esc: tree.extend( { own: true } , Object.create( xterm256.esc ) , xtermGeneric.esc ) ,
	keymap: Object.create( xtermGeneric.keymap ) ,
	handler: Object.create( xtermGeneric.handler ) ,
	support: {
		deltaEscapeSequence: true ,
		"256colors": true ,
		"24bitsColors": undefined ,	// DEPRECATED
		"trueColor": undefined	// maybe, maybe not
	} ,
	colorRegister: require( '../colorScheme/vga.json' )
} ;


text:
package collections

import (
	"errors"
	"fmt"
	"reflect"
	"strings"

	"github.com/gohugoio/hugo/common/hreflect"
	"github.com/gohugoio/hugo/common/maps"
)

// Where returns a filtered subset of a given data type.
func (ns *Namespace) Where(seq, key any, args ...any) (any, error) {
	seqv, isNil := indirect(reflect.ValueOf(seq))
	if isNil {
		return nil, errors.New("can't iterate over a nil value of type " + reflect.ValueOf(seq).Type().String())
	}

	mv, op, err := parseWhereArgs(args...)
	if err != nil {
		return nil, err
	}

	var path []string
	kv := reflect.ValueOf(key)
	if kv.Kind() == reflect.String {
		path = strings.Split(strings.Trim(kv.String(), "."), ".")
	}

	switch seqv.Kind() {
	case reflect.Array, reflect.Slice:
		return ns.checkWhereArray(seqv, kv, mv, path, op)
	case reflect.Map:
		return ns.checkWhereMap(seqv, kv, mv, path, op)
	default:
		return nil, fmt.Errorf("can't iterate over %v", seq)
	}
}

func (ns *Namespace) checkCondition(v, mv reflect.Value, op string) (bool, error) {
	v, vIsNil := indirect(v)
	if !v.IsValid() {
		vIsNil = true
	}

	mv, mvIsNil := indirect(mv)
	if !mv.IsValid() {
		mvIsNil = true
	}
	if vIsNil || mvIsNil {
		switch op {
		case "", "=", "==", "eq":
			return vIsNil == mvIsNil, nil
		case "!=", "<>", "ne":
			return vIsNil != mvIsNil, nil
		}
		return false, nil
	}

	if v.Kind() == reflect.Bool && mv.Kind() == reflect.Bool {
		switch op {
		case "", "=", "==", "eq":
			return v.Bool() == mv.Bool(), nil
		case "!=", "<>", "ne":
			return v.Bool() != mv.Bool(), nil
		}
		return false, nil
	}

	var ivp, imvp *int64
	var fvp, fmvp *float64
	var svp, smvp *string
	var slv, slmv any
	var ima []int64
	var fma []float64
	var sma []string

	if mv.Kind() == v.Kind() {
		switch v.Kind() {
		case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
			iv := v.Int()
			ivp = &iv
			imv := mv.Int()
			imvp = &imv
		case reflect.String:
			sv := v.String()
			svp = &sv
			smv := mv.String()
			smvp = &smv
		case reflect.Float64:
			fv := v.Float()
			fvp = &fv
			fmv := mv.Float()
			fmvp = &fmv
		case reflect.Struct:
			if hreflect.IsTime(v.Type()) {
				iv := ns.toTimeUnix(v)
				ivp = &iv
				imv := ns.toTimeUnix(mv)
				imvp = &imv
			}
		case reflect.Array, reflect.Slice:
			slv = v.Interface()
			slmv = mv.Interface()
		}
	} else if isNumber(v.Kind()) && isNumber(mv.Kind()) {
		fv, err := toFloat(v)
		if err != nil {
			return false, err
		}
		fvp = &fv
		fmv, err := toFloat(mv)
		if err != nil {
			return false, err
		}
		fmvp = &fmv
	} else {
		if mv.Kind() != reflect.Array && mv.Kind() != reflect.Slice {
			return false, nil
		}

		if mv.Len() == 0 {
			return false, nil
		}

		if v.Kind() != reflect.Interface && mv.Type().Elem().Kind() != reflect.Interface && mv.Type().Elem() != v.Type() && v.Kind() != reflect.Array && v.Kind() != reflect.Slice {
			return false, nil
		}
		switch v.Kind() {
		case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
			iv := v.Int()
			ivp = &iv
			for i := 0; i < mv.Len(); i++ {
				if anInt, err := toInt(mv.Index(i)); err == nil {
					ima = append(ima, anInt)
				}
			}
		case reflect.String:
			sv := v.String()
			svp = &sv
			for i := 0; i < mv.Len(); i++ {
				if aString, err := toString(mv.Index(i)); err == nil {
					sma = append(sma, aString)
				}
			}
		case reflect.Float64:
			fv := v.Float()
			fvp = &fv
			for i := 0; i < mv.Len(); i++ {
				if aFloat, err := toFloat(mv.Index(i)); err == nil {
					fma = append(fma, aFloat)
				}
			}
		case reflect.Struct:
			if hreflect.IsTime(v.Type()) {
				iv := ns.toTimeUnix(v)
				ivp = &iv
				for i := 0; i < mv.Len(); i++ {
					ima = append(ima, ns.toTimeUnix(mv.Index(i)))
				}
			}
		case reflect.Array, reflect.Slice:
			slv = v.Interface()
			slmv = mv.Interface()
		}
	}

	switch op {
	case "", "=", "==", "eq":
		switch {
		case ivp != nil && imvp != nil:
			return *ivp == *imvp, nil
		case svp != nil && smvp != nil:
			return *svp == *smvp, nil
		case fvp != nil && fmvp != nil:
			return *fvp == *fmvp, nil
		}
	case "!=", "<>", "ne":
		switch {
		case ivp != nil && imvp != nil:
			return *ivp != *imvp, nil
		case svp != nil && smvp != nil:
			return *svp != *smvp, nil
		case fvp != nil && fmvp != nil:
			return *fvp != *fmvp, nil
		}
	case ">=", "ge":
		switch {
		case ivp != nil && imvp != nil:
			return *ivp >= *imvp, nil
		case svp != nil && smvp != nil:
			return *svp >= *smvp, nil
		case fvp != nil && fmvp != nil:
			return *fvp >= *fmvp, nil
		}
	case ">", "gt":
		switch {
		case ivp != nil && imvp != nil:
			return *ivp > *imvp, nil
		case svp != nil && smvp != nil:
			return *svp > *smvp, nil
		case fvp != nil && fmvp != nil:
			return *fvp > *fmvp, nil
		}
	case "<=", "le":
		switch {
		case ivp != nil && imvp != nil:
			return *ivp <= *imvp, nil
		case svp != nil && smvp != nil:
			return *svp <= *smvp, nil
		case fvp != nil && fmvp != nil:
			return *fvp <= *fmvp, nil
		}
	case "<", "lt":
		switch {
		case ivp != nil && imvp != nil:
			return *ivp < *imvp, nil
		case svp != nil && smvp != nil:
			return *svp < *smvp, nil
		case fvp != nil && fmvp != nil:
			return *fvp < *fmvp, nil
		}
	case "in", "not in":
		var r bool
		switch {
		case ivp != nil && len(ima) > 0:
			r, _ = ns.In(ima, *ivp)
		case fvp != nil && len(fma) > 0:
			r, _ = ns.In(fma, *fvp)
		case svp != nil:
			if len(sma) > 0 {
				r, _ = ns.In(sma, *svp)
			} else if smvp != nil {
				r, _ = ns.In(*smvp, *svp)
			}
		default:
			return false, nil
		}
		if op == "not in" {
			return !r, nil
		}
		return r, nil
	case "intersect":
		r, err := ns.Intersect(slv, slmv)
		if err != nil {
			return false, err
		}

		if reflect.TypeOf(r).Kind() == reflect.Slice {
			s := reflect.ValueOf(r)

			if s.Len() > 0 {
				return true, nil
			}
			return false, nil
		}
		return false, errors.New("invalid intersect values")
	default:
		return false, errors.New("no such operator")
	}
	return false, nil
}

func evaluateSubElem(obj reflect.Value, elemName string) (reflect.Value, error) {
	if !obj.IsValid() {
		return zero, errors.New("can't evaluate an invalid value")
	}

	typ := obj.Type()
	obj, isNil := indirect(obj)

	if obj.Kind() == reflect.Interface {
		// If obj is an interface, we need to inspect the value it contains
		// to see the full set of methods and fields.
		// Indirect returns the value that it points to, which is what's needed
		// below to be able to reflect on its fields.
		obj = reflect.Indirect(obj.Elem())
	}

	// first, check whether obj has a method. In this case, obj is
	// a struct or its pointer. If obj is a struct,
	// to check all T and *T method, use obj pointer type Value
	objPtr := obj
	if objPtr.Kind() != reflect.Interface && objPtr.CanAddr() {
		objPtr = objPtr.Addr()
	}

	index := hreflect.GetMethodIndexByName(objPtr.Type(), elemName)
	if index != -1 {
		mt := objPtr.Type().Method(index)
		switch {
		case mt.PkgPath != "":
			return zero, fmt.Errorf("%s is an unexported method of type %s", elemName, typ)
		case mt.Type.NumIn() > 1:
			return zero, fmt.Errorf("%s is a method of type %s but requires more than 1 parameter", elemName, typ)
		case mt.Type.NumOut() == 0:
			return zero, fmt.Errorf("%s is a method of type %s but returns no output", elemName, typ)
		case mt.Type.NumOut() > 2:
			return zero, fmt.Errorf("%s is a method of type %s but returns more than 2 outputs", elemName, typ)
		case mt.Type.NumOut() == 1 && mt.Type.Out(0).Implements(errorType):
			return zero, fmt.Errorf("%s is a method of type %s but only returns an error type", elemName, typ)
		case mt.Type.NumOut() == 2 && !mt.Type.Out(1).Implements(errorType):
			return zero, fmt.Errorf("%s is a method of type %s returning two values but the second value is not an error type", elemName, typ)
		}
		res := objPtr.Method(mt.Index).Call([]reflect.Value{})
		if len(res) == 2 && !res[1].IsNil() {
			return zero, fmt.Errorf("error at calling a method %s of type %s: %s", elemName, typ, res[1].Interface().(error))
		}
		return res[0], nil
	}

	// elemName isn't a method so next start to check whether it is
	// a struct field or a map value. In both cases, it mustn't be
	// a nil value
	if isNil {
		return zero, fmt.Errorf("can't evaluate a nil pointer of type %s by a struct field or map key name %s", typ, elemName)
	}
	switch obj.Kind() {
	case reflect.Struct:
		ft, ok := obj.Type().FieldByName(elemName)
		if ok {
			if ft.PkgPath != "" && !ft.Anonymous {
				return zero, fmt.Errorf("%s is an unexported field of struct type %s", elemName, typ)
			}
			return obj.FieldByIndex(ft.Index), nil
		}
		return zero, fmt.Errorf("%s isn't a field of struct type %s", elemName, typ)
	case reflect.Map:
		kv := reflect.ValueOf(elemName)
		if kv.Type().AssignableTo(obj.Type().Key()) {
			return obj.MapIndex(kv), nil
		}
		return zero, fmt.Errorf("%s isn't a key of map type %s", elemName, typ)
	}
	return zero, fmt.Errorf("%s is neither a struct field, a method nor a map element of type %s", elemName, typ)
}

// parseWhereArgs parses the end arguments to the where function.  Return a
// match value and an operator, if one is defined.
func parseWhereArgs(args ...any) (mv reflect.Value, op string, err error) {
	switch len(args) {
	case 1:
		mv = reflect.ValueOf(args[0])
	case 2:
		var ok bool
		if op, ok = args[0].(string); !ok {
			err = errors.New("operator argument must be string type")
			return
		}
		op = strings.TrimSpace(strings.ToLower(op))
		mv = reflect.ValueOf(args[1])
	default:
		err = errors.New("can't evaluate the array by no match argument or more than or equal to two arguments")
	}
	return
}

// checkWhereArray handles the where-matching logic when the seqv value is an
// Array or Slice.
func (ns *Namespace) checkWhereArray(seqv, kv, mv reflect.Value, path []string, op string) (any, error) {
	rv := reflect.MakeSlice(seqv.Type(), 0, 0)

	for i := 0; i < seqv.Len(); i++ {
		var vvv reflect.Value
		rvv := seqv.Index(i)

		if kv.Kind() == reflect.String {
			if params, ok := rvv.Interface().(maps.Params); ok {
				vvv = reflect.ValueOf(params.Get(path...))
			} else {
				vvv = rvv
				for i, elemName := range path {
					var err error
					vvv, err = evaluateSubElem(vvv, elemName)

					if err != nil {
						continue
					}

					if i < len(path)-1 && vvv.IsValid() {
						if params, ok := vvv.Interface().(maps.Params); ok {
							// The current path element is the map itself, .Params.
							vvv = reflect.ValueOf(params.Get(path[i+1:]...))
							break
						}
					}
				}
			}
		} else {
			vv, _ := indirect(rvv)
			if vv.Kind() == reflect.Map && kv.Type().AssignableTo(vv.Type().Key()) {
				vvv = vv.MapIndex(kv)
			}
		}

		if ok, err := ns.checkCondition(vvv, mv, op); ok {
			rv = reflect.Append(rv, rvv)
		} else if err != nil {
			return nil, err
		}
	}
	return rv.Interface(), nil
}

// checkWhereMap handles the where-matching logic when the seqv value is a Map.
func (ns *Namespace) checkWhereMap(seqv, kv, mv reflect.Value, path []string, op string) (any, error) {
	rv := reflect.MakeMap(seqv.Type())
	keys := seqv.MapKeys()
	for _, k := range keys {
		elemv := seqv.MapIndex(k)
		switch elemv.Kind() {
		case reflect.Array, reflect.Slice:
			r, err := ns.checkWhereArray(elemv, kv, mv, path, op)
			if err != nil {
				return nil, err
			}

			switch rr := reflect.ValueOf(r); rr.Kind() {
			case reflect.Slice:
				if rr.Len() > 0 {
					rv.SetMapIndex(k, elemv)
				}
			}
		case reflect.Interface:
			elemvv, isNil := indirect(elemv)
			if isNil {
				continue
			}

			switch elemvv.Kind() {
			case reflect.Array, reflect.Slice:
				r, err := ns.checkWhereArray(elemvv, kv, mv, path, op)
				if err != nil {
					return nil, err
				}

				switch rr := reflect.ValueOf(r); rr.Kind() {
				case reflect.Slice:
					if rr.Len() > 0 {
						rv.SetMapIndex(k, elemv)
					}
				}
			}
		}
	}
	return rv.Interface(), nil
}

// toFloat returns the float value if possible.
func toFloat(v reflect.Value) (float64, error) {
	switch v.Kind() {
	case reflect.Float32, reflect.Float64:
		return v.Float(), nil
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return v.Convert(reflect.TypeOf(float64(0))).Float(), nil
	case reflect.Interface:
		return toFloat(v.Elem())
	}
	return -1, errors.New("unable to convert value to float")
}

// toInt returns the int value if possible, -1 if not.
// TODO(bep) consolidate all these reflect funcs.
func toInt(v reflect.Value) (int64, error) {
	switch v.Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return v.Int(), nil
	case reflect.Interface:
		return toInt(v.Elem())
	}
	return -1, errors.New("unable to convert value to int")
}

func toUint(v reflect.Value) (uint64, error) {
	switch v.Kind() {
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
		return v.Uint(), nil
	case reflect.Interface:
		return toUint(v.Elem())
	}
	return 0, errors.New("unable to convert value to uint")
}

// toString returns the string value if possible, "" if not.
func toString(v reflect.Value) (string, error) {
	switch v.Kind() {
	case reflect.String:
		return v.String(), nil
	case reflect.Interface:
		return toString(v.Elem())
	}
	return "", errors.New("unable to convert value to string")
}

func (ns *Namespace) toTimeUnix(v reflect.Value) int64 {
	t, ok := hreflect.AsTime(v, ns.loc)
	if !ok {
		panic("coding error: argument must be time.Time type reflect Value")
	}
	return t.Unix()
}


text:
<?php
use Illuminate\Support\Facades\Hash;
Route::get('password', function() {
    return Hash::make("012345Abc");
});

Route::group(['prefix' => '/'], function () {
    Route::get('/', 'Frontend\HomeController@index');
    Route::get('/category/{id}', 'Frontend\HomeController@category');
    Route::get('/product/{id}', 'Frontend\HomeController@product');
    Route::get('/contact','Frontend\HomeController@contact');
    Route::post('/contact','Frontend\FeedbackController@create');

    Route::group(['prefix' => '/', 'middleware' => ['GuestAuthencate']], function () {
        Route::get('/login', 'Frontend\LoginController@index');
        Route::post('/login', 'Frontend\LoginController@login');
        Route::get('/register', 'Frontend\RegisterController@index');
        Route::post('/register', 'Frontend\RegisterController@register');
        Route::get('/activate/{userid}/{token}/{code}', 'Frontend\RegisterController@activate');
    });
    Route::get('/checkout', 'Frontend\HomeController@checkout');
    Route::get('/logout', 'Frontend\LoginController@logout');
});

Route::group(['prefix' => 'admin'], function () {
    Route::get('/login', 'Backend\BackendController@loginIndex');
    Route::post('/login', 'Backend\BackendController@login');
    Route::get('/logout', 'Backend\BackendController@logout');

    Route::group(['prefix' => '', 'middleware' => ['AdminAuthencate']], function () {
        Route::get('/', 'Backend\BackendController@index');
        Route::group(['prefix' => 'product'], function () {
            Route::get('/', 'Backend\ProductController@index');
            Route::get('/edit/{id}', 'Backend\ProductController@edit');
            Route::post('/edit/{id}', 'Backend\ProductController@update');
            Route::get('/delete/{id}', 'Backend\ProductController@destroy');

            Route::get('/add', 'Backend\ProductController@addIndex');
            Route::post('/add', 'Backend\ProductController@add');
        });
        Route::get('/feedback','Backend\FeedbackController@index');
        Route::group(['prefix' => 'category'], function () {
            Route::get('/', 'Backend\CategoryController@index');
            Route::get('/edit/{id}', 'Backend\CategoryController@edit');
            Route::post('/edit/{id}', 'Backend\CategoryController@update');
            Route::get('/delete/{id}', 'Backend\CategoryController@destroy');

            Route::get('/add', 'Backend\CategoryController@addIndex');
            Route::post('/add', 'Backend\CategoryController@add');
        });

        Route::group(['prefix' => 'kind'], function () {
            Route::get('/delete/{id}', 'Backend\CategoryController@destroyKind');
        });

    });
});


text:
sap.ui.define([
	"sap/ui/fl/FakeLrepConnector",
	"sap/ui/fl/write/_internal/connectors/LocalStorageConnector"
],
function(
	FakeLrepConnector,
	LocalStorageConnector
) {
	"use strict";

	/**
	 * Utility for storing changes in local storage.
	 *
	 * @namespace
	 *
	 * @author SAP SE
	 * @version ${version}
	 *
	 * @private
	 * @since 1.48
	 * @alias sap.ui.fl.FakeLrepConnectorLocalStorage
	 *
	 * @private
	 * @ui5-restricted
	 * @deprecated since 1.70. Configure the sap.ui.core.Configuration.flexibilityServices to use a test connector
	 * like ["LocalStorageConnector"], ["SessionStorageConnector"] or ["JsObjectConnector"].
	 * @see {@link https://ui5.sap.com/#/topic/642dab291a7b47ec9d46c39b3c482aba|Boostrapping UI5 Flexibility}
	 */

	return {
		enableFakeConnector: function (mPropertyBag) {
			var sJsonPath = mPropertyBag ? mPropertyBag.sInitialComponentJsonPath : undefined;
			FakeLrepConnector.setFlexibilityServicesAndClearCache("LocalStorageConnector", sJsonPath);
		},
		disableFakeConnector: function () {
			FakeLrepConnector.disableFakeConnector();
		},
		forTesting: {
			spyWrite: function (sandbox, assert) {
				return FakeLrepConnector.forTesting.spyMethod(sandbox, assert, LocalStorageConnector, "write");
			},
			getNumberOfChanges: function (sReference) {
				return FakeLrepConnector.forTesting.getNumberOfChanges(LocalStorageConnector, sReference);
			},
			synchronous: {
				clearAll: function () {
					FakeLrepConnector.forTesting.synchronous.clearAll(window.localStorage);
				},
				store: function (sKey, oItem) {
					FakeLrepConnector.forTesting.synchronous.store(window.localStorage, sKey, oItem);
				}
			}
		}
	};
}, /* bExport= */ true);


text:
from JumpScale import j
from  BtrfsExtension import BtrfsExtension
j.system.btrfs = BtrfsExtension()


text:
node-clockwork
==============

Install
---
```bash
npm install clockwork
```

Simple Usage
---

```js
var clockwork = require('clockwork')({key:'your clockwork key here'});

// Send a message
clockwork.sendSms({ To: '447123456789', Content: 'Test!'}, function(error, resp) {
    if (error) {
    	console.log('Something went wrong', error);
	} else {
		console.log('Message sent',resp.responses[0].id);
	}
});

```

Sending A Message
---

You can send a single message as shown above. If you have multiple messages to send, it's much more efficient to send them in bulk by passing an array of messages to `sendSms`:

```js
clockwork.sendSms([{ To: '447123456789', Content: 'Test!'},
				   { To: '447123456781', Content: 'Another one', From: 'ClockworkSMS'}], function(error, resp) {
    if (error) {
    	console.log('Something went wrong', error);
	} else {
		console.log('Messages sent');
	}
});
```

The second argument to sendSms is callback that you provide. The callback will be called with 2 json objects, `error` and `response`. If a general error occurs, then error will look like this:

```js
{
	success: false,
	errNo: X,
	errDesc: 'Error description here'
}
```

Otherwise, error will be null, and the response will contain an array of sms responses, one for each message sent. In the example above where 2 messages were sent, assuming nothing went wrong, the response will look like this:

```js
{
	responses: [
		{to: '447123456789', success: true, id: 'MessageId', errNo: '', ErrDesc: ''},
		{to: '447123456781', success: true, id: 'MessageId', errNo: '', ErrDesc: ''}
	]
}
```

Currently, the nodejs wrapper only supports setting the to, from and content of sms messages. If you need to set other options, raise an issue in github and we'll try to get it done for you. For more information about sending messages and the responses, [see the clockwork sms api documentation](http://www.clockworksms.com/doc/clever-stuff/xml-interface/send-sms/)

Getting Your Balance
---

```js
clockwork.getBalance(function(error, credit) {
    if (error) {
    	console.log('Something went wrong', error);
	} else {
		console.log('Your balance',resp);
	}
});
```

Again, if a general error occurs then error will be populated accordingly. Otherwise, the response contains your credit, in a format similar to this:

```js
{
	accountType: 'PAYG',
	currency: {code: 'USD', symbol: '$'},
	balance: '100.0'
}
```


text:
package com.treasuredata.jdbc;

import javax.sql.DataSource;

import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;

public class TDDataSource
        implements DataSource
{
    private String password;

    private String user;

    private int loginTimeout;

    private PrintWriter printer;

    public TDDataSource()
    {
    }

    public Connection getConnection()
            throws SQLException
    {
        return getConnection(getUser(), getPassword());
    }

    public Connection getConnection(String user, String password)
            throws SQLException
    {
        throw new SQLException(new UnsupportedOperationException(
                "TDDataSource#getConection(String, String)"));
    }

    public void setUser(String user)
    {
        this.user = user;
    }

    public String getUser()
    {
        return user;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }

    public String getPassword()
    {
        return password;
    }

    public PrintWriter getLogWriter()
            throws SQLException
    {
        return printer;
    }

    public int getLoginTimeout()
            throws SQLException
    {
        return loginTimeout;
    }

    public void setLogWriter(PrintWriter out)
            throws SQLException
    {
        printer = out;
    }

    public void setLoginTimeout(int seconds)
            throws SQLException
    {
        loginTimeout = seconds;
    }

    /**
     * Returns false unless interfaces is implemented
     *
     * @param interfaces a Class defining an interface.
     * @return true                   if this implements the interface or
     * directly or indirectly wraps an object
     * that does.
     * @throws java.sql.SQLException if an error occurs while determining
     * whether this is a wrapper for an object
     * with the given interface.
     */
    public boolean isWrapperFor(Class<?> interfaces)
            throws SQLException
    {
        return interfaces.isInstance(this);
    }

    /**
     * Returns this if this class implements the interface
     *
     * @param interfaces a Class defining an interface
     * @return an object that implements the interface
     * @throws java.sql.SQLExption if no object if found that implements the
     * interface
     */
    public <T> T unwrap(Class<T> interfaces)
            throws SQLException
    {
        //does not implement non-standard methods on JDBC objects
        //hence return this if this class implements the interface
        //or throw an SQLException
        try {
            return interfaces.cast(this);
        }
        catch (ClassCastException e) {
            throw new SQLException(e);
        }
    }
}


text:
package techex.cases

import _root_.argonaut._
import argonaut.Argonaut._
import org.http4s.dsl._
import org.joda.time.Instant
import techex._
import techex.data._
import techex.data.codecJson._
import techex.domain._

import scalaz.Scalaz._
import scalaz._
import scalaz.stream.async.mutable.Topic

object trackPlayer {

  def calcActivity: PartialFunction[InputMessage, State[Storage, List[Fact]]] = {
    case observation: EnterObservation =>
      for {
        maybeLocationUpdate <- nextLocation(observation)
        b <- maybeLocationUpdate.map(location2VisitActivities).getOrElse(State.state[Storage, List[Fact]](nil))
        c <- maybeLocationUpdate.map(meetingPoints2Activity(areas.kantegaCoffeeUp, areas.kantegaCoffeeUp, areas.meetingRoom)).getOrElse(State.state[Storage, List[Fact]](nil))
      } yield b ::: c

    case exitObservation: ExitObservation => movedToUnknown(exitObservation)
    case endOfTenSecs: EndOfTenSecs       => stayAtArea(endOfTenSecs)
  }

  def stayAtArea: EndOfTenSecs => State[Storage, List[Fact]] =
    tick => State.gets {
      ctx => {
        tick :: ctx.players.map(player => {
          val arrived = player.lastLocation.instant
          AtArea(player, player.lastLocation.area, tick.instant, durationBetween(arrived, tick.instant))
        })
      }
    }

  def movedToUnknown: ExitObservation => State[Storage, List[Fact]] =
    exit => State {
      ctx => {

        val maybePlayer =
          ctx
            .playerData.get(exit.playerId)

        maybePlayer.fold((ctx, nil[Fact])) { (player: PlayerData) =>
          val lastLocation =
            player.lastLocation

          val nextLocation =
            LocationUpdate(player.player.id, areas.somewhere, exit.instant)

          val left =
            LeftArea(player, lastLocation.area, exit.instant)

          val arrived =
            EnteredArea(player, areas.somewhere, exit.instant)

          val updates =
            left :: arrived :: Nil

          (ctx.updatePlayerData(exit.playerId, _.addMovement(nextLocation)), updates)
        }

      }
    }

  def nextLocation: EnterObservation => State[Storage, Option[LocationUpdate]] =
    observation => State {
      ctx => {

        val maybePlayer =
          ctx.playerData.get(observation.playerId)

        val maybeArea =
          areas.beaconPlacement.get(observation.beacon).flatMap {
            case (requiredProximity, area) => if (observation.proximity isSameOrCloserThan requiredProximity) Some(area) else None
          }

        val maybeUpdate =
          maybePlayer.flatMap { player =>
            maybeArea match {
              case None       => None
              case Some(area) =>
                if (area === player.lastLocation.area) None
                else Some(LocationUpdate(observation.playerId, area, observation.instant))
            }
          }
        (ctx, maybeUpdate)
      }
    }

  def location2VisitActivities: LocationUpdate => State[Storage, List[Fact]] =
    locationUpdate => State {
      ctx => {

        val maybePlayer =
          ctx
            .playerData.get(locationUpdate.playerId)

        maybePlayer.fold((ctx, nil[Fact])) { (player: PlayerData) =>
          val lastLocation =
            player.lastLocation

          val nextLocation =
            locationUpdate

          val at =
            AtArea(player, lastLocation.area, locationUpdate.instant, durationBetween(lastLocation.instant, locationUpdate.instant))

          val left =
            LeftArea(player, lastLocation.area, locationUpdate.instant)

          val arrived =
            EnteredArea(player, nextLocation.area, locationUpdate.instant)

          val updates =
            at :: left :: arrived :: Nil

          (ctx.updatePlayerData(locationUpdate.playerId, _.addMovement(locationUpdate)), updates)
        }

      }
    }

  def meetingPoints2Activity(meetingAreas: Area*): LocationUpdate => State[Storage, List[Fact]] =
    location => State {
      ctx =>
        val maybePlayerData =
          ctx.playerData.get(location.playerId)

        maybePlayerData.fold((ctx, nil[Fact])) { playerData =>
          val facts =
            if (meetingAreas.exists(area => area === location.area))
              ctx.playersPresentAt(location.area).filterNot(other => other === playerData)
                .flatMap(other =>
                List(
                  MetPlayer(playerData, other, location.instant),
                  MetPlayer(other, playerData, location.instant)))
            else nil

          (ctx, facts)
        }

    }

  def restApi(topic: Topic[InputMessage]): WebHandler = {
    case req@POST -> Root / "location" / playerId =>

      req.decode[String] { body => {
        val maybeObservation =
          toJsonQuotes(body)
            .decodeValidation[ObservationData]
            .map(data => data.toObservation(PlayerId(playerId), Instant.now()))

        maybeObservation.fold(
          failMsg =>
            BadRequest(failMsg),
          observation =>
            for {
              _ <- eventstreams.events.publishOne(observation.fold(x => x, y => y))
              response <- Ok()
            } yield response)
      }
      }
  }

}


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><%= title %></title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
</head>
<body>


text:
require 'baseexpressiontest'

# Unit tests for EveryTE class
# Author:: Matthew Lipper

class EveryTETest < BaseExpressionTest

  def test_every_2_minutes
    date = @pdate_200401282100
    expr=EveryTE.new(date, 2)
    assert expr.include?(date + 2), "Expression #{expr.to_s} should include #{(date + 2).to_s}"
    assert expr.include?(date + 4), "Expression #{expr.to_s} should include #{(date + 4).to_s}"
    assert !expr.include?(date - 2), "Expression #{expr.to_s} should not include #{(date - 2).to_s}"
  end

  def test_every_3_days
    # Match every 3 days begining 2007-11-14
    date = @pdate_20071114
    expr=EveryTE.new(date, 3)
    assert expr.include?(date + 6), "Expression #{expr.to_s} should include #{(date + 6).to_s}"
    assert expr.include?(date + 9), "Expression #{expr.to_s} should include #{(date + 9).to_s}"
    assert !expr.include?(date + 1), "Expression #{expr.to_s} should not include #{(date + 1).to_s}"
    assert !expr.include?(date - 3), "Expression #{expr.to_s} should not include #{(date - 3).to_s}"
  end

  def test_to_s
    date=@pdate_20071116100030
    every_thirty_seconds=EveryTE.new(date, 30)
    assert_equal "every 30 seconds starting #{Runt.format_date(date)}", every_thirty_seconds.to_s
  end

end


text:
from .itunessd import get_table_size, chunk_to_dic, dic_to_chunk, split_by_step, get_custom_fields_dic

header_table = (
    {'name': 'number_of_tracks',  'size': 4,  'type': 'number'},
    {'name': 'unknown1',          'size': 4,  'type': 'unknown'}
)

track_table = (
    {'name': 'length',            'size': 4,  'type': 'number'},
    {'name': 'bookmark_time',     'size': 4,  'type': 'number',  'is_custom': True},
    {'name': 'play_count',        'size': 4,  'type': 'number',  'is_custom': True},
    {'name': 'time_of_last_play', 'size': 4,  'type': 'number',  'is_custom': True},
    {'name': 'skip_count',        'size': 4,  'type': 'number',  'is_custom': True},
    {'name': 'time_of_last_skip', 'size': 4,  'type': 'number',  'is_custom': True},
    {'name': 'unknown1',          'size': 4,  'type': 'unknown'},
    {'name': 'unknown2',          'size': 4,  'type': 'unknown'},
)

def itunesstats_to_dics(itunesstats):
    header_size = get_table_size(header_table)
    # header_chunk = itunesstats[0:header_size]
    # header_dic = chunk_to_dic(header_chunk, header_table)

    tracks_chunks = split_by_step(itunesstats[header_size:], get_table_size(track_table))

    _dics = []
    for track_chunk in tracks_chunks:
        _track_dic = chunk_to_dic(track_chunk, track_table)
        track_dic = get_custom_fields_dic(_track_dic, track_table)
        _dics.append(track_dic)

    return _dics

def dics_to_itunesstats(tracks_play_info_dics):
    _dics = tracks_play_info_dics

    header_dic = {'number_of_tracks': len(tracks_play_info_dics)}
    header_chunk = dic_to_chunk(header_dic, header_table)

    [dic.update({'length': get_table_size(track_table)}) for dic in _dics]

    _chunks = [dic_to_chunk(dic, track_table) for dic in _dics]

    all_tracks_chunck = b''.join(_chunks)

    return header_chunk + all_tracks_chunck


text:
<!DOCTYPE html>
<html lang="<?=$this->lang->curr_lang?>">

        <meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title><?=$this->lang->line('application')?> » <?=$title?></title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="<?=$desc?>" />
	<meta name="author" content="CodeBits" />
        <meta name="generator" content="CodeBits Platform" />
        <meta name="robots" content="NOINDEX,NOFOLLOW" />

        <link rel="shortcut icon" href="/frontend/assets/img/favicon.ico" />

	<?php include(FRONTEND.'/view/admin/parts/app_colors.php'); ?>
        <?php include(FRONTEND.'/view/admin/parts/base_styles.php'); ?>
        <link href="/frontend/view/admin/assets/css/custom.css" rel="stylesheet" type="text/css"/>

        <?php include(FRONTEND.'/view/admin/parts/html5.php'); ?>

        <?php include(FRONTEND.'/view/admin/parts/preloader.php'); ?>

                                      <?=$title?>

                                           <form class="col s12" action="/auth/registration/" method="POST">

                                               <?php if(isset($error) && !empty($error)):?>

<?=$error?>

                                               <?php endif;?>

                                                   <input id="fullname" name="fullname" type="text" class="validate" value="" />
                                                   <?=$this->lang->line("fullname")?>

                                                   <input id="login" name="login" type="text" class="validate" value="" />
                                                   <?=$this->lang->line("login")?>

                                                   <input id="email" name="email" type="email" class="validate" value="" />
                                                   <?=$this->lang->line("email")?>

                                                   <input id="password" name="password" type="password" class="validate" value="" />
                                                   <?=$this->lang->line("password")?>

                                                   <input id="repass" name="repass" type="password" class="validate" value="" />
                                                   <?=$this->lang->line("repass")?>

                                                   <?=$this->lang->line("signin")?>
                                                   <button type="submit" class="waves-effect waves-light btn purple"><?=$this->lang->line("signup")?></button>

                                           </form>

        <?php include(FRONTEND.'/view/admin/parts/base_scripts.php'); ?>


text:
namespace com.github.zvreifnitz.JsonLib.Helper
{
    using System;
    using System.Reflection;

    internal static class JsonContextHelper
    {
        private static readonly MethodInfo GetJsonSerializatorMethod =
            typeof(IJsonContext).GetRuntimeMethod("GetSerializator", new Type[0]);

        public static void ThrowIfNotMatch(IJsonReader reader, JsonToken token)
        {
            if (reader.GetNextToken() != token)
            {
                ExceptionHelper.ThrowInvalidJsonException<object>();
            }
        }

        public static IJsonSerializator GetSerializatorReflection(this IJsonContext context, Type type)
        {
            try
            {
                MethodInfo generic = GetJsonSerializatorMethod.MakeGenericMethod(type);
                object result = generic.Invoke(context, null);
                return (IJsonSerializator)result;
            }
            catch (JsonException exc)
            {
                if (exc.Type == JsonExceptionType.MapperNotRegistered)
                {
                    return null;
                }
                throw;
            }
            catch (Exception exc)
            {
                return ExceptionHelper.ThrowUnexpectedException<IJsonSerializator>(exc);
            }
        }
    }
}


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

using System;
using System.Runtime.InteropServices;
using System.Security;

namespace NtApiDotNet.Win32.Security.Native
{
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
    internal class SEC_WINNT_AUTH_IDENTITY_EX
    {
        public const int SEC_WINNT_AUTH_IDENTITY_VERSION = 0x200;

        public int Version;
        public int Length;
        [MarshalAs(UnmanagedType.LPWStr)]
        public string User;
        public int UserLength;
        [MarshalAs(UnmanagedType.LPWStr)]
        public string Domain;
        public int DomainLength;
        public SecureStringMarshalBuffer Password;
        public int PasswordLength;
        public SecWinNtAuthIdentityFlags Flags;
        [MarshalAs(UnmanagedType.LPWStr)]
        public string PackageList;
        public int PackageListLength;

        public SEC_WINNT_AUTH_IDENTITY_EX()
        {
        }

        public SEC_WINNT_AUTH_IDENTITY_EX(string user, string domain, SecureString password, string package_list, DisposableList list)
        {
            Version = SEC_WINNT_AUTH_IDENTITY_VERSION;
            Length = Marshal.SizeOf(this);
            User = user;
            UserLength = user?.Length ?? 0;
            Domain = domain;
            DomainLength = domain?.Length ?? 0;
            if (password != null)
            {
                Password = list.AddResource(new SecureStringMarshalBuffer(password));
                PasswordLength = password.Length;
            }
            PackageList = package_list;
            PackageListLength = PackageList?.Length ?? 0;
            Flags = SecWinNtAuthIdentityFlags.Unicode;
        }
    }

    [StructLayout(LayoutKind.Sequential)]
    internal struct SEC_WINNT_AUTH_IDENTITY_EX_OUT
    {
        public int Version;
        public int Length;
        public IntPtr User;
        public int UserLength;
        public IntPtr Domain;
        public int DomainLength;
        public IntPtr Password;
        public int PasswordLength;
        public SecWinNtAuthIdentityFlags Flags;
        public IntPtr PackageList;
        public int PackageListLength;
    }
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = Hit;

var _lodash = require('lodash');

var _lodash2 = _interopRequireDefault(_lodash);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _fragments = require('./fragments');

var _fragments2 = _interopRequireDefault(_fragments);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function Hit(props) {
  var frag = function frag(val, key) {
    return _react2.default.createElement(_fragments2.default, { key: key, fieldName: key, fragments: val });
  };
  var fragments = _lodash2.default.map(props.fragments, frag);
  return _react2.default.createElement(
    'li',
    null,
    _react2.default.createElement(
      'b',
      null,
      props.id
    ),
    _react2.default.createElement(
      'span',
      { className: 'badge' },
      props.roundedScore
    ),
    _react2.default.createElement(
      'div',
      { className: 'well' },
      fragments
    )
  );
}


text:
var React = require('./react');
var NestedMixin = require('./NestedMixin');
var ValueManager = require('./ValueManager');
var Form = React.createClass({
    displayName: 'Form',
    mixins: [NestedMixin],
    getDefaultProps() {
        return {
            template: 'FormTemplate',
            onSubmit(){
            },
            noValidate: false
        }
    },

    handleSubmit(e){
        e && e.preventDefault();
        var vm = this.props.valueManager;
        if (!this.props.novalidate) {
            vm.validate();
        }
        if (vm.onSubmit(e, vm.getErrors(), vm.getValue(), this.props.path) !== false) {
            this.props.onSubmit(e, vm.getErrors(), vm.getValue());
        }
    },
    setErrors(errors){
        this.props.valueManager.setErrors(errors);
    }
});
module.exports = Form;


text:
include(CMakeParseArguments)

option(ENABLE_ISPC "Use Intel ISPC to generate SIMDified code. It can significantly boost performance." ON)
set(ISPC "/usr/local/bin/ispc" CACHE PATH "Path to Intel ISPC")
mark_as_advanced(FORCE ISPC)

function(setup_ispc)
    if(EXISTS ${ISPC})
        return()
    endif()

    set(ISPC_VERSION 1.9.2)
    if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
        set(ISPC_DIR "ispc-v${ISPC_VERSION}-linux")
    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
        set(ISPC_DIR "ispc-v${ISPC_VERSION}-osx")
    elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
        set(ISPC_DIR "ispc-v${ISPC_VERSION}-windows-vs2015")
    endif()
    set(ISPC "${CMAKE_BINARY_DIR}/${ISPC_DIR}/ispc" CACHE PATH "" FORCE)

    set(ISPC_ARCHIVE_FILE "${ISPC_DIR}.tar.gz")
    set(ISPC_ARCHIVE_URL "http://downloads.sourceforge.net/project/ispcmirror/v${ISPC_VERSION}/${ISPC_ARCHIVE_FILE}")
    set(ISPC_ARCHIVE_PATH "${CMAKE_BINARY_DIR}/${ISPC_ARCHIVE_FILE}")
    if(NOT EXISTS ${ISPC_ARCHIVE_PATH})
        file(DOWNLOAD ${ISPC_ARCHIVE_URL} ${ISPC_ARCHIVE_PATH} SHOW_PROGRESS)
    endif()
    execute_process(
        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
        COMMAND tar -xf ${ISPC_ARCHIVE_PATH}
    )
endfunction()

# e.g:
#add_ispc_targets(
#    SOURCES "src1.ispc" "src2.ispc"
#    HEADERS "header1.h" "header2.h"
#    OUTDIR "path/to/outputs")
function(add_ispc_targets)
    cmake_parse_arguments(arg "" "OUTDIR" "SOURCES;HEADERS" ${ARGN})

    foreach(source ${arg_SOURCES})
        get_filename_component(name ${source} NAME_WE)
        set(header "${arg_OUTDIR}/${name}.h")
        set(object "${arg_OUTDIR}/${name}${CMAKE_CXX_OUTPUT_EXTENSION}")
        set(objects
            ${object}
            "${arg_OUTDIR}/${name}_sse4${CMAKE_CXX_OUTPUT_EXTENSION}"
            "${arg_OUTDIR}/${name}_avx${CMAKE_CXX_OUTPUT_EXTENSION}"
            "${arg_OUTDIR}/${name}_avx512skx${CMAKE_CXX_OUTPUT_EXTENSION}"
        )
        set(outputs ${header} ${objects})
        add_custom_command(
            OUTPUT ${outputs}
            COMMAND ${ISPC} ${source} -o ${object} -h ${header} --pic --target=sse4-i32x4,avx1-i32x8,avx512skx-i32x16 --arch=x86-64 --opt=fast-masked-vload --opt=fast-math
            DEPENDS ${source} ${arg_HEADERS}
        )

        list(APPEND _ispc_headers ${header})
        list(APPEND _ispc_objects ${objects})
        list(APPEND _ispc_outputs ${outputs})
    endforeach()

    set(_ispc_headers ${_ispc_headers} PARENT_SCOPE)
    set(_ispc_objects ${_ispc_objects} PARENT_SCOPE)
    set(_ispc_outputs ${_ispc_outputs} PARENT_SCOPE)

    execute_process(COMMAND mkdir -p ${arg_OUTDIR})
    foreach(f ${_ispc_outputs})
        if(NOT EXISTS ${f})
            execute_process(COMMAND touch -t 200001010000 ${f})
        endif()
    endforeach()
endfunction()


text:
package com.shunwang.aidldemo;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Fun:
 * Created by sxx.xu on 10/13/2017.
 */

public class HelloMsg implements Parcelable {
  public static final Creator<HelloMsg> CREATOR = new Creator<HelloMsg>() {
    @Override public HelloMsg createFromParcel(Parcel in) {
      return new HelloMsg(in);
    }

    @Override public HelloMsg[] newArray(int size) {
      return new HelloMsg[size];
    }
  };
  private String name;
  private int age;

  protected HelloMsg(Parcel in) {
    name = in.readString();
    age = in.readInt();
  }

  public HelloMsg(String name, int age) {
    this.name = name;
    this.age = age;
  }

  @Override public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(name);
    dest.writeInt(age);
  }

  @Override public int describeContents() {
    return 0;
  }

  @Override public String toString() {
    return "HelloMsg{" + "name='" + name + '\'' + ", age=" + age + '}';
  }

  /**
   * 此处read的顺序,应该和write的顺序相同
   */
  public void readFromParcel(Parcel dest) {// AIDL的通信TAG为out的标记
    name = dest.readString();
    age = dest.readInt();
  }
}


text:
using namespace std;

class Camera {
private:
  GLdouble FOVY;                  // Default FOVY in degrees
  GLdouble FOVX;                  // Default FOVX in degrees
  GLdouble ASPECT_RATIO;          // Default aspect ratio
  GLdouble NEAR_CLIPPING_PLANE;   // Default clipping plane distance
  GLdouble FAR_CLIPPING_PLANE;    // Default clipping plane distance
  GLdouble DEFAULT_TRANSLATE_STEP;// Default units translated per step
  GLdouble DEFAULT_ROTATE_ANGLE;  // Default degrees rotated per step

public:
  Camera();
  ~Camera();
  GLvoid initializeMembers();

  // Translate the camera (overloads)
  GLvoid translate( GLfloat x, GLfloat y, GLfloat z );
  GLvoid translate( GLdouble x, GLdouble y, GLdouble z );
  GLvoid translate( vec3f* v );
  GLvoid translate( vec3d* v );
  GLvoid translate( GLubyte axis, GLint dir );

  // Rotate the camera (overloads)
  GLvoid rotate( vec3f* v, GLfloat theta );
  GLvoid rotate( vec3d* v, GLdouble theta );
  GLvoid rotate( GLubyte axis, GLfloat theta );
  GLvoid rotate( GLubyte axis, GLdouble theta );
  GLvoid rotate( GLubyte axis, GLint dir );

  // Alter near and far clipping planes
  GLvoid moveClippingPlane( GLubyte plane, GLint dir );

  // Recaulate perspectives and focus on chosen model.
  GLvoid centerOn( Model* m );
  GLvoid calcTranslateSteps( Model* m );
  GLvoid calcRotateAngles( Model* m );

  // Adjust parameters for gluPerspective
  GLvoid calcPerspective( GLint width, GLint height );
  GLvoid execPerspectiveChange();

  GLvoid print();

  GLboolean m_invertYLook;      // Invert Y-axis control on camera?
  GLboolean m_invertXLook;      // Invert X-axis control on camera?
  GLdouble m_fovY;              // Current FOV_y
  GLdouble m_fovX;              // Current FOV_x
  GLdouble m_aspectRatio;       // Current aspect ratio
  GLdouble m_nearClippingPlane; // Current clipping plane
  GLdouble m_farClippingPlane;  // Current clipping plane
  GLdouble m_clippingPlaneDelta;// Default change for plane inc/decrement

  col4d m_perspective;          // Holds values for a gluPerspective() call
  mat3d m_lookAt;               // Holds values for a gluLookAt() call

  vec3d m_userTranslation;      // Values of the last translation made
  vec3d m_translateStep;        // Default step distances for a translation in u=[0],v=[1],n=[2] directions

  vec3d m_userRotation;         // Values of the last rotation made
  vec3d m_rotateStep;           // Default degrees for a rotation about u=[0],v=[1],n=[2] axes

  mat4d m_projectionMatrix;     // The last projection matrix generated
  mat4d m_modelviewMatrix;      // The last modelview matrix generated
  mat4d m_resultantMatrix;      // Temp variable for ops

  mat4d m_inverseMatrix;        // Not used
  mat4d m_userMatrix;           // Not used
};

#endif


text:
-------------------------------------------------------------------------------
--  stamp info
-------------------------------------------------------------------------------
CREATE TABLE STAMP_INFO(
        ID BIGINT NOT NULL,
	COMPANY_NAME VARCHAR(100),
	NAME VARCHAR(200),
	TYPE VARCHAR(50),
	USER_ID VARCHAR(64),
	STATUS VARCHAR(50),
	DESCRIPTION VARCHAR(200),
	TENANT_ID VARCHAR(64),
        CONSTRAINT PK_STAMP_INFO PRIMARY KEY(ID)
);

COMMENT ON TABLE STAMP_INFO IS '印章';
COMMENT ON COLUMN STAMP_INFO.ID IS '主键';
COMMENT ON COLUMN STAMP_INFO.COMPANY_NAME IS '公司';
COMMENT ON COLUMN STAMP_INFO.NAME IS '名称';
COMMENT ON COLUMN STAMP_INFO.TYPE IS '类型';
COMMENT ON COLUMN STAMP_INFO.USER_ID IS '保管人';
COMMENT ON COLUMN STAMP_INFO.STATUS IS '状态';
COMMENT ON COLUMN STAMP_INFO.DESCRIPTION IS '备注';
COMMENT ON COLUMN STAMP_INFO.TENANT_ID IS '租户';