text:
# gulp-deploy-git
[![Downloads per Month](http://img.shields.io/npm/dm/gulp-deploy-git.svg?style=flat)](https://www.npmjs.org/package/gulp-deploy-git)
[![Version](http://img.shields.io/npm/v/gulp-deploy-git.svg?style=flat)](https://www.npmjs.org/package/gulp-deploy-git)

> Deploy Git projects to remote Git repositories.

## Installation

Install the package with npm and add it to your development dependencies:

`npm install --save-dev gulp-deploy-git`

## Usage

### Single deployment target

```javascript
var deploy = require('gulp-deploy-git');

gulp.task('deploy', function() {
  return gulp.src('dist/**/*', { read: false })
    .pipe(deploy({
      repository: 'https://github.com/zhevron/gulp-deploy-git.git'
    }));
});
```

### Multiple deployment targets

```javascript
var deploy = require('gulp-deploy-git');

gulp.task('deploy', function() {
  return gulp.src('dist/**/*', { read: false })
    .pipe(deploy({
      repository: 'https://username@github.com/username/my-repo.git',
      branches:   ['master']
    }))
    .pipe(deploy({
      repository: 'https://username@github.com/username/my-staging-repo.git',
      branches:   ['staging']
    }));
});
```

## Options

- `prefix`

  Prefix to strip from the relative path names when copying source files.

- `message`

  The commit message to use when pushing to the remote deployment repository.
  If omitted, Git will be used to determine the last commit message and use that.

- `repository`

	The remote Git repository to push to.

- `remoteBranch`

  The remote branch to clone and push to. Defaults to `master`.

- `branches`

	Only trigger deployment on the following branch(es). Defaults to `master`.

- `verbose`

  Verbose mode. Will show output from all git commands run. Defaults to `false`.

- `debug`

  Debugging mode. A lot of extra output to debug deployment issues.
  Implies `verbose`. Defaults to `false`.

## Errors

**gulp-deploy-git** emits an 'error' event if it is unable to commit to the
remote repository.

To handle errors across your entire pipeline, see the
[gulp](https://github.com/gulpjs/gulp/blob/master/docs/recipes/combining-streams-to-handle-errors.md#combining-streams-to-handle-errors) documentation.

## License

**gulp-deploy-git** is licensed under the [MIT license](http://opensource.org/licenses/MIT).
For the full license, see the `LICENSE.md` file.


text:
var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
(_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {

	"use strict";

		var _cssRatioSetter = function(pt, cssp, mod) { //Takes an individual CSSPropTween and converts it into a type:2 that has a setRatio that does everything the regular CSSPlugin.setRatio() method does but applying the mod() too. We do this to keep the main CSSPlugin.setRatio() as fast as possible (the vast majority of times, no mod() will be necessary)
				var type = pt.type,
					oldSetRatio = pt.setRatio,
					tween = cssp._tween,
					target = cssp._target;
				pt.type = 2;
				pt.m = mod;
				pt.setRatio = function(v) {
					var min = 0.000001,
						val, str, i;
					if (v === 1 && (tween._time === tween._duration || tween._time === 0)) {

						if (type !== 2) {
							if (pt.r && type !== -1) {
								val = Math.round(pt.s + pt.c);
								if (!type) {
									pt.t[pt.p] = mod(val + pt.xs0, target);
								} else if (type === 1) {
									str = pt.xs0 + val + pt.xs1;
									for (i = 1; i < pt.l; i++) {
										str += pt["xn"+i] + pt["xs"+(i+1)];
									}
									pt.t[pt.p] = mod(str, target);
								}
							} else {
								pt.t[pt.p] = mod(pt.e, target);
							}
						} else {
							oldSetRatio.call(pt, v);
						}

					} else if (v || !(tween._time === tween._duration || tween._time === 0) || tween._rawPrevTime === -0.000001) {
						val = pt.c * v + pt.s;
						if (pt.r) {
							val = Math.round(val);
						} else if (val < min) if (val > -min) {
							val = 0;
						}
						if (!type) {
							pt.t[pt.p] = mod(val + pt.xs0, target);
						} else if (type === 1) {
							str = pt.xs0 + val + pt.xs1;
							for (i = 1; i < pt.l; i++) {
								str += pt["xn"+i] + pt["xs"+(i+1)];
							}
							pt.t[pt.p] = mod(str, target);

						} else if (type === -1) { //non-tweening value
							pt.t[pt.p] = mod(pt.xs0, target);

						} else if (oldSetRatio) {
							oldSetRatio.call(pt, v);
						}

					} else {
						if (type !== 2) {
							pt.t[pt.p] = mod(pt.b, target);
						} else {
							oldSetRatio.call(pt, v);
						}
					}
				};
			},
			_modCSS = function(lookup, cssp) {
				var pt = cssp._firstPT,
					hasBezier = (lookup.rotation && cssp._overwriteProps.join("").indexOf("bezier") !== -1); //when a Bezier tween is applying autoRotation, it's a very special case we need to handle differently.
				while (pt) {
					if (typeof(lookup[pt.p]) === "function") {
						_cssRatioSetter(pt, cssp, lookup[pt.p]);
					} else if (hasBezier && pt.n === "bezier" && pt.plugin._overwriteProps.join("").indexOf("rotation") !== -1) {
						pt.data.mod = lookup.rotation;
					}
					pt = pt._next;
				}
			},

			ModifiersPlugin = _gsScope._gsDefine.plugin({
				propName: "modifiers",
				version: "0.0.3",
				API: 2,

				//called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
				init: function(target, value, tween) {
					this._tween = tween;
					this._vars = value;
					return true;
				},

				initAll: function() {
					var tween = this._tween,
						lookup = this._vars,
						mpt = this,
						pt = tween._firstPT,
						val, next;
					while (pt) {
						next = pt._next; //record here, because it may get removed
						val = lookup[pt.n];
						if (pt.pg) {
							if (pt.t._propName === "css") { //handle CSSPlugin uniquely (for performance, due to the fact that the values almost always are a concatenation of numbers and strings, like suffixes, and we don't want to slow down the regular CSSPlugin setRatio() performance with conditional checks for if the value needs to be modded, so we pull any modding prop out and change it to a type:2 one that simply calls a setRatio() method where we encapsulate the modding and update all together. That way, it says in the main CSSProp linked list and just has some custom logic applied to it inside its setRatio())
								_modCSS(lookup, pt.t);
							} else if (pt.t !== mpt) { //don't run modProps on modProps :)
								val = lookup[pt.t._propName];
								pt.t._mod((typeof(val) === "object") ? val : lookup);
							}
						} else if (typeof(val) === "function") {
							if (pt.f === 2 && pt.t) { //a blob (text containing multiple numeric values)
								pt.t._applyPT.m = val;
							} else {
								this._add(pt.t, pt.p, pt.s, pt.c, val);
								//remove from linked list
								if (next) {
									next._prev = pt._prev;
								}
								if (pt._prev) {
									pt._prev._next = next;
								} else if (tween._firstPT === pt) {
									tween._firstPT = next;
								}
								pt._next = pt._prev = null;
								tween._propLookup[pt.n] = mpt;
							}
						}
						pt = next;
					}
					return false;
				}

			}),
			p = ModifiersPlugin.prototype;

		p._add = function(target, p, s, c, mod) {
			this._addTween(target, p, s, s + c, p, mod);
			this._overwriteProps.push(p);
		};

	p = _gsScope._gsDefine.globals.TweenLite.version.split(".");
	if (Number(p[0]) <= 1 && Number(p[1]) < 19 && _gsScope.console) {
		console.log("ModifiersPlugin requires GSAP 1.19.0 or later.");
	}

}); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }

//export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date)
(function(name) {
	"use strict";
	var getGlobal = function() {
		return (_gsScope.GreenSockGlobals || _gsScope)[name];
	};
	if (typeof(module) !== "undefined" && module.exports) { //node
		require("../TweenLite.js");
		module.exports = getGlobal();
	} else if (typeof(define) === "function" && define.amd) { //AMD
		define(["TweenLite"], getGlobal);
	}
}("ModifiersPlugin"));

redpajama_set_name: RedPajamaGithub


text:
SOAPP
==============
==============

State of the App, or SOAPP, is a way for software developers to see what others in their team are working on. SOAPP uses the Github API to grab user's projects online, and combines that with data from local machines. SOAPP then displays this information in an easy to read overview dashboard.

==============
==============

## The Team

* [Anthony Ferragano](https://github.com/aferragano)
* [Chris Wallwork](https://github.com/cwallwork)
* [Rafael Rocha](https://github.com/rafaelrochasilva)

SOAPP
==============
============
=======
Download the rake task file and place the file within the app/lib/task folder of the Rails project you want to track.

Run the rake task:

rake use:soapp

What does it do?

The rake task will create a post-commit file inside the .git/hooks folder of your repository, and set that file to be executable.

Now, after every local commit the git hook will send information about the commit to SOAPP. Using the SOAPP dashboard you can see every local commit and prevent possible problems before they happen.

Push for team members

Once you push the repository to github other users of your repository can run the rake task and their progress will be tracked.

Without ruby

Download the git hook file. Copy the file to the .git/hooks directory within your repo. Now, while in the hooks directory type: chmod +x post-commit . This will set the hook to executable.


text:
package com.ibm.greenhat.examples.stubreporter;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.text.MessageFormat;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import com.ibm.greenhat.examples.stubreporter.model.Component;
import com.ibm.greenhat.examples.stubreporter.model.Domain;
import com.ibm.greenhat.examples.stubreporter.model.Environment;
import com.ibm.greenhat.examples.stubreporter.model.Operation;
import com.ibm.greenhat.examples.stubreporter.model.Server;
import com.ibm.greenhat.examples.stubreporter.model.StubDefinition;
import com.ibm.greenhat.examples.stubreporter.model.StubInstance;

/**
 * Gathers data from RTCP and creates a model and then outputs the XML
 */
public class RTCPStubDataGatherer {

    private final String baseURL;
    private final Server server;
    private final DocumentBuilder dBuilder;

    public RTCPStubDataGatherer(final Server server, final DocumentBuilder dBuilder) throws Exception {
        String urlWithTrailingSlash = server.getUrl();
        if (!urlWithTrailingSlash.endsWith("/")) {
            urlWithTrailingSlash += "/";
        }
        baseURL = urlWithTrailingSlash;
        this.server = server;
        this.dBuilder = dBuilder;
    }

    /**
     * Loop through all the domains and environments and get stub information from RTCP
     */
    public void populate() throws Exception {
        for (final Domain domain : server.getDomains()) {
            for (final Environment env : domain.getEnvironments()) {
                addStubDefinitions(domain, env);
            }
        }
    }

    /**
     * Query RTCP to get StubDefinition information for the supplied domain and environment
     */
    private void addStubDefinitions(final Domain domain, final Environment env) throws IOException,
            ParserConfigurationException, SAXException {
        final String urlPart = MessageFormat.format("rest/stubs/?domain={0}&env={1}", domain.getName(), env.getName());
        final URL url = new URL(baseURL + urlPart);
        final Document stubDefs = getXML(url);
        final NodeList stubs = stubDefs.getElementsByTagName("stub");
        for (int i = 0; i < stubs.getLength(); i++) {
            final Node node = stubs.item(i);
            if (node instanceof Element) {
                final String name = ((Element) node).getAttribute("name");
                final String component = ((Element) node).getAttribute("component");
                final String operation = ((Element) node).getAttribute("operation");
                final String version = ((Element) node).getAttribute("version");
                final String href = ((Element) node).getAttribute("href");

                final StubDefinition stubDef = new StubDefinition(component, operation, name, version);
                addStubInstances(stubDef, href);

                final Component comp = env.addComponent(new Component(component));
                if (!"".equals(operation)) {
                    final Operation op = comp.addOperation(new Operation(operation));
                    op.addStub(stubDef);
                } else {
                    comp.addStub(stubDef);
                }
            }
        }
    }

    /**
     * Get locate the instance URL needed to find Stub instance information
     */
    private void addStubInstances(final StubDefinition stubDefinition, final String href) throws IOException,
            ParserConfigurationException, SAXException {
        final String urlPart = MessageFormat.format("rest/stubs/{0}", href);
        final URL url = new URL(baseURL + urlPart);
        final Document stubDef = getXML(url);
        final NodeList instances = stubDef.getElementsByTagName("instances");
        if (instances.getLength() == 1) {
            final Node node = instances.item(0);
            if (node instanceof Element) {
                final String instancesHref = ((Element) node).getAttribute("href");
                final String instancesUrl = urlPart + instancesHref;
                addInstanceData(instancesUrl, stubDefinition);
            }
        }

    }

    /**
     * Get stub instance data, i.e. the status, so it can be added to the definition
     */
    private void addInstanceData(final String instancesUrl, final StubDefinition stubDefinition) throws IOException,
            ParserConfigurationException, SAXException {
        final URL url = new URL(baseURL + instancesUrl);
        final Document instanceDoc = getXML(url);
        final NodeList instancesContainerNode = instanceDoc.getElementsByTagName("instances");
        if (instancesContainerNode.getLength() == 1) {
            final NodeList childNodes = instancesContainerNode.item(0).getChildNodes();
            for (int k = 0; k < childNodes.getLength(); k++) {
                final Node node = childNodes.item(k);
                if (node instanceof Element) {
                    final String status = ((Element) node).getAttribute("status");
                    final StubInstance instance = new StubInstance(status);
                    stubDefinition.addInstance(instance);
                }
            }
        }
    }

    /**
     * Simple connection to the server to get XML information back
     */
    private Document getXML(final URL url) throws IOException, ParserConfigurationException, SAXException {
        final URLConnection con = url.openConnection();
        try {
            final Document doc = dBuilder.parse(con.getInputStream());
            return doc;
        } catch (final IOException e) {
            final int responseCode = ((HttpURLConnection) con).getResponseCode();
            if (responseCode == 412 || responseCode == 404) {
                return dBuilder.newDocument();
            }
            throw e;
        } finally {
            if (con instanceof HttpURLConnection) {
                ((HttpURLConnection) con).disconnect();
            }
        }
    }
}


text:
require 'spec_helper'

describe Zarinpal do
  before do
    Zarinpal.configure do |config|
      config.merchant_id = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
      config.callback_url = 'http://www.m0b.ir/verify.php'
    end
  end

  it 'responses to merchant_id' do
    expect(Zarinpal.configuration.merchant_id).to eq(
      'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
    )
  end

  it 'responses to client with default value' do
    expect(Zarinpal.configuration.client).to eq(
      'https://de.zarinpal.com/pg/services/WebGate/wsdl'
    )
  end
end


text:
/*
 * The English translation file has to exist to avoid complicating things for
 * index.js, but it doesn't need to actually have any translations, because that
 * would just be redundant with the default messages (which are all in English).
 */
module.exports = {
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

	<!-- <include file="changesets/liquibase/initial-schema-sqlfire.sql"/>  -->
	<include file="changesets/db-agnostic/initial-schema.xml"/>

	<!-- Load Example Data Provided By SqlFire  -->
	<include file="changesets/sqlfire/data/loadCOUNTRIES.sql"/>
	<include file="changesets/sqlfire/data/loadCITIES.sql"/>
	<include file="changesets/sqlfire/data/loadAIRLINES.sql"/>
	<include file="changesets/sqlfire/data/loadFLIGHTS1.sql"/>
	<include file="changesets/sqlfire/data/loadFLIGHTS2.sql"/>
	<include file="changesets/sqlfire/data/loadFLIGHTAVAILABILITY1.sql"/>
	<include file="changesets/sqlfire/data/loadFLIGHTAVAILABILITY2.sql"/>

	<include file="changesets/db-agnostic/schema-only.xml"/>
	<include file="changesets/db-agnostic/qa-only.xml"/>
	<include file="changesets/db-agnostic/sql-server-only.xml"/>
	<include file="changesets/db-agnostic/tag-database.xml"/>

</databaseChangeLog>


text:
<resources>
    <string name="app_name">ASleepyCoder</string>

    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
</resources>


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:startColor="#fefeff"
        android:endColor="#e4e5e8"
        android:angle="270"
     />
</shape>


text:
using System;
using System.Collections.Generic;
using System.Web.Mvc;
using Microsoft.Practices.ServiceLocation;

namespace Uranium.Mvc.Infrastructure
{
    class StructureMapDependencyResolver : IDependencyResolver
    {
        public object GetService(Type serviceType)
        {
            if(!serviceType.IsAbstract)
                return ServiceLocator.Current.GetService(serviceType);

            return null;
        }

        public IEnumerable<object> GetServices(Type serviceType)
        {
            return ServiceLocator.Current.GetAllInstances(serviceType);
        }
    }
}


text:
package com.helospark.FakeSsh.compression.factory;

import com.helospark.lightdi.annotation.Order;
import com.helospark.lightdi.annotation.Component;

import com.helospark.FakeSsh.compression.SshCompression;
import com.helospark.FakeSsh.compression.SshCompressionFactory;
import com.helospark.FakeSsh.compression.implementation.ZlibSshCompression;
import com.jcraft.jzlib.Deflater;
import com.jcraft.jzlib.Inflater;
import com.jcraft.jzlib.JZlib;

@Component
@Order(1)
public class ZlibSshCompressionFactory implements SshCompressionFactory {

	@Override
	public SshCompression create() {
		return new ZlibSshCompression(createDeflater(), createInflater());
	}

	public Deflater createDeflater() {
		Deflater deflater = new Deflater();
		deflater.init(6);
		return deflater;
	}

	@SuppressWarnings("deprecation")
	public Inflater createInflater() {
		Inflater inflater = new Inflater();
		inflater.inflateInit(JZlib.MAX_WBITS, JZlib.W_ZLIB);
		return inflater;
	}

	@Override
	public String getName() {
		return "zlib";
	}
}


text:
<?php
/**
 * @file
 * Display profile fields.
 *
 * @todo Need definition of what variables are available here.
 */
?>
<?php if (is_array($vars)): ?>
  <?php  foreach ($vars as $class => $field): ?>

      <dt class="profile-<?php print $class; ?>"><?php print $field['title']; ?>

      <dd class="profile-<?php print $class; ?>"><?php print $field['value']; ?>

  <?php endforeach; ?>
<?php endif; ?>


text:
import time, sys, signal, atexit
import pyupm_hmtrp as upmHmtrp

# Instantiate a HMTRP radio device on uart 0
my_HMTRP_Radio = upmHmtrp.HMTRP(0)

## Exit handlers ##
# This stops python from printing a stacktrace when you hit control-C
def SIGINTHandler(signum, frame):
	raise SystemExit

# This function lets you run code on exit,
# including functions from my_HMTRP_Radio
def exitHandler():
	print "Exiting"
	sys.exit(0)

# Register exit handlers
atexit.register(exitHandler)
signal.signal(signal.SIGINT, SIGINTHandler)

myCounter = 0

# normal read/write mode
bufferLength = 256
radioBuffer = upmHmtrp.charArray(bufferLength)

# make sure port is initialized properly. 9600 baud is the default.
if (not my_HMTRP_Radio.setupTty(upmHmtrp.cvar.int_B9600)):
	print "Failed to setup tty port parameters"
	sys.exit(0)

usageStr = ("Usage:\n"
"Pass a commandline argument (any argument) to this program\n"
"to query the radio configuration and output it.  NOTE: the\n"
"radio must be in CONFIG mode for this to work.\n\n"
"Running this program without arguments will simply transmit\n"
"'Hello World!' every second, and output any data received from\n"
"another radio.\n\n")
print usageStr

'''
By default, this radio simply transmits data sent via writeData()
and reads any available data via readData().

It can be placed into a configuration mode by grounding the
CONFIG pin on the module.  When this is done, the various
configuration query and config methods can be used.  In this
example, by default, we just read any data available fom the
device, and periodically transmit "Hello World".

If any argument was specified on the command line, do a simple
configuration query and output the results.  The radio must be in
CONFIG mode for this to work.

Note that the first command-line argument should be "hmtry.py"
The data we want would be the second... if it exists
'''
if (len(sys.argv) > 1):
	# config mode
	freq = upmHmtrp.uint32Array(0)
	dataRate = upmHmtrp.uint32Array(0)
	rxBandwidth = upmHmtrp.uint16Array(0)
	modulation = upmHmtrp.uint8Array(0)
	txPower = upmHmtrp.uint8Array(0)
	uartBaud = upmHmtrp.uint32Array(0)

	if (my_HMTRP_Radio.getConfig(freq, dataRate, rxBandwidth,
	modulation, txPower, uartBaud)):
		print "Radio configuration:"
		outputStr = ("freq: {0} dataRate: {1} "
		"rxBandwidth: {2}Khz").format(freq.__getitem__(0),
		dataRate.__getitem__(0),
		rxBandwidth.__getitem__(0))
		print outputStr

		outputStr = "modulation: %d Khz txPower: %d uartBaud: %d" % (
		modulation.__getitem__(0), txPower.__getitem__(0),
		uartBaud.__getitem__(0))
		print outputStr
	else:
		errString = ("getConfig() failed.  Make sure the radio "
		"is in CONFIG mode.")
		print errString
else:
	print "Running in normal read/write mode."
	while (1):
		# we don't want the read to block in this example, so always
		# check to see if data is available first.
		if (my_HMTRP_Radio.dataAvailable()):
			rv = my_HMTRP_Radio.readData(radioBuffer, bufferLength)

			if (rv > 0):
				resultStr = "";
				for x in range(rv):
					resultStr += radioBuffer.__getitem__(x)
				print "Received:", resultStr

			if (rv < 0): # some sort of read error occurred
				print "Port read error."
				sys.exit(0)
		myCounter += 1
		# every second, transmit "Hello World"
		if (myCounter > 10):
			msg = "Hello World!"

			print "Transmitting %s..." % msg

			# Adding 1 for NULL terminator.
			# Note that SWIG automatically adds a NULL terminator,
			# so no need to NULL-terminate ourselves.
			# Just increment the message length to include
			# the NULL that's already there
			my_HMTRP_Radio.writeData(msg, (len(msg) + 1))
			myCounter = 0
		time.sleep(.1)


text:
/**
 * Module dependencies.
 */
var express = require("express");
var minify = require("express-minify");
var routes = require("./routes");
var http = require("http");
var path = require("path");
var cons = require("consolidate");
var five = require("johnny-five");
var socketio = require("socket.io");
var Station = require("./lib/stations");

// Global variables
var app,
  io,
  board,
  active = false,
  startTime,
  stopTime,
  reference,
  product,
  stations = Array(5);

// Setup

// Web server setup
app = express();

app.engine("hbs", cons.handlebars);
// change to 80 when deploying in pcDuino
app.set("port", process.env.PORT || 3000);
app.set("views", path.join(__dirname, "views"));
app.set("view engine", "hbs");
app.use(express.logger("dev"));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.compress());
app.use(minify({
    js_match: /javascript/,
    css_match: /css/,
    sass_match: /scss/,
    less_match: /less/,
    stylus_match: /stylus/,
    coffee_match: /coffeescript/,
    cache: false,
    blacklist: [/\.min\.(css|js)$/],
    whitelist: null
}));
app.use(express.static(path.join(__dirname, "static")));

// development only
if ("development" == app.get("env")) {
  app.use(express.errorHandler());
}

app.get("/", routes.index);

http.createServer(app).listen(app.get("port"), function(){
  console.log("HTTP server listening on port " + app.get("port"));
});

// Event server setup
resetStations();

// Registers handlers for physical sensors.
// Data collection must be done here.
board = new five.Board();

board.on("ready", function() {
  s1 = new five.Button(2);
  s2 = new five.Button(3);
  s3 = new five.Button(4);
  s4 = new five.Button(5);

  s1.on("down", function() {
    if(active) {
      stations[0].enqueue();
      stations[1].enqueue();
      board.emit("s1_on");
    }
  }).on("up", function() {
    if(active) {
      board.emit("s1_off");
    }
  });

  s2.on("down", function() {
    if(active) {
      stations[1].dequeue();
      stations[2].enqueue();
      board.emit("s2_on");
    }
  }).on("up", function() {
    if(active) {
      board.emit("s2_off");
    }
  });

  s3.on("down", function() {
    if(active) {
      stations[2].dequeue();
      stations[3].enqueue();
      board.emit("s3_on");
    }
  }).on("up", function() {
    if(active) {
      board.emit("s3_off");
    }
  });

  s4.on("down", function() {
    if(active) {
      stations[3].dequeue();
      stations[0].dequeue();
      board.emit("s4_on");
    }
  }).on("up", function() {
    if(active) {
      board.emit("s4_off");
    }
  });

});

// Websocket setup
io = socketio.listen(8080);

// Registers handler for client connections.
io.sockets.on("connection", function (socket) {
  processConnection(socket);
  handleBoardEvents(socket);
  handleClientEvents(socket);
  handleClientDisconnection(socket);
});

// TODO: Move to module in ./lib
// Processes a new client connection.
function processConnection(socket) {
  // Puts client in pool so that it can broadcast messages to peers.
  socket.join("clients");
  var connectedClients = io.sockets.clients("clients").length;
  socket.emit("clients", {"clients": connectedClients});
  socket.broadcast.to("clients").emit("clients", {"clients": connectedClients});
  // Syncronizes client's state.
  socket.emit("sync", {
    "active": active,
    "startTime": startTime,
    "reference": reference,
    "product": product,
    "stations":stationStats(),
  });
}

// Processes a client disconnection.
function handleClientDisconnection(socket) {
  socket.on("disconnect", function() {
    var connectedClients = io.sockets.clients("clients").length - 1;
    socket.broadcast.to("clients").emit("clients", {"clients": connectedClients});
  });
}

// Registers event handlers for control board events.
// i.e when a pushbutton is pressed
function handleBoardEvents(socket) {
  board.on("s1_on", function(){
    socket.emit("s1_on", stationStats());
  });

  board.on("s1_off", function(){
    socket.emit("s1_off");
  });

  board.on("s2_on", function(){
    socket.emit("s2_on", stationStats());
  });

  board.on("s2_off", function(){
    socket.emit("s2_off");
  });

  board.on("s3_on", function(){
    socket.emit("s3_on", stationStats());
  });

  board.on("s3_off", function(){
    socket.emit("s3_off");
  });

  board.on("s4_on", function(){
    socket.emit("s4_on", stationStats());
  });

  board.on("s4_off", function(){
    socket.emit("s4_off");
  });

  board.on("s5_on", function(){
    socket.emit("s4_on", stationStats());
  });

  board.on("s5_off", function(){
    socket.emit("s5_off");
  });
}

// Registers event handlers for client events.
// i.e. when a user presses Start button
function handleClientEvents(socket) {
    socket.on("start", function(data) {
      processStart(socket, data);
    });

    socket.on("stop", function(data) {
      processStop(socket, data);
    });
}

function processStart(socket, data) {
  if(!active) {
    active = true;
    startTime = data.startTime = Date.now();
    reference = data.reference;
    product = data.product;
    for(var i = 0; i < stations.length; ++i) {
      stations[i].operator = data.operators[i];
    }
    data.stations = stationStats();
    socket.emit("start", data);
    socket.broadcast.to("clients").emit("start", data);
  }
}

function processStop(socket, data) {
  if(active) {
    stopTime = Date.now();
    active = false;
    socket.broadcast.to("clients").emit("stop");
    var report = {
      duration: elapsedTime(startTime, stopTime),
      product: product,
      reference: reference,
      stations: stationStats(),
    };
    socket.emit("report", report);
    socket.broadcast.to("clients").emit("report", report);
    resetStations();
  }
}

// Resets stations data.
function resetStations() {
  for(var i = 0; i < stations.length; ++i) {
    stations[i] = new Station();
  }
}

// Returns list of station statistics.
function stationStats() {
  var stats = new Array(stations.length);
  for(var i = 0; i < stations.length; ++i) {
    stats[i] = stations[i].stats;
    stats[i].operator = stations[i].operator;
  }
  return stats;
}

// Computes elapsed time in hours, minutes, and seconds.
function elapsedTime(start, end) {
    start = new Date(start);
    end = new Date(end);

    var timeDiff = end - start,
      seconds, minutes, hours;

    timeDiff = Math.floor(timeDiff / 1000);
    seconds = Math.round(timeDiff % 60);

    timeDiff = Math.floor(timeDiff / 60);
    minutes = Math.round(timeDiff % 60);

    timeDiff = Math.floor(timeDiff / 60);
    hours = Math.round(timeDiff % 24);

    return {hours:hours, minutes:minutes, seconds:seconds};
}


text:
angular.module('jiraCardApp')
    .controller('WizardCtrl', function ($scope, $rootScope, jiraProvider) {

        /**
         * define constants
         * @type {{SPRINT: string, BOARD: string, TICKETS: string, XBOARD: string}}
         */
        $scope.type = {
            SPRINT: 'sprint',
            TICKETS: 'tickets'
        };

        /**
         * define initial types
         * @type {*[]}
         */
        $scope.types = [
            {id: $scope.type.SPRINT, name: 'Jira Finder'},
            {id: $scope.type.TICKETS, name: 'Comma Seperated Tickets'}
        ];

        $scope.isLoading = false;

        /**
         * define wizard data
         * @type {{type: string, project: null, sprint: null, board: null, tickets: null, fixVersion: null}}
         */
        $scope.wizard = {
            type: null,
            project: null,
            fixVersion: null,
            tickets: null
        };

        /**
         * define collection data
         * @type {{project: Array, sprint: Array, board: Array, tickets: Array, fixVersion: Array}}
         */
        $scope.collection = {};
        $scope.tickets = [];

        /**
         * define wizard functions
         */
        $scope.changeType = function () {
            $scope.wizard.project = null;
            $scope.wizard.fixVersion = null;
            $scope.wizard.tickets = null;

            $scope.typeHandler($scope.wizard.type);
        };

        $scope.typeHandler = function (type) {
            switch (type.id) {
                case $scope.type.SPRINT:
                    $scope.isLoading = true;
                    jiraProvider.getProjects()
                        .success(function (data, status, headers, config) {
                            $scope.collection['project'] = data;
                            $scope.isLoading = false;
                        });
                    break;
            }
        };

        $scope.isApplied = function (type) {
            if (typeof $scope.wizard[type] === 'undefined') {
                return false;
            }
            if ($scope.wizard[type] === null) {
                return false;
            }
            if (!$scope.wizard[type].hasOwnProperty('id') && !$scope.wizard[type].hasOwnProperty('key')) {
                return false;
            }
            return true;
        };

        $scope.isType = function (type) {
            if (false === $scope.isApplied('type')) {
                return false;
            }
            return $scope.wizard.type.id === type;
        };

        $scope.canShow = function (type) {
            if ($scope.isLoading) {
                return false;
            }

            if (!$scope.isApplied('type')) {
                return false;
            }

            switch (type) {
                case 'project':
                    return $scope.isType($scope.type.SPRINT);
                case 'tickets':
                    return $scope.isType($scope.type.TICKETS);
                case 'fixVersion':
                    return $scope.isApplied('project');
                case 'submit':
                    if ($scope.isType($scope.type.SPRINT)) {
                        if (!$scope.isApplied('project')) {
                            return false;
                        }
                        if (!$scope.isApplied('fixVersion')) {
                            return false;
                        }
                    }
                    return true;
            }
            return false;
        };

        $scope.getCollection = function (type) {
            if (typeof $scope.collection[type] === 'undefined') {
                return [];
            }
            return $scope.collection[type];
        };

        $scope.selectHandler = function (type) {
            switch (type) {
                case 'project':
                    if ($scope.isApplied('project')) {
                        $scope.isLoading = true;
                        jiraProvider.getProject($scope.wizard.project.id)
                            .success(function (data, status, headers, config) {
                                $scope.collection['fixVersion'] = data.versions;
                                $scope.isLoading = false;
                            });
                    }
                    break;
            }
        };

        $scope.submit = function (form) {
            if ($scope.isType($scope.type.TICKETS)) {
                if (typeof $scope.collection['tickets'] === "undefined" || $scope.collection['tickets'] === null) {
                    return false;
                }

                var tickets = $scope.collection['tickets'].split(",").map(λ("_.trim()")).map(λ("_.toUpperCase()"));

                $scope.isLoading = true;
                jiraProvider.getTicketsById(tickets)
                    .success(function (data, status, headers, config) {
                        $scope.isLoading = false;
                        $rootScope.$broadcast('ticketsAreLoaded', {
                            tickets: data.issues
                        });
                    });
            }

            if ($scope.isType($scope.type.SPRINT)) {
                var projectId = $scope.wizard.project.id,
                    fixVersion = $scope.wizard.fixVersion.id;

                jiraProvider.doSearch("project = " + projectId + " and fixVersion = " + fixVersion + " and status not in ('closed', 'resolved') ORDER BY key")
                    .success(function (data, status, headers, config) {
                        $scope.isLoading = false;
                        $rootScope.$broadcast('ticketsAreLoaded', {
                            tickets: data.issues
                        });
                    });
            }
        };
    }
);


text:
class Jugador

	@jugador = nil
	def initialize(jugador)
		@jugador = jugador
	end

	def get_jugador
		return @jugador
	end

	def mover(tab, x, y)
		res = tab.colocar_ficha(x, y, @jugador)
	end

end


text:
<?php

class Category extends Eloquent {

  public $timestamps = false;

}


text:
class SessionsController < ApplicationController
  include SessionsHelper

  # Do *NOT* redirect session creation, that will cause complicated failures
  # because we don't really want the locale.
  skip_before_action :redir_missing_locale, only: :create

  def new
    if logged_in?
      flash[:success] = t('sessions.already_logged_in')
      redirect_to root_url
    else
      use_secure_headers_override(:allow_github_form_action)
      store_location_and_locale
    end
  end

  # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
  def create
    counter_fixation # Counter session fixation (but save forwarding url)
    if Rails.application.config.deny_login
      flash.now[:danger] = t('sessions.login_disabled')
      render 'new', status: :forbidden
    elsif request.env['omniauth.auth'].present?
      omniauth_login
    elsif params[:session][:provider] == 'local'
      local_login
    else
      flash.now[:danger] = t('sessions.incorrect_login_info')
      render 'new'
    end
  end
  # rubocop:enable Metrics/AbcSize, Metrics/MethodLength

  def destroy
    log_out if logged_in?
    flash[:success] = t('sessions.signed_out')
    redirect_to root_url
  end

  private

  # Perform tasks for a user who just successfully logged in.
  def successful_login(user)
    log_in user
    redirect_back_or root_url

    # Report last login time (this can help users detect problems)
    last_login = user.last_login_at
    last_login = t('sessions.no_login_time') if last_login.blank?
    flash[:success] = t('sessions.signed_in', last_login_at: last_login)

    # Record last_login_at time.  We use update_columns because
    # it works even if we don't have the correct email decryption keys,
    # and so it won't change updated_at (so updated_at becomes more useful).
    # We don't need the model validations, we're just setting a timestamp.
    # rubocop: disable Rails/SkipsModelValidations
    user.update_columns(last_login_at: Time.now.utc)
    # rubocop: enable Rails/SkipsModelValidations
  end

  # We want to save the forwarding url of a session but
  # still need to counter session fixation,  this does it
  def counter_fixation
    ref_url = session[:forwarding_url] # Save forwarding url
    I18n.locale = session[:locale]
    reset_session # Counter session fixation
    session[:forwarding_url] = ref_url # Reload forwarding url
  end

  def local_login
    user = User.find_by provider: 'local',
                        email: params[:session][:email]
    if user&.authenticate(params[:session][:password])
      local_login_procedure(user)
    else
      flash.now[:danger] = t('sessions.invalid_combo')
      render 'new'
    end
  end

  def omniauth_login
    auth = request.env['omniauth.auth']
    user = User.find_by(provider: auth['provider'], uid: auth['uid']) ||
           User.create_with_omniauth(auth)
    session[:user_token] = auth['credentials']['token']
    user.name ||= user.nickname
    successful_login(user)
  end

  def local_login_procedure(user)
    if user.activated?
      successful_login(user)
      params[:session][:remember_me] == '1' ? remember(user) : forget(user)
    else
      flash[:warning] = t('sessions.not_activated')
      redirect_to root_url
    end
  end
end


text:
#include <folly/futures/Future.h>
#include <folly/portability/GTest.h>

using namespace folly;

TEST(NonCopyableLambda, basic) {
  Promise<int> promise;
  Future<int> future = promise.getFuture();

  Future<Unit>().then(std::bind(
      [](Promise<int>& promise) mutable { promise.setValue(123); },
      std::move(promise)));

  // The previous statement can be simplified in C++14:
  //  Future<Unit>().then([promise = std::move(promise)]() mutable {
  //    promise.setValue(123);
  //  });

  EXPECT_TRUE(future.isReady());
  EXPECT_EQ(future.get(), 123);
}

TEST(NonCopyableLambda, unique_ptr) {
  Promise<Unit> promise;
  auto int_ptr = folly::make_unique<int>(1);

  EXPECT_EQ(*int_ptr, 1);

  auto future = promise.getFuture().then(std::bind(
      [](std::unique_ptr<int>& int_ptr) mutable {
        ++*int_ptr;
        return std::move(int_ptr);
      },
      std::move(int_ptr)));

  // The previous statement can be simplified in C++14:
  //  auto future =
  //      promise.getFuture().then([int_ptr = std::move(int_ptr)]() mutable {
  //        ++*int_ptr;
  //        return std::move(int_ptr);
  //      });

  EXPECT_FALSE(future.isReady());
  promise.setValue();
  EXPECT_TRUE(future.isReady());
  EXPECT_EQ(*future.get(), 2);
}

TEST(NonCopyableLambda, Function) {
  Promise<int> promise;

  Function<int(int)> callback = [](int x) { return x + 1; };

  auto future = promise.getFuture().then(std::move(callback));
  EXPECT_THROW(callback(0), std::bad_function_call);

  EXPECT_FALSE(future.isReady());
  promise.setValue(100);
  EXPECT_TRUE(future.isReady());
  EXPECT_EQ(future.get(), 101);
}

TEST(NonCopyableLambda, FunctionConst) {
  Promise<int> promise;

  Function<int(int) const> callback = [](int x) { return x + 1; };

  auto future = promise.getFuture().then(std::move(callback));
  EXPECT_THROW(callback(0), std::bad_function_call);

  EXPECT_FALSE(future.isReady());
  promise.setValue(100);
  EXPECT_TRUE(future.isReady());
  EXPECT_EQ(future.get(), 101);
}


text:
from csvreader import CSVReader
import sys

if __name__ == "__main__":
    try:
        csv_path = sys.argv[1]
    except:
        raise ValueError('csv file path not given')

    CSVReader(csv_path)


text:
class LoginTokenForCustomer < LoginToken
end


text:
#ifndef MSTD_ALGORITHM_MAX_HPP_
#define MSTD_ALGORITHM_MAX_HPP_

/*!
*
* Note that the problem is that we use const T& and promise not to modify the input parameters. Whereas
* we can only return const T& in such cases, which may be insufficient sometimes. eg:
*   auto a = BigObj();
*   auto b = BigObj();
*   auto& c = min(a, b);
* Then we have to use c as a constant. So I eliminate all the consts.
*/

namespace mstd {
    template <class T>
    inline constexpr/*const*/ T& max(/*const*/ T& x, /*const*/ T& y)
    {
        return x < y ? y : x;
    }

    template <class T, class Cmp>
    inline constexpr/*const*/ T& max(/*const*/ T& x, /*const*/ T& y, Cmp cmp)
    {
        return cmp(x, y) ? y : x;
    }
} // of namespace mstd

#endif // !MSTD_ALGORITHM_MAX_HPP_


text:
package blueprint.zulu.util;

public class Dashboard {
	private String senderID;
	private String dashBody;

	// Constructor

	public Dashboard( String senderID, String dashBody)
	{
		this.senderID = senderID;
		this.dashBody = dashBody;
	}

	// Method to get sender's ID
	public String getSenderID()
	{
		return senderID;
	}

	// Method to get message body
	public String getDashBody()
	{
		return dashBody;
	}

	// String representation of the Message class
	public String toString()
	{
		return this.getSenderID() +  this.getDashBody();
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:id="@+id/nd3_account_register_phone_layout"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:orientation ="vertical"
	android:fillViewport="true"
	>

    <!-- 注册提示语 -->
	<TextView
		android:layout_width="fill_parent"
		android:layout_height="wrap_content"
		android:gravity="left"
		android:text="@string/nd3_account_register_phone_tip"
		android:textSize="@dimen/nd3_register_agreement_text_size"
		android:textColor="@color/nd3_white"
		android:layout_marginTop="@dimen/nd3_option_margin_top"
		style="@style/nd3_option_margin_style"
		>
	</TextView>

	<!-- 手机号、密码 -->
	<LinearLayout
		android:layout_width="fill_parent"
		android:layout_height="wrap_content"
		android:orientation ="vertical"
		android:background="@drawable/nd3_bk1"
		style="@style/nd3_option_margin_style"
		>

		<!-- 手机号 -->
		<LinearLayout
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:orientation ="horizontal"
			android:gravity="center_vertical"
			style="@style/nd3_option_item_margin_style"
			>

			<TextView
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:text="@string/nd3_account_register_tip_phone"
				style="@style/nd3_option_textview_style"
				>
			</TextView>

			<AutoCompleteTextView
				android:id="@+id/nd3_account_register_phone_phone"
				android:layout_width="fill_parent"
				android:layout_height="wrap_content"
				android:layout_weight="1"
				android:singleLine="true"
				android:maxLength="11"
				android:inputType="number"
				android:hint="@string/nd3_account_register_hint_phone"
				style="@style/nd3_option_edittext_style"
				>
			</AutoCompleteTextView>

		</LinearLayout>

		<!-- 分隔线 -->
		<ImageView
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:background="@drawable/nd3_horizontal_line"
			>
		</ImageView>

		<!-- 密码 -->
		<LinearLayout
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:orientation ="horizontal"
			android:gravity="center_vertical"
			style="@style/nd3_option_item_margin_style"
			>

			<TextView
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:text="@string/nd3_account_register_tip_password"
				style="@style/nd3_option_textview_style"
				>
			</TextView>

			<EditText
				android:id="@+id/nd3_account_register_phone_password"
				android:layout_width="fill_parent"
				android:layout_height="wrap_content"
				android:layout_weight="1"
				android:singleLine="true"
				android:maxLength="12"
				android:hint="@string/nd3_account_register_hint_password"
				style="@style/nd3_option_edittext_style"
				>
			</EditText>

		</LinearLayout>

	</LinearLayout>

	<!-- 验证码 -->
	<LinearLayout
		android:layout_width="fill_parent"
		android:layout_height="wrap_content"
		android:orientation ="vertical"
		android:background="@drawable/nd3_bk1"
		android:layout_marginTop="0dip"
		style="@style/nd3_option_margin_style"
		>

		<!-- 手机号 -->
		<LinearLayout
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:orientation ="horizontal"
			android:gravity="center_vertical"
			style="@style/nd3_option_item_margin_style"
			>

			<TextView
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:text="@string/nd3_account_register_tip_code"
				style="@style/nd3_option_textview_style"
				>
			</TextView>

			<AutoCompleteTextView
				android:id="@+id/nd3_account_register_phone_code"
				android:layout_width="fill_parent"
				android:layout_height="wrap_content"
				android:layout_weight="1"
				android:singleLine="true"
				android:maxLength="70"
				android:hint="@string/nd3_account_register_hint_code"
				style="@style/nd3_option_edittext_style"
				>
			</AutoCompleteTextView>

		</LinearLayout>

	</LinearLayout>

	<!-- 使用条款 -->
	<LinearLayout
		android:layout_width="fill_parent"
		android:layout_height="wrap_content"
		android:orientation ="horizontal"
		android:visibility="gone"
		style="@style/nd3_option_margin_style"
		>

		<CheckBox
			android:id="@+id/nd3_account_register_phone_is_agree"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:checked="true"
			android:button="@null"
			android:background="@drawable/nd3_square_checkbox_button"
			>
		</CheckBox>

		<TextView
			android:id="@+id/nd3_account_register_phone_agreement"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginLeft="@dimen/nd3_option_item_marginLeft"
			android:text="@string/nd3_account_register_agreement"
			android:textColor="@color/nd3_white"
			android:textSize="@dimen/nd3_register_agreement_text_size"
			>
		</TextView>

	</LinearLayout>

	<Button
	    android:id="@+id/nd3_account_register_phone_gain"
    	android:layout_width="fill_parent"
		android:layout_height="wrap_content"
		android:text="@string/nd3_account_register_button_gain_code"
		style="@style/nd3_option_margin_style"
		/>
</LinearLayout>


text:
/* Licensed under the terms of the 3-Clause BSD license. See LICENSE file in the project root for details. */
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_yahoo_db_mdbm_internal_NativeMdbmAccess */

#ifndef _Included_com_yahoo_db_mdbm_internal_NativeMdbmAccess
#define _Included_com_yahoo_db_mdbm_internal_NativeMdbmAccess
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    createIter
 * Signature: ()Lcom/yahoo/db/mdbm/internal/NativeMdbmIterator;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_createIter
  (JNIEnv *, jclass);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    freeIter
 * Signature: (J)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_freeIter
  (JNIEnv *, jclass, jlong);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_open
 * Signature: (Ljava/lang/String;IIII)Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1open
  (JNIEnv *, jclass, jstring, jint, jint, jint, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_close
 * Signature: (J)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1close
  (JNIEnv *, jclass, jlong);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_store_r
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/MdbmDatum;Lcom/yahoo/db/mdbm/MdbmDatum;ILcom/yahoo/db/mdbm/internal/NativeMdbmIterator;)Z
 */
JNIEXPORT jboolean JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1store_1r
  (JNIEnv *, jclass, jobject, jobject, jobject, jint, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_fetch_r
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/MdbmDatum;Lcom/yahoo/db/mdbm/internal/NativeMdbmIterator;)Lcom/yahoo/db/mdbm/MdbmDatum;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1fetch_1r
  (JNIEnv *, jclass, jobject, jobject, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_fetch_r_locked
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/MdbmDatum;Lcom/yahoo/db/mdbm/internal/NativeMdbmIterator;)Lcom/yahoo/db/mdbm/MdbmDatum;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1fetch_1r_1locked
  (JNIEnv *, jclass, jobject, jobject, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_fetch_dup_r
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/MdbmDatum;Lcom/yahoo/db/mdbm/internal/NativeMdbmIterator;)Lcom/yahoo/db/mdbm/MdbmDatum;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1fetch_1dup_1r
  (JNIEnv *, jclass, jobject, jobject, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_delete
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/MdbmDatum;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1delete
  (JNIEnv *, jclass, jobject, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_delete_r
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/internal/NativeMdbmIterator;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1delete_1r
  (JNIEnv *, jclass, jobject, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_lock
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1lock
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_unlock
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1unlock
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_plock
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/MdbmDatum;I)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1plock
  (JNIEnv *, jclass, jobject, jobject, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_tryplock
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/MdbmDatum;I)I
 */
JNIEXPORT jint JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1tryplock
  (JNIEnv *, jclass, jobject, jobject, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_punlock
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/MdbmDatum;I)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1punlock
  (JNIEnv *, jclass, jobject, jobject, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_lock_shared
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1lock_1shared
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_trylock_shared
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)I
 */
JNIEXPORT jint JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1trylock_1shared
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_lock_smart
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/MdbmDatum;I)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1lock_1smart
  (JNIEnv *, jclass, jobject, jobject, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_trylock_smart
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/MdbmDatum;I)I
 */
JNIEXPORT jint JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1trylock_1smart
  (JNIEnv *, jclass, jobject, jobject, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_unlock_smart
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/MdbmDatum;I)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1unlock_1smart
  (JNIEnv *, jclass, jobject, jobject, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_sethash
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;I)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1sethash
  (JNIEnv *, jclass, jobject, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_sync
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1sync
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_limit_size_v3
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;JLcom/yahoo/db/mdbm/ShakeCallback;Ljava/lang/Object;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1limit_1size_1v3
  (JNIEnv *, jclass, jobject, jlong, jobject, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_compress_tree
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1compress_1tree
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_close_fd
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1close_1fd
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_truncate
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1truncate
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_replace_file
 * Signature: (Ljava/lang/String;Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1replace_1file
  (JNIEnv *, jclass, jstring, jstring);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_replace_db
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1replace_1db
  (JNIEnv *, jclass, jobject, jstring);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_pre_split
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;J)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1pre_1split
  (JNIEnv *, jclass, jobject, jlong);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_setspillsize
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;I)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1setspillsize
  (JNIEnv *, jclass, jobject, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_store_str
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Ljava/lang/String;Ljava/lang/String;I)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1store_1str
  (JNIEnv *, jclass, jobject, jstring, jstring, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_fetch_str
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Ljava/lang/String;)Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1fetch_1str
  (JNIEnv *, jclass, jobject, jstring);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_delete_str
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1delete_1str
  (JNIEnv *, jclass, jobject, jstring);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_prune
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/PruneCallback;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1prune
  (JNIEnv *, jclass, jobject, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_purge
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1purge
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_fsync
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1fsync
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_trylock
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)I
 */
JNIEXPORT jint JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1trylock
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_islocked
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)Z
 */
JNIEXPORT jboolean JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1islocked
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_isowned
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)Z
 */
JNIEXPORT jboolean JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1isowned
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_first_r
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/internal/NativeMdbmIterator;)Lcom/yahoo/db/mdbm/MdbmKvPair;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1first_1r
  (JNIEnv *, jclass, jobject, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_next_r
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/internal/NativeMdbmIterator;)Lcom/yahoo/db/mdbm/MdbmKvPair;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1next_1r
  (JNIEnv *, jclass, jobject, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_firstkey_r
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/internal/NativeMdbmIterator;)Lcom/yahoo/db/mdbm/MdbmDatum;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1firstkey_1r
  (JNIEnv *, jclass, jobject, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_nextkey_r
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;Lcom/yahoo/db/mdbm/internal/NativeMdbmIterator;)Lcom/yahoo/db/mdbm/MdbmDatum;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1nextkey_1r
  (JNIEnv *, jclass, jobject, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_get_size
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)J
 */
JNIEXPORT jlong JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1get_1size
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_get_limit_size
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)J
 */
JNIEXPORT jlong JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1get_1limit_1size
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_get_page_size
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)I
 */
JNIEXPORT jint JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1get_1page_1size
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_get_hash
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)I
 */
JNIEXPORT jint JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1get_1hash
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_get_alignment
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)I
 */
JNIEXPORT jint JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1get_1alignment
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_get_version
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;)J
 */
JNIEXPORT jlong JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1get_1version
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_dup_handle
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;I)Lcom/yahoo/db/mdbm/internal/NativeMdbmImplementation;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1dup_1handle
  (JNIEnv *, jclass, jobject, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    mdbm_get_hash_value
 * Signature: (Lcom/yahoo/db/mdbm/MdbmDatum;I)J
 */
JNIEXPORT jlong JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_mdbm_1get_1hash_1value
  (JNIEnv *, jclass, jobject, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    create_pool
 * Signature: (Lcom/yahoo/db/mdbm/MdbmInterface;I)Lcom/yahoo/db/mdbm/MdbmPoolInterface;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_create_1pool
  (JNIEnv *, jclass, jobject, jint);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    destroy_pool
 * Signature: (J)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_destroy_1pool
  (JNIEnv *, jclass, jlong);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    acquire_handle
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmPoolImplementation;)Lcom/yahoo/db/mdbm/MdbmInterface;
 */
JNIEXPORT jobject JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_acquire_1handle
  (JNIEnv *, jclass, jobject);

/*
 * Class:     com_yahoo_db_mdbm_internal_NativeMdbmAccess
 * Method:    release_handle
 * Signature: (Lcom/yahoo/db/mdbm/internal/NativeMdbmPoolImplementation;Lcom/yahoo/db/mdbm/MdbmInterface;)V
 */
JNIEXPORT void JNICALL Java_com_yahoo_db_mdbm_internal_NativeMdbmAccess_release_1handle
  (JNIEnv *, jclass, jobject, jobject);

#ifdef __cplusplus
}
#endif
#endif


text:
package org.elasticsearch.xpack.core.security.action.token;

import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.xpack.core.security.authc.Authentication;
import org.elasticsearch.xpack.core.security.user.User;

public class CreateTokenResponseTests extends ESTestCase {

    public void testSerialization() throws Exception {
        CreateTokenResponse response = new CreateTokenResponse(randomAlphaOfLengthBetween(1, 10), TimeValue.timeValueMinutes(20L),
            randomBoolean() ? null : "FULL", randomAlphaOfLengthBetween(1, 10), randomBoolean() ? null :randomAlphaOfLengthBetween(1, 10),
            new Authentication(new User("joe", new String[]{"custom_superuser"}, new User("bar", "not_superuser")),
                new Authentication.RealmRef("test", "test", "node"), new Authentication.RealmRef("test", "test", "node")));
        try (BytesStreamOutput output = new BytesStreamOutput()) {
            response.writeTo(output);
            try (StreamInput input = output.bytes().streamInput()) {
                CreateTokenResponse serialized = new CreateTokenResponse(input);
                assertEquals(response, serialized);
            }
        }

        response = new CreateTokenResponse(randomAlphaOfLengthBetween(1, 10), TimeValue.timeValueMinutes(20L),
            randomBoolean() ? null : "FULL", null, null,
            new Authentication(new User("joe", new String[]{"custom_superuser"}, new User("bar", "not_superuser")),
                new Authentication.RealmRef("test", "test", "node"), new Authentication.RealmRef("test", "test", "node")));
        try (BytesStreamOutput output = new BytesStreamOutput()) {
            response.writeTo(output);
            try (StreamInput input = output.bytes().streamInput()) {
                CreateTokenResponse serialized = new CreateTokenResponse(input);
                assertEquals(response, serialized);
            }
        }
    }
}


text:
/**
 *
 * $Id: AnimalModelManagerSingleton.java,v 1.3 2006-04-17 19:11:05 pandyas Exp $
 *
 * $Log: not supported by cvs2svn $
 *
 */

package gov.nih.nci.camod.service.impl;

import gov.nih.nci.camod.service.AnimalModelManager;

/**
 * @author dgeorge
 *
 * Singleton class for the AnimalModelManager
 */
public class AnimalModelManagerSingleton
{

    private static AnimalModelManager ourManager = new AnimalModelManagerImpl();

    /**
     * @return the global instance of the AnimalModelManager
     */
    public static synchronized AnimalModelManager instance()
    {
        return ourManager;
    }
}

/*
 * $Log: not supported by cvs2svn $
 * Revision 1.2  2006/01/18 14:24:23  georgeda
 * TT# 376 - Updated to use new Java 1.5 features
 *
 * Revision 1.1  2005/09/08 17:37:10  georgeda
 * Initial revision
 *
 */


text:
package cn.simastudio.charkey.test;

import java.io.IOException;
import java.io.InputStream;

/**
 *
Created by Charkey on 2016/8/8.

 */
public class Loader {

    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        ClassLoader classLoader = new ClassLoader() {
            @Override
            public Class<?> loadClass(String name) throws ClassNotFoundException {
                try {
                    String className = name.substring(name.lastIndexOf(".") + 1) + ".class";
                    InputStream inputStream = getClass().getResourceAsStream(className);
                    if (inputStream == null) {
                        return super.loadClass(name);
                    }
                    byte[] bytes = new byte[inputStream.available()];
                    inputStream.read(bytes);
                    return defineClass(name, bytes, 0, bytes.length);
                } catch (IOException e) {
                    throw new ClassNotFoundException(name);
                }
            }
        };

        System.out.println("Loader loaded by: " + Loader.class.getClassLoader());
        Object loader1 = new Loader();
        System.out.println("new loader1 loaded by " + loader1.getClass().getClassLoader() + "-" + loader1.getClass());
        Object objectLoaded1 = classLoader.loadClass(Loader.class.getName()).newInstance();
        System.out.println("objectLoaded1 loaded by classLoader " + objectLoaded1.getClass().getClassLoader() + "-" + objectLoaded1.getClass());

        System.out.println(objectLoaded1 instanceof cn.simastudio.charkey.test.Loader);

        Object loader2 = new Loader();
        System.out.println("new loader1 loaded by " + loader2.getClass().getClassLoader() + "-" + loader2.getClass());
        System.out.println(loader2 instanceof cn.simastudio.charkey.test.Loader);
    }
}


text:
  {{>header {title: "Languages"}}}

      {{#languages}}

          <input class="nm-lang-name" type="text" value="{{name}}" placeholder="Enter a name for this language">
          {{#isParent}}
          (Parent)
          {{/isParent}}

        <button class="btn nm-cell nm-cell-btn nm-cell-4" on-click="setAsParent(id)" {{#isParent}}disabled{{/isParent}}>Set as parent</button>

        <button class="btn nm-cell nm-cell-btn nm-cell-3" on-click="removeWhere('languages', {id: id})">Remove</button>

      {{/languages}}

        <button class="nm-cell nm-cell-btn btn nm-cell-placeholder" on-click="addLanguage()">
          + Add a language
        </button>

  <button type="button" class="btn btn-default pull-left" on-click="close()">Save and close </button>


text:
using AllAuth.Lib.Db.Sqlite;
using AllAuth.Mobile.TestDevice.AppDatabase.Migrations;
using SQLite.Net;

namespace AllAuth.Mobile.TestDevice.AppDatabase
{
    internal class MigrationsRunner : Migrator
    {
        protected override bool MigrateToVersion(SQLiteConnection dbConn, int version)
        {
            switch (version)
            {
                case 1:
                    Mig0001CreateInitialTables.Up(dbConn);
                    InsertVersion(dbConn, version, "Mig0001CreateInitialTables");
                    return true;
            }

            return false;
        }
    }
}


text:
var ApplicationService = require('ui/service/ApplicationService');
var Control = require('ui/control/Controller');

Ti.App.addEventListener('configComplete', onInitialized);

function onInitialized(e)
{
	Ti.API.info('config complete handler');
	Control.createUI();
}

ApplicationService.initialize();


text:
require 'date'

module Jaspion
  module Kilza
    # Objective-C Language parser
    class Objc
      include Jaspion::Kilza::Language

      RESERVED_PROPERTY_PREFIX = '_'
      RESERVED_CLASS_POSFIX = 'Class'
      RESERVED_WORDS = %w(
        auto break case char const continue,
        class default do double else enum extern float for,
        goto if id implementation inline int interface long,
        new nonatomic property protocol readonly readwrite register,
        restrict retain return short signed sizeof static strong,
        struct switch typedef union unsafe_unretained unsigned void,
        volatile weak while _bool _complex _imaginary sel imp,
        bool nil yes no self super __strong __weak oneway,
        in out inout bycopy byref description
      )
      TYPES = {
        'nilclass'    => 'id',
        'string'      => 'NSString *',
        'fixnum'      => 'NSNumber *',
        'float'       => 'NSNumber *',
        'falseclass'  => 'NSNumber *',
        'trueclass'   => 'NSNumber *',
        'hash'        => 'NSObject *'
      }

      def initialize(json_string)
        super(json_string)

        @equal_keys = %w(id identifier uid)
      end

      def clazz(name)
        Jaspion::Kilza::Objc::Class.new(name)
      end

      def property(name, type, array, key)
        Jaspion::Kilza::Objc::Property.new(name , type, array, key)
      end
    end
  end
end


text:
layout: post
title: "PIC Programlama"
date: 2017-04-11 03:32:44
image: '/assets/img/'
description: 'PIC Programlamaya Giris-I'
tags:
- PIC
- microc
categories:
- PIC Programlama
twitter_text: 'I am learning PIC Programming'
---

Merhaba arkadaslar,
-------------------

PIC programlama ve uygulama örnekleri ile bir baslangıç yapmak istedim.

Çalısmalarımızı 16F877A ve 18F4550 PIC'lerini kullanmayı amaçlıyorum.
Ilk olarak yol "https://www.mikroe.com/mikroc/" MikroC'nin kendi sitesinden demo versiyonunu indirerek baslayacagız. Sıfırdan baslamak isteyen arkadaslar için olabildigince ayrıntıya inecegim bu yüzden sıkıcı gelebilir kusura bakmayın lütfen.

PIC olanı seçiyoruz ve;

Download dedikten sonra programı kuruyoruz.

Kurulum bittikten sonra eger elimizde PICkit varsa çıkan iki yükleme menüsüne de "yes" deyip ilerliyoruz.
PICkit yoksa brenner PIC programlayıcı kartlarından birini almanızı tavsiye ederim. Çogu yerde yapılısını anlatıyor ama bu tip konularda genelde alınmasından yanayım.

Ben PIC K150 adı verilen sekildeki kartı kullanıyorum. Bunun içinde "https://buyhere22.com/components/k150/" linkinde "download" butonuna bastıktan sonra indirdigimiz arsivdeki "PIC Programmer Software" klasörünü içerisindeki "microbrn.exe" uygulamasını çalıstırıyoruz.

"microbrn.exe" uygulaması açıldıgında eger hatasını alıyorsak driver eksik demektir.

Bunun içinde "http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=225&pcid=41" sitesinden "Download File: PL2303_Prolific_DriverInstaller_v1.18.0B.zip" arsivini indirip kuruyoruz ve bilgisayarımızı yeniden baslatıyoruz. su ana kadar win7 win8 win8.1 de sorunsuz çalıstıgını ancak win10 da çok ugrasmama ragmen çalısmadıgını gördüm. Driver'ı yazan adamla iletisime geçtigimde de win10 için güncelleyecegini söylemisti umarım çalısıyodur.

Sizlere tavsiye ettigim "mikroborn.exe" uygulaması denedigim tüm PIC programlama kartlarında ise yaradıgını ve çokta stabil çalısan bi programlama uygulaması oldugunu gördüm.
Tabi gönül isterki PICkit alalım ama maliyet el vermiyor.

PIC programlamanın bir avantajı da ICSP ile programlamaktır.
Tam olarak ne oldugunu tarif edememekle birlikte PIC imizi devreden sökmeden programlama kartımızın arkasında isimleri yazan "PGC, PGD, GND, VDD ve VPP" çıkıslarını PIC imizin (16F877A ve 18F4550) sırasıyla PGC = 39. PGD = 40. GND = 12. ve 31. VDD = 11. ve 32. VPP = 1. bacaklarına baglıyoruz ve programlayıcı uygulamızla programımızı PIC imizin içine atıyoruz.

   Mikroborn uygulaması ile PIC imize programı nasıl atacagımıza gelirsek eger öncelikle program açıldıgında ve "K150 Connected" yazısını gördügümüzde sag tarafta PIC imizi seçiyoruz. Zaten uygulama görselinde bize hangi PIC i kullanırsak kullanalım (10F ve 18F serisi içerisinde) nasıl baglanacagını gösteriyor.

Ilk olarak "Blank" diyoruz ve oradan "Erase Chip" butonuna tıklayıp "OK" diyoruz.
Bu islem ardından PIC imizin içi temizleniyor.
Ardından "Load" butonuna tıklayıp MikroC ile yazıp derlendiginde bize hex çıktısının kayıtlı oldugu yeri bulup seçiyoruz.
Ardından "Fuses" kısmına tıklıyoruz ilk gelen alert ekranında "yes" butonunu seçerek "Fuses" ayarlarını MikroC de ayarladıgımız gibi otomatik olarak algılamasını istiyoruz.
Sonrasında çıkan ekranı kapatıp "Program" butonuna tıklıyoruz.
Eger "Bad ve Good" içeren bi hata mesajı alırsak Fuses (sigorta) ayarlarını yanlıs ayarlamısız demektir.
Buna ayrıntılı bi sekilde deginecegiz ileride.

Ilk kez böyle bi yazı yazdıgım için çok amatörce olabilir zamanla eksik taslar ve anlatımım yerine oturacaktır.Okudugunuz için tesekkür ederim.


text:
package org.syphr.lametrictime.api.cloud.model;

import com.google.gson.annotations.SerializedName;

public enum IconOrder
{
 @SerializedName("popular")
 POPULAR,
 @SerializedName("newest")
 NEWEST,
 @SerializedName("title")
 TITLE
}


text:
export timestamp=$(date +%H%M%s)
echo $timestamp
rosrun openreroc_posturesensor output_accel_angle > log/acc_${timestamp}.txt


text:
* Provides a simple base allowing to discover SNAP and HLS constraints and pragmas
* C code is calculating keys for SHA3 secure hashes
  * no memory access required in this example
  * multithreading for CPU or FPGA modes for comparison

:star: Please check the [actions/hls_sponge/doc](./doc/) directory for detailed information


text:
<!DOCTYPE html>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
        <title></title>
        <link rel="stylesheet" href="css/main.css" />

                <input id="address" type="text" placeholder="Enter address" />


text:
import abc
import logging
from types import SimpleNamespace

from requests.auth import HTTPBasicAuth

LOG = logging.getLogger("errbot.plugin.st2.creds_adapter")

class AbstractCredentialsFactory(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def __init__(self):
        raise NotImplementedError

    @abc.abstractmethod
    def instantiate(self, credential_type=None):
        raise NotImplementedError

class CredentialsFactory(AbstractCredentialsFactory):
    def __init__(self):
        pass

    @staticmethod
    def instantiate(credential_type="user"):
        return {"user": St2UserCredentials, "token": St2UserToken, "apikey": St2ApiKey}.get(
            credential_type, St2UserCredentials
        )

class AbstractCredentials(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def __init__(self, username=None, password=None):
        raise NotImplementedError

    @abc.abstractmethod
    def requests(self):
        raise NotImplementedError

    @abc.abstractmethod
    def st2client(self):
        raise NotImplementedError

class St2UserCredentials(AbstractCredentials):
    def __init__(self, username=None, password=None):
        self.username = username
        self.password = password

    def __repr__(self):
        return "".join([self.username, " : ", "".join(["*" for c in self.password])])

    def requests(self, st2_x_auth=False):
        # TODO: FIX: Find a cleaner way for requests to produce the header.
        headers = (
            HTTPBasicAuth(self.username, self.password)
            .__call__(SimpleNamespace(**{"headers": {}}))
            .headers
        )
        if st2_x_auth:
            headers["X-Authenticate"] = headers["Authorization"]
            del headers["Authorization"]
        return headers

    def st2client(self):
        raise NotImplementedError

class St2UserToken(AbstractCredentials):
    def __init__(self, token=None):
        self.token = None
        if token:
            self.token = token

    def __repr__(self):
        return self.token

    def requests(self):
        return {"X-Auth-Token": self.token}

    def st2client(self):
        return {"token": self.token}

class St2ApiKey(AbstractCredentials):
    def __init__(self, apikey=None):
        self.apikey = None
        if apikey:
            self.apikey = apikey

    def __repr__(self):
        return self.apikey

    def requests(self):
        return {"St2-Api-Key": self.apikey}

    def st2client(self):
        return {"api_key": self.apikey}


text:
title: Installer Linux
category: Linux
---

## Installer Linux

### Pour une installation en dual-boot avec Windows

* Effectuer une défragmentation
* Réduire la partition Windows via le Disk Manager (Super +  r  > `diskmgmt.msc`)
    * Minimum : 60G
    * Pour quelques logiciels / serveur : 100/200G

Si votre partition `D:` est vide et que vous souhaitez installer Linux dessus, faire un clic droit sur cette partition dans le Disk Manager et choisir "Supprimer". Cela retirera le formattage NTFS et laissera l'espace libre pour l'installation Linux.

### Déterminer le BIOS utilisé (Legacy ou UEFI)

* Ouvrir la console en mode admin (Rechercher "cmd" > Ctrl + Maj + Entrée)
* Taper `bcdedit`
  Si le "path" du chargeur de démarrage Windows est "winload.efi" = UEFI, si "winload.exe" = Legacy

  ``` diff
  Windows Boot Loader
  -------------------
  identifier              {current}
  device                  partition=C:
  +path                    \Windows\system32\winload.efi
  description             Windows 7 Home Premium (recovered)
  locale                  en-US
  recoverysequence        {2844aaae-9978-11e0-a381-afc0564c0e08}
  recoveryenabled         Yes
  osdevice                partition=C:
  systemroot              \Windows
  resumeobject            {3aa4c728-9935-11e0-9f12-806e6f6e6963}
  ```

### Créer une clé bootable

* [Télécharger l'ISO](http://www.ubuntu.com/download/desktop)
* Créer une clé USB bootable à partir de l'ISO, en fonction du BIOS
    * UEFI : [Utiliser Win32DiskImager](https://sourceforge.net/projects/win32diskimager/)
    * Legacy : [Utiliser Unetbootin](https://doc.ubuntu-fr.org/unetbootin)

### Booter sur la clé

* Windows 10 : sur un ordinateur allumé
    * Mettre la clé USB sur l'ordinateur
    * Paramètres > Mise à jour et sécurité > Récupération > Démarrage avancé : Redémarrer maintenant
    * Utiliser un périphérique
* Sinon : sur un ordinateur eteint
    * Mettre la clé USB sur l'ordinateur où installer Ubuntu
    * Démarrer
    * Au moment du (re)démarrage : entrer dans le menu du BIOS (F2, F10, F10 ou Echap au moment du démarrage suivant la marque de l'ordinateur) et changer l'ordre de boot pour mettre la clé USB en premier

### Installer

* Démarrer une session live avec la clé bootable
* Vérifier que le matériel est bien détecté (touchpad, souris, son, luminosité, ...)
* Se connecter à Internet via un cable ethernet
* Procéder à l'installation.
  À l'écran "type d'installation", le plus simple est de choisir d'"installer Linux à côté de Windows". Linux s'installera sur l'espace vide restant sur la même partition que Windows (généralement /dev/sdb). Ou vous pouvez choisir le [partitionnement manuel](https://openclassrooms.com/fr/courses/43538-reprenez-le-controle-a-laide-de-linux/37192-partitionner-son-disque). NB Depuis Ubuntu 17.04, la swap n'est plus une partition mais un fichier situé dans /swapfile.
* Redémarrer

Si le démarrage s'effectue toujours sur Windows :

* Entrer dans le menu du BIOS
* Ajouter "/EFI/ubuntu/shimx64.efi" dans les fichiers EFI autorisés
* Sauvegarder et retourner dans le menu du BIOS
* Modifier l'ordre de boot pour mettre le fichier EFI en premier

---

## Post-installation

### Mettre à jour tous les packets

    sudo apt-get update
    sudo apt-get upgrade

---

### Activer le wifi

    ifconfig                            # Lister les interfaces activées
    iwconfig                            # Lister les interfaces disponibles

    sudo ifconfig wlan0 up0             # Activer l'interface wlan0 (wifi)
    sudo /etc/init.d/networking restart # Redémarrer le gestionnaire réseau

    sudo iwlist wlan0 scan              # Lister les réseaux wifi

Troubleshooting :

* wlan0 n'est pas listé par iwconfig

  ``` shell
  sudo lshw -class network # Lister les cartes réseau
  lspci | grep -i net      # Afficher le nom complet, ex: 07:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)
  ```
  Rechercher sur le net s'il existe des drivers, ex "[ubuntu Qualcomm Atheros QCA6174 802.11ac (rev 32)](https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1520343)"

* SIOCSIFFLAGS: Ressource temporairement non-disponible
  [Le driver installé n'est pas bon](http://osdir.com/ml/org.user-groups.linux.quebec.aide/2001-07/msg00296.html)

* SIOCSIFFLAGS: Opération impossible du fait de RF-kill soft blocked

  ``` shell
  sudo rfkill list         # Lister les appareils gérés par RF-kill et leur statut
  sudo rfkill unblock wifi # Débloquer un wifi "Soft blocked"
  ```

---

### Activer la répétition des touches

Pour que garder une touche enfoncée répète la touche :

    xset r rate 200 20

Cette commande modifie les configurations ne manière permanente, il n'est donc pas nécessaire de l'ajouter au démarrage

---

### Désactiver la session invité

Modifier le fichier /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf et ajouter la ligne

    allow-guest=false

Redémarrer

---

### Modifier des entrées Grub (renommer, supprimer)

Rechercher dans /boot/grub/grub.cfg
- L'entrée que vous souhaitez modifier : menuentry 'Windows Boot UEFI loader
- Et le fichier de cette entrée : ### BEGIN /etc/grub.d/25_custom

Pour désactiver toutes les entrées du fichier :

``` shell
sudo chmod -x /etc/grub.d/25_custom
sudo update-grub
```

Ou modifier une entrée en particulier

``` shell
sudo cp /etc/grub.d/25_custom /etc/grub.d/25_custom.bak
sudo chmod -x /etc/grub.d/25_custom.bak
sudo gedit /etc/grub.d/25_custom
sudo update-grub
```

[Plus d'infos](http://ubuntuforums.org/showthread.php?t=1287602)

---

### Modifier l'action de la fermeture du capot

Modifier le fichier `/etc/systemd/logind.conf`

    HandleLidSwitch=lock

Liste des valeurs possibles :

| Valeur    | Description                                     |
|---        |---                                              |
| poweroff  | Eteindre l'ordinateur (comportement par défaut) |
| reboot    | Redémarrer                                      |
| hibernate | Hiberner                                        |
| suspend   | Suspendre                                       |
| lock      | Locker l'écran                                  |
| ignore    | Ne rien faire                                   |

---

### Désactiver la webcam

* Désactiver le module de la webcam temporairement :

  ``` shell
  sudo modprobe -r uvcvideo
  ```

* Pour qu'elle soit désactivée par défaut au démarrage :

  ``` shell
  sudo vim /etc/modprobe.d/blacklist.conf
  ```

  ```
  #Disabling the webcam device.
  blacklist uvcvideo
  ```

  Redémarrer

* Pour la réactiver temporairement :

  ``` shell
  sudo modprobe uvcvideo
  ```

---

### Modifier la luminosité au démarrage

* Afficher la luminosité en cours

  ``` shell
  xrandr --verbose | grep -i 'backlight\|range' -m 2
  ```

  Exemple :

  ```
  BACKLIGHT: 146
      range: (0, 937)
  ```

* Essayer de modifier la luminosité de l'écran

  ``` shell
  output=`xrandr -q | grep " connected" | cut -d ' ' -f 1`
  xrandr --output $output --set BACKLIGHT 150
  ```

* Pour modifier la luminosité de l'écran au moment du démarrage, ajouter les lignes de commandes à la fin du fichier ~/.profile

---

### Modifier le compte utilisateur

* Associer un avatar à son compte
  Placer une image ~/.face de 96×96 pixels dans son home directory

* Créer le répertoire ~/bin
  Nécessite une reconnection pour être pris en compte

      mkdir ~/bin

---

### Désactiver le clic à 3 doigts

1. Identifier l'ID du touchpad

   ```
   xinput list
   ```

   Par exemple `SynPs/2 Synaptics TouchPad` (id `15`):

   ```
   ⎡ Virtual core pointer                      id=2    [master pointer  (3)]
   ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
   ⎜   ↳ ELAN Touchscreen                          id=12   [slave  pointer  (2)]
   ⎜   ↳ SynPS/2 Synaptics TouchPad                id=15   [slave  pointer  (2)]
   ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
       ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
       ↳ Power Button                              id=6    [slave  keyboard (3)]
       ↳ Video Bus                                 id=7    [slave  keyboard (3)]
       ↳ Video Bus                                 id=8    [slave  keyboard (3)]
       ↳ Power Button                              id=9    [slave  keyboard (3)]
       ↳ Sleep Button                              id=10   [slave  keyboard (3)]
       ↳ Integrated Webcam: Integrated W           id=11   [slave  keyboard (3)]
       ↳ Dell WMI hotkeys                          id=13   [slave  keyboard (3)]
       ↳ AT Translated Set 2 keyboard              id=14   [slave  keyboard (3)]
    ```

2. Désactiver le clic du milieu
   Remplacer `15` par votre propre ID

   ```
   xinput set-button-map 15 1 0 3
   ```

[Touch pad usage will randomly copy-paste text from the screen](https://superuser.com/questions/1300966/touch-pad-usage-will-randomly-copy-paste-text-from-the-screen)

---

### Installer les drivers Nvidia

Pour installer le pilote graphique Nvidia (propriétaire) sous Ubuntu 18.04, avec ses dépendances:

```
sudo ubuntu-drivers autoinstall
sudo reboot
```

#### Secure Boot UEFI

Si le Secure Boot UEFI est activé, l'installation demandera de choisir un mot de passe pour le "MOK Management" (MOK: Machine Owner Key).
Lors du redémarrage, un écran va s'afficher pour confirmer la signature du pilote:

- Choisir "Enroll MOK"

  ![](https://i.imgur.com/oAiwERK.png)

- Vérifier les détails en choisissant "View key 0". Puis "Continue" pour signer.

  ![](https://i.imgur.com/BhEgIEo.png)

- Choisir "Yes" pour confirmer

  ![](https://i.imgur.com/dSabMWs.png)

- Entrer le mot de passe choisit lors de l'installation

  ![](https://i.imgur.com/wxJUd4N.png)

- Redémarrer

  ![](https://i.imgur.com/GCeOKis.png)

#### Mises à jour

Le pilote Nvidia sera également mis à jour automatiquement lorsqu'une mise à jour est disponible.

Il n'est pas nécessaire de désinstaller le pilote graphique open source pré-installé, ils peuvent être installés côte à côte, ce qui permet d'utiliser le pilote graphique open source comme alternative de secours en cas de problème.
Pour voir la liste des drivers installés, ouvrir Logiciels & mises à jour > Pilotes additionnels

![](https://i.imgur.com/9tVNc8w.jpg)

---

### Mettre à jour le firmware du BIOS

* Vérifier si votre firmware est pris en charge: [LVFS Device List](https://fwupd.org/lvfs/devicelist).
* Démarrer fwupd

  ```
  sudo service fwupd start
  ```

* Vérifier la version actuelle de votre firmware

  ```
  sudo fwupdmgr get-devices
  ```

* Vérifier les mises à jour

  ```
  sudo fwupdmgr refresh
  sudo fwupdmgr get-updates
  ```

* Mettre à jour

  ```
  sudo fwupdmgr update
  ```

Sinon, télécharger l'exe sur le site du constructeur. Ex: [Drivers Dell](https://www.dell.com/support/home/fr/fr/frbsdt1/product-support/product/inspiron-15-7577-laptop/drivers)

[How to Update Firmware on Ubuntu 18.04](https://itsfoss.com/update-firmware-ubuntu/)


text:
define(function(require) {
  /*
    DEPENDENCIES
   */

  var Locale = require('utils/locale');
  var Accounting = require('utils/accounting');

  /*
    CONSTANTS
   */

  var TAB_ID = require('../tabId');
  var PANEL_ID = require('./accounting/panelId');
  var RESOURCE = "Group";
  var XML_ROOT = "GROUP";

  /*
    CONSTRUCTOR
   */

  function Panel(info) {
    this.title = Locale.tr("Accounting");
    this.icon = "fa-bar-chart-o";

    this.element = info[XML_ROOT];

    return this;
  }

  Panel.PANEL_ID = PANEL_ID;
  Panel.prototype.html = _html;
  Panel.prototype.setup = _setup;

  return Panel;

  /*
    FUNCTION DEFINITIONS
   */

  function _html() {
    return Accounting.html();
  }

  function _setup(context) {
    Accounting.setup(
      context,
      { fixed_group: this.element.ID,
        init_group_by: "user"
      });
  }
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:ldap="http://www.springframework.org/schema/ldap"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/ldap https://www.springframework.org/schema/ldap/spring-ldap.xsd http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">

    <ldap:context-source
            username="username"
            password="password"
            url="ldap://a.localhost:389,ldap://b.localhost:389" />
</beans>


text:
<?php namespace Sofa\Eloquence\Searchable;

use Sofa\Eloquence\Subquery as BaseSubquery;

class Subquery extends BaseSubquery
{

}


text:
use bytes::Bytes;
use log::*;
use serde::de::DeserializeOwned;
use serde_json::from_slice;

use super::super::super::request::BufferedHttpResponse;
use super::super::super::RusotoError;

pub struct ResponsePayload {
    body: Bytes,
}

impl ResponsePayload {
    pub fn new(res: &BufferedHttpResponse) -> Self {
        let mut body = res.body.clone();

        // `serde-json` serializes field-less structs as "null", but AWS returns
        // "{}" for a field-less response, so we must check for this result
        // and convert it if necessary.
        if body.is_empty() || body.as_ref() == b"null" {
            body = Bytes::from_static(b"{}");
        }

        debug!("Response body: {:?}", body);
        debug!("Response status: {}", res.status);

        Self { body }
    }

    pub fn deserialize<T: DeserializeOwned, E>(&self) -> Result<T, RusotoError<E>> {
        Ok(from_slice(&self.body)?)
    }
}