text:
tingbot

Not really a Module, but the main constructor. Creates a tingbot instance and loads optional tingbot submodules (backlight, buttons).

backlight

Backlight module. Gets loaded and exposed as
backlight

buttons

The Button event listener module gets loaded and exposed as
buttons

## Objects

tingbot : object

tingbot-node itself. exposes optional tingbot submodules (backlight, buttons), event listeners and convenience functions

## tingbot
Not really a Module, but the main constructor. Creates a [tingbot](#tingbot) instance and loads optional tingbot submodules ([backlight](#tingbot.backlight), [buttons](#tingbot.buttons)).

| Param | Type | Description |
| --- | --- | --- |
| [options] | Object |  |
| options.modules | Array.<String> | (['buttons', 'backlight']) If you only want do set the backlight, you don't need to load wiring-pi |

**Example** *(create a tingbot-node instance called tingbot)*
```js
var tb = require('tingbot-node'), tingbot = new tb();
```

* [tingbot](#module_tingbot)
    * _instance_
        * [.init()](#module_tingbot+init)
    * _inner_
        * [~run(cmd, cb)](#module_tingbot..run)

### tingbot.init()
Loads modules set in this.options.modules once internally and self-destructs. Don't use.

**Kind**: instance method of [tingbot](#module_tingbot)

### tingbot~run(cmd, cb)
Internal function to run gpio shell commands.
Beware: Usually run with sudo! (There is no password handling, because by default,
 linux user 'pi' is allowed to sudo without a password.)

**Kind**: inner method of [tingbot](#module_tingbot)

| Param | Type | Description |
| --- | --- | --- |
| cmd | string | Command to be exected |
| cb | function | (error, stdout, stderr): callback when ready. |

## backlight
Backlight module. Gets loaded and exposed as
[backlight](#tingbot.backlight)

| Param | Type | Description |
| --- | --- | --- |
| min_backlight | number | minimum backlight value (default:0) |
| max_backlight | number | maximum backlight value (default:65536) |

## buttons
The Button event listener module gets loaded and exposed as
[buttons](#tingbot.buttons)

### buttons~setButtonChanged(number, isdown, buttons)
internal: Set button changed. Used by wiring-pi callback and simulate methods.

**Kind**: inner method of [buttons](#module_buttons)
**Emits**: [button](#tingbot+event_button)

| Param | Type | Description |
| --- | --- | --- |
| number | number | button index |
| isdown | Boolean | true: press; false: release |
| buttons | Array | since this isn't scoped within tingbot.buttons, those are given via argument |

## tingbot : object
tingbot-node itself. exposes optional tingbot submodules ([backlight](#tingbot.backlight), [buttons](#tingbot.buttons)), event listeners and convenience functions

**Kind**: global namespace
**Example** *(create a tingbot-node instance called tingbot)*
```js
var tb = require('tingbot-node'), tingbot = new tb();
//use tingbot.on or tingbot.set_backlight
```

* [tingbot](#tingbot) : object
    * _instance_
        * ["backlight"](#tingbot+event_backlight)
        * ["button"](#tingbot+event_button)
    * _static_
        * [.backlight](#tingbot.backlight) : object
            * _static_
                * [.min_backlight](#tingbot.backlight.min_backlight) : Number
                * [.max_backlight](#tingbot.backlight.max_backlight) : Number
                * [.current_backlight](#tingbot.backlight.current_backlight) : Number
                * [.do_tween](#tingbot.backlight.do_tween) : Boolean
                * [.tweenable](#tingbot.backlight.tweenable) : shifty
                * [.tween_duration](#tingbot.backlight.tween_duration) : number
                * [.set_backlight(num, [cb])](#tingbot.backlight.set_backlight)
            * _inner_
                * [~setBrightnessCallback](#tingbot.backlight..setBrightnessCallback) : function
        * [.buttons](#tingbot.buttons) : object
            * [.buttons](#tingbot.buttons.buttons) : [Array.<button>](#tingbot+event_button)
            * [.setPinCallback](#tingbot.buttons.setPinCallback)
            * [.simulateDown](#tingbot.buttons.simulateDown)
            * [.simulateUp](#tingbot.buttons.simulateUp)
        * [.set_backlight(num, [cb])](#tingbot.set_backlight)
        * [.on(evname, cb)](#tingbot.on)
        * [.once(evname, cb)](#tingbot.once)
    * _inner_
        * [~onCallback](#tingbot..onCallback) : function

### "backlight"
Backlight event. Emitted as 'backlight' when a change has occurred,
'backlight:tweendone' when a tween is finished or 'backlight:tween' on every tween step

**Kind**: event emitted by [tingbot](#tingbot)
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| type | String | is 'backlight'. |
| value | number | changed brightness value. |

**Example** *(listen to a backlight change event)*
```js
tingbot.on('backlight', function(data) {
 console.log('done', data);
});
```

### "button"
Button event. Emitted as 'button' when a change has occurred, but can be optionally suffixed to get selector behavior:

`button`: Emitted when any Button is pressed or released.

`button#[0-3]`: Emitted when Button number [0-3] (from left to right) is pressed or released.

`button-[name]`: Emitted when Button [name] is pressed or released. [name] can be `left`, `center-left`,  `center-right`, `right`.

`button-[pin]`: Emitted when Button on Pin number [pin] is pressed or released.

` :down`: can be appended to only get press events.

` :up`: can be appended to only get release events.

**Kind**: event emitted by [tingbot](#tingbot)
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| type | String | is 'button'. |
| name | String | one of 'left', 'center-left', 'center-right' or 'right'. |
| direction | String | is the button pressed or released? 'up' or 'down'. |
| pin | number | button pin number. |
| changed | Date | date of last change. |
| changed_before | Date | date of previous change to get an idea how long a button was pressed. |
| value | number | button return value. |
| isdown | Boolean | is the button currently pressed down. |

**Example** *(listen to a release button event)*
```js
tingbot.on('button-left:up', function(data) {
 console.log('button left released', data);
});
```

### tingbot.backlight : object
The Backlight module is available as `tingbot.backlight`.
Set `tingbot.backlight.do_tween = true;` for a somewhat smoother brightness change.

The module emits the following events via `tingbot.on` or `tingbot.once`:
 - `backlight`: Emitted when tingbot-node has finished updating the LCD backlight brightness
 - `backlight:tween`: Emitted at every tweening step if tweening is activated
 - `backlight:tweendone`: Emitted when tweening is finished

**Kind**: static namespace of [tingbot](#tingbot)
**Example**
```js
tingbot.on('backlight', function(obj) {
 	console.log('backlight event:', obj.value);
 });
// run `tingbot.backlight.set_backlight` or short `tingbot.set_backlight` to set brightness
tingbot.set_backlight(0, function() {
	//does a lot of brightness updates, but can look nice:
	tingbot.backlight.do_tween = true;
	setTimeout(function() {
		//high values will set to maximum
		tingbot.set_backlight(300000);
	}, 1500);
});
```

* [.backlight](#tingbot.backlight) : object
    * _static_
        * [.min_backlight](#tingbot.backlight.min_backlight) : Number
        * [.max_backlight](#tingbot.backlight.max_backlight) : Number
        * [.current_backlight](#tingbot.backlight.current_backlight) : Number
        * [.do_tween](#tingbot.backlight.do_tween) : Boolean
        * [.tweenable](#tingbot.backlight.tweenable) : shifty
        * [.tween_duration](#tingbot.backlight.tween_duration) : number
        * [.set_backlight(num, [cb])](#tingbot.backlight.set_backlight)
    * _inner_
        * [~setBrightnessCallback](#tingbot.backlight..setBrightnessCallback) : function

#### backlight.min_backlight : Number
Minimum brightness value to allow

**Kind**: static property of [backlight](#tingbot.backlight)
**Default**: 0

#### backlight.max_backlight : Number
Maximum brightness value to allow

**Kind**: static property of [backlight](#tingbot.backlight)
**Default**: 65536

#### backlight.current_backlight : Number
Last set brightness value

**Kind**: static property of [backlight](#tingbot.backlight)
**Example**
```js
console.log(tingbot.backlight.current_backlight);
```

#### backlight.do_tween : Boolean
Try to smooth brightness changes

**Kind**: static property of [backlight](#tingbot.backlight)
**Default**: false
**Example** *(enable smooth backlight changes:)*
```js
tingbot.backlight.do_tween = true;
```

#### backlight.tweenable : shifty
Tween instance

**Kind**: static property of [backlight](#tingbot.backlight)

#### backlight.tween_duration : number
Tween duration in ms

**Kind**: static property of [backlight](#tingbot.backlight)
**Default**: 400

#### backlight.set_backlight(num, [cb])
Sets a new brightness value, tweens if do_tween is true

**Kind**: static method of [backlight](#tingbot.backlight)
**Emits**: [backlight](#tingbot+event_backlight)

| Param | Type | Description |
| --- | --- | --- |
| num | number | new brightness value |
| [cb] | [setBrightnessCallback](#tingbot.backlight..setBrightnessCallback) | callback when ready |

**Example** *(set backlight to maximum:)*
```js
tingbot.backlight.set_backlight(tingbot.backlight.max_backlight, function(val){
	console.log('done', val);
});
```

#### backlight~setBrightnessCallback : function
gets called when set_backlight is done.

**Kind**: inner typedef of [backlight](#tingbot.backlight)

| Param | Type | Description |
| --- | --- | --- |
| tingbot_event | object |  |
| tingbot_event.type | string | is 'brightness' |
| tingbot_event.value | number | brightness value |

### tingbot.buttons : object
The Buttons Module is available as `tingbot.buttons`, but normally you should just listen to events fired by it via `tingbot.on` or `tingbot.once`. It emits the following events:

`button`: Emitted when any Button is pressed or released.

`button#[0-3]`: Emitted when Button number [0-3] (from left to right) is pressed or released.

`button-[name]`: Emitted when Button [name] is pressed or released. [name] can be `left`, `center-left`,  `center-right`, `right`.

`button-[pin]`: Emitted when Button on Pin number [pin] is pressed or released.

` :down`: can be appended to only get press events. `tingbot.on('button#3:down', function(){})`

` :up`: can be appended to only get release events. `tingbot.on('button-left:up', function(){})`

**Kind**: static namespace of [tingbot](#tingbot)
**Example**
```js
//To listen to press/release events on one Button,
//you'll likely want to access it by name:
 tingbot.on('button-center-left', function (data) {
 	if (data.direction === 'up') { //do something when the button is released:
 		console.log(data.name + ' released:', data);
 	}
 });
 //… or by number:
 tingbot.on('button#0', function (data) {
 	if (data.direction === 'down') { //do something when the button is pressed:
 		console.log(data.name + ' pressed:', data);
 	}
 });
```

* [.buttons](#tingbot.buttons) : object
    * [.buttons](#tingbot.buttons.buttons) : [Array.<button>](#tingbot+event_button)
    * [.setPinCallback](#tingbot.buttons.setPinCallback)
    * [.simulateDown](#tingbot.buttons.simulateDown)
    * [.simulateUp](#tingbot.buttons.simulateUp)

#### buttons.buttons : [Array.<button>](#tingbot+event_button)
Array of four current button states

**Kind**: static property of [buttons](#tingbot.buttons)

#### buttons.setPinCallback
internal: set pin callback

**Kind**: static property of [buttons](#tingbot.buttons)

| Param | Type | Description |
| --- | --- | --- |
| pin | number | pin number |
| number | number | button index |
| name | string | button name |

#### buttons.simulateDown
Simulate a button press action. Remember to release the button afterwards. Will fire an event, if the button is already pressed. Might not actually move the physical button.

**Kind**: static property of [buttons](#tingbot.buttons)

| Param | Type | Description |
| --- | --- | --- |
| number | number | Number of the button to be pressed (0-3) |

#### buttons.simulateUp
Simulate a button release action. Will fire an event, if the button is already released. Might not actually move the physical button.

**Kind**: static property of [buttons](#tingbot.buttons)

| Param | Type | Description |
| --- | --- | --- |
| number | number | Number of the button to be released (0-3) |

### tingbot.set_backlight(num, [cb])
Sets a new brightness value, tweens if do_tween is true. Alias for [set_backlight](#tingbot.backlight.set_backlight)

**Kind**: static method of [tingbot](#tingbot)
**Emits**: [backlight](#tingbot+event_backlight)

| Param | Type | Description |
| --- | --- | --- |
| num | number | the new brightness value |
| [cb] | [setBrightnessCallback](#tingbot.backlight..setBrightnessCallback) | callback when ready, gets value as argument |

**Example** *(set backlight value)*
```js
tingbot.backlight.set_backlight(99999, function(val){
	console.log('done', val);
});
```

### tingbot.on(evname, cb)
Attaches Event listener to tingbot-node events.

**Kind**: static method of [tingbot](#tingbot)

| Param | Type | Description |
| --- | --- | --- |
| evname | string | Event name, like 'button' |
| cb | [onCallback](#tingbot..onCallback) | callback function to be called with event specific argument payload |

**Example** *(listen to a release button event)*
```js
tingbot.on('button-left:up',
 function(data) {
  console.log('button left released', data);
});
```

### tingbot.once(evname, cb)
Attaches Event listener to tingbot-node events for only one event.

**Kind**: static method of [tingbot](#tingbot)

| Param | Type | Description |
| --- | --- | --- |
| evname | string | Event name, like 'button' |
| cb | [onCallback](#tingbot..onCallback) | callback function to be called with event specific argument payload |

**Example** *(listen to a press button event once)*
```js
tingbot.once('button#3:down', function(data) {
  console.log('button right pressed', data);
});
```

### tingbot~onCallback : function
This callback is displayed as a global member. Should, among optional event specific properties, always have 'type' and 'value'. Look at the specific Events for more Detail.

**Kind**: inner typedef of [tingbot](#tingbot)

| Param | Type | Description |
| --- | --- | --- |
| tingbot_event | object |  |
| tingbot_event.type | string | Type of Event, eg 'button' |
| tingbot_event.value | number | value of Event, eg brightness |


text:
<?php

namespace Google\AdsApi\AdManager\v202211;

/**
 * This file was generated from WSDL. DO NOT EDIT.
 */
class CreativeNativeStylePreview
{

    /**
     * @var int $nativeStyleId
     */
    protected $nativeStyleId = null;

    /**
     * @var string $previewUrl
     */
    protected $previewUrl = null;

    /**
     * @param int $nativeStyleId
     * @param string $previewUrl
     */
    public function __construct($nativeStyleId = null, $previewUrl = null)
    {
      $this->nativeStyleId = $nativeStyleId;
      $this->previewUrl = $previewUrl;
    }

    /**
     * @return int
     */
    public function getNativeStyleId()
    {
      return $this->nativeStyleId;
    }

    /**
     * @param int $nativeStyleId
     * @return \Google\AdsApi\AdManager\v202211\CreativeNativeStylePreview
     */
    public function setNativeStyleId($nativeStyleId)
    {
      $this->nativeStyleId = (!is_null($nativeStyleId) && PHP_INT_SIZE === 4)
          ? floatval($nativeStyleId) : $nativeStyleId;
      return $this;
    }

    /**
     * @return string
     */
    public function getPreviewUrl()
    {
      return $this->previewUrl;
    }

    /**
     * @param string $previewUrl
     * @return \Google\AdsApi\AdManager\v202211\CreativeNativeStylePreview
     */
    public function setPreviewUrl($previewUrl)
    {
      $this->previewUrl = $previewUrl;
      return $this;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package gensupport

import "net/url"

// URLParams is a simplified replacement for url.Values
// that safely builds up URL parameters for encoding.
type URLParams map[string][]string

// Set sets the key to value.
// It replaces any existing values.
func (u URLParams) Set(key, value string) {
	u[key] = []string{value}
}

// SetMulti sets the key to an array of values.
// It replaces any existing values.
// Note that values must not be modified after calling SetMulti
// so the caller is responsible for making a copy if necessary.
func (u URLParams) SetMulti(key string, values []string) {
	u[key] = values
}

// Encode encodes the values into ``URL encoded'' form
// ("bar=baz&foo=quux") sorted by key.
func (u URLParams) Encode() string {
	return url.Values(u).Encode()
}


text:
package com.markeloff.demo.java8lambdas.ch3_stream;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import static org.junit.Assert.assertEquals;
import com.markeloff.demo.java8lambdas.data.Artist;

public class LondonArtist {
	public static void main(String[] args) {
		String BeyondMembers[] = { "JiaJu Huang", "JiaQiang Huang", "GuanZhong Huang", "ShiRong Ye" };
		String BeatlesMembers[] = { "John Lennon" };
		String FakeMembers[] = { "Justin" };

		List<Artist> allArtists = Arrays.asList(
				new Artist("The Beyond", new HashSet<String>(Arrays.asList(BeyondMembers)), "HongKong"),
				new Artist("The Beatles", new HashSet<String>(Arrays.asList(BeatlesMembers)), "Livepool"),
				new Artist("The Fake", new HashSet<String>(Arrays.asList(FakeMembers)), "London")
				);

		//	Traditional way
		long count = 0;
		for (Artist artist : allArtists) {
			if (artist.origin.equals("London")) {
				count++;
			}
		}
		assertEquals(1, count);

		//	Java 8 Lambda way
		count = allArtists.stream().filter(artist -> {
			System.out.println(artist.name + " is from " + artist.origin);
			return artist.origin.equals("London");
		}).count();
		assertEquals(1, count);
	}
}


text:
<?php

/*
 * This file is part of PHP CS Fixer.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *     Dariusz Rumiński <dariusz.ruminski@gmail.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace PhpCsFixer\Tests\Fixer\FunctionNotation;

use PhpCsFixer\Tests\Test\AbstractFixerTestCase;

/**
 * @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
 *
 * @internal
 *
 * @requires PHP 7.0
 * @covers \PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer
 */
final class ReturnTypeDeclarationFixerTest extends AbstractFixerTestCase
{
    public function testInvalidConfiguration()
    {
        $this->expectException(\PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException::class);
        $this->expectExceptionMessageRegExp(
            '#^\[return_type_declaration\] Invalid configuration: The option "s" does not exist\. (Known|Defined) options are: "space_before"\.$#'
        );

        $this->fixer->configure(['s' => 9000]);
    }

    /**
     * @group legacy
     * @dataProvider provideFixWithSpaceBeforeNoneCases
     * @expectedDeprecation Passing NULL to set default configuration is deprecated and will not be supported in 3.0, use an empty array instead.
     *
     * @param string      $expected
     * @param null|string $input
     */
    public function testLegacyFixWithDefaultConfiguration($expected, $input = null)
    {
        $this->fixer->configure(null);

        $this->doTest($expected, $input);
    }

    /**
     * @dataProvider provideFixWithSpaceBeforeNoneCases
     *
     * @param string      $expected
     * @param null|string $input
     */
    public function testFixWithDefaultConfiguration($expected, $input = null)
    {
        $this->fixer->configure([]);

        $this->doTest($expected, $input);
    }

    /**
     * @dataProvider provideFixWithSpaceBeforeNoneCases
     *
     * @param string      $expected
     * @param null|string $input
     */
    public function testFixWithSpaceBeforeNone($expected, $input = null)
    {
        $this->fixer->configure([
            'space_before' => 'none',
        ]);

        $this->doTest($expected, $input);
    }

    public function provideFixWithSpaceBeforeNoneCases()
    {
        return [
            [
                '<?php function foo1(int $a) {}',
            ],
            [
                '<?php function foo2(int $a): string {}',
                '<?php function foo2(int $a):string {}',
            ],
            [
                '<?php function foo3(int $c)/**/ : /**/ string {}',
            ],
            [
                '<?php function foo4(int $a): string {}',
                '<?php function foo4(int $a)  :  string {}',
            ],
            [
                '<?php function foo5(int $e)#
: #
#
string {}',
                '<?php function foo5(int $e)#
:#
#
string {}',
            ],
            [
                '<?php
                    function foo1(int $a): string {}
                    function foo2(int $a): string {}
                    function foo3(int $a): string {}
                    function foo4(int $a): string {}
                    function foo5(int $a): string {}
                    function foo6(int $a): string {}
                    function foo7(int $a): string {}
                    function foo8(int $a): string {}
                    function foo9(int $a): string {}
                ',
                '<?php
                    function foo1(int $a):string {}
                    function foo2(int $a):string {}
                    function foo3(int $a):string {}
                    function foo4(int $a):string {}
                    function foo5(int $a):string {}
                    function foo6(int $a):string {}
                    function foo7(int $a):string {}
                    function foo8(int $a):string {}
                    function foo9(int $a):string {}
                ',
            ],
        ];
    }

    /**
     * @dataProvider provideFixWithSpaceBeforeOneCases
     *
     * @param string      $expected
     * @param null|string $input
     */
    public function testFixWithSpaceBeforeOne($expected, $input = null)
    {
        $this->fixer->configure([
            'space_before' => 'one',
        ]);

        $this->doTest($expected, $input);
    }

    public function provideFixWithSpaceBeforeOneCases()
    {
        return [
            [
                '<?php function fooA(int $a) {}',
            ],
            [
                '<?php function fooB(int $a) : string {}',
                '<?php function fooB(int $a):string {}',
            ],
            [
                '<?php function fooC(int $a)/**/ : /**/string {}',
                '<?php function fooC(int $a)/**/:/**/string {}',
            ],
            [
                '<?php function fooD(int $a) : string {}',
                '<?php function fooD(int $a)  :  string {}',
            ],
            [
                '<?php function fooE(int $a) /**/ : /**/ string {}',
            ],
        ];
    }

    /**
     * @dataProvider provideFixWithSpaceBeforeNonePhp74Cases
     * @requires PHP 7.4
     *
     * @param string      $expected
     * @param null|string $input
     */
    public function testFixWithDefaultConfigurationPhp74($expected, $input = null)
    {
        $this->doTest($expected, $input);
    }

    public function provideFixWithSpaceBeforeNonePhp74Cases()
    {
        return [
            [
                '<?php fn(): int => 1;',
                '<?php fn():int => 1;',
            ],
        ];
    }
}


text:
layout: page
title: Zimmerman Industries Dinner
date: 2016-05-24
author: Doris Fleming
tags: weekly links, java
status: published
summary: Nulla volutpat facilisis est ut maximus. Morbi massa.
banner: images/banner/leisure-01.jpg
booking:
  startDate: 10/10/2018
  endDate: 10/15/2018
  ctyhocn: SACABHX
  groupCode: ZID
published: true
---
Curabitur tristique et leo ut auctor. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque quis facilisis diam. In sagittis eleifend aliquet. Suspendisse eu nisl ut libero cursus facilisis. Aliquam faucibus tortor turpis, ut accumsan ante efficitur id. Cras blandit fringilla lorem. Aenean varius vulputate tortor, eu ornare lectus laoreet at. Morbi aliquam convallis risus pretium placerat. Morbi aliquet ante ut tempor placerat. Maecenas placerat vehicula feugiat. Donec eget efficitur lacus. Nam non metus eget tortor rutrum convallis. Fusce odio nulla, consequat vitae tincidunt sed, tincidunt scelerisque libero. Aenean bibendum lacinia ex ac sollicitudin. Phasellus vel sem tristique, posuere velit quis, viverra ligula.

* Pellentesque id ipsum id ipsum rhoncus ultricies nec eu erat
* Vivamus nec erat at nisi efficitur ullamcorper a quis tortor
* Maecenas vel urna ullamcorper, faucibus est at, maximus magna
* Maecenas scelerisque justo sed quam rhoncus, at aliquet ligula mollis
* Donec at nibh faucibus, imperdiet sapien et, scelerisque lorem.

Sed pellentesque risus placerat, hendrerit massa hendrerit, sodales nisl. Aliquam dapibus et lectus rhoncus dapibus. Etiam vitae odio sapien. Nam elementum nisi elit, non pellentesque orci malesuada vel. Proin aliquet dui felis, quis egestas tellus tempus non. Morbi sit amet purus et dui condimentum semper. Pellentesque dui tortor, vehicula sed augue accumsan, semper ultrices neque. Integer metus erat, sollicitudin ac nunc eget, consectetur iaculis orci. Fusce molestie tristique velit luctus dignissim. Mauris laoreet ac nisl eget pharetra. Morbi in semper lorem. Integer felis orci, ullamcorper vel elit non, viverra maximus justo.


text:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
	<string name="random__welcome">Theme's com.random.widget i18n overrides original widget random__welcome</string>
</resources>


text:
package org.apache.servicecomb.demo.multiServiceCenterServerB;

import java.util.List;

import javax.ws.rs.core.MediaType;

import org.apache.servicecomb.provider.rest.common.RestSchema;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.netflix.config.DynamicPropertyFactory;

@RestSchema(schemaId = "ConfigurationEndpoint")
@RequestMapping(path = "/register/url/config", produces = MediaType.APPLICATION_JSON)
public class ConfigurationEndpoint {
  private static final Logger LOGGER
      = LoggerFactory.getLogger(ServerEndpoint.class);

  @Autowired
  private Environment environment;

  @Value("${demo.multi.service.center.serverB.key1}")
  private String key1;

  @Value("${demo.multi.service.center.serverB.key2}")
  private String key2;

  @Value("${demo.multi.service.center.serverB.key3}")
  private String key3;

  @Value("${demo.multi.service.center.serverB.key4}")
  private String key4;

  @Value("${demo.multi.service.center.serverB.key5}")
  private String key5;

  @Value("${demo.multi.service.center.serverB.key6}")
  private String key6;

  @Value("${demo.multi.service.center.serverB.key7}")
  private List<String> key7;

  @GetMapping(path = "/config")
  public String getValue(@RequestParam(name = "key") String key, @RequestParam(name = "type") int type) {
    if (type == 1) {
      return environment.getProperty(key);
    } else if (type == 2) {
      return DynamicPropertyFactory.getInstance().getStringProperty(key, null).get();
    } else {
      switch (key) {
        case "demo.multi.service.center.serverB.key1":
          return key1;
        case "demo.multi.service.center.serverB.key2":
          return key2;
        case "demo.multi.service.center.serverB.key3":
          return key3;
        case "demo.multi.service.center.serverB.key4":
          return key4;
        case "demo.multi.service.center.serverB.key5":
          return key5;
        case "demo.multi.service.center.serverB.key6":
          return key6;
        default:
          return null;
      }
    }
  }

  @SuppressWarnings("unchecked")
  @GetMapping(path = "/configList")
  public List<String> getValueList(@RequestParam(name = "key") String key, @RequestParam(name = "type") int type) {
    if (type == 1) {
      return environment.getProperty(key, List.class);
    } else {
      switch (key) {
        case "demo.multi.service.center.serverB.key7":
          return key7;
        default:
          return null;
      }
    }
  }
}


text:
<?php

$lang['upload_userfile_not_set'] = "Impossible de trouver une variable de type POST nommée userfile.";
$lang['upload_file_exceeds_limit'] = "Le fichier envoyé dépasse la taille limite définie dans votre fichier de configuration PHP.";
$lang['upload_file_exceeds_form_limit'] = "Le fichier envoyé dépasse la taille limite définie dans votre formulaire d'envoi.";
$lang['upload_file_partial'] = "Le fichier n'a été que partiellement envoyé.";
$lang['upload_no_temp_directory'] = "Il manque le répertoire temporaire.";
$lang['upload_unable_to_write_file'] = "Le fichier n'a pas pu être enregistré sur le disque.";
$lang['upload_stopped_by_extension'] = "L'envoi du fichier a été stoppé par l'extension.";
$lang['upload_no_file_selected'] = "Vous n'avez pas choisi de fichier à envoyer.";
$lang['upload_invalid_filetype'] = "Le type de fichier que vous tentez d'envoyer n'est pas autorisé.";
$lang['upload_invalid_filesize'] = "Le fichier que vous tentez d'envoyer est plus gros que la taille autorisée.";
$lang['upload_invalid_dimensions'] = "L'image que vous tentez d'envoyer dépasse les valeurs maximales autorisées pour la hauteur ou la largeur.";
$lang['upload_destination_error'] = "Une erreur est survenue lors du déplacement du fichier envoyé vers sa destination finale.";
$lang['upload_no_filepath'] = "Le chemin de destination semble invalide.";
$lang['upload_no_file_types'] = "Vous n'avez pas spécifié de type de fichiers autorisés.";
$lang['upload_bad_filename'] = "Un fichier avec le même nom que celui que vous avez envoyé existe déjà sur le serveur.";
$lang['upload_not_writable'] = "Le répertoire de destination ne semble pas être accessible en écriture.";

/* End of file upload_lang.php */
/* Location: ./system/language/french/upload_lang.php */


text:
class AddColumnFirstGuessRightToGuesses < ActiveRecord::Migration
  def change
    add_column :guesses, :first_guess_correct, :boolean, default: false
  end
end


text:
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System.Web.Services.Protocols;
using DBlog.Web.UnitTests.WebServices.Blog;
using System.Reflection;

namespace DBlog.Web.UnitTests.WebServices
{
    [TestFixture]
    public class BlogAssociatedCommentTest : BlogTest
    {
        [Test]
        public void TestGetAssociatedComments()
        {
            int count = Blog.GetAssociatedCommentsCount(Ticket, null);
            Console.WriteLine("Count: {0}", count);
            Assert.IsTrue(count >= 0);
            TransitAssociatedComment[] comments = Blog.GetAssociatedComments(Ticket, null);
            Assert.IsNotNull(comments);
            Assert.IsTrue(comments.Length >= 0);
            Console.WriteLine("Comments: {0}", comments.Length);
            Assert.AreEqual(comments.Length, count);
        }
    }
}


text:
package br.com.rooting.roxana.parameter.finder;

import br.com.rooting.roxana.parameter.Parameter;
import org.apache.commons.lang3.StringUtils;

import javax.validation.ConstraintViolation;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class ConstraintValidationParameterFinder implements ParameterFinderStrategy {

    private static final String EMPTY_VALUE = "";

    private static final String INVALID_VALUE_PARAMETER = "invalidValue";
    private static final String PROPERTY_NAME_PARAMETER = "propertyName";

    private static final String REMOVED_PARAMETER_GROUP = "groups";
    private static final String REMOVED_PARAMETER_MESSAGE = "message";
    private static final String REMOVED_PARAMETER_PAYLOAD = "payload";

    private final ConstraintViolation<?> violation;

    public ConstraintValidationParameterFinder(final ConstraintViolation<?> violation) throws IllegalArgumentException {
        if (violation == null) {
            throw new IllegalArgumentException();
        }

        this.violation = violation;
    }

    @Override
    public List<Parameter> findParameters() {
        List<Parameter> parameters = new ArrayList<>();
        String propertyName = this.formatPropertyName(this.getViolation().getPropertyPath().toString());

        // TODO Create annotation for customizing.
        parameters.add(Parameter.create(PROPERTY_NAME_PARAMETER, propertyName));

        Object invalidValue = this.getViolation().getInvalidValue() == null ? EMPTY_VALUE : this.getViolation().getInvalidValue();
        parameters.add(Parameter.create(INVALID_VALUE_PARAMETER, invalidValue));

        Map<String, Object> attributes = new HashMap<>(this.getViolation().getConstraintDescriptor().getAttributes());

        attributes.remove(REMOVED_PARAMETER_GROUP);
        attributes.remove(REMOVED_PARAMETER_MESSAGE);
        attributes.remove(REMOVED_PARAMETER_PAYLOAD);

        parameters.addAll(attributes.entrySet()
                .stream()
                .map(e -> Parameter.create(e.getKey(), e.getValue()))
                .collect(Collectors.toList())
        );
        return parameters;
    }

    private ConstraintViolation<?> getViolation() {
        return this.violation;
    }

    private String formatPropertyName(String propertyName) {
        return Stream.of(StringUtils.splitByCharacterTypeCamelCase(propertyName))
                .map(StringUtils::capitalize)
                .reduce((s1, s2) -> s1.concat(" ").concat(s2))
                .orElse(EMPTY_VALUE);
    }

}


text:
<?php

class TimeZoneConvert_VTimeZoneTests extends PHPUnit_Framework_TestCase
{

    public static $rfc5545AmericaNewYork = <<<EOT
BEGIN:VTIMEZONE
TZID:America/New_York
LAST-MODIFIED:20050809T050000Z
BEGIN:DAYLIGHT
DTSTART:19670430T020000
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=-1SU;UNTIL=19730429T070000Z
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:19671029T020000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU;UNTIL=20061029T060000Z
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19740106T020000
RDATE:19750223T020000
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
END:DAYLIGHT
BEGIN:DAYLIGHT
DTSTART:19760425T020000
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=-1SU;UNTIL=19860427T070000Z
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
END:DAYLIGHT
BEGIN:DAYLIGHT
DTSTART:19870405T020000
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU;UNTIL=20060402T070000Z
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
END:DAYLIGHT
BEGIN:DAYLIGHT
DTSTART:20070311T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20071104T020000
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
END:STANDARD
END:VTIMEZONE
EOT;

    /**
     * https://bugzilla.mozilla.org/show_bug.cgi?id=504299
     * STANDARD BUG FIXED 20100927T020000 -> 20100927T020000
     */
    public static $customAsiaJerusalem = <<<EOT
BEGIN:VTIMEZONE
TZID:Asia/Jerusalem
X-LIC-LOCATION:Asia/Jerusalem
BEGIN:STANDARD
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
TZNAME:IST
DTSTART:20081005T020000
RDATE;VALUE=DATE-TIME:20081005T020000,20090927T020000,20100912T020000,20111002T020000,
20120923T020000,20130908T020000,20140928T020000,20150920T020000,20161009T020000,
20170924T020000,20180916T020000,20191006T020000,20200927T020000,20210912T020000,
20221002T020000,20230924T020000,20241006T020000,20250928T020000,20260920T020000,
20271010T020000,20280924T020000,20290916T020000,20301006T020000,20310921T020000,
20320912T020000,20331002T020000,20340917T020000,20351007T020000,20360928T020000,
20370913T020000
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20090327T020000
RDATE;VALUE=DATE-TIME:20090327T020000,20100326T020000,20110401T020000,20120330T020000,
20130329T020000,20140328T020000,20150327T020000,20160401T020000,20170331T020000,
20180330T020000,20190329T020000,20200327T020000,20210326T020000,20220401T020000,
20230331T020000,20240329T020000,20250328T020000,20260327T020000,20270326T020000,
20280331T020000,20290330T020000,20300329T020000,20310328T020000,20320326T020000,
20330401T020000,20340331T020000,20350330T020000,20360328T020000,20370327T020000
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
TZNAME:Jerusalem DST
END:DAYLIGHT
END:VTIMEZONE
EOT;

    /**
     * thunderbird starts most of its rrule 1970 (start of unix timestamp)
     */
    public static $thunderbirdEuropeBerlin = <<<EOT
BEGIN:VTIMEZONE
TZID:Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
EOT;

    public static $msexchange2007EuropeBerlin = <<<EOT
PRODID:Microsoft Exchange Server 2007
BEGIN:VTIMEZONE
TZID:W. Europe Standard Time
BEGIN:STANDARD
DTSTART:16010101T030000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
EOT;

    public static $msexchangeCDO = <<<EOT
PRODID:Microsoft CDO for Microsoft Exchange
BEGIN:VTIMEZONE
TZID:(GMT+01.00) Sarajevo/Warsaw/Zagreb
X-MICROSOFT-CDO-TZID:2
BEGIN:STANDARD
DTSTART:16010101T030000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
END:VTIMEZONE
EOT;

    public static $appleical5 = <<<EOT
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
DTSTART:19810329T020000
TZNAME:CEST
TZOFFSETTO:+0200
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
DTSTART:19961027T030000
TZNAME:CET
TZOFFSETTO:+0100
END:STANDARD
END:VTIMEZONE
EOT;

    public static $novellgroupwise8 = <<<EOT
PRODID:-//Novell Inc//Groupwise 8.0.2
BEGIN:VTIMEZONE
TZID:(GMT+0100) Westeuropäische Normalzeit
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:20001028T020000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
TZNAME:Westeuropäische Normalzeit
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:20000325T010000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
TZNAME:Westeuropäische Sommerzeit
END:DAYLIGHT
END:VTIMEZONE
EOT;

    /**
     * @var TimeZoneConvert_VTimeZone
     */
    public $uit;

    public function setUp()
    {
        $this->uit = new TimeZoneConvert_VTimeZone();
    }

    public function testGetTransitionRules()
    {
         $transitionRules = $this->uit->getTransitionRules(self::$rfc5545AmericaNewYork);

         $this->assertEquals(7, count($transitionRules), '7 transitions rules should be found');

         $this->assertEquals(TRUE, $transitionRules[0]->isdst, 'first rule is dst');
         $this->assertEquals(-4*60*60, $transitionRules[0]->offset, 'offset is 4 hours');
         $this->assertEquals('EDT', $transitionRules[0]->abbr, 'abbr failed');
         $this->assertEquals(4, $transitionRules[0]->month, 'month failed');
         $this->assertEquals(0, $transitionRules[0]->wkday, 'wkday failed');
         $this->assertEquals(-1, $transitionRules[0]->numwk, 'numwk failed');
         $this->assertEquals(new DateTime('19670430T070000', new DateTimeZone('UTC')), $transitionRules[0]->from, 'from failed NOTE the offset!');
         $this->assertEquals(new DateTime('19730429T070000', new DateTimeZone('UTC')), $transitionRules[0]->until, 'first rule until fails');

         $this->assertEquals(FALSE, $transitionRules[1]->isdst, 'second rule is non dst');
         $this->assertEquals('EST', $transitionRules[1]->abbr, 'abbr failed');
         $this->assertEquals(TRUE, $transitionRules[1]->isRecurringRule(), 'second rule is per rrule');
         $this->assertEquals(new DateTime('20061029T060000', new DateTimeZone('UTC')), $transitionRules[1]->until, 'second rule until fails');

         $transitionDates = $transitionRules[2]->getTransitionDates();
         $this->assertEquals(1, count($transitionDates), 'thrird rule should have one rdate transition');
         $this->assertEquals(FALSE, $transitionRules[2]->isRecurringRule(), 'thrird rule has no rrule');
         $this->assertEquals(new DateTime('19750223T070000', new DateTimeZone('UTC')), $transitionDates[0], 'thrird rule transitions date fails');

        $transitionRules = $this->uit->getTransitionRules(self::$customAsiaJerusalem);
        $this->assertEquals(2, count($transitionRules), '2 transitions rules should be found in $customAsiaJerusalem');
        $transitionDates = $transitionRules[0]->getTransitionDates();
        $this->assertEquals(30, count($transitionDates));

        $transitions = $this->uit->getTransitions($transitionRules);
    }

    public function testGetTransitionsRfc5545AmericaNewYork()
    {
        $transitionRules = $this->uit->getTransitionRules(self::$rfc5545AmericaNewYork);
        $transitions = $this->uit->getTransitions($transitionRules);

        $this->assertTrue(count($transitions) > 7, 'min. 7 transitions should be computed');

        $this->assertEquals(-84387600, $transitions[0]['ts']);
        $this->assertEquals('1967-04-30T07:00:00+0000', $transitions[0]['date']);
        $this->assertEquals(-14400, $transitions[0]['offset']);
        $this->assertEquals(TRUE, $transitions[0]['isdst']);
        $this->assertEquals('EDT', $transitions[0]['abbr']);
    }

    public function testGetTransitionsThunderbirdEuropeBerlin()
    {
        $transitionRules = $this->uit->getTransitionRules(self::$thunderbirdEuropeBerlin);
        $transitions = $this->uit->getTransitions($transitionRules);

        $this->assertEquals(2, count($transitions), '2 transitions should be found');
    }

    public function testGetTransitionsAppleical5()
    {
        $transitionRules = $this->uit->getTransitionRules(self::$appleical5);
        $transitions = $this->uit->getTransitions($transitionRules);

        $timezone = TimeZoneConvert_Transition::getMatchingTimezone($transitions);

        $this->assertTrue($timezone instanceof DateTimeZone, 'timezone not found');
        $this->assertEquals('Arctic/Longyearbyen', $timezone->getName());
    }

    public function testGetTransitionsMsexchange2007EuropeBerlin()
    {
        $transitionRules = $this->uit->getTransitionRules(self::$msexchange2007EuropeBerlin);
        $transitions = $this->uit->getTransitions($transitionRules);

        $timezone = TimeZoneConvert_Transition::getMatchingTimezone($transitions);

        $this->assertTrue($timezone instanceof DateTimeZone, 'timezone not found');
        $this->assertEquals('Africa/Ceuta', $timezone->getName());
    }

    public function testComputeTimezoneRfc5545AmericaNewYork()
    {
        $timezone = $this->uit->computeTimezone(self::$rfc5545AmericaNewYork);

        $this->assertEquals('America/New_York', $timezone->getName());
    }

    public function testGetTZIdentifierAppleical5()
    {
        $tzid = $this->uit->getTZIdentifier(self::$appleical5);

        $this->assertEquals('Europe/Berlin', $tzid);
    }

    public function testGetTZIdentifierMsexchange2007EuropeBerlin()
    {
        $tzid = $this->uit->getTZIdentifier(self::$msexchange2007EuropeBerlin);

        $this->assertEquals('Europe/Berlin', $tzid);
    }

    public function testGetTZIdentifierMsexchangeCDOSarajevo()
    {
        $tzid = $this->uit->getTZIdentifier(self::$msexchangeCDO);

        $this->assertEquals('Europe/Lisbon', $tzid);
    }

    public function testGetTZIdentifierThunderbirdEuropeBerlin()
    {
        $tzid = $this->uit->getTZIdentifier(str_replace('TZID:Europe/Berlin', 'TZID:SOMEUNKNOWNID', self::$thunderbirdEuropeBerlin));

        $this->assertEquals('Europe/Berlin', $tzid);
    }

    public function testGetTZIdentifierNovellgroupwise8EuropeBerlin()
    {
        $tzid = $this->uit->getTZIdentifier(preg_replace('/PRODID:.*/', '', self::$novellgroupwise8), '-//Novell Inc//Groupwise 8.0.2');

        $this->assertEquals('Europe/Berlin', $tzid);
    }

    public function testGetVTimezoneUTC()
    {
        $VTimeZone = $this->uit->getVTimezone('UTC');

        // make shure it don't fails
        // UTC should not be represented as VTIMEZONE normally
        $UTCTZ = <<<EOT
BEGIN:VTIMEZONE
TZID:UTC
END:VTIMEZONE
EOT;
        foreach(explode(TimeZoneConvert_VTimeZone::EOL, $VTimeZone) as $line) {
            if (! $line) continue;
             $this->assertTrue(strstr($UTCTZ, $line) !== FALSE, "$line failed");
        }
    }

    public function testGetVTimezoneEuropeBerlin()
    {
        $VTimeZone = $this->uit->getVTimezone('Europe/Berlin');
        foreach(explode(TimeZoneConvert_VTimeZone::EOL, $VTimeZone) as $line) {
            if (! $line) continue;
             $this->assertTrue(strstr(self::$appleical5, $line) !== FALSE, "$line failed");
        }
    }

    public function testGetVTimezoneAsiaJerusalem()
    {
        $from = new DateTime('2008-06-01T00:00:00', new DateTimeZone('UTC'));
        $until = new DateTime('2037-12-31T00:00:00', new DateTimeZone('UTC'));

        $VTimeZone = $this->uit->getVTimezone('Asia/Jerusalem', $from, $until);

        foreach(explode(TimeZoneConvert_VTimeZone::EOL, $VTimeZone) as $line) {
            if (! $line || strstr($line, 'TZNAME') !== FALSE) continue; // different TZNAME
             $this->assertTrue(strstr(self::$customAsiaJerusalem, $line) !== FALSE, "$line failed");
        }

    }
}


text:
{{class.current.Name}}

What You Need To Know

        In this course you will be walking through the necessary steps to make a product accessible to a buyer-user
        on your buyer side application. You will be working with three types of objects and 2 types of assignments,
        all of which are necessary for your buyer-user to gain access to a product.

        At the culmination of this course, you will get the chance to authenticate as a buyer-user and check
        if they have access to the product. If you follow closely, you won't have any trouble. Pay close
        attention to the What You Need To Know section, as we will explain some of the different rules and
        options you have when working with buyer-user product access beyond this course.

        Before you get started, you will want to write down the userID of the user you plan on working with.
        This will help you keep track of things during this course, so you won't have to start over. If you
        do not have any users, step out of this course and create a user in one of two ways: Create a user
        in the API Console, or, Take the
        Basics course, where we will help you create a
        basic environment, including your first user.

Creating & Getting a Product

        Looking over to the right, you can see that we have provided you with multiple scripts. While ultimate
        goal of this class is to set up a product OR get a product that you have already created, we also want
        to introduce you to the relevant CRUD operations you have access to. Take a look at the update.js,
        patch.js, and delete.js scripts and feel free to give them a try.

        Once you are done playing around with these CRUD scripts, let's focus on the goal of this class. If you
        have a product in mind (and its ID), go into the get.js script. The Script is ready to
        run once you have filled in the var productID with the ID of the product you want to use.
        Make sure you take note of the ID that you are using, so you don't forget it in future classes!!! If
        this is your plan, go ahead and run it, and you are done!

        If instead you would like to create an entirely new product, we will focus on the create.js
        script. As you can see, there is an entire product object set inside the var prod variable.
        To create the new product, you only need to set the ID, Description,
        Name, QuantityMultiplier, and Active values. Everything else
        is up to you, but we recommend you focus on the fundamentals right now.

        Set the ID, Description, and Name to whatever you like. Set the
        QuantityMultiplier to 1 or more, and set Active to true. Note that in order
        for a buyer-user to access a product, in MUST be active.

        Now that you have completed the configuration, review the code block. Note that the service
        call to create a Product is, Products.Create(prod);, where 'prod' is the new object you are
        creating, and the only parameter as part of the method call.

        On success, you will see in your console log the HTTP Request details. Click on the down button to see
        the JSON representation of the Request's response. In the response, you should see the same object you
        sent off in the request as your request object. Make sure you keep a note on the ID of the
        product you just created. Now Hit 'Run' when you are ready!


text:
#pragma once
#if !defined( CLIENT_H )
#define CLIENT_H

//	Boost headers that we want to use
//	#define BOOST_PROGRAM_OPTIONS_DYN_LINK
#include <boost/program_options.hpp>
#include "stdafx.h"
#include "../statTimer/statisticalTimer.extern.h"
#include "../include/unicode.compatibility.h"

#include <fftw3.h>

typedef unsigned char uint24_t[3];

#define CALLBCKSTR(...) #__VA_ARGS__
#define STRINGIFY(...) 	CALLBCKSTR(__VA_ARGS__)

#define BATCH_LENGTH 1024

#define ConvertToFloat typedef unsigned char uint24_t[3]; \n \
						float convert24To32bit(__global void* in, uint inoffset, __global void* userdata) \n \
						{ \n \
						__global uint24_t* inData =  (__global uint24_t*)in; \n \
						float val = inData[inoffset][0] << 16 | inData[inoffset][1] << 8 | inData[inoffset][2] ; \n \
						return val;  \n \
						}

#define ConvertToFloat_KERNEL typedef unsigned char uint24_t[3]; \n \
							__kernel void convert24To32bit (__global void *input, __global void *output) \n \
							 { \n \
								uint inoffset = get_global_id(0); \n \
								__global uint24_t* inData =  (__global uint24_t*)input; \n \
								float val = inData[inoffset][0] << 16 | inData[inoffset][1] << 8 | inData[inoffset][2] ; \n \
								*((__global float*)output + inoffset) = val;  \n \
							} \n

#define MagnitudeExtraction void extractMagnitude(__global void *output, uint outoffset, __global void *userdata, float2 fftoutput) \n \
							{ \n \
								float magnitude = sqrt(fftoutput.x * fftoutput.x + fftoutput.y * fftoutput.y); \n \
								*((__global float*)output + outoffset) = magnitude; \n \
							} \n

#define MagnitudeExtraction_KERNEL __kernel void extractMagnitude(__global float2 *output, __global float *magoutput) \n \
							{ \n \
								uint outoffset = get_global_id(0); \n \
								float magnitude = sqrt(output[outoffset].x * output[outoffset].x + output[outoffset].y * output[outoffset].y); \n \
								*(magoutput + outoffset) = magnitude; \n \
							} \n

template < typename T >
void R2C_transform(std::auto_ptr< clfftSetupData > setupData, size_t* inlengths, size_t batchSize,
				   clfftDim dim, clfftPrecision precision,  cl_uint profile_count);

template < typename T >
void runR2C_FFT_WithCallback(std::auto_ptr< clfftSetupData > setupData, cl_context context, cl_command_queue commandQueue,
						size_t* inlengths, clfftDim dim, clfftPrecision precision,
						size_t batchSize, size_t vectorLength, size_t fftLength, cl_uint profile_count);

template < typename T >
void runR2C_FFT_PreAndPostprocessKernel(std::auto_ptr< clfftSetupData > setupData, cl_context context,
							cl_command_queue commandQueue, cl_device_id device_id,
							size_t* inlengths, clfftDim dim, clfftPrecision precision,
							size_t batchSize, size_t vectorLength, size_t fftLength, cl_uint profile_count);

fftwf_complex* get_R2C_fftwf_output(size_t* lengths, size_t fftbatchLength, int batch_size,
									clfftLayout in_layout, clfftDim dim);

template < typename T1, typename T2>
bool compare(T1 *refData, std::vector< T2 > data,
             size_t length, const float epsilon = 1e-6f);

#ifdef WIN32

struct Timer
{
    LARGE_INTEGER start, stop, freq;

public:
    Timer() { QueryPerformanceFrequency( &freq ); }

    void Start() { QueryPerformanceCounter(&start); }
    double Sample()
    {
        QueryPerformanceCounter  ( &stop );
        double time = (double)(stop.QuadPart-start.QuadPart) / (double)(freq.QuadPart);
        return time;
    }
};

#elif defined(__APPLE__) || defined(__MACOSX)

#include <mach/clock.h>
#include <mach/mach.h>

struct Timer
{
    clock_serv_t clock;
    mach_timespec_t start, end;

public:
    Timer() { host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &clock); }
    ~Timer() { mach_port_deallocate(mach_task_self(), clock); }

    void Start() { clock_get_time(clock, &start); }
    double Sample()
    {
        clock_get_time(clock, &end);
        double time = 1000000000L * (end.tv_sec - start.tv_sec) + end.tv_nsec - start.tv_nsec;
        return time * 1E-9;
    }
};

#else

#include <time.h>
#include <math.h>

struct Timer
{
    struct timespec start, end;

public:
    Timer() { }

    void Start() { clock_gettime(CLOCK_MONOTONIC, &start); }
    double Sample()
    {
        clock_gettime(CLOCK_MONOTONIC, &end);
        double time = 1000000000L * (end.tv_sec - start.tv_sec) + end.tv_nsec - start.tv_nsec;
        return time * 1E-9;
    }
};

#endif

#endif


text:
(function(global, $) {

	global.ui.Window = ui.Widget.extend({

		onRender : function() {

		},

		initPlugin : function() {

			this.$el.modal({
				show : this.options.autoShow
			});
		}

	});

})(this, domLib());


text:
'use strict';

var fs      = require('fs');
var through = require('through2');

function read(fn, options) {
  if (!options && options !== null) {
    options = 'utf8';
  }

  return through.obj(function (file, e, cb) {
    if (options === null || typeof options === 'string') {
      if (file.stats.isDirectory()) {
        fs.readdir(file.path, function (err, files) {
          if (err) { cb(err); return; }

          fn(files);
          cb(null, file);
        });
      }

      else {
        fs.readFile(file.path, options, function (err, data) {
          if (err) { cb(err); return; }

          fn(data);
          cb(null, file);
        });
      }
    }

    else {
      fn(fs.createReadStream(file.path, options));
      cb(null, file);
    }
  });
}

module.exports = read;


text:
package com.hazelcast.cache.impl.journal;

import com.hazelcast.cache.impl.CacheDataSerializerHook;
import com.hazelcast.cache.impl.CacheService;
import com.hazelcast.cache.journal.EventJournalCacheEvent;
import com.hazelcast.internal.journal.EventJournal;
import com.hazelcast.internal.journal.EventJournalReadOperation;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.projection.Projection;
import com.hazelcast.ringbuffer.impl.ReadResultSetImpl;
import com.hazelcast.util.function.Predicate;

import java.io.IOException;

/**
 * Reads from the cache event journal in batches. You may specify the start sequence,
 * the minumum required number of items in the response, the maximum number of items
 * in the response, a predicate that the events should pass and a projection to
 * apply to the events in the journal.
 * If the event journal currently contains less events than the required minimum, the
 * call will wait until it has sufficient items.
 * The predicate, filter and projection may be {@code null} in which case all elements are returned
 * and no projection is applied.
 *
 * @param <T> the return type of the projection. It is equal to the journal event type
 *            if the projection is {@code null} or it is the identity projection
 * @since 3.9
 */
public class CacheEventJournalReadOperation<K, V, T>
        extends EventJournalReadOperation<T, InternalEventJournalCacheEvent> {
    protected Predicate<? super EventJournalCacheEvent<K, V>> predicate;
    protected Projection<? super EventJournalCacheEvent<K, V>, ? extends T> projection;

    public CacheEventJournalReadOperation() {
    }

    public CacheEventJournalReadOperation(
            String cacheName, long startSequence, int minSize, int maxSize,
            Predicate<? super EventJournalCacheEvent<K, V>> predicate,
            Projection<? super EventJournalCacheEvent<K, V>, ? extends T> projection
    ) {
        super(cacheName, startSequence, minSize, maxSize);
        this.predicate = predicate;
        this.projection = projection;
    }

    @Override
    protected EventJournal<InternalEventJournalCacheEvent> getJournal() {
        final CacheService service = getService();
        return service.getEventJournal();
    }

    @Override
    public int getFactoryId() {
        return CacheDataSerializerHook.F_ID;
    }

    @Override
    public int getId() {
        return CacheDataSerializerHook.EVENT_JOURNAL_READ_OPERATION;
    }

    @Override
    public String getServiceName() {
        return CacheService.SERVICE_NAME;
    }

    @Override
    protected void writeInternal(ObjectDataOutput out) throws IOException {
        super.writeInternal(out);
        out.writeObject(predicate);
        out.writeObject(projection);
    }

    @Override
    protected void readInternal(ObjectDataInput in) throws IOException {
        super.readInternal(in);
        predicate = in.readObject();
        projection = in.readObject();
    }

    @Override
    protected ReadResultSetImpl<InternalEventJournalCacheEvent, T> createResultSet() {
        return new CacheEventJournalReadResultSetImpl<K, V, T>(
                minSize, maxSize, getNodeEngine().getSerializationService(), predicate, projection);
    }
}


text:
using System;
using System.Diagnostics.Contracts;

namespace System.Globalization
{
    internal class CalendricalCalculationsHelper
    {
        private const double FullCircleOfArc = 360.0; // 360.0;
        private const int HalfCircleOfArc = 180;
        private const double TwelveHours = 0.5; // half a day
        private const double Noon2000Jan01 = 730120.5;
        internal const double MeanTropicalYearInDays = 365.242189;
        private const double MeanSpeedOfSun = MeanTropicalYearInDays / FullCircleOfArc;
        private const double LongitudeSpring = 0.0;
        private const double TwoDegreesAfterSpring = 2.0;
        private const int SecondsPerDay = 24 * 60 * 60; // 24 hours * 60 minutes * 60 seconds

        private const int DaysInUniformLengthCentury = 36525;
        private const int SecondsPerMinute = 60;
        private const int MinutesPerDegree = 60;

        private static long s_startOf1810 = GetNumberOfDays(new DateTime(1810, 1, 1));
        private static long s_startOf1900Century = GetNumberOfDays(new DateTime(1900, 1, 1));

        private static double[] s_coefficients1900to1987 = new double[] { -0.00002, 0.000297, 0.025184, -0.181133, 0.553040, -0.861938, 0.677066, -0.212591 };
        private static double[] s_coefficients1800to1899 = new double[] { -0.000009, 0.003844, 0.083563, 0.865736, 4.867575, 15.845535, 31.332267, 38.291999, 28.316289, 11.636204, 2.043794 };
        private static double[] s_coefficients1700to1799 = new double[] { 8.118780842, -0.005092142, 0.003336121, -0.0000266484 };
        private static double[] s_coefficients1620to1699 = new double[] { 196.58333, -4.0675, 0.0219167 };
        private static double[] s_lambdaCoefficients = new double[] { 280.46645, 36000.76983, 0.0003032 };
        private static double[] s_anomalyCoefficients = new double[] { 357.52910, 35999.05030, -0.0001559, -0.00000048 };
        private static double[] s_eccentricityCoefficients = new double[] { 0.016708617, -0.000042037, -0.0000001236 };
        private static double[] s_coefficients = new double[] { Angle(23, 26, 21.448), Angle(0, 0, -46.8150), Angle(0, 0, -0.00059), Angle(0, 0, 0.001813) };
        private static double[] s_coefficientsA = new double[] { 124.90, -1934.134, 0.002063 };
        private static double[] s_coefficientsB = new double[] { 201.11, 72001.5377, 0.00057 };

        private static double RadiansFromDegrees(double degree)
        {
            return degree * Math.PI / 180;
        }

        private static double SinOfDegree(double degree)
        {
            return Math.Sin(RadiansFromDegrees(degree));
        }

        private static double CosOfDegree(double degree)
        {
            return Math.Cos(RadiansFromDegrees(degree));
        }
        private static double TanOfDegree(double degree)
        {
            return Math.Tan(RadiansFromDegrees(degree));
        }

        public static double Angle(int degrees, int minutes, double seconds)
        {
            return ((seconds / SecondsPerMinute + minutes) / MinutesPerDegree) + degrees;
        }

        private static double Obliquity(double julianCenturies)
        {
            return PolynomialSum(s_coefficients, julianCenturies);
        }

        internal static long GetNumberOfDays(DateTime date)
        {
            return date.Ticks / GregorianCalendar.TicksPerDay;
        }

        private static int GetGregorianYear(double numberOfDays)
        {
            return new DateTime(Math.Min((long)(Math.Floor(numberOfDays) * GregorianCalendar.TicksPerDay), DateTime.MaxValue.Ticks)).Year;
        }

        private enum CorrectionAlgorithm
        {
            Default,
            Year1988to2019,
            Year1900to1987,
            Year1800to1899,
            Year1700to1799,
            Year1620to1699
        }

        private struct EphemerisCorrectionAlgorithmMap
        {
            public EphemerisCorrectionAlgorithmMap(int year, CorrectionAlgorithm algorithm)
            {
                _lowestYear = year;
                _algorithm = algorithm;
            }

            internal int _lowestYear;
            internal CorrectionAlgorithm _algorithm;
        };

        private static EphemerisCorrectionAlgorithmMap[] s_ephemerisCorrectionTable = new EphemerisCorrectionAlgorithmMap[]
        {
            // lowest year that starts algorithm, algorithm to use
            new EphemerisCorrectionAlgorithmMap(2020, CorrectionAlgorithm.Default),
            new EphemerisCorrectionAlgorithmMap(1988, CorrectionAlgorithm.Year1988to2019),
            new EphemerisCorrectionAlgorithmMap(1900, CorrectionAlgorithm.Year1900to1987),
            new EphemerisCorrectionAlgorithmMap(1800, CorrectionAlgorithm.Year1800to1899),
            new EphemerisCorrectionAlgorithmMap(1700, CorrectionAlgorithm.Year1700to1799),
            new EphemerisCorrectionAlgorithmMap(1620, CorrectionAlgorithm.Year1620to1699),
            new EphemerisCorrectionAlgorithmMap(int.MinValue, CorrectionAlgorithm.Default) // default must be last
        };

        private static double Reminder(double divisor, double dividend)
        {
            double whole = Math.Floor(divisor / dividend);
            return divisor - (dividend * whole);
        }

        private static double NormalizeLongitude(double longitude)
        {
            longitude = Reminder(longitude, FullCircleOfArc);
            if (longitude < 0)
            {
                longitude += FullCircleOfArc;
            }
            return longitude;
        }

        static public double AsDayFraction(double longitude)
        {
            return longitude / FullCircleOfArc;
        }

        private static double PolynomialSum(double[] coefficients, double indeterminate)
        {
            double sum = coefficients[0];
            double indeterminateRaised = 1;
            for (int i = 1; i < coefficients.Length; i++)
            {
                indeterminateRaised *= indeterminate;
                sum += (coefficients[i] * indeterminateRaised);
            }

            return sum;
        }

        private static double CenturiesFrom1900(int gregorianYear)
        {
            long july1stOfYear = GetNumberOfDays(new DateTime(gregorianYear, 7, 1));
            return (double)(july1stOfYear - s_startOf1900Century) / DaysInUniformLengthCentury;
        }

        // the following formulas defines a polynomial function which gives us the amount that the earth is slowing down for specific year ranges
        private static double DefaultEphemerisCorrection(int gregorianYear)
        {
            Contract.Assert(gregorianYear < 1620 || 2020 <= gregorianYear);
            long january1stOfYear = GetNumberOfDays(new DateTime(gregorianYear, 1, 1));
            double daysSinceStartOf1810 = january1stOfYear - s_startOf1810;
            double x = TwelveHours + daysSinceStartOf1810;
            return ((Math.Pow(x, 2) / 41048480) - 15) / SecondsPerDay;
        }

        private static double EphemerisCorrection1988to2019(int gregorianYear)
        {
            Contract.Assert(1988 <= gregorianYear && gregorianYear <= 2019);
            return (double)(gregorianYear - 1933) / SecondsPerDay;
        }

        private static double EphemerisCorrection1900to1987(int gregorianYear)
        {
            Contract.Assert(1900 <= gregorianYear && gregorianYear <= 1987);
            double centuriesFrom1900 = CenturiesFrom1900(gregorianYear);
            return PolynomialSum(s_coefficients1900to1987, centuriesFrom1900);
        }

        private static double EphemerisCorrection1800to1899(int gregorianYear)
        {
            Contract.Assert(1800 <= gregorianYear && gregorianYear <= 1899);
            double centuriesFrom1900 = CenturiesFrom1900(gregorianYear);
            return PolynomialSum(s_coefficients1800to1899, centuriesFrom1900);
        }

        private static double EphemerisCorrection1700to1799(int gregorianYear)
        {
            Contract.Assert(1700 <= gregorianYear && gregorianYear <= 1799);
            double yearsSince1700 = gregorianYear - 1700;
            return PolynomialSum(s_coefficients1700to1799, yearsSince1700) / SecondsPerDay;
        }

        private static double EphemerisCorrection1620to1699(int gregorianYear)
        {
            Contract.Assert(1620 <= gregorianYear && gregorianYear <= 1699);
            double yearsSince1600 = gregorianYear - 1600;
            return PolynomialSum(s_coefficients1620to1699, yearsSince1600) / SecondsPerDay;
        }

        // ephemeris-correction: correction to account for the slowing down of the rotation of the earth
        private static double EphemerisCorrection(double time)
        {
            int year = GetGregorianYear(time);
            foreach (EphemerisCorrectionAlgorithmMap map in s_ephemerisCorrectionTable)
            {
                if (map._lowestYear <= year)
                {
                    switch (map._algorithm)
                    {
                        case CorrectionAlgorithm.Default: return DefaultEphemerisCorrection(year);
                        case CorrectionAlgorithm.Year1988to2019: return EphemerisCorrection1988to2019(year);
                        case CorrectionAlgorithm.Year1900to1987: return EphemerisCorrection1900to1987(year);
                        case CorrectionAlgorithm.Year1800to1899: return EphemerisCorrection1800to1899(year);
                        case CorrectionAlgorithm.Year1700to1799: return EphemerisCorrection1700to1799(year);
                        case CorrectionAlgorithm.Year1620to1699: return EphemerisCorrection1620to1699(year);
                    }

                    break; // break the loop and assert eventually
                }
            }

            Contract.Assert(false, "Not expected to come here");
            return DefaultEphemerisCorrection(year);
        }

        static public double JulianCenturies(double moment)
        {
            double dynamicalMoment = moment + EphemerisCorrection(moment);
            return (dynamicalMoment - Noon2000Jan01) / DaysInUniformLengthCentury;
        }

        private static bool IsNegative(double value)
        {
            return Math.Sign(value) == -1;
        }

        private static double CopySign(double value, double sign)
        {
            return (IsNegative(value) == IsNegative(sign)) ? value : -value;
        }

        // equation-of-time; approximate the difference between apparent solar time and mean solar time
        // formal definition is EOT = GHA - GMHA
        // GHA is the Greenwich Hour Angle of the apparent (actual) Sun
        // GMHA is the Greenwich Mean Hour Angle of the mean (fictitious) Sun
        // http://www.esrl.noaa.gov/gmd/grad/solcalc/
        // http://en.wikipedia.org/wiki/Equation_of_time
        private static double EquationOfTime(double time)
        {
            double julianCenturies = JulianCenturies(time);
            double lambda = PolynomialSum(s_lambdaCoefficients, julianCenturies);
            double anomaly = PolynomialSum(s_anomalyCoefficients, julianCenturies);
            double eccentricity = PolynomialSum(s_eccentricityCoefficients, julianCenturies);

            double epsilon = Obliquity(julianCenturies);
            double tanHalfEpsilon = TanOfDegree(epsilon / 2);
            double y = tanHalfEpsilon * tanHalfEpsilon;

            double dividend = ((y * SinOfDegree(2 * lambda))
                - (2 * eccentricity * SinOfDegree(anomaly))
                + (4 * eccentricity * y * SinOfDegree(anomaly) * CosOfDegree(2 * lambda))
                - (0.5 * Math.Pow(y, 2) * SinOfDegree(4 * lambda))
                - (1.25 * Math.Pow(eccentricity, 2) * SinOfDegree(2 * anomaly)));
            double divisor = 2 * Math.PI;
            double equation = dividend / divisor;

            // approximation of equation of time is not valid for dates that are many millennia in the past or future
            // thus limited to a half day
            return CopySign(Math.Min(Math.Abs(equation), TwelveHours), equation);
        }

        private static double AsLocalTime(double apparentMidday, double longitude)
        {
            // slightly inaccurate since equation of time takes mean time not apparent time as its argument, but the difference is negligible
            double universalTime = apparentMidday - AsDayFraction(longitude);
            return apparentMidday - EquationOfTime(universalTime);
        }

        // midday
        static public double Midday(double date, double longitude)
        {
            return AsLocalTime(date + TwelveHours, longitude) - AsDayFraction(longitude);
        }

        private static double InitLongitude(double longitude)
        {
            return NormalizeLongitude(longitude + HalfCircleOfArc) - HalfCircleOfArc;
        }

        // midday-in-tehran
        static public double MiddayAtPersianObservationSite(double date)
        {
            return Midday(date, InitLongitude(52.5)); // 52.5 degrees east - longitude of UTC+3:30 which defines Iranian Standard Time
        }

        private static double PeriodicTerm(double julianCenturies, int x, double y, double z)
        {
            return x * SinOfDegree(y + z * julianCenturies);
        }

        private static double SumLongSequenceOfPeriodicTerms(double julianCenturies)
        {
            double sum = 0.0;
            sum += PeriodicTerm(julianCenturies, 403406, 270.54861, 0.9287892);
            sum += PeriodicTerm(julianCenturies, 195207, 340.19128, 35999.1376958);
            sum += PeriodicTerm(julianCenturies, 119433, 63.91854, 35999.4089666);
            sum += PeriodicTerm(julianCenturies, 112392, 331.2622, 35998.7287385);
            sum += PeriodicTerm(julianCenturies, 3891, 317.843, 71998.20261);
            sum += PeriodicTerm(julianCenturies, 2819, 86.631, 71998.4403);
            sum += PeriodicTerm(julianCenturies, 1721, 240.052, 36000.35726);
            sum += PeriodicTerm(julianCenturies, 660, 310.26, 71997.4812);
            sum += PeriodicTerm(julianCenturies, 350, 247.23, 32964.4678);
            sum += PeriodicTerm(julianCenturies, 334, 260.87, -19.441);
            sum += PeriodicTerm(julianCenturies, 314, 297.82, 445267.1117);
            sum += PeriodicTerm(julianCenturies, 268, 343.14, 45036.884);
            sum += PeriodicTerm(julianCenturies, 242, 166.79, 3.1008);
            sum += PeriodicTerm(julianCenturies, 234, 81.53, 22518.4434);
            sum += PeriodicTerm(julianCenturies, 158, 3.5, -19.9739);
            sum += PeriodicTerm(julianCenturies, 132, 132.75, 65928.9345);
            sum += PeriodicTerm(julianCenturies, 129, 182.95, 9038.0293);
            sum += PeriodicTerm(julianCenturies, 114, 162.03, 3034.7684);
            sum += PeriodicTerm(julianCenturies, 99, 29.8, 33718.148);
            sum += PeriodicTerm(julianCenturies, 93, 266.4, 3034.448);
            sum += PeriodicTerm(julianCenturies, 86, 249.2, -2280.773);
            sum += PeriodicTerm(julianCenturies, 78, 157.6, 29929.992);
            sum += PeriodicTerm(julianCenturies, 72, 257.8, 31556.493);
            sum += PeriodicTerm(julianCenturies, 68, 185.1, 149.588);
            sum += PeriodicTerm(julianCenturies, 64, 69.9, 9037.75);
            sum += PeriodicTerm(julianCenturies, 46, 8.0, 107997.405);
            sum += PeriodicTerm(julianCenturies, 38, 197.1, -4444.176);
            sum += PeriodicTerm(julianCenturies, 37, 250.4, 151.771);
            sum += PeriodicTerm(julianCenturies, 32, 65.3, 67555.316);
            sum += PeriodicTerm(julianCenturies, 29, 162.7, 31556.08);
            sum += PeriodicTerm(julianCenturies, 28, 341.5, -4561.54);
            sum += PeriodicTerm(julianCenturies, 27, 291.6, 107996.706);
            sum += PeriodicTerm(julianCenturies, 27, 98.5, 1221.655);
            sum += PeriodicTerm(julianCenturies, 25, 146.7, 62894.167);
            sum += PeriodicTerm(julianCenturies, 24, 110.0, 31437.369);
            sum += PeriodicTerm(julianCenturies, 21, 5.2, 14578.298);
            sum += PeriodicTerm(julianCenturies, 21, 342.6, -31931.757);
            sum += PeriodicTerm(julianCenturies, 20, 230.9, 34777.243);
            sum += PeriodicTerm(julianCenturies, 18, 256.1, 1221.999);
            sum += PeriodicTerm(julianCenturies, 17, 45.3, 62894.511);
            sum += PeriodicTerm(julianCenturies, 14, 242.9, -4442.039);
            sum += PeriodicTerm(julianCenturies, 13, 115.2, 107997.909);
            sum += PeriodicTerm(julianCenturies, 13, 151.8, 119.066);
            sum += PeriodicTerm(julianCenturies, 13, 285.3, 16859.071);
            sum += PeriodicTerm(julianCenturies, 12, 53.3, -4.578);
            sum += PeriodicTerm(julianCenturies, 10, 126.6, 26895.292);
            sum += PeriodicTerm(julianCenturies, 10, 205.7, -39.127);
            sum += PeriodicTerm(julianCenturies, 10, 85.9, 12297.536);
            sum += PeriodicTerm(julianCenturies, 10, 146.1, 90073.778);
            return sum;
        }

        private static double Aberration(double julianCenturies)
        {
            return (0.0000974 * CosOfDegree(177.63 + (35999.01848 * julianCenturies))) - 0.005575;
        }

        private static double Nutation(double julianCenturies)
        {
            double a = PolynomialSum(s_coefficientsA, julianCenturies);
            double b = PolynomialSum(s_coefficientsB, julianCenturies);
            return (-0.004778 * SinOfDegree(a)) - (0.0003667 * SinOfDegree(b));
        }

        static public double Compute(double time)
        {
            double julianCenturies = JulianCenturies(time);
            double lambda = 282.7771834
                + (36000.76953744 * julianCenturies)
                + (0.000005729577951308232 * SumLongSequenceOfPeriodicTerms(julianCenturies));

            double longitude = lambda + Aberration(julianCenturies) + Nutation(julianCenturies);
            return InitLongitude(longitude);
        }

        static public double AsSeason(double longitude)
        {
            return (longitude < 0) ? (longitude + FullCircleOfArc) : longitude;
        }

        private static double EstimatePrior(double longitude, double time)
        {
            double timeSunLastAtLongitude = time - (MeanSpeedOfSun * AsSeason(InitLongitude(Compute(time) - longitude)));
            double longitudeErrorDelta = InitLongitude(Compute(timeSunLastAtLongitude) - longitude);
            return Math.Min(time, timeSunLastAtLongitude - (MeanSpeedOfSun * longitudeErrorDelta));
        }

        // persian-new-year-on-or-before
        //  number of days is the absolute date. The absolute date is the number of days from January 1st, 1 A.D.
        //  1/1/0001 is absolute date 1.
        internal static long PersianNewYearOnOrBefore(long numberOfDays)
        {
            double date = (double)numberOfDays;

            double approx = EstimatePrior(LongitudeSpring, MiddayAtPersianObservationSite(date));
            long lowerBoundNewYearDay = (long)Math.Floor(approx) - 1;
            long upperBoundNewYearDay = lowerBoundNewYearDay + 3; // estimate is generally within a day of the actual occurrance (at the limits, the error expands, since the calculations rely on the mean tropical year which changes...)
            long day = lowerBoundNewYearDay;
            for (; day != upperBoundNewYearDay; ++day)
            {
                double midday = MiddayAtPersianObservationSite((double)day);
                double l = Compute(midday);
                if ((LongitudeSpring <= l) && (l <= TwoDegreesAfterSpring))
                {
                    break;
                }
            }
            Contract.Assert(day != upperBoundNewYearDay);

            return day - 1;
        }
    }
}


text:
/**
 *
 */
package codemining.java.tokenizers;

import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.SortedMap;
import java.util.logging.Logger;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.AbstractFileFilter;
import org.apache.commons.io.filefilter.RegexFileFilter;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.eclipse.jdt.core.compiler.ITerminalSymbols;
import org.eclipse.jdt.core.compiler.InvalidInputException;
import org.eclipse.jdt.internal.core.util.PublicScanner;

import codemining.languagetools.ITokenizer;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

/**
 * A tokenizer of Java code but it returns the token type.
 *
 * @author Miltos Allamanis <m.allamanis@ed.ac.uk>
 *
 */
public class JavaTokenTypeTokenizer implements ITokenizer {

	/**
	 * @param token
	 * @return
	 */
	public static boolean isLiteralToken(final int token) {
		return token == ITerminalSymbols.TokenNameStringLiteral
				|| token == ITerminalSymbols.TokenNameCharacterLiteral
				|| token == ITerminalSymbols.TokenNameFloatingPointLiteral
				|| token == ITerminalSymbols.TokenNameIntegerLiteral
				|| token == ITerminalSymbols.TokenNameLongLiteral
				|| token == ITerminalSymbols.TokenNameDoubleLiteral;
	}

	private static final long serialVersionUID = 7532823864395627836L;

	private static final Logger LOGGER = Logger
			.getLogger(JavaTokenTypeTokenizer.class.getName());
	private final RegexFileFilter javaCodeFiler = new RegexFileFilter(
			".*\\.java$");
	private final boolean tokenizeComments;
	public static final String LITERAL_TOKEN = "LITERAL";
	public static final String IDENTIFIER_TOKEN = "IDENTIFIER";
	public static final String COMMENT_JAVADOC = "COMMENT_JAVADOC";
	public static final String COMMENT_LINE = "COMMENT_LINE";

	public static final String COMMENT_BLOCK = "COMMENT_BLOCK";

	public JavaTokenTypeTokenizer() {
		this.tokenizeComments = false;
	}

	public JavaTokenTypeTokenizer(final boolean tokenizeComments) {
		this.tokenizeComments = tokenizeComments;
	}

	/**
	 * @return
	 */
	private PublicScanner createScanner() {
		final PublicScanner scanner = new PublicScanner();
		scanner.tokenizeComments = tokenizeComments;
		return scanner;
	}

	@Override
	public SortedMap<Integer, FullToken> fullTokenListWithPos(final char[] code) {
		final SortedMap<Integer, FullToken> tokens = Maps.newTreeMap();
		tokens.put(-1, new FullToken(SENTENCE_START, SENTENCE_START));
		tokens.put(Integer.MAX_VALUE, new FullToken(SENTENCE_END, SENTENCE_END));
		final PublicScanner scanner = createScanner();
		scanner.setSource(code);
		while (!scanner.atEnd()) {
			do {
				try {
					final int token = scanner.getNextToken();
					final int position = scanner.getCurrentTokenStartPosition();

					if (token == ITerminalSymbols.TokenNameEOF) {
						break;
					} else if (token == ITerminalSymbols.TokenNameIdentifier) {
						tokens.put(position,
								new FullToken(IDENTIFIER_TOKEN, ""));
					} else if (token == ITerminalSymbols.TokenNameCOMMENT_BLOCK) {
						tokens.put(position, new FullToken(COMMENT_BLOCK, ""));
					} else if (token == ITerminalSymbols.TokenNameCOMMENT_JAVADOC) {
						tokens.put(position, new FullToken(COMMENT_JAVADOC, ""));
					} else if (token == ITerminalSymbols.TokenNameCOMMENT_LINE) {
						tokens.put(position, new FullToken(COMMENT_LINE, ""));
					} else if (isLiteralToken(token)) {
						tokens.put(position, new FullToken(LITERAL_TOKEN, ""));
					} else {
						tokens.put(position,
								new FullToken(scanner.getCurrentTokenString(),
										""));
					}

				} catch (final InvalidInputException e) {
					LOGGER.warning(ExceptionUtils.getFullStackTrace(e));
				}
			} while (!scanner.atEnd());

		}
		return tokens;
	}

	@Override
	public AbstractFileFilter getFileFilter() {
		return javaCodeFiler;
	}

	@Override
	public String getIdentifierType() {
		// We do not return types here...
		throw new IllegalArgumentException("Retrieving types is not possible");
	}

	@Override
	public Collection<String> getKeywordTypes() {
		throw new IllegalArgumentException("Retrieving types is not possible");
	}

	@Override
	public Collection<String> getLiteralTypes() {
		throw new IllegalArgumentException("Retrieving types is not possible");
	}

	@Override
	public FullToken getTokenFromString(final String token) {
		return new FullToken(token, "");
	}

	@Override
	public List<FullToken> getTokenListFromCode(final char[] code) {
		final List<FullToken> tokens = Lists.newArrayList();
		tokens.add(new FullToken(SENTENCE_START, SENTENCE_START));
		final PublicScanner scanner = createScanner();
		scanner.setSource(code);
		do {
			try {
				final int token = scanner.getNextToken();
				if (token == ITerminalSymbols.TokenNameEOF) {
					break;
				} else if (token == ITerminalSymbols.TokenNameIdentifier) {
					tokens.add(new FullToken(IDENTIFIER_TOKEN, ""));
				} else if (isLiteralToken(token)) {
					tokens.add(new FullToken(LITERAL_TOKEN, ""));
				} else if (token == ITerminalSymbols.TokenNameCOMMENT_BLOCK) {
					tokens.add(new FullToken(COMMENT_BLOCK, ""));
				} else if (token == ITerminalSymbols.TokenNameCOMMENT_JAVADOC) {
					tokens.add(new FullToken(COMMENT_JAVADOC, ""));
				} else if (token == ITerminalSymbols.TokenNameCOMMENT_LINE) {
					tokens.add(new FullToken(COMMENT_LINE, ""));
				} else {
					tokens.add(new FullToken(scanner.getCurrentTokenString(),
							""));
				}

			} catch (final InvalidInputException e) {
				LOGGER.warning(ExceptionUtils.getFullStackTrace(e));
			}
		} while (!scanner.atEnd());
		tokens.add(new FullToken(SENTENCE_END, SENTENCE_END));
		return tokens;
	}

	@Override
	public List<FullToken> getTokenListFromCode(final File codeFile)
			throws IOException {
		return getTokenListFromCode(FileUtils.readFileToString(codeFile)
				.toCharArray());
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see uk.ac.ed.inf.javacodeutils.ITokenizer#tokenListFromCode(char[])
	 */
	@Override
	public List<String> tokenListFromCode(final char[] code) {
		final List<String> tokens = Lists.newArrayList();
		tokens.add(SENTENCE_START);
		final PublicScanner scanner = createScanner();
		scanner.setSource(code);
		do {
			try {
				final int token = scanner.getNextToken();
				if (token == ITerminalSymbols.TokenNameEOF) {
					break;
				} else if (token == ITerminalSymbols.TokenNameIdentifier) {
					tokens.add(IDENTIFIER_TOKEN);
				} else if (token == ITerminalSymbols.TokenNameCOMMENT_BLOCK) {
					tokens.add(COMMENT_BLOCK);
				} else if (token == ITerminalSymbols.TokenNameCOMMENT_LINE) {
					tokens.add(COMMENT_LINE);
				} else if (token == ITerminalSymbols.TokenNameCOMMENT_JAVADOC) {
					tokens.add(COMMENT_JAVADOC);
				} else if (isLiteralToken(token)) {
					tokens.add(LITERAL_TOKEN);
				} else {
					tokens.add(scanner.getCurrentTokenString());
				}

			} catch (final InvalidInputException e) {
				LOGGER.warning(ExceptionUtils.getFullStackTrace(e));
			}
		} while (!scanner.atEnd());
		tokens.add(SENTENCE_END);
		return tokens;
	}

	@Override
	public List<String> tokenListFromCode(final File codeFile)
			throws IOException {
		return tokenListFromCode(FileUtils.readFileToString(codeFile)
				.toCharArray());
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see uk.ac.ed.inf.javacodeutils.ITokenizer#tokenListWithPos(char[])
	 */
	@Override
	public SortedMap<Integer, String> tokenListWithPos(final char[] code) {
		final SortedMap<Integer, String> tokens = Maps.newTreeMap();
		tokens.put(-1, SENTENCE_START);
		tokens.put(Integer.MAX_VALUE, SENTENCE_END);
		final PublicScanner scanner = createScanner();
		scanner.setSource(code);
		while (!scanner.atEnd()) {
			do {
				try {
					final int token = scanner.getNextToken();
					final int position = scanner.getCurrentTokenStartPosition();

					if (token == ITerminalSymbols.TokenNameEOF) {
						break;
					} else if (token == ITerminalSymbols.TokenNameIdentifier) {
						tokens.put(position, IDENTIFIER_TOKEN);
					} else if (isLiteralToken(token)) {
						tokens.put(position, LITERAL_TOKEN);
					} else if (token == ITerminalSymbols.TokenNameCOMMENT_BLOCK) {
						tokens.put(position, COMMENT_BLOCK);
					} else if (token == ITerminalSymbols.TokenNameCOMMENT_JAVADOC) {
						tokens.put(position, COMMENT_JAVADOC);
					} else if (token == ITerminalSymbols.TokenNameCOMMENT_LINE) {
						tokens.put(position, COMMENT_LINE);
					} else {
						tokens.put(position, scanner.getCurrentTokenString());
					}

				} catch (final InvalidInputException e) {
					LOGGER.warning(ExceptionUtils.getFullStackTrace(e));
				}
			} while (!scanner.atEnd());

		}
		return tokens;
	}

	@Override
	public SortedMap<Integer, FullToken> tokenListWithPos(final File file)
			throws IOException {
		return fullTokenListWithPos(FileUtils.readFileToString(file)
				.toCharArray());
	}
}


text: docker image build -t hello-compsci .


text:
package com.golshadi.majid.database.constants;

/**
 * Created by Majid Golshadi on 4/10/2014.
 *
 * chunks table columns name
 */
public class CHUNKS {

    public final static String COLUMN_ID        = "id";
    public final static String COLUMN_TASK_ID   = "task_id";
    public final static String COLUMN_BEGIN     = "begin";
    public final static String COLUMN_END       = "end";
    public final static String COLUMN_COMPLETED = "completed";
}


text:
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Arka Maity");
MODULE_DESCRIPTION("Intro to linux kernel programming");

static int __init hello_init(void)
{
	printk(KERN_INFO "Hello, World\n");
	return 0;
}

static void __exit hello_exit(void)
{
	printk(KERN_INFO "Goodbye, world\n");
}

module_init(hello_init);
module_exit(hello_exit);


text:
package biz.golek.whattodofordinner.database.business.dao;

import javax.inject.Provider;

import biz.golek.whattodofordinner.business.contract.dao.MarkDinnerUsedDao;
import biz.golek.whattodofordinner.business.contract.entities.Dinner;
import biz.golek.whattodofordinner.database.DinnerDao;
import biz.golek.whattodofordinner.database.DinnerStatDao;
import biz.golek.whattodofordinner.database.entities.DinnerStat;
import biz.golek.whattodofordinner.database.entities.DinnerStatType;

/**
 * Created by Bartosz Gołek on 24.02.16.
 */
public class MarkDinnerUsedDaoImpl implements MarkDinnerUsedDao {
    private final Provider<DinnerDao> dinnerDaoProvider;
    private Provider<DinnerStatDao> dinnerStatDaoProvider;
    private DBDinnerToDinner converter;

    public MarkDinnerUsedDaoImpl(Provider<DinnerDao> dinnerDaoProvider, Provider<DinnerStatDao> dinnerStatDaoProvider, DBDinnerToDinner converter) {
        this.dinnerDaoProvider = dinnerDaoProvider;
        this.dinnerStatDaoProvider = dinnerStatDaoProvider;
        this.converter = converter;
    }

    @Override
    public Dinner GetDinner(Long dinnerId) {
        return converter.toBusiness(dinnerDaoProvider.get()
            .queryBuilder()
            .where(DinnerDao.Properties.Id.eq(dinnerId))
            .unique());
    }

    @Override
    public void SaveDinner(Dinner dinner) {
        biz.golek.whattodofordinner.database.entities.Dinner entity = converter.toDatabase(dinner);

        DinnerStat dinnerStat = new DinnerStat();
        dinnerStat.setType(DinnerStatType.Usage);
        dinnerStat.setDate(entity.getLastUsage());
        dinnerStat.setDinnerId(dinner.getId());
        dinnerStatDaoProvider.get().insert(dinnerStat);

        dinnerDaoProvider.get().update(entity);
    }
}


text:
package com.thunisoft.videox;

import java.io.IOException;

import com.thunisoft.videox.mp4.Box;
import com.thunisoft.videox.mp4.MP4Parser;

public class TestMP4 {
    public static void main(String[] args) throws IOException {
        String name = "E:/media/国王的演讲/0001.优酷网-国王的演讲[高清版]-0001.mp4";
        MP4Parser parser = new MP4Parser(name);

        // trak head
        Box[] tkhd = parser.findBoxes("moov.trak.tkhd");
        for (int i = 0; i < tkhd.length; i++) {
            Box box = parser.readTrakHeaderBox(tkhd[i]);
            System.out.println(box);
        }

        // time 2 sample
        Box[] stts = parser.findBoxes("moov.trak.mdia.minf.stbl.stts");
        for (int i = 0; i < stts.length; i++) {
            Box box = parser.readSampleTableTimeSampeBox(stts[i]);
            System.out.println(box);
        }

        // 多少个样本组成一个 chunk
        Box[] stsc = parser.findBoxes("moov.trak.mdia.minf.stbl.stsc");
        for (int i = 0; i < stsc.length; i++) {
            Box box = parser.readSampleTableSampleChunkBox(stsc[i]);
            System.out.println(box);
        }

        // 每个 chunk 的偏移量
        Box[] stco = parser.findBoxes("moov.trak.mdia.minf.stbl.stco");
        for (int i = 0; i < stco.length; i++) {
            Box box = parser.readSimpleTableChunkOffsetBox(stco[i]);
            System.out.println(box);
        }

        // simple table size
        Box[] stsz = parser.findBoxes("moov.trak.mdia.minf.stbl.stsz");
        for (int i = 0; i < stsz.length; i++) {
            Box box = parser.readSampleTableSampleSizeBox(stsz[i]);
            System.out.println(box);
        }

        // sample table sync sample
        Box[] stss = parser.findBoxes("moov.trak.mdia.minf.stbl.stss");
        for (int i = 0; i < stss.length; i++) {
            Box box = parser.readSampleTableSyncSampleBox(stss[i]);
            System.out.println(box);
        }

        // mdhd
        Box[] mdhd = parser.findBoxes("moov.trak.mdia.mdhd");
        for (int i = 0; i < mdhd.length; i++) {
            Box box = parser.readMediaHeader(mdhd[i]);
            System.out.println(box);
        }

        // handler
        Box[] hdlrBox = parser.findBoxes("moov.trak.mdia.hdlr");
        for (int i = 0; i < hdlrBox.length; i++) {
            Box box = parser.readTrackHandlerBox(hdlrBox[i]);
            System.out.println(box);
        }

        Box[] stsd = parser.findBoxes("moov.trak.mdia.minf.stbl.stsd");
        for (int i = 0; i < stsd.length; i++) {
            Box box = parser.readSampleTableSampleDescriptBox(stsd[i]);
            System.out.println(box);
        }

        Box[] ctts = parser.findBoxes("moov.trak.mdia.minf.stbl.ctts");
        for (int i = 0; i < ctts.length; i++) {
            Box box = parser.readSampleTableCompositionOffset(ctts[i]);
            System.out.println(box);
        }
    }
}


text:
gadgets['ee'] = gadgets['ee'] || {};

(function() {

  var contextListeners = [];
  var isContextSet = false;

  /**
   * Sets the context for this embedded experience.
   * @param {Object} context
   *         The embedded experiences context.
   */
  function setDataContext(context) {
    if (this.f !== '..') {
      return;
    }
    opensocial.data.DataContext.putDataSet('org.opensocial.ee.context', context);
  };

  /**
   * Init the embedded experiences feature.  This calls an RPC handler to get
   * the embedded experiences context and puts it in the gadgets data context.
   * @param {Object} config
   *        Configuration for the feature.
   */
  function init(config) {
    gadgets.rpc.call(null, 'ee_gadget_rendered', setDataContext, {});
    gadgets.rpc.register('ee_set_context', setDataContext);
    opensocial.data.getDataContext().registerListener('org.opensocial.ee.context', function(key) {
      var context = opensocial.data.getDataContext().getDataSet(key);
      isContextSet = true;
      var length = contextListeners.length;
      for(var i = length;  i--;) {
        contextListeners[i](context);
      }
    });
  };

  if (gadgets.config) {
    gadgets.config.register('embedded-experiences', null, init);
  }

  /**
   * Registers a listener for when the embedded experiences context object is set for
   * this gadget.  This listener will be called whenever the context is set for the gadget.
   *
   * @param {Function} listener
   *        A function to be called when the listener is set.
   */
  gadgets.ee.registerContextListener = function(listener) {
    //Add the listener regardless
    contextListeners.push(listener);

    //It could be that the context was already set before the gadget called this function
    //so see if we have a context object in the data context and if we do call the listener
    //back right away
    if(isContextSet) {
      listener(opensocial.data.getDataContext().getDataSet('org.opensocial.ee.context'));
    }
  };
}());


text:
using Sequencing.WeatherApp.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Sequencing.WeatherApp.Controllers.DaoLayer
{
    public class SettingsRetrieveDTO
    {
        public string accessToken { set; get; }
        public string expiresIn { set; get; }
        public string tokenType { set; get; }
        public string scope { set; get; }
        public string refreshToken { set; get; }
        public string oldDeviceToken { set; get; }
        public string newDeviceToken { set; get; }
        public bool sendPush { set; get; }
        public DeviceType deviceType { set; get; }
        public ApplicationType applicationId { set; get; }
        public string appVersion { set; get; }
    }
}