text:
#include <stdio.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <inttypes.h>
#include "zlib.h"

static const uint8_t *data;
static size_t dataLen;

static void check_compress_level(uint8_t *compr, size_t comprLen,
                                 uint8_t *uncompr, size_t uncomprLen,
                                 int level) {
  compress2(compr, &comprLen, data, dataLen, level);
  uncompress(uncompr, &uncomprLen, compr, comprLen);

  /* Make sure compress + uncompress gives back the input data. */
  assert(dataLen == uncomprLen);
  assert(0 == memcmp(data, uncompr, dataLen));
}

#define put_byte(s, i, c) {s[i] = (unsigned char)(c);}

static void write_zlib_header(uint8_t *s, unsigned compression_method, unsigned flags) {
  unsigned int header = (Z_DEFLATED + ((flags)<<4)) << 8;
  header |= (compression_method << 6);

  header += 31 - (header % 31);

  /* s is guaranteed to be longer than 2 bytes. */
  put_byte(s, 0, (unsigned char)(header >> 8));
  put_byte(s, 1, (unsigned char)(header & 0xff));
}

static void check_decompress(uint8_t *compr, size_t comprLen, unsigned compression_method, unsigned flags) {
  /* We need to write a valid zlib header of size two bytes. Copy the input data
     in a larger buffer. Do not modify the input data to avoid libFuzzer error:
     fuzz target overwrites its const input. */
  size_t copyLen = dataLen + 2;
  uint8_t *copy = (uint8_t *)malloc(copyLen);
  memcpy(copy + 2, data, dataLen);
  write_zlib_header(copy, compression_method, flags);

  uncompress(compr, &comprLen, copy, copyLen);
  free(copy);
}

int LLVMFuzzerTestOneInput(const uint8_t *d, size_t size) {
  if (size < 10 || size > 1024 * 1024)
    return 0;

  const int level = d[0] % 10;
  d++,size--;

  //https://web.archive.org/web/20200220015003/http://www.onicos.com/staff/iz/formats/gzip.html
  unsigned compression_method = d[0] % 5;
  if (compression_method == 4)  //[4...7] are reserved
    compression_method = 8;
  d++,size--;
  unsigned flags = d[0] & (2 << 4);
  d++,size--;

  size_t comprLen = compressBound(size);
  size_t uncomprLen = size;
  uint8_t *compr = NULL, *uncompr = NULL;

  data = d;
  dataLen = size;
  compr = (uint8_t *)calloc(1, comprLen);
  if (!compr)
    goto err;
  uncompr = (uint8_t *)calloc(1, uncomprLen);
  if (!uncompr)
    goto err;

  check_compress_level(compr, comprLen, uncompr, uncomprLen, level);
  check_decompress(compr, comprLen, compression_method, flags);

err:
  free(compr);
  free(uncompr);

  /* This function must return 0. */
  return 0;
}


text:
namespace Google.Cloud.Spanner.Admin.Database.V1.Snippets
{
    // [START spanner_v1_generated_DatabaseAdmin_GetDatabase_sync_flattened_resourceNames]
    using Google.Cloud.Spanner.Admin.Database.V1;
    using Google.Cloud.Spanner.Common.V1;

    public sealed partial class GeneratedDatabaseAdminClientSnippets
    {
        /// <summary>Snippet for GetDatabase</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void GetDatabaseResourceNames()
        {
            // Create client
            DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
            // Initialize request argument(s)
            DatabaseName name = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
            // Make the request
            Database response = databaseAdminClient.GetDatabase(name);
        }
    }
    // [END spanner_v1_generated_DatabaseAdmin_GetDatabase_sync_flattened_resourceNames]
}

redpajama_set_name: RedPajamaGithub


text:
For further information, check curi's homepage at [curi.cloderic.com](http://curi.cloderic.com).

There are some [C source code examples](https://github.com/cloderic/curi/tree/master/examples) you can examine.

[![Build status](https://travis-ci.org/cloderic/curi.png?branch=master)](https://travis-ci.org/cloderic/curi)

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/cloderic/curi/trend.png)](https://bitdeli.com/free "Bitdeli Badge")


text:
package com.javatests;

import org.junit.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class CounterTests {

    @Test
    public void test17() {
        boolean[] array1 = {true,  true,  true,  false,
                true,  true,  true,  true ,
                true,  false, true,  false,
                true,  false, false, true ,
                true,  true,  true,  true ,
                false, false, true,  true };
        assertEquals(17, new Counter().countSheeps(array1), "Expected 17 sheep.");
    }

    @Test
    public void test03() {
        boolean[] array1 = {true,  true,  false,  false,
                true,  false,false,false };
        assertEquals(3, new Counter().countSheeps(array1), "Expected 17 sheep.");
    }

    @Test
    public void testNone() {
        boolean[] array1 = {false};
        assertEquals(0, new Counter().countSheeps(array1), "Expected 17 sheep.");
    }

}


text:
/*
 * VAS / RLN project.
 *
 * @author Michael Diponio <michael.diponio@uts.edu.au>
 * @date  30th July 2016
 */

package io.rln.node.ss.client;

/**
 * Response from calling operations.
 */
public class OperationResponse
{
    /** Message possibly indicating a reason for failure. */
    private String message;

    /** HTTP response code. */
    private int code;

    public OperationResponse()
    {
        this.code = 200;
    }

    public OperationResponse(int code)
    {
        this.code = code;
    }

    public String getMessage()
    {
        return this.message;
    }
    public void setMessage(String message)
    {
        this.message = message;
    }

    public int getCode()
    {
        return this.code;
    }

    public void setCode(int code)
    {
        this.code = code;
    }

    /**
     * Whether the operation was successful.
     *
     * @return true if successful
     */
    public boolean ok()
    {
        return this.code == 200;
    }

    public String error()
    {
        return this.code + ": " + this.message;
    }
}


text:
@implementation LTCard

- (void)setScore:(NSInteger)score {
    _score = score;
    UIButton *buton = (UIButton *)self.view;
    [buton setTitle:@(self.score).stringValue forState:UIControlStateNormal];
    buton.titleLabel.font=[UIFont boldSystemFontOfSize:30];
    switch (score) {
        case 2:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xEEE4DB];
            break;
        case 4:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xEDE0C9];
            break;
        case 8:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xF1B17D];
            break;
        case 16:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xF39568];
            break;
        case 32:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xF47C63];
            break;
        case 64:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xF45F42];
            break;
        case 128:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xECCE78];
            break;
        case 256:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xECCB69];
            break;
        case 1024:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xECC75A];
            break;
        case 2048:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xECC478];
            break;
        case 4096:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xECC15A];
            break;
        case 8192:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xECA75A];
            break;
        case 16284:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xECA45A];
            break;
        case 32768:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xECA15A];
            break;
        case 65536:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xEC775A];            break;
        default:
            buton.backgroundColor = [UIColor lt_colorWithHex:0xEC715A];
            break;
    }
}

- (NSInteger)twice {
    self.score=self.score * 2;
    return self.score;
}
@end


text:
'use strict';

var projectLoader = require('../../storage/project');
var repository = require('../../storage/repository');

module.exports = {
	init: function init(clooca) {
		var _this = this;

		return this.list(clooca).then(function (projects) {
			if (projects.length == 0) {
				return clooca.getPlugin('clooca').request('templateProject', {});
			} else {
				return new Promise(function (resolve, reject) {
					resolve([]);
				});
			}
		}).then(function (templateprojects) {
			return Promise.all(templateprojects.map(function (p) {
				_this.save(clooca, p.key, p.data);
			}));
		}).then(function (projects) {
			return new Promise(function (resolve, reject) {
				setTimeout(resolve, 1000);
			});
		});
	},
	load: function load(clooca, projectId) {
		var storage = clooca.getStorage();
		var modelInterface = clooca.createModelInterface();
		return projectLoader.loadProject(storage, projectId).then(function (projectData) {
			var required = projectData.required || [];
			var loadRequiredTasks = required.map(function (requiredModel) {
				return function () {
					return repository.loadModel(storage, requiredModel.uri).then(function (modelJson) {
						if (modelJson || requiredModel.uri == 'http://www.eclipse.org/emf/2002/Ecore') {
							return modelInterface.loadModel(requiredModel.uri, modelJson, 'r');
						} else {
							return clooca.getPlugin('clooca').request('findEcoreModel', { url: requiredModel.uri }).then(function (model) {
								return modelInterface.loadModel(requiredModel.uri, model, 'r');
							});
						}
					});
				};
			});
			var models = projectData.models || [];
			var loadModelTasks = models.map(function (requiredModel) {
				return function () {
					return repository.loadModel(storage, requiredModel.uri).then(function (modelJson) {
						if (!modelJson && requiredModel.import) {
							return clooca.getPlugin('clooca').request('findEcoreModel', { url: requiredModel.uri }).then(function (model) {
								return modelInterface.loadModel(requiredModel.uri, model, 'w');
							});
						} else {
							return modelInterface.loadModel(requiredModel.uri, modelJson, 'w');
						}
					});
				};
			});
			var loadTasks = loadRequiredTasks.concat(loadModelTasks);
			return loadTasks.reduce(function (a, b) {
				return a.then(b);
			}, Promise.resolve(null));
		});
	},
	save: function save(clooca, name, data) {
		return projectLoader.saveProject(clooca.getStorage(), name, data);
	},
	delete: function _delete(clooca, name) {
		return projectLoader.deleteProject(clooca.getStorage(), name);
	},
	list: function list(clooca) {
		return projectLoader.listProjects(clooca.getStorage());
	}
};
//# sourceMappingURL=index.js.map


text:
package io.sarl.lang.tests.bugs.to00999;

import static io.sarl.tests.api.tools.TestEObjects.file;
import static io.sarl.tests.api.tools.TestUtils.multilineString;
import static io.sarl.tests.api.tools.TestValidator.validate;
import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import io.sarl.lang.SARLVersion;
import io.sarl.lang.sarl.SarlPackage;
import io.sarl.lang.sarl.SarlScript;
import io.sarl.tests.api.AbstractSarlTest;
import io.sarl.tests.api.tools.TestValidator.Validator;

/** Testing class for issue: Incorrect generic method compilation.
 *
 * <p>https://github.com/sarl/sarl/issues/720
 *
 * @author $Author: sgalland$
 * @version $Name$ $Revision$ $Date$
 * @mavengroupid $GroupId$
 * @mavenartifactid $ArtifactId$
 */
@DisplayName("Bug #720")
@SuppressWarnings("all")
@Tag("core")
public class Bug720Test extends AbstractSarlTest {

	private static final String SNIPSET1 = multilineString(
			"package io.sarl.lang.tests.bug720",
			"capacity ExampleCapacity",
			"{",
			"    def exampleMethod(clazz : Class<T>) with T",
			"}");

	private final String EXPECTED1 = multilineString(
			"package io.sarl.lang.tests.bug720;",
			"",
			"import io.sarl.lang.annotation.SarlElementType;",
			"import io.sarl.lang.annotation.SarlSpecification;",
			"import io.sarl.lang.core.AgentTrait;",
			"import io.sarl.lang.core.Capacity;",
			"",
			"@FunctionalInterface",
			"@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING+ "\")",
			"@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")",
			"@SuppressWarnings(\"all\")",
			"public interface ExampleCapacity extends Capacity {",
			"  <T extends Object> void exampleMethod(final Class<T> clazz);",
			"  ",
			"  /**",
			"   * @ExcludeFromApidoc",
			"   */",
			"  class ContextAwareCapacityWrapper<C extends ExampleCapacity> extends Capacity.ContextAwareCapacityWrapper<C> implements ExampleCapacity {",
			"    public ContextAwareCapacityWrapper(final C capacity, final AgentTrait caller) {",
			"      super(capacity, caller);",
			"    }",
			"    ",
			"    public <T extends Object> void exampleMethod(final Class<T> clazz) {",
			"      try {",
			"        ensureCallerInLocalThread();",
			"        this.capacity.exampleMethod(clazz);",
			"      } finally {",
			"        resetCallerInLocalThread();",
			"      }",
			"    }",
			"  }",
			"}",
			"");

	private static final String SNIPSET2 = multilineString(
			"package io.sarl.lang.tests.bug720",
			"capacity ExampleCapacity",
			"{",
			"    def exampleMethod(clazz : Class<T>) with T extends Number",
			"}");

	private final String EXPECTED2 = multilineString(
			"package io.sarl.lang.tests.bug720;",
			"",
			"import io.sarl.lang.annotation.SarlElementType;",
			"import io.sarl.lang.annotation.SarlSpecification;",
			"import io.sarl.lang.core.AgentTrait;",
			"import io.sarl.lang.core.Capacity;",
			"",
			"@FunctionalInterface",
			"@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING+ "\")",
			"@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")",
			"@SuppressWarnings(\"all\")",
			"public interface ExampleCapacity extends Capacity {",
			"  <T extends Number> void exampleMethod(final Class<T> clazz);",
			"  ",
			"  /**",
			"   * @ExcludeFromApidoc",
			"   */",
			"  class ContextAwareCapacityWrapper<C extends ExampleCapacity> extends Capacity.ContextAwareCapacityWrapper<C> implements ExampleCapacity {",
			"    public ContextAwareCapacityWrapper(final C capacity, final AgentTrait caller) {",
			"      super(capacity, caller);",
			"    }",
			"    ",
			"    public <T extends Number> void exampleMethod(final Class<T> clazz) {",
			"      try {",
			"        ensureCallerInLocalThread();",
			"        this.capacity.exampleMethod(clazz);",
			"      } finally {",
			"        resetCallerInLocalThread();",
			"      }",
			"    }",
			"  }",
			"}",
			"");

	private static final String SNIPSET3 = multilineString(
			"package io.sarl.lang.tests.bug720",
			"capacity ExampleCapacity",
			"{",
			"    def exampleMethod(clazz : Class<T>, clazz2 : T2) with T extends Number, T2 extends T",
			"}");

	private final String EXPECTED3 = multilineString(
			"package io.sarl.lang.tests.bug720;",
			"",
			"import io.sarl.lang.annotation.SarlElementType;",
			"import io.sarl.lang.annotation.SarlSpecification;",
			"import io.sarl.lang.core.AgentTrait;",
			"import io.sarl.lang.core.Capacity;",
			"",
			"@FunctionalInterface",
			"@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING+ "\")",
			"@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")",
			"@SuppressWarnings(\"all\")",
			"public interface ExampleCapacity extends Capacity {",
			"  <T extends Number, T2 extends T> void exampleMethod(final Class<T> clazz, final T2 clazz2);",
			"  ",
			"  /**",
			"   * @ExcludeFromApidoc",
			"   */",
			"  class ContextAwareCapacityWrapper<C extends ExampleCapacity> extends Capacity.ContextAwareCapacityWrapper<C> implements ExampleCapacity {",
			"    public ContextAwareCapacityWrapper(final C capacity, final AgentTrait caller) {",
			"      super(capacity, caller);",
			"    }",
			"    ",
			"    public <T extends Number, T2 extends T> void exampleMethod(final Class<T> clazz, final T2 clazz2) {",
			"      try {",
			"        ensureCallerInLocalThread();",
			"        this.capacity.exampleMethod(clazz, clazz2);",
			"      } finally {",
			"        resetCallerInLocalThread();",
			"      }",
			"    }",
			"  }",
			"}",
			"");

	private static final String SNIPSET4 = multilineString(
			"package io.sarl.lang.tests.bug720",
			"capacity ExampleCapacity",
			"{",
			"    def exampleMethod(plan : (T) => void) with T",
			"}");

	private final String EXPECTED4 = multilineString(
			"package io.sarl.lang.tests.bug720;",
			"",
			"import io.sarl.lang.annotation.SarlElementType;",
			"import io.sarl.lang.annotation.SarlSpecification;",
			"import io.sarl.lang.core.AgentTrait;",
			"import io.sarl.lang.core.Capacity;",
			"import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;",
			"",
			"@FunctionalInterface",
			"@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING+ "\")",
			"@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")",
			"@SuppressWarnings(\"all\")",
			"public interface ExampleCapacity extends Capacity {",
			"  <T extends Object> void exampleMethod(final Procedure1<? super T> plan);",
			"  ",
			"  /**",
			"   * @ExcludeFromApidoc",
			"   */",
			"  class ContextAwareCapacityWrapper<C extends ExampleCapacity> extends Capacity.ContextAwareCapacityWrapper<C> implements ExampleCapacity {",
			"    public ContextAwareCapacityWrapper(final C capacity, final AgentTrait caller) {",
			"      super(capacity, caller);",
			"    }",
			"    ",
			"    public <T extends Object> void exampleMethod(final Procedure1<? super T> plan) {",
			"      try {",
			"        ensureCallerInLocalThread();",
			"        this.capacity.exampleMethod(plan);",
			"      } finally {",
			"        resetCallerInLocalThread();",
			"      }",
			"    }",
			"  }",
			"}",
			"");

	@Test
	@Tag("sarlValidation")
	public void parsing_01() throws Exception {
		SarlScript mas = file(getParseHelper(), SNIPSET1);
		final Validator validator = validate(getValidationHelper(), getInjector(), mas);
		validator.assertNoErrors();
	}

	@Test
	@Tag("compileToJava")
	public void compiling_01() throws Exception {
		getCompileHelper().compile(SNIPSET1, (it) -> {
			final String actual = it.getGeneratedCode("io.sarl.lang.tests.bug720.ExampleCapacity");
			assertEquals(EXPECTED1, actual);
		});
	}

	@Test
	@Tag("sarlValidation")
	public void parsing_02() throws Exception {
		SarlScript mas = file(getParseHelper(), SNIPSET2);
		final Validator validator = validate(getValidationHelper(), getInjector(), mas);
		validator.assertNoErrors();
	}

	@Test
	@Tag("compileToJava")
	public void compiling_02() throws Exception {
		getCompileHelper().compile(SNIPSET2, (it) -> {
			final String actual = it.getGeneratedCode("io.sarl.lang.tests.bug720.ExampleCapacity");
			assertEquals(EXPECTED2, actual);
		});
	}

	@Test
	@Tag("sarlValidation")
	public void parsing_03() throws Exception {
		SarlScript mas = file(getParseHelper(), SNIPSET3);
		final Validator validator = validate(getValidationHelper(), getInjector(), mas);
		validator.assertNoErrors();
	}

	@Test
	@Tag("compileToJava")
	public void compiling_03() throws Exception {
		getCompileHelper().compile(SNIPSET3, (it) -> {
			final String actual = it.getGeneratedCode("io.sarl.lang.tests.bug720.ExampleCapacity");
			assertEquals(EXPECTED3, actual);
		});
	}

	@Test
	@Tag("sarlValidation")
	public void parsing_04() throws Exception {
		SarlScript mas = file(getParseHelper(), SNIPSET4);
		final Validator validator = validate(getValidationHelper(), getInjector(), mas);
		validator.assertNoErrors();
	}

	@Test
	@Tag("compileToJava")
	public void compiling_04() throws Exception {
		getCompileHelper().compile(SNIPSET4, (it) -> {
			final String actual = it.getGeneratedCode("io.sarl.lang.tests.bug720.ExampleCapacity");
			assertEquals(EXPECTED4, actual);
		});
	}

}


text:
RelayPoint gateway for Kiala
======

Kiala Relay point search

[![Latest Version](https://img.shields.io/github/release/pfeyssaguet/relaypoint-kiala.svg?style=flat-square)](https://github.com/pfeyssaguet/relaypoint-kiala/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/pfeyssaguet/relaypoint-kiala/master.svg?style=flat-square)](https://travis-ci.org/pfeyssaguet/relaypoint-kiala)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/pfeyssaguet/relaypoint-kiala.svg?style=flat-square)](https://scrutinizer-ci.com/g/pfeyssaguet/relaypoint-kiala/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/pfeyssaguet/relaypoint-kiala.svg?style=flat-square)](https://scrutinizer-ci.com/g/pfeyssaguet/relaypoint-kiala)

## Installation

Install via [Composer](http://getcomposer.org/). To install, simply add it
to your `composer.json` file:

```json
{
    "require": {
        "relaypoint/kiala": "~1.0"
    }
}
```

And run composer to update your dependencies:

    $ curl -s http://getcomposer.org/installer | php
    $ php composer.phar update

## Usage

``` php
$o = (new GatewayFactory())->create('Kiala');
$o->setParameter('dspid', 'DEMO_DSP'); // Replace this with your dspid

$a = $o->search(array('zip' => '92100'));

var_dump($a);
```

## Testing

``` bash
$ phpunit
```

## Credits

- [Pierre Feyssaguet](https://github.com/pfeyssaguet)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.


text:
package f5

import (
	"crypto/tls"
	"encoding/json"
	"errors"
	"fmt"
	"github.com/jmcvetta/napping"
	"log"
	"net/http"
	"net/url"
	"sync"
	"time"
)

var (
	//sessn   napping.Session
	tsport     http.Transport
	clnt       http.Client
	headers    http.Header
	debug      bool
	tokenMutex = sync.Mutex{}
)

const (
	GET = iota
	POST
	POSTR
	PUT
	PUTR
	PATCH
	DELETE
)

type httperr struct {
	Message string
	Errors  []struct {
		Resource string
		Field    string
		Code     string
	}
}

type Device struct {
	Hostname   string
	Username   string
	Password   string
	Session    napping.Session
	AuthToken  authToken
	AuthMethod AuthMethod
	Proto string
}

type Response struct {
	Status  int
	Message string
}

type LBEmptyBody struct{}

type LBTransaction struct {
	TransId int    `json:"transId"`
	Timeout int    `json:"timeoutSeconds"`
	State   string `json:"state"`
}

type LBTransactionState struct {
	State string `json:"state"`
}

type AuthMethod int

const (
	TOKEN AuthMethod = iota
	BASIC_AUTH
)

type authToken struct {
	Token            string
	ExpirationMicros int64
}

func New(host string, username string, pwd string, authMethod AuthMethod) *Device {
	f := Device{Hostname: host, Username: username, Password: pwd, AuthMethod: authMethod, Proto: "https"}
	f.InitSession()
	return &f
}

func NewInsecure(host string, username string, pwd string, authMethod AuthMethod) *Device {
	f := Device{Hostname: host, Username: username, Password: pwd, AuthMethod: authMethod, Proto: "http"}
	f.InitSession()
	return &f
}

func (f *Device) InitSession() {

	// REST connection setup
	if f.Proto == "https" {
		tsport = http.Transport{
			TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
		}
		clnt = http.Client{Transport: &tsport}
	} else {
		clnt = http.Client{}
	}
	headers = make(http.Header)

	//
	// Setup HTTP Basic auth for this session (ONLY use this with SSL).  Auth
	// can also be configured on a per-request basis when using Send().
	//
	f.Session = napping.Session{
		Client: &clnt,
		Log:    debug,
		// if Userinfo is set - napping will set the basic auth header for you
		Userinfo: url.UserPassword(f.Username, f.Password),
		Header:   &headers,
	}

}

func (f *Device) SetDebug(b bool) {
	debug = b
}

func (f *Device) StartTransaction() (error, string) {

	u := f.Proto + "://" + f.Hostname + "/mgmt/tm/transaction"
	empty := LBEmptyBody{}
	tres := LBTransaction{}
	err, _ := f.sendRequest(u, POST, &empty, &tres)
	if err != nil {
		return err, ""
	}

	tid := fmt.Sprintf("%d", tres.TransId)
	// set the transaction header
	f.Session.Header.Set("X-F5-REST-Coordination-Id", tid)
	return nil, tid

}

func (f *Device) CommitTransaction(tid string) error {

	// remove the transaction header first
	f.Session.Header.Del("X-F5-REST-Coordination-Id")

	u := f.Proto + "://" + f.Hostname + "/mgmt/tm/transaction/" + tid
	body := LBTransaction{State: "VALIDATING"}
	tres := LBTransaction{}
	err, _ := f.sendRequest(u, PATCH, &body, &tres)
	if err != nil {
		return err
	}

	return nil

}

func (f *Device) sendRequest(u string, method int, pload interface{}, res interface{}) (error, *Response) {

	if f.AuthMethod == TOKEN {
		f.ensureValidToken()
	}

	//
	// Send request to server
	//
	e := httperr{}
	var (
		err   error
		nresp *napping.Response
	)
	f.Session.Log = debug

	switch method {
	case GET:
		nresp, err = f.Session.Get(u, nil, &res, &e)
	case POST:
		nresp, err = f.Session.Post(u, &pload, &res, &e)
	case PUT:
		nresp, err = f.Session.Put(u, &pload, &res, &e)
	case PATCH:
		nresp, err = f.Session.Patch(u, &pload, &res, &e)
	case DELETE:
		nresp, err = f.Session.Delete(u, nil, &res, &e)
	case POSTR:
		r := napping.Request{
			Method:  "POST",
			Url:     u,
			Params: nil,
			Payload: pload,
			RawPayload: true,
			Result:  res,
			Error:   e,
		}
		nresp, err = f.Session.Send(&r)
	case PUTR:
		r := napping.Request{
			Method:  "PUT",
			Url:     u,
			Params: nil,
			Payload: pload,
			RawPayload: true,
			Result:  &res,
			Error:   &e,
		}
		nresp, err = f.Session.Send(&r)
	}

	var resp = Response{Status: nresp.Status(), Message: e.Message}
	if err != nil {
		return err, &resp
	}
	if nresp.Status() == 401 {
		f.PrintObject(resp)
		return errors.New("error: 401 Unauthorised - check your username and passwd"), &resp
	}
	if nresp.Status() >= 300 {
		return errors.New(e.Message), &resp
	} else {
		// all is good in the world
		return nil, &resp
	}
}

func (f *Device) PrintObject(input interface{}) {

	jsonresp, err := json.MarshalIndent(&input, "", "\t")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(string(jsonresp))

}

// F5 Module data struct
// to show all available modules when using show without args
type LBModule struct {
	Link string `json:"link"`
}

type LBModuleRef struct {
	Reference LBModule `json:"reference"`
}

type LBModules struct {
	Items []LBModuleRef `json:"items"`
}

func (f *Device) ShowModules() (error, *LBModules) {

	u := f.Proto + "://" + f.Hostname + "/mgmt/tm/ltm"
	res := LBModules{}

	err, _ := f.sendRequest(u, GET, nil, &res)
	if err != nil {
		return err, nil
	} else {
		return nil, &res
	}
}

func (f *Device) GetToken() {

	type login struct {
		Token struct {
			Token            string `json:"token"`
			ExpirationMicros int64  `json:"expirationMicros"`
		} `json:"token"`
	}

	// Simply posting LoginData to the login endpoint doesn't seem to work.
	// I seem to need to set basic auth for the token request
	// after which I can disable basic auth by killing f.Session.Userinfo
	// I suspect this is a BIG-IP v11 issue - v12 docs clearly state no basic auth header is required
	// https://devcentral.f5.com/wiki/iControl.Authentication_with_the_F5_REST_API.ashx?lc=1
	// can't hurt for now
	if f.Session.Userinfo == nil {
		// turn on basic auth for this token request only
		f.Session.Userinfo = url.UserPassword(f.Username, f.Password)
	}

	// We need to remove X-F5-Auth-Token header when logging in because the BIG-IP
	// will look att it first and if it has expired it will return Unathorized
	f.Session.Header.Del("X-F5-Auth-Token")

	LoginData := map[string]string{"username": f.Username, "password": f.Password, "loginProviderName": "tmos"}
	byteLogin, err := json.Marshal(LoginData)
	body := json.RawMessage(byteLogin)
	u := f.Proto + "://" + f.Hostname + "/mgmt/shared/authn/login"
	res := login{}
	e := httperr{}

	resp, err := f.Session.Post(u, &body, &res, &e)
	if err != nil {
		log.Fatal(fmt.Errorf("error: %s, %v", err, resp))
		return
	}
	if debug {
	  f.PrintObject(&resp)
	}

	f.AuthToken = authToken{
		Token:            res.Token.Token,
		ExpirationMicros: res.Token.ExpirationMicros,
	}
	f.Session.Header.Set("X-F5-Auth-Token", f.AuthToken.Token)

	// disable basic auth now
	f.Session.Userinfo = nil
}

func (f *Device) hasValidToken() bool {
	nowMicros := time.Now().UnixNano() / (int64(time.Microsecond) / int64(time.Nanosecond))
	if f.AuthToken.Token == "" || f.AuthToken.ExpirationMicros < nowMicros+int64(time.Millisecond)*100 {
		return false
	}
	return true
}

func (f *Device) ensureValidToken() {
	tokenMutex.Lock()
	defer tokenMutex.Unlock()
	if !f.hasValidToken() {
		f.GetToken()
	}
}


text:
package com.amazonaws.services.redshift.model;

import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 */
public class CreateHsmConfigurationRequest extends AmazonWebServiceRequest
        implements Serializable, Cloneable {

    /**
     *

     * The identifier to be assigned to the new Amazon Redshift HSM
     * configuration.
     *

     */
    private String hsmConfigurationIdentifier;
    /**
     *

     * A text description of the HSM configuration to be created.
     *

     */
    private String description;
    /**
     *

     * The IP address that the Amazon Redshift cluster must use to access the
     * HSM.
     *

     */
    private String hsmIpAddress;
    /**
     *

     * The name of the partition in the HSM where the Amazon Redshift clusters
     * will store their database encryption keys.
     *

     */
    private String hsmPartitionName;
    /**
     *

     * The password required to access the HSM partition.
     *

     */
    private String hsmPartitionPassword;
    /**
     *

     * The HSMs public certificate file. When using Cloud HSM, the file name is
     * server.pem.
     *

     */
    private String hsmServerPublicCertificate;
    /**
     *

     * A list of tag instances.
     *

     */
    private com.amazonaws.internal.SdkInternalList<Tag> tags;

    /**
     *

     * The identifier to be assigned to the new Amazon Redshift HSM
     * configuration.
     *

     *
     * @param hsmConfigurationIdentifier
     *        The identifier to be assigned to the new Amazon Redshift HSM
     *        configuration.
     */

    public void setHsmConfigurationIdentifier(String hsmConfigurationIdentifier) {
        this.hsmConfigurationIdentifier = hsmConfigurationIdentifier;
    }

    /**
     *

     * The identifier to be assigned to the new Amazon Redshift HSM
     * configuration.
     *

     *
     * @return The identifier to be assigned to the new Amazon Redshift HSM
     *         configuration.
     */

    public String getHsmConfigurationIdentifier() {
        return this.hsmConfigurationIdentifier;
    }

    /**
     *

     * The identifier to be assigned to the new Amazon Redshift HSM
     * configuration.
     *

     *
     * @param hsmConfigurationIdentifier
     *        The identifier to be assigned to the new Amazon Redshift HSM
     *        configuration.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateHsmConfigurationRequest withHsmConfigurationIdentifier(
            String hsmConfigurationIdentifier) {
        setHsmConfigurationIdentifier(hsmConfigurationIdentifier);
        return this;
    }

    /**
     *

     * A text description of the HSM configuration to be created.
     *

     *
     * @param description
     *        A text description of the HSM configuration to be created.
     */

    public void setDescription(String description) {
        this.description = description;
    }

    /**
     *

     * A text description of the HSM configuration to be created.
     *

     *
     * @return A text description of the HSM configuration to be created.
     */

    public String getDescription() {
        return this.description;
    }

    /**
     *

     * A text description of the HSM configuration to be created.
     *

     *
     * @param description
     *        A text description of the HSM configuration to be created.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateHsmConfigurationRequest withDescription(String description) {
        setDescription(description);
        return this;
    }

    /**
     *

     * The IP address that the Amazon Redshift cluster must use to access the
     * HSM.
     *

     *
     * @param hsmIpAddress
     *        The IP address that the Amazon Redshift cluster must use to access
     *        the HSM.
     */

    public void setHsmIpAddress(String hsmIpAddress) {
        this.hsmIpAddress = hsmIpAddress;
    }

    /**
     *

     * The IP address that the Amazon Redshift cluster must use to access the
     * HSM.
     *

     *
     * @return The IP address that the Amazon Redshift cluster must use to
     *         access the HSM.
     */

    public String getHsmIpAddress() {
        return this.hsmIpAddress;
    }

    /**
     *

     * The IP address that the Amazon Redshift cluster must use to access the
     * HSM.
     *

     *
     * @param hsmIpAddress
     *        The IP address that the Amazon Redshift cluster must use to access
     *        the HSM.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateHsmConfigurationRequest withHsmIpAddress(String hsmIpAddress) {
        setHsmIpAddress(hsmIpAddress);
        return this;
    }

    /**
     *

     * The name of the partition in the HSM where the Amazon Redshift clusters
     * will store their database encryption keys.
     *

     *
     * @param hsmPartitionName
     *        The name of the partition in the HSM where the Amazon Redshift
     *        clusters will store their database encryption keys.
     */

    public void setHsmPartitionName(String hsmPartitionName) {
        this.hsmPartitionName = hsmPartitionName;
    }

    /**
     *

     * The name of the partition in the HSM where the Amazon Redshift clusters
     * will store their database encryption keys.
     *

     *
     * @return The name of the partition in the HSM where the Amazon Redshift
     *         clusters will store their database encryption keys.
     */

    public String getHsmPartitionName() {
        return this.hsmPartitionName;
    }

    /**
     *

     * The name of the partition in the HSM where the Amazon Redshift clusters
     * will store their database encryption keys.
     *

     *
     * @param hsmPartitionName
     *        The name of the partition in the HSM where the Amazon Redshift
     *        clusters will store their database encryption keys.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateHsmConfigurationRequest withHsmPartitionName(
            String hsmPartitionName) {
        setHsmPartitionName(hsmPartitionName);
        return this;
    }

    /**
     *

     * The password required to access the HSM partition.
     *

     *
     * @param hsmPartitionPassword
     *        The password required to access the HSM partition.
     */

    public void setHsmPartitionPassword(String hsmPartitionPassword) {
        this.hsmPartitionPassword = hsmPartitionPassword;
    }

    /**
     *

     * The password required to access the HSM partition.
     *

     *
     * @return The password required to access the HSM partition.
     */

    public String getHsmPartitionPassword() {
        return this.hsmPartitionPassword;
    }

    /**
     *

     * The password required to access the HSM partition.
     *

     *
     * @param hsmPartitionPassword
     *        The password required to access the HSM partition.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateHsmConfigurationRequest withHsmPartitionPassword(
            String hsmPartitionPassword) {
        setHsmPartitionPassword(hsmPartitionPassword);
        return this;
    }

    /**
     *

     * The HSMs public certificate file. When using Cloud HSM, the file name is
     * server.pem.
     *

     *
     * @param hsmServerPublicCertificate
     *        The HSMs public certificate file. When using Cloud HSM, the file
     *        name is server.pem.
     */

    public void setHsmServerPublicCertificate(String hsmServerPublicCertificate) {
        this.hsmServerPublicCertificate = hsmServerPublicCertificate;
    }

    /**
     *

     * The HSMs public certificate file. When using Cloud HSM, the file name is
     * server.pem.
     *

     *
     * @return The HSMs public certificate file. When using Cloud HSM, the file
     *         name is server.pem.
     */

    public String getHsmServerPublicCertificate() {
        return this.hsmServerPublicCertificate;
    }

    /**
     *

     * The HSMs public certificate file. When using Cloud HSM, the file name is
     * server.pem.
     *

     *
     * @param hsmServerPublicCertificate
     *        The HSMs public certificate file. When using Cloud HSM, the file
     *        name is server.pem.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateHsmConfigurationRequest withHsmServerPublicCertificate(
            String hsmServerPublicCertificate) {
        setHsmServerPublicCertificate(hsmServerPublicCertificate);
        return this;
    }

    /**
     *

     * A list of tag instances.
     *

     *
     * @return A list of tag instances.
     */

    public java.util.List<Tag> getTags() {
        if (tags == null) {
            tags = new com.amazonaws.internal.SdkInternalList<Tag>();
        }
        return tags;
    }

    /**
     *

     * A list of tag instances.
     *

     *
     * @param tags
     *        A list of tag instances.
     */

    public void setTags(java.util.Collection<Tag> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new com.amazonaws.internal.SdkInternalList<Tag>(tags);
    }

    /**
     *

     * A list of tag instances.
     *

     *

     * NOTE: This method appends the values to the existing list (if
     * any). Use {@link #setTags(java.util.Collection)} or
     * {@link #withTags(java.util.Collection)} if you want to override the
     * existing values.
     *

     *
     * @param tags
     *        A list of tag instances.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateHsmConfigurationRequest withTags(Tag... tags) {
        if (this.tags == null) {
            setTags(new com.amazonaws.internal.SdkInternalList<Tag>(tags.length));
        }
        for (Tag ele : tags) {
            this.tags.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of tag instances.
     *

     *
     * @param tags
     *        A list of tag instances.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CreateHsmConfigurationRequest withTags(java.util.Collection<Tag> tags) {
        setTags(tags);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getHsmConfigurationIdentifier() != null)
            sb.append("HsmConfigurationIdentifier: "
                    + getHsmConfigurationIdentifier() + ",");
        if (getDescription() != null)
            sb.append("Description: " + getDescription() + ",");
        if (getHsmIpAddress() != null)
            sb.append("HsmIpAddress: " + getHsmIpAddress() + ",");
        if (getHsmPartitionName() != null)
            sb.append("HsmPartitionName: " + getHsmPartitionName() + ",");
        if (getHsmPartitionPassword() != null)
            sb.append("HsmPartitionPassword: " + getHsmPartitionPassword()
                    + ",");
        if (getHsmServerPublicCertificate() != null)
            sb.append("HsmServerPublicCertificate: "
                    + getHsmServerPublicCertificate() + ",");
        if (getTags() != null)
            sb.append("Tags: " + getTags());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof CreateHsmConfigurationRequest == false)
            return false;
        CreateHsmConfigurationRequest other = (CreateHsmConfigurationRequest) obj;
        if (other.getHsmConfigurationIdentifier() == null
                ^ this.getHsmConfigurationIdentifier() == null)
            return false;
        if (other.getHsmConfigurationIdentifier() != null
                && other.getHsmConfigurationIdentifier().equals(
                        this.getHsmConfigurationIdentifier()) == false)
            return false;
        if (other.getDescription() == null ^ this.getDescription() == null)
            return false;
        if (other.getDescription() != null
                && other.getDescription().equals(this.getDescription()) == false)
            return false;
        if (other.getHsmIpAddress() == null ^ this.getHsmIpAddress() == null)
            return false;
        if (other.getHsmIpAddress() != null
                && other.getHsmIpAddress().equals(this.getHsmIpAddress()) == false)
            return false;
        if (other.getHsmPartitionName() == null
                ^ this.getHsmPartitionName() == null)
            return false;
        if (other.getHsmPartitionName() != null
                && other.getHsmPartitionName().equals(
                        this.getHsmPartitionName()) == false)
            return false;
        if (other.getHsmPartitionPassword() == null
                ^ this.getHsmPartitionPassword() == null)
            return false;
        if (other.getHsmPartitionPassword() != null
                && other.getHsmPartitionPassword().equals(
                        this.getHsmPartitionPassword()) == false)
            return false;
        if (other.getHsmServerPublicCertificate() == null
                ^ this.getHsmServerPublicCertificate() == null)
            return false;
        if (other.getHsmServerPublicCertificate() != null
                && other.getHsmServerPublicCertificate().equals(
                        this.getHsmServerPublicCertificate()) == false)
            return false;
        if (other.getTags() == null ^ this.getTags() == null)
            return false;
        if (other.getTags() != null
                && other.getTags().equals(this.getTags()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime
                * hashCode
                + ((getHsmConfigurationIdentifier() == null) ? 0
                        : getHsmConfigurationIdentifier().hashCode());
        hashCode = prime
                * hashCode
                + ((getDescription() == null) ? 0 : getDescription().hashCode());
        hashCode = prime
                * hashCode
                + ((getHsmIpAddress() == null) ? 0 : getHsmIpAddress()
                        .hashCode());
        hashCode = prime
                * hashCode
                + ((getHsmPartitionName() == null) ? 0 : getHsmPartitionName()
                        .hashCode());
        hashCode = prime
                * hashCode
                + ((getHsmPartitionPassword() == null) ? 0
                        : getHsmPartitionPassword().hashCode());
        hashCode = prime
                * hashCode
                + ((getHsmServerPublicCertificate() == null) ? 0
                        : getHsmServerPublicCertificate().hashCode());
        hashCode = prime * hashCode
                + ((getTags() == null) ? 0 : getTags().hashCode());
        return hashCode;
    }

    @Override
    public CreateHsmConfigurationRequest clone() {
        return (CreateHsmConfigurationRequest) super.clone();
    }
}


text:
<?php

namespace Nascom\TeamleaderApiClient\Request\Contact;

use Nascom\TeamleaderApiClient\Request\AbstractPostRequest;

/**
 * Class UpdateContactRequest
 *
 * @package Nascom\TeamleaderApiClient\Request\Contact
 */
class UpdateContactRequest extends AbstractPostRequest
{
    /**
     * UpdateContactRequest constructor.
     *
     * @param $contact_id
     * @param $track_changes
     * @param array $options
     *   Optional parameters:
     *   - forename
     *   - surname
     *   - city
     *   - zipcode
     *   - street
     *   - number
     *   - language
     *   - gender
     *   - dob
     *   - description
     *   - country
     *   - gsm
     *   - telephone
     *   - fax
     *   - website
     *   - email
     *   - linked_company_ids
     *   - add_tag_by_string
     *   - remove_tag_by_string
     *   - custom_field_ID
     */
    public function __construct($contact_id, $track_changes, array $options = [])
    {
        $this->options = $options;
        $this->setContactId($contact_id);
        $this->setTrackChanges($track_changes);
    }

    /**
     * @param $contact_id
     */
    public function setContactId($contact_id)
    {
        $this->options['contact_id'] = $contact_id;
    }

    /**
     * @param $track_changes
     */
    public function setTrackChanges($track_changes)
    {
        $this->options['track_changes'] = $track_changes;
    }

    /**
     * @return string
     */
    public function getUri()
    {
        return 'updateContact.php';
    }
}


text:
config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

# Keep same perms on rc.preload.new:
if [ -e etc/rc.d/rc.preload ]; then
  cp -a etc/rc.d/rc.preload etc/rc.d/rc.preload.new.incoming
  cat etc/rc.d/rc.preload.new > etc/rc.d/rc.preload.new.incoming
  mv etc/rc.d/rc.preload.new.incoming etc/rc.d/rc.preload.new
fi

# Create log file and state file if they are not already there
[ ! -e var/log/preload.log ] && touch var/log/preload.log
[ ! -e var/lib/preload/preload.state ] && touch var/lib/preload/preload.state

config etc/rc.d/rc.preload.new
config etc/preload.conf.new
config etc/logrotate.d/preload.new


text:
/**
 Use C-SCV and RBF kernel for spam classification
 Dataset :
 * Webb Spam Corpus unigram (http://www.cc.gatech.edu/projects/doi/WebbSpamCorpus.html)
 * # of classes: 2
 * # of data: 20,000 (choosen randomly from the official dataset)

 Note :
 * Webb Spam dataset is already normalized so we don't normalize it again
 * node-svm use PCA reduction by default to speed-up training . This is why dataset is reduced from 126 to 28 features. To disable PCA set 'reduce'
 parameter to false
 **/
'use strict';

var so = require('stringify-object');
var svm = require('../lib');
var fileName = './examples/datasets/webspam_unigram_subset20000.ds';
var numeric = require('numeric');

var clf = new svm.CSVC({
    gamma: [0.01, 0.1],
    c: 8,
    kFold: 4,
    normalize: true,
    reduce: true, // default value
    retainedVariance: 0.95
});

svm.read(fileName)
    .then(function (dataset) {
        console.log('start training (may take a while)...');
        return clf.train(dataset)
            .progress(function(progress){
                console.log('training progress: %d%', Math.round(progress*100));
            });
    })
    .spread(function (model, report) {
        console.log('SVM trained. \nReport:\n%s', so(report));
    }).done(function () {
        console.log('done.');
    });

/*************************
 *        OUTPUT         *
 *************************

 start training (may take a while)...
 [training progress...]
 SVM trained.
 Report:
 {
     accuracy: 0.97485,
     fscore: 0.9681221877178527,
     recall: 0.9694123619748699,
     precision: 0.9668354430379746,
     class: {
         '1': {
             precision: 0.9800826446280991,
             recall: 0.9783846217308803,
             fscore: 0.979232897072788,
             size: 12121
         },
         '-1': {
             precision: 0.9668354430379746,
             recall: 0.9694123619748699,
             fscore: 0.9681221877178527,
             size: 7879
         }
     },
     size: 20000,
     reduce: true,
     retainedVariance: 0.950955024168114,
     retainedDimension: 62,
     initialDimension: 254
 }
 done.

 */


text:
<!DOCTYPE html>
<title>CSS Text Test: A combination of `overflow-wrap: break-word` and `white-space` should not crash</title>
<link rel="help" href="https://crbug.com/1001359">
<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">

    <spacer></spacer>
    <nowrap>
<inline-block></inline-block>
123456</nowrap>987654321


text:
SettingsSlider::SettingsSlider(QWidget *parent) :
	QSettingsWidget(parent)
{
	this->setOrientation(Qt::Horizontal);

	connect(this, &SettingsSlider::sliderPressed,
			this, &SettingsSlider::showValue,
			Qt::QueuedConnection);
	connect(this, &SettingsSlider::sliderMoved,
			this, &SettingsSlider::showValue,
			Qt::QueuedConnection);
}

void SettingsSlider::setValue(const QVariant &value)
{
	this->QSlider::setValue(value.toInt());
}

QVariant SettingsSlider::getValue() const
{
	return this->value();
}

void SettingsSlider::resetValue()
{
	this->QSlider::setValue(0);
}

void SettingsSlider::showValue()
{
	QPoint point;
	if(this->orientation() == Qt::Horizontal) {
		auto pos = QStyle::sliderPositionFromValue(this->minimum(),
												   this->maximum(),
												   this->value(),
												   this->width() -
												   this->style()->pixelMetric(QStyle::PM_SliderLength));
		point = QPoint(pos,
					   this->style()->pixelMetric(QStyle::PM_SliderLength));
	} else {
		auto pos = QStyle::sliderPositionFromValue(this->minimum(),
												   this->maximum(),
												   this->value(),
												   this->height() -
												   this->style()->pixelMetric(QStyle::PM_SliderLength),
												   true);
		point = QPoint(this->style()->pixelMetric(QStyle::PM_SliderThickness),
					   pos - this->style()->pixelMetric(QStyle::PM_SliderLength));
	}
	point = this->mapToGlobal(point);
	QToolTip::showText(point, QLocale().toString(this->value()), this);
}


text:
using System;
using System.Collections.Generic;
using MusicianHelper.Infrastructure.Models;

namespace MusicianHelper.Infrastructure.Services.Abstract
{

    public delegate void VideoUploadedEventHandler(object sender, VideoUploadedEventArgs e);

    public interface IVideoNetworkService
    {
        string ExtractAuthToken(string returnString);
        Uri CreateRequestUri();
        OauthTokenModel GetRequestTokens(string authToken);
        void SaveOauthResponse(OauthTokenModel otm);
        void UploadVideo(AudioUoW audio, OauthTokenModel otm, List<VideoUploadedEventHandler> videoUploaded = null);
        bool? HasCredentials();
        OauthTokenModel RefreshRequestTokens(OauthTokenModel ytm);
    }
}


text:
tomcatHost=$tomcatHost
tomcatPort=$tomcatPort
serverHost=$serverHost
serverPort=$serverPort
ei_host=$eiHost
ei_port=$eiPort

echo "BaseScript Done..."


text:
class UsersController < ApplicationController
  before_action :authenticate_user!

  def update
    if current_user.update_attributes(user_params)
      flash[:notice] = "User information updated"
      redirect_to edit_user_registration_path
    else
      flash[:error] = "Invalid user information"
      redirect_to edit_user_registration_path
    end
  end

  private

  def user_params
    params.require(:user).permit(:name)
  end

end


text:
//-----------------------------------------------------------------------
// <copyright file="TestKitAssertionsProvider.cs" company="Akka.NET Project">
//     Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
//     Copyright (C) 2013-2015 Akka.NET project <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------

using Akka.Actor;

namespace Akka.TestKit
{
    /// <summary>
    /// Contains <see cref="ITestKitAssertions"/>.
    /// </summary>
    public class TestKitAssertionsProvider : IExtension
    {
        private readonly ITestKitAssertions _assertions;

        public TestKitAssertionsProvider(ITestKitAssertions assertions)
        {
            _assertions = assertions;
        }

        public ITestKitAssertions Assertions { get { return _assertions; } }
    }
}


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

<TITLE>
TProgram
</TITLE>

<META NAME="date" CONTENT="2009-09-18">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

uk.ac.ebi.interproscan

Class TProgram

java.lang.Object
  uk.ac.ebi.interproscan.TProgram

All Implemented Interfaces:
java.io.Serializable

public class TProgram
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary

TProgram()

TProgram(java.lang.String citation,
         java.lang.String name,
         java.lang.String version)

Method Summary

 boolean
equals(java.lang.Object obj)

 java.lang.String
getCitation()

          Gets the citation value for this TProgram.

static org.apache.axis.encoding.Deserializer
getDeserializer(java.lang.String mechType,
                java.lang.Class _javaType,
                javax.xml.namespace.QName _xmlType)

          Get Custom Deserializer

 java.lang.String
getName()

          Gets the name value for this TProgram.

static org.apache.axis.encoding.Serializer
getSerializer(java.lang.String mechType,
              java.lang.Class _javaType,
              javax.xml.namespace.QName _xmlType)

          Get Custom Serializer

static org.apache.axis.description.TypeDesc
getTypeDesc()

          Return type metadata object

 java.lang.String
getVersion()

          Gets the version value for this TProgram.

 int
hashCode()

 void
setCitation(java.lang.String citation)

          Sets the citation value for this TProgram.

 void
setName(java.lang.String name)

          Sets the name value for this TProgram.

 void
setVersion(java.lang.String version)

          Sets the version value for this TProgram.

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TProgram

public TProgram()

TProgram

public TProgram(java.lang.String citation,
                java.lang.String name,
                java.lang.String version)

Method Detail

getName

public java.lang.String getName()

Gets the name value for this TProgram.

Returns:
name

setName

public void setName(java.lang.String name)

Sets the name value for this TProgram.

Parameters:
name -

getVersion

public java.lang.String getVersion()

Gets the version value for this TProgram.

Returns:
version

setVersion

public void setVersion(java.lang.String version)

Sets the version value for this TProgram.

Parameters:
version -

getCitation

public java.lang.String getCitation()

Gets the citation value for this TProgram.

Returns:
citation

setCitation

public void setCitation(java.lang.String citation)

Sets the citation value for this TProgram.

Parameters:
citation -

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

getTypeDesc

public static org.apache.axis.description.TypeDesc getTypeDesc()

Return type metadata object

getSerializer

public static org.apache.axis.encoding.Serializer getSerializer(java.lang.String mechType,
                                                                java.lang.Class _javaType,
                                                                javax.xml.namespace.QName _xmlType)

Get Custom Serializer

getDeserializer

public static org.apache.axis.encoding.Deserializer getDeserializer(java.lang.String mechType,
                                                                    java.lang.Class _javaType,
                                                                    javax.xml.namespace.QName _xmlType)

Get Custom Deserializer

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
FormsGallery (Windows)
============

Windows and Windows Phone versions for the [Windows PREVIEW](http://developer.xamarin.com/guides/cross-platform/xamarin-forms/windows/).

![](Screenshots/windows.png)

This program displays all the views, cells, layouts, and pages available in Xamarin.Forms,
one per page.

**If you open the solution in Xamarin Studio, it will not be able to load the Windows Phone project;
and if you open the solution in Xamarin Studio under Windows, it will not be able to load the iOS project either.**

**Note: Due to path length limitations on Windows, this sample will likely need to be moved
closer to the root of your hard drive in order to build successfully.**

Author
------

Charles Petzold


text:
Building KubOS Linux for the Beaglebone Black
=============================================

Overview
--------

This supplementary document covers specific features and components of KubOS Linux for the Beaglebone Black.

The :doc:`kubos-linux-overview` doc covers the major components of KubOS Linux.

Additionally, this document covers the steps required in order to build KubOS Linux.

Reference Documents
-------------------

Beaglebone Documentation
~~~~~~~~~~~~~~~~~~~~~~~~

- `Beaglebone Black Web Page <https://beagleboard.org/black>`__
- `Beaglebone Black Wiki <http://elinux.org/Beagleboard:BeagleBoneBlack>`__
- `Beaglebone Black Hardware Diagrams <http://beagleboard.org/Support/bone101/#hardware>`__
- `Beaglebone Black System Reference Manual Rev C <http://static6.arrow.com/aropdfconversion/8fff89aa85f5c451318cbdee2facd9c9fac36872/bbb_srm.pdf>`__

Kubos Documentation
~~~~~~~~~~~~~~~~~~~

-  :doc:`../installation-docs/installing-linux-bbb` - Steps to install KubOS Linux
-  :doc:`using-kubos-linux` - General guide for interacting with KubOS Linux
-  :doc:`working-with-the-bbb` - Guide for interacting with BBB-specific features

Software Components
-------------------

ROM Bootloader
~~~~~~~~~~~~~~

The ROM bootloader lives in a small section of ROM space. It should come
pre-loaded on the board and should not need to be modified. It selects the
next bootloader depending on whether the boot mode button is being held.
If not held, it attempts to run the next boot step from eMMC storage;
otherwise, it attempts to boot from the microSD card.

U-Boot
~~~~~~
This board utilizes U-Boot's SPL feature. A small boot file called "MLO" is
run and that file then loads the main U-Boot image into SDRAM.

KubOS Linux Build Process
-------------------------

If for some reason you want or need to modify and rebuild the KubOS Linux components, follow
the steps in this section.

.. _build-os-bbb:

Build the OS Files
~~~~~~~~~~~~~~~~~~

.. warning::

    The OS files cannot be built using a `synced folder <https://www.vagrantup.com/docs/synced-folders/>`__ in a Vagrant box (or regular VM).
    VirtualBox does not support hard links in shared folders, which are crucial in order to complete
    the build.

:doc:`SSH into a Kubos SDK box <../installation-docs/sdk-installing>`

In order to build KubOS Linux, two components are needed:

- The `kubos-linux-build repo <https://github.com/kubos/kubos-linux-build>`__ - Contains the configurations, patches, and extra tools needed to build KubOS Linux
- `BuildRoot <https://buildroot.org/>`__ - The actual build system

These components should be setup as children of the same parent directory.
There are several commands and variables in the build process which use relative file paths to navigate between the components.

After the environment has been set up, all build commands will be run from the BuildRoot directory unless otherwise stated.

To set up a build environment and build KubOS Linux:

Create a new parent folder to contain the build environment

::

    $ mkdir kubos-linux

Enter the new folder

::

    $ cd kubos-linux

Download BuildRoot-2017.02 (more current versions of BuildRoot may work as well,
but all testing has been done against 2017.02)

.. note:: All Kubos documentation will refer to v2017.02.8, which is the latest version of the LTS release at the time of this writing.

::

    $ wget https://buildroot.uclibc.org/downloads/buildroot-2017.02.8.tar.gz && tar xvzf buildroot-2017.02.8.tar.gz && rm buildroot-2017.02.8.tar.gz

Pull the kubos-linux-build repo

::

    $ git clone http://github.com/kubos/kubos-linux-build

Move into the buildroot directory

::

    $ cd buildroot-2017.02.8

Point BuildRoot to the external kubos-linux-build folder and tell it to build
for the Beaglebone Black.

.. note::

    You will need to build with ``sudo`` if you are using the default
    configuration, since it points the output toolchain to "/usr/bin/bbb_toolchain",
    which is a protected directory.

::

    $ sudo make BR2_EXTERNAL=../kubos-linux-build beaglebone-black_defconfig

Build everything

::

    $ sudo make

The full build process will take a while. Running on a Linux VM, it takes about
an hour. Running in native Linux, it took about ten minutes. Once this build
process has completed once, you can run other BuildRoot commands to rebuild
only certain sections and it will go much more quickly (<5 min).

BuildRoot documentation can be found
`**here** <https://buildroot.org/docs.html>`__

The generated files will be located in buildroot-2017.02.8/output/images.
The relevant files are:

-  uboot.bin - The U-Boot binary
-  kernel - The compressed Linux kernel file
-  beaglebone-black.dtb - The Device Tree Binary that Linux uses to configure itself
   for the Beaglebone Black board
-  rootfs.tar - The root file system. Contains BusyBox and other libraries
-  kubos-linux.img - The complete KubOS Linux SD card image

Changing the Output Toolchain Directory (optional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you would like to build your toolchain in somewhere other than the
"/usr/bin/bbb_toolchain" directory, update the ``BR2_HOST_DIR`` variable in the
"configs/bbb_defconfig" file.

If you would like BuildRoot to just build the toolchain locally, you may remove
the ``BR2_HOST_DIR`` variable entirely. The toolchain will then be built under the
main "buildroot-2017.02.8" directory in a new "output/host" folder.

Create auxilliary SD Card Image
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

By default, the build process will create a bootable SD card image. This will be flashed
onto the eMMC. In order to create a full KubOS Linux setup, you'll want to also create
an auxiliary image for the microSD card containing the upgrade partition and an additional
user data partition.

Follow the :ref:`upgrade-creation` instructions in order to create a Kubos Package file
(kpack-\*.itb) to be used for recovery.

Then, from the `kubos-linux-build/tools` folder, run the ``format-aux.img`` script.
This will create a new SD card image, `aux-sd.img`, with two partitions:
- An upgrade partition containing `kpack-base.itb`
- A user data partition

There are two parameters which may be specified:

-  -s : Sets the size of the aux-sd.img file, specified in MB. The default is 3800 (3.8GB)
-  -i : Specifies the name and location of the kpack-\*.itb file to use as kpack-base.itb

For example:

::

    $ ./format-aux.sh -i ../kpack-2017.07.21.itb

Reset the Global Links
~~~~~~~~~~~~~~~~~~~~~~

If you run a full build, the links to all the Kubos SDK modules will be changed to
point at modules within the buildroot directory. As a result, you will be unable
to build any future Kubos SDK projects as a non-privileged user.

To fix this, run these commands:

::

    $ cd $HOME/.kubos/kubos/tools
    $ ./kubos_link.py

Depending on the state of your Kubos SDK project, you might also need to change the
module links locally:

::

    $ cd {project folder}
    $ kubos link -a

Using KubOS Linux
-----------------

For information on how to create and run applications on your new KubOS Linux system, see the
:doc:`working-with-the-bbb` guide.


text:
	<title>Camilla Tominey's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Camilla Tominey's panel show appearances

Camilla Tominey has appeared in 6 episodes between 2017-2019. Note that these appearances may be for more than one person if multiple people have the same name.

2017

2018

2019

2019-09-19 / Question Time

2019-01-31 / Question Time

2018-09-20 / Question Time

2018-05-03 / Question Time

2018-02-22 / Question Time

2017-10-26 / Question Time


text:
"use strict";
/*
 * ATTENTION: An "eval-source-map" devtool has been used.
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
self["webpackHotUpdate_N_E"]("webpack",{},
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ /* webpack/runtime/getFullHash */
/******/ !function() {
/******/ 	__webpack_require__.h = function() { return "0c629eadbd637218fb8c"; }
/******/ }();
/******/
/******/ /* webpack/runtime/compat */
/******/
/******/
/******/ // noop fns to prevent runtime errors during initialization
/******/ if (typeof self !== "undefined") {
/******/ 	self.$RefreshReg$ = function () {};
/******/ 	self.$RefreshSig$ = function () {
/******/ 		return function (type) {
/******/ 			return type;
/******/ 		};
/******/ 	};
/******/ }
/******/
/******/ }
);


text:
package com.blogspot.sontx.bottle.model.service;

import android.util.Log;

import com.blogspot.sontx.bottle.App;
import com.blogspot.sontx.bottle.model.bean.BottleUser;
import com.blogspot.sontx.bottle.model.bean.UserSetting;
import com.blogspot.sontx.bottle.model.service.interfaces.BottleServerUserSettingService;
import com.blogspot.sontx.bottle.model.service.rest.ApiClient;
import com.blogspot.sontx.bottle.model.service.rest.ApiUserSetting;

import lombok.Getter;
import retrofit2.Call;
import retrofit2.Response;

class BottleServerUserSettingServiceImpl extends BottleServerServiceBase implements BottleServerUserSettingService {
    @Getter
    private UserSetting currentUserSetting;

    @Override
    public void clearCached() {
        super.clearCached();
        currentUserSetting = null;
    }

    @Override
    public void getUserSettingAsync(final Callback<UserSetting> callback) {
        if (currentUserSetting != null) {
            callback.onSuccess(currentUserSetting);
            return;
        }

        if (!App.getInstance().getBottleContext().isLogged()) {
            callback.onError(new Exception("Unauthenticated"));
            return;
        }

        BottleUser bottleUser = App.getInstance().getBottleContext().getCurrentBottleUser();

        ApiUserSetting apiUserSetting = ApiClient.getClient(bottleUser.getToken()).create(ApiUserSetting.class);

        Call<UserSetting> call = apiUserSetting.getUserSetting(bottleUser.getUid());

        call.enqueue(new retrofit2.Callback<UserSetting>() {
            @Override
            public void onResponse(Call<UserSetting> call, Response<UserSetting> response) {
                if (response.code() == 200) {
                    currentUserSetting = response.body();
                    callback.onSuccess(currentUserSetting);
                } else {
                    Log.e(TAG, "getUserSettingAsync: " + response.code() + " " + response.message());
                    callback.onError(new Exception(""));
                }
            }

            @Override
            public void onFailure(Call<UserSetting> call, Throwable t) {
                callback.onError(t);
            }
        });
    }

    @Override
    public void updateUserSettingAsync(final UserSetting userSetting, final Callback<UserSetting> callback) {
        this.currentUserSetting = userSetting;

        if (!App.getInstance().getBottleContext().isLogged()) {
            callback.onError(new Exception("Unauthenticated"));
            return;
        }

        BottleUser bottleUser = App.getInstance().getBottleContext().getCurrentBottleUser();

        ApiUserSetting apiUserSetting = ApiClient.getClient(bottleUser.getToken()).create(ApiUserSetting.class);

        Call<UserSetting> call = apiUserSetting.updateUserSetting(bottleUser.getUid(), userSetting);

        call.enqueue(new retrofit2.Callback<UserSetting>() {
            @Override
            public void onResponse(Call<UserSetting> call, Response<UserSetting> response) {
                if (response.code() == 200) {
                    currentUserSetting = response.body();
                    callback.onSuccess(userSetting);
                } else {
                    Log.e(TAG, "updateUserSettingAsync: " + response.code() + " " + response.message());
                    callback.onError(new Exception(""));
                }
            }

            @Override
            public void onFailure(Call<UserSetting> call, Throwable t) {
                callback.onError(t);
            }
        });
    }
}


text:
  background: #ddd;
  height: 360px;
  margin-bottom: 0px;
  overflow: hidden;
  padding: 0;
  position: relative;
  border-top: solid 1px #fff;
  border-bottom: solid 1px #fff;
}

#examples:after,
#examples:before {
  content: "";
  display: block;
  width: 100%;
  position: absolute;
  background: red;
  height: 16px;
  z-index: 2;
}

#examples:before {
  bottom: -16px;
  box-shadow: 0px -8px 16px rgba(0,0,0, .3);
}

#examples:after {
  top: -16px;
  box-shadow: 0px 8px 16px rgba(0,0,0, .3);
}

#examples-deep {
  -webkit-transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  backface-visibility: hidden;
}

#examples svg,
#examples canvas {
  position: absolute;
}

.example-mesh {
  fill: none;
  stroke: #fff;
  stroke-width: 2px;
}

.example-anchor path {
  fill: none;
  pointer-events: all;
}

.example-anchor path:hover {
  stroke: #000;
  stroke-width: 2px;
}


text:
package com.chinamobile.bcbsp.graph;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.Text;

import com.chinamobile.bcbsp.Constants;
import com.chinamobile.bcbsp.api.BSP;
import com.chinamobile.bcbsp.api.Edge;
import com.chinamobile.bcbsp.api.Vertex;
import com.chinamobile.bcbsp.bspstaff.BSPStaffContext;
import com.chinamobile.bcbsp.bspstaff.Staff;
import com.chinamobile.bcbsp.comm.CommunicatorInterface;
import com.chinamobile.bcbsp.comm.GraphStaffHandler;
import com.chinamobile.bcbsp.io.RecordWriter;
import com.chinamobile.bcbsp.subgraph.SGAGraphdataStore;
import com.chinamobile.bcbsp.util.BSPJob;

public class GraphDataManagerMem implements GraphDataInterface {

  public static final Log LOG = LogFactory.getLog(GraphDataManagerMem.class);
  /** handle of staff. */
  private Staff staff;
  /** the list of vertices in this partition. */
  private List<Vertex> vertexList = new ArrayList<Vertex>();
  /** the list of vertex active flag. */
  private List<Boolean> activeFlags = new ArrayList<Boolean>();
  /** Total number of vertices . */
  private int totalVerticesNum = 0;
  /** Total number of edges. */
  private int totalEdgesNum = 0;
  /** global index of graph data. */
  private int globalIndex = 0;
  /** vertex class. */
  private Class<? extends Vertex<?, ?, ?>> vertexClass;
  /** edge class. */
  private Class<? extends Edge<?, ?>> edgeClass;
  private long activeCounter = 0;
  private int lastSuperstepCounter = 0;

  @Override
  public void initialize() {
    // Note Initialize The Job Working Directory For Vertices.
    String jobId = staff.getJobID().toString();
    int partitionId = staff.getPartition();
    vertexClass = staff.getConf().getVertexClass();
    edgeClass = staff.getConf().getEdgeClass();
  }

  @Override
  public void addForAll(Vertex vertex) {
    vertexList.add(vertex);
    activeFlags.add(true);
    this.totalEdgesNum = this.totalEdgesNum + vertex.getEdgesNum();
  }

  @Override
  public void processingByBucket(GraphStaffHandler graphStaffHandler, BSP bsp,
      BSPJob job, int superStepCounter, BSPStaffContext context)
      throws IOException {
    this.lastSuperstepCounter = superStepCounter;
    int tmpCounter = sizeForAll();
    Vertex vertex;
    boolean flag;
    for (int i = 0; i < tmpCounter; i++) {
      /** Clock */
      vertex = getForAll(i);
      flag = this.getActiveFlagForAll(i);
      graphStaffHandler.vertexProcessing(vertex, bsp, job, superStepCounter,
          context, flag);
      this.set(i, context.getVertex(), context.getActiveFLag());
    }
  }

  @Override
  public void saveAllVertices(GraphStaffHandler graphStaffHandler,
      RecordWriter output) throws IOException, InterruptedException {
    // TODO Auto-generated method stub
    for (Vertex v : vertexList) {
      graphStaffHandler.saveResultOfVertex(v, output);
    }
  }

  @Override
  public void saveAllVertices(RecordWriter output) throws IOException,
      InterruptedException {
    for (Vertex v : vertexList) {
      ArrayList<Edge> edgelist = (ArrayList<Edge>) v.getAllEdges();
      StringBuffer outEdges = new StringBuffer();
      for (Edge e : edgelist) {
        outEdges.append(e.getVertexID() + Constants.SPLIT_FLAG
            + e.getEdgeValue() + Constants.SPACE_SPLIT_FLAG);
      }
      output
          .write(
              new Text(v.getVertexID() + Constants.SPLIT_FLAG
                  + v.getVertexValue()), new Text(outEdges.toString()));;
    }
  }

  @Override
  public int size() {
    return vertexList.size();
  }

  @Override
  public int sizeForAll() {
    // TODO Auto-generated method stub
    return vertexList.size();
  }

  @Override
  public long getActiveCounter() {
    // TODO Auto-generated method stub
    return this.activeCounter;
  }

  @Override
  public void setStaff(Staff staff) {
    this.staff = staff;
  }

  @Override
  public int getVertexSize() {
    // TODO Auto-generated method stub
    return vertexList.size();
  }

  @Override
  public void getAllVertex(GraphStaffHandler graphStaffHandler,
      CommunicatorInterface communicator, RecordWriter output)
      throws IOException, InterruptedException {
    // TODO Auto-generated method stub

  }

  @Override
  public Vertex get(int index) {
    return null;
  }

  @Override
  public void set(int index, Vertex vertex, boolean activeFlag) {
    if (lastSuperstepCounter == 0) {
      activeCounter = 1;
    } else if (activeFlag) {
      activeCounter++;
    }
  }

  @Override
  public Vertex getForAll(int index) {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public boolean getActiveFlagForAll(int index) {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public void finishAdd() {
    // TODO Auto-generated method stub

  }

  @Override
  public void clean() {
    // TODO Auto-generated method stub

  }

  @Override
  public void showMemoryInfo() {
    // TODO Auto-generated method stub

  }

  @Override
  public int getEdgeSize() {
    // TODO Auto-generated method stub
    return 0;
  }

  @Override
  public void setMigratedStaffFlag(boolean flag) {
    // TODO Auto-generated method stub

  }

  @Override
  public void setRecovryFlag(boolean recovery) {
    // TODO Auto-generated method stub

  }

  @Override
  public void processMirrorSync() {
    // TODO Auto-generated method stub

  }

  @Override
  public SGAGraphdataStore getVertexStore() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public HashMap<String, Integer> chooseMigrateVertex(int maxMigrateNum,
      float minMigrateFactor, byte[] bs) {
    // TODO Auto-generated method stub
    return null;
  }

}


text:
var EndScene = cc.Scene.extend({
    onEnter:function () {
        //调用基类构造函数
        this._super();
        console.log("结束场景运行");
        var gameBgLayer = new GameBgLayer();
        gameBgLayer.init();
        this.addChild(gameBgLayer);
        var endBgLayer = new EndBgLayer();
        endBgLayer.init();
        this.addChild(endBgLayer);
        var gameHudLayer = new GameHudLayer();
        gameHudLayer.init();
        this.addChild(gameHudLayer);
        var endMenuLayer = new EndMenuLayer();
        endMenuLayer.init();
        this.addChild(endMenuLayer);
    }
});