text:
<!DOCTYPE html>

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="generator" content="Hugo 0.57.2" />
<meta property="og:title" content="Thomas Rothe" />
<meta name="twitter:title" content="Thomas Rothe"/>
<meta itemprop="name" content="Thomas Rothe"><meta property="og:description" content="Working as Analyst, often in complex environment with several delivery pipelines in place. My job include setting up pipelines, improve or migrate them. Besides of that, i enjoy speaking for the Scrum User Group (last time in Surabaya) and DevOps Indonesia (last time in Jakarta). Last year, i’ve been speaker of the Agile Indonesia Conference and spoke about Continuous Delivery. A couple of my slides can be found here:  https://www." />
  <meta name="twitter:description" content="Working as Analyst, often in complex environment with several delivery pipelines in place. My job include setting up pipelines, improve or migrate them. Besides of that, i enjoy speaking for the Scrum User Group (last time in Surabaya) and DevOps Indonesia (last time in Jakarta). Last year, i’ve been speaker of the Agile Indonesia Conference and spoke about Continuous Delivery. A couple of my slides can be found here:  https://www." />
  <meta itemprop="description" content="Working as Analyst, often in complex environment with several delivery pipelines in place. My job include setting up pipelines, improve or migrate them. Besides of that, i enjoy speaking for the Scrum User Group (last time in Surabaya) and DevOps Indonesia (last time in Jakarta). Last year, i’ve been speaker of the Agile Indonesia Conference and spoke about Continuous Delivery. A couple of my slides can be found here:  https://www."><meta name="twitter:site" content="@devopsdays">
<meta property="og:type" content="speaker" />
<meta property="og:url" content="/events/2018-jakarta/speakers/thomas-rothe/" /><meta name="twitter:creator" content="@devopsdaysjkt" /><meta name="twitter:label1" value="Event" />
  <meta name="twitter:data1" value="devopsdays Jakarta 2018" /><meta name="twitter:label2" value="Dates" />
    <meta name="twitter:data2" value="April 26 - 27, 2018" /><meta property="og:image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta itemprop="image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta property="fb:app_id" content="1904065206497317" /><meta itemprop="wordCount" content="70">
<title>Thomas Rothe - devopsdays Jakarta 2018
</title>

<link href="/css/site.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700" rel="stylesheet"><link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192"  href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">

      <link href="/events/index.xml" rel="alternate" type="application/rss+xml" title="DevOpsDays" />
      <link href="/events/index.xml" rel="feed" type="application/rss+xml" title="DevOpsDays" />

  DevOpsDays

<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">

</button>

events

blog

sponsor

speaking

organizing

about

  Jakarta
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar2">

</button>

                  program

                  speakers

                  contact

                  conduct

Thomas Rothe

Working as Analyst, often in complex environment with several delivery pipelines in place. My job include setting up pipelines, improve or migrate them. Besides of that, i enjoy speaking for the Scrum User Group (last time in Surabaya) and DevOps Indonesia (last time in Jakarta). Last year, i’ve been speaker of the Agile Indonesia Conference and spoke about Continuous Delivery. A couple of my slides can be found here:

https://www.slideshare.net/gheemads

Thomas Rothe at Jakarta 2018

                Batch Size Matters - Small is beautiful

Platinum Sponsors

Gold Sponsors

Silver Sponsors

Community Sponsors

Media Sponsors

@DEVOPSDAYS

BLOG

10 years of devopsdays

by Kris Buytaert - 10 May, 2019

It’s hard to believe but it is almost 10 years ago since #devopsdays happened for the first time in Gent. Back then there were almost 70 of us talking about topics that were of interest to both Operations and Development, we were exchanging our ideas and experiences `on how we were improving the quality of software delivery.
Our ideas got started on the crossroads of Open Source, Agile and early Cloud Adoption.

Blogs

10 May, 2019

Feed

CFP OPEN
Campinas
Macapá
Shanghai
Recife
Charlotte
Prague
Tokyo
Salt Lake City

Propose a talk at an event near you!

About

    devopsdays is a worldwide community conference series for anyone interested in IT improvement.

    About devopsdays

    Privacy Policy

    Code of Conduct


text:
import { Command } from "./Command";
import { CommandResult } from "./CommandResult";
import { LineResults } from "./LineResults";

/**
 * A command for the end of a new dictionary.
 */
export class DictionaryNewEndCommand extends Command {
    /**
     * Renders the command for a language with the given parameters.
     *
     * @param parameters   The command's name, followed by any parameters.
     * @returns Line(s) of code in the language.
     */
    public render(parameters: string[]): LineResults {
        let ender: string = this.language.properties.dictionaries.initializeEnd;

        return new LineResults([new CommandResult(ender, -1)], true);
    }
}

redpajama_set_name: RedPajamaGithub


text:
.panel-group .panel-heading { padding: 0;}
.panel-group .panel-title > a {
	display: block;
	padding: 0.4em 0.6em;
    outline: none;
    font-weight:bold;
    text-decoration: none;
}

.panel-group .panel-title > a.accordion-toggle::before, .panel-group a[data-toggle="collapse"]::before  {
    content:"\e113";
    float: left;
    font-family: 'Glyphicons Halflings';
	margin-right :1em;
}
.panel-group .panel-title > a.accordion-toggle.collapsed::before, .panel-group a.collapsed[data-toggle="collapse"]::before  {
    content:"\e114";
}

.required:after {
  content:"*";
  color:red;
}


text:
package iso20022

// Choice of format for the repair reason.
type RepairReason13Choice struct {

	// Specifies the reason why the instruction/request has a repair or rejection status.
	Code *RepairReason5Code `xml:"Cd"`

	// Specifies the reason why the instruction/request has a repair or rejection status.
	Proprietary *GenericIdentification47 `xml:"Prtry"`
}

func (r *RepairReason13Choice) SetCode(value string) {
	r.Code = (*RepairReason5Code)(&value)
}

func (r *RepairReason13Choice) AddProprietary() *GenericIdentification47 {
	r.Proprietary = new(GenericIdentification47)
	return r.Proprietary
}


text:
void *varnish_init(monikor_t *mon, monikor_config_dict_t *config) {
  varnish_module_t *mod;

  (void)mon;
  if (!(mod = malloc(sizeof(*mod))))
    return NULL;
  mod->mon = mon;
  if (!(mod->vd = VSM_New())) {
    free(mod);
    return NULL;
  }

  mod->instance = monikor_config_dict_get_scalar(config, "varnish.instance");
  if (mod->instance) {
    if (strlen(mod->instance) >= MONIKOR_VARNISH_MAX_INSTANCE_LENGTH) {
      mod->instance[MONIKOR_VARNISH_MAX_INSTANCE_LENGTH - 1] = 0;
      monikor_log_mod(LOG_WARNING, MOD_NAME, "Instance name too long, stripped to %d chars\n",
        MONIKOR_VARNISH_MAX_INSTANCE_LENGTH);
    }
    VSM_n_Arg(mod->vd, mod->instance);
  }
  return (void *)mod;
}

void varnish_cleanup(monikor_t *mon, void *data) {
  varnish_module_t *mod = (varnish_module_t *)data;

  (void)mon;
  VSM_Close(mod->vd);
  VSM_Delete(mod->vd);
  free(mod);
}

int varnish_poll(monikor_t *mon, void *data) {
  struct timeval now;

  (void)mon;
  gettimeofday(&now, NULL);
  if (!data) {
    monikor_log_mod(LOG_ERR, MOD_NAME, "Invalid context data.\n");
    return -1;
  }
  return varnish_poll_metrics((varnish_module_t *)data, &now);
}


text:
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies          #-}

module HaskellWorks.Data.Bits.Word where

import Data.Word
import HaskellWorks.Data.Bits.BitLength
import HaskellWorks.Data.Bits.BitWise

class WordConcat a where
  type DoubleWords a
  -- | Concatenate two words in little-endian order of the same size into a
  -- word of twice the size.
  leConcat :: a -> a -> DoubleWords a

class WordSplit a where
  type HalfWords a
  -- | Split a word equally into two smaller words in little-endian order.
  leSplit :: a -> (HalfWords a, HalfWords a)

instance WordConcat Word8 where
  type DoubleWords Word8 = Word16
  leConcat a b = (fromIntegral b .<. bitLength a) .|. fromIntegral a

instance WordConcat Word16 where
  type DoubleWords Word16 = Word32
  leConcat a b = (fromIntegral b .<. bitLength a) .|. fromIntegral a

instance WordConcat Word32 where
  type DoubleWords Word32 = Word64
  leConcat a b = (fromIntegral b .<. bitLength a) .|. fromIntegral a

instance WordSplit Word64 where
  type HalfWords Word64 = Word32
  leSplit a = (fromIntegral a, fromIntegral (a .>. 32))

instance WordSplit Word32 where
  type HalfWords Word32 = Word16
  leSplit a = (fromIntegral a, fromIntegral (a .>. 16))

instance WordSplit Word16 where
  type HalfWords Word16 = Word8
  leSplit a = (fromIntegral a, fromIntegral (a .>. 8))


text:
package org.gradle.plugins.javascript.coffeescript.compile.internal.rhino;

import org.gradle.api.Action;
import org.gradle.api.internal.file.RelativeFile;
import org.gradle.plugins.javascript.base.SourceTransformationException;
import org.gradle.plugins.javascript.coffeescript.compile.internal.CoffeeScriptCompileDestinationCalculator;
import org.gradle.plugins.javascript.coffeescript.compile.internal.SerializableCoffeeScriptCompileSpec;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.JavaScriptException;
import org.mozilla.javascript.Scriptable;

import static org.gradle.plugins.javascript.rhino.worker.internal.RhinoWorkerUtils.*;

public class CoffeeScriptCompilerWorker implements CoffeeScriptCompilerProtocol {

    @Override
    public void process(SerializableCoffeeScriptCompileSpec spec) {
        Scriptable coffeeScriptScope = parse(spec.getCoffeeScriptJs(), "UTF-8", new Action<Context>() {
            @Override
            public void execute(Context context) {
                context.setOptimizationLevel(-1);
            }
        });

        String encoding = spec.getOptions().getEncoding();

        CoffeeScriptCompileDestinationCalculator destinationCalculator = new CoffeeScriptCompileDestinationCalculator(spec.getDestinationDir());

        for (RelativeFile target : spec.getSource()) {
            String source = readFile(target.getFile(), encoding);
            String output = compile(coffeeScriptScope, source, target.getRelativePath().getPathString());
            writeFile(output, destinationCalculator.transform(target.getRelativePath()), encoding);
        }
    }

    private String compile(Scriptable rootScope, final String source, final String sourceName) {
        return childScope(rootScope, new DefaultScopeOperation<String>() {
            @Override
            public String action(Scriptable compileScope, Context context) {
                compileScope.put("coffeeScriptSource", compileScope, source);
                try {
                    return (String) context.evaluateString(compileScope, "CoffeeScript.compile(coffeeScriptSource, {});", sourceName, 0, null);
                } catch (JavaScriptException jse) {
                    throw new SourceTransformationException(String.format("Failed to compile coffeescript file: %s", sourceName), jse);
                }
            }
        });
    }
}


text:
param($installPath, $toolsPath, $package)

Import-Module (Join-Path $toolsPath commands.psm1) -ArgumentList $installPath, $toolsPath


text:
package ch.epfl.bbp.uima.validation;

import static java.lang.String.format;

public class TestResult {

    private double precision;
    private double recall;

    // private int sizeExpected;
    // private int sizeActual;

    public TestResult(int sizeExpected, int sizeActual, double precision,
            double recall) {
        // this.sizeExpected = sizeExpected;
        // this.sizeActual = sizeActual;
        this.precision = precision;
        this.recall = recall;
    }

    public double getPrecision() {
        return precision;
    }

    public double getRecall() {
        return recall;
    }

    public double getF1() {
        return 2 * precision * recall / (precision + recall);
    }

    @Override
    public String toString() {
        return format(
                "TestResult:\n\tprecision:\t%.3f\n\trecall:\t%.3f\n\tF1:\t%.3f\n"
                        + "Latex:: %.1f\\%% & %.1f\\%% & %.1f\\%%", precision,
                recall, getF1(), precision * 100, recall * 100, getF1() * 100);
    }
}


text:
package im.actor.model.api.rpc;
/*
 *  Generated by the Actor API Scheme generator.  DO NOT EDIT!
 */

import im.actor.model.droidkit.bser.Bser;
import im.actor.model.droidkit.bser.BserValues;
import im.actor.model.droidkit.bser.BserWriter;

import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;

import java.io.IOException;
import im.actor.model.network.parser.*;

public class RequestCommitFileUpload extends Request<ResponseCommitFileUpload> {

    public static final int HEADER = 0x7a;
    public static RequestCommitFileUpload fromBytes(byte[] data) throws IOException {
        return Bser.parse(new RequestCommitFileUpload(), data);
    }

    private byte[] uploadKey;
    private String fileName;

    public RequestCommitFileUpload(@NotNull byte[] uploadKey, @NotNull String fileName) {
        this.uploadKey = uploadKey;
        this.fileName = fileName;
    }

    public RequestCommitFileUpload() {

    }

    @NotNull
    public byte[] getUploadKey() {
        return this.uploadKey;
    }

    @NotNull
    public String getFileName() {
        return this.fileName;
    }

    @Override
    public void parse(BserValues values) throws IOException {
        this.uploadKey = values.getBytes(1);
        this.fileName = values.getString(2);
    }

    @Override
    public void serialize(BserWriter writer) throws IOException {
        if (this.uploadKey == null) {
            throw new IOException();
        }
        writer.writeBytes(1, this.uploadKey);
        if (this.fileName == null) {
            throw new IOException();
        }
        writer.writeString(2, this.fileName);
    }

    @Override
    public String toString() {
        String res = "rpc CommitFileUpload{";
        res += "}";
        return res;
    }

    @Override
    public int getHeaderKey() {
        return HEADER;
    }
}


text:
function searchBinarily(sortedArray, target) {
  let left = 0;
  let right = sortedArray.length -1;

  while (left <= right) {
    let middle = Math.floor((left + right) / 2);

    if (target === sortedArray[middle]) {
      return middle;
    } else {
      if (target > sortedArray[middle]) {
        left = middle + 1;
      } else {
        right = middle - 1;
      }
    }
  }

  return null;
}


text:
package uk.co.samicemalone.libtv;

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;

/**
 * Filter video files in a directory with the option of accepting directories
 * @author Sam Malone
 */
public class VideoFilter implements FileFilter, DirectoryStream.Filter<Path> {

    private final boolean allowDirectories;

    private final String[] validExtensions = new String[] {
        "mkv", "mp4", "avi", "mpg", "mpeg", "mov"
    };

    public VideoFilter() {
        this.allowDirectories = false;
    }

    public VideoFilter(boolean allowDirectories) {
        this.allowDirectories = allowDirectories;
    }

    @Override
    public boolean accept(File file) {
        try {
            return accept(file.toPath());
        } catch(IOException ex) {
            return false;
        }
    }

    @Override
    public boolean accept(Path entry) throws IOException {
        if(allowDirectories && Files.isDirectory(entry)) {
            return true;
        }
        Path filename = entry.getFileName();
        if(filename != null) {
            for(String ext : validExtensions) {
                if(filename.toString().endsWith(ext)) {
                    return true;
                }
            }
        }
        return false;
    }

}


text:
<?php

namespace Composer\DependencyResolver;

/**
 * Stores decisions on installing, removing or keeping packages
 *
 * @author Nils Adermann <naderman@naderman.de>
 */
class Decisions implements \Iterator, \Countable
{
    const DECISION_LITERAL = 0;
    const DECISION_REASON = 1;

    protected $pool;
    protected $decisionMap;
    protected $decisionQueue = array();

    public function __construct($pool)
    {
        $this->pool = $pool;

        if (version_compare(PHP_VERSION, '5.3.4', '>=')) {
            $this->decisionMap = new \SplFixedArray($this->pool->getMaxId() + 1);
        } else {
            $this->decisionMap = array_fill(0, $this->pool->getMaxId() + 1, 0);
        }
    }

    public function decide($literal, $level, $why)
    {
        $this->addDecision($literal, $level);
        $this->decisionQueue[] = array(
            self::DECISION_LITERAL => $literal,
            self::DECISION_REASON => $why,
        );
    }

    public function satisfy($literal)
    {
        $packageId = abs($literal);

        return (
            $literal > 0 && $this->decisionMap[$packageId] > 0 ||
            $literal < 0 && $this->decisionMap[$packageId] < 0
        );
    }

    public function conflict($literal)
    {
        $packageId = abs($literal);

        return (
            ($this->decisionMap[$packageId] > 0 && $literal < 0) ||
            ($this->decisionMap[$packageId] < 0 && $literal > 0)
        );
    }

    public function decided($literalOrPackageId)
    {
        return $this->decisionMap[abs($literalOrPackageId)] != 0;
    }

    public function undecided($literalOrPackageId)
    {
        return $this->decisionMap[abs($literalOrPackageId)] == 0;
    }

    public function decidedInstall($literalOrPackageId)
    {
        return $this->decisionMap[abs($literalOrPackageId)] > 0;
    }

    public function decisionLevel($literalOrPackageId)
    {
        return abs($this->decisionMap[abs($literalOrPackageId)]);
    }

    public function decisionRule($literalOrPackageId)
    {
        $packageId = abs($literalOrPackageId);

        foreach ($this->decisionQueue as $i => $decision) {
            if ($packageId === abs($decision[self::DECISION_LITERAL])) {
                return $decision[self::DECISION_REASON];
            }
        }

        return null;
    }

    public function atOffset($queueOffset)
    {
        return $this->decisionQueue[$queueOffset];
    }

    public function validOffset($queueOffset)
    {
        return $queueOffset >= 0 && $queueOffset < count($this->decisionQueue);
    }

    public function lastReason()
    {
        return $this->decisionQueue[count($this->decisionQueue) - 1][self::DECISION_REASON];
    }

    public function lastLiteral()
    {
        return $this->decisionQueue[count($this->decisionQueue) - 1][self::DECISION_LITERAL];
    }

    public function reset()
    {
        while ($decision = array_pop($this->decisionQueue)) {
            $this->decisionMap[abs($decision[self::DECISION_LITERAL])] = 0;
        }
    }

    public function resetToOffset($offset)
    {
        while (count($this->decisionQueue) > $offset + 1) {
            $decision = array_pop($this->decisionQueue);
            $this->decisionMap[abs($decision[self::DECISION_LITERAL])] = 0;
        }
    }

    public function revertLast()
    {
        $this->decisionMap[abs($this->lastLiteral())] = 0;
        array_pop($this->decisionQueue);
    }

    public function count()
    {
        return count($this->decisionQueue);
    }

    public function rewind()
    {
        end($this->decisionQueue);
    }

    public function current()
    {
        return current($this->decisionQueue);
    }

    public function key()
    {
        return key($this->decisionQueue);
    }

    public function next()
    {
        return prev($this->decisionQueue);
    }

    public function valid()
    {
        return false !== current($this->decisionQueue);
    }

    public function isEmpty()
    {
        return count($this->decisionQueue) === 0;
    }

    protected function addDecision($literal, $level)
    {
        $packageId = abs($literal);

        $previousDecision = $this->decisionMap[$packageId];
        if ($previousDecision != 0) {
            $literalString = $this->pool->literalToString($literal);
            $package = $this->pool->literalToPackage($literal);
            throw new SolverBugException(
                "Trying to decide $literalString on level $level, even though $package was previously decided as ".(int) $previousDecision."."
            );
        }

        if ($literal > 0) {
            $this->decisionMap[$packageId] = $level;
        } else {
            $this->decisionMap[$packageId] = -$level;
        }
    }
}


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

  <title>Description of matrix</title>
  <meta name="keywords" content="matrix">
  <meta name="description" content="Converts a vector to a matrix in the QTT-Tucker format">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 © 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">

Home >  tt2 > @qtt_tucker > matrix.m

matrix

PURPOSE

Converts a vector to a matrix in the QTT-Tucker format

SYNOPSIS

function [qt]=matrix(qt, sz1, sz2)

DESCRIPTION

Converts a vector to a matrix in the QTT-Tucker format
   [QT]=MATRIX(QT, SZ1, SZ2) Makes factors of QTT-Tucker to be TT-matrices
   SZ1 and SZ2 are cell arrays with N, M dimensions for each factor
   If they are absent, the square matrices are assumed

 TT-Toolbox 2.2, 2009-2012

This is TT Toolbox, written by Ivan Oseledets et al.
Institute of Numerical Mathematics, Moscow, Russia
webpage: http://spring.inm.ras.ru/osel

For all questions, bugs and suggestions please mail
ivan.oseledets@gmail.com
---------------------------

CROSS-REFERENCE INFORMATION

This function calls:

tt_matrix	TT_matrix class constructor

This function is called by:

SOURCE CODE

0001 function [qt]=matrix(qt, sz1, sz2)
0002 %Converts a vector to a matrix in the QTT-Tucker format
0003 %   [QT]=MATRIX(QT, SZ1, SZ2) Makes factors of QTT-Tucker to be TT-matrices
0004 %   SZ1 and SZ2 are cell arrays with N, M dimensions for each factor
0005 %   If they are absent, the square matrices are assumed
0006 %
0007 %
0008 %
0009 % TT-Toolbox 2.2, 2009-2012
0010 %
0011 %This is TT Toolbox, written by Ivan Oseledets et al.
0012 %Institute of Numerical Mathematics, Moscow, Russia
0013 %webpage: http://spring.inm.ras.ru/osel
0014 %
0015 %For all questions, bugs and suggestions please mail
0016 %ivan.oseledets@gmail.com
0017 %---------------------------
0018
0019 if (nargin<3)
0020     sz1 = [];
0021     sz2 = [];
0022 end;
0023
0024 d = qt.dphys;
0025 for i=1:d
0026     if (~isempty(sz1))||(~isempty(sz2))
0027         qt.tuck{i} = tt_matrix(qt.tuck{i}, sz1{i}, sz2{i});
0028     else
0029         cursz = qt.tuck{i}.n;
0030         cursz = sqrt(cursz);
0031         qt.tuck{i} = tt_matrix(qt.tuck{i}, cursz, cursz);
0032     end;
0033 end;
0034
0035 end

<address>Generated on Wed 08-Feb-2012 18:20:24 by m2html © 2005</address>


text:
#ifndef EventListener_h
#define EventListener_h

#include <wtf/RefCounted.h>

namespace JSC {
    class JSObject;
    class MarkStack;
}

namespace WebCore {

    class ScriptExecutionContext;
    class Event;

    class EventListener : public RefCounted<EventListener> {
    public:
        enum Type {
            JSEventListenerType,
            ImageEventListenerType,
            InspectorDOMAgentType,
            InspectorDOMStorageResourceType,
            ObjCEventListenerType,
            CPPEventListenerType,
            ConditionEventListenerType,
            GObjectEventListenerType,
            NativeEventListenerType
        };

        virtual ~EventListener() { }
        virtual bool operator==(const EventListener&) = 0;
        virtual void handleEvent(ScriptExecutionContext*, Event*) = 0;
        virtual bool wasCreatedFromMarkup() const { return false; }

#if USE(JSC)
        virtual void markJSFunction(JSC::MarkStack&) { }
#endif

        bool isAttribute() const { return virtualisAttribute(); }
        Type type() const { return m_type; }

    protected:
        EventListener(Type type)
            : m_type(type)
        {
        }

    private:
        virtual bool virtualisAttribute() const { return false; }

        Type m_type;
    };

}

#endif


text:
namespace ViewControllerSwap
{

	// Should subclass AppKit.NSView
	[Foundation.Register ("SecondView")]
	public partial class SecondView
	{
	}
}


text:
#ifndef TENSORFLOW_COMPILER_MLIR_TOSA_TRANSFORMS_PASSES_H
#define TENSORFLOW_COMPILER_MLIR_TOSA_TRANSFORMS_PASSES_H

#include <memory>
#include <string>
#include <unordered_set>

#include "mlir/Dialect/Func/IR/FuncOps.h"  // from @llvm-project
#include "mlir/Pass/Pass.h"  // from @llvm-project

namespace mlir {
namespace tosa {

void populateLegalizeTFPatterns(MLIRContext* ctx, RewritePatternSet& patterns);
void populateLegalizeTFLPatterns(MLIRContext* ctx, RewritePatternSet& patterns);

std::unique_ptr<OperationPass<func::FuncOp>> createLegalizeTFPass();
std::unique_ptr<OperationPass<func::FuncOp>> createFuseBiasTFPass();

// `disabledPatterns` is a set of labels used to filter out input patterns with
// a debug label or debug name in this set.
// `enabledPatterns` is a set of labels used to filter out input patterns that
//  do not have one of the labels in this set.
std::unique_ptr<OperationPass<func::FuncOp>> createLegalizeTFLPass(
    ArrayRef<std::string> disabled_patterns = llvm::None,
    ArrayRef<std::string> enabled_patterns = llvm::None);

std::unique_ptr<OperationPass<func::FuncOp>> createLegalizeTFTFLPass();
std::unique_ptr<OperationPass<func::FuncOp>> createConvertTFLUint8Pass();
std::unique_ptr<OperationPass<func::FuncOp>> createStripQuantTypesPass();

#define GEN_PASS_REGISTRATION
#include "tensorflow/compiler/mlir/tosa/transforms/passes.h.inc"

}  // namespace tosa
}  // namespace mlir

#endif  // TENSORFLOW_COMPILER_MLIR_TOSA_TRANSFORMS_PASSES_H


text:
mkdir "%APPDATA%\JetBrains\ReSharper\v4.1\vs9.0\Plugins"
copy Machine.Specifications.dll "%APPDATA%\JetBrains\ReSharper\v4.1\vs9.0\Plugins"
copy Machine.Specifications.pdb "%APPDATA%\JetBrains\ReSharper\v4.1\vs9.0\Plugins"
copy Machine.Specifications.ReSharperRunner.4.1.dll "%APPDATA%\JetBrains\ReSharper\v4.1\vs9.0\Plugins"
copy Machine.Specifications.ReSharperRunner.4.1.pdb "%APPDATA%\JetBrains\ReSharper\v4.1\vs9.0\Plugins"


text:
<?php

namespace ANN;

/**
 * @package ANN
 * @access public
 */

interface InterfaceLoadable
{

}


text:
namespace Walltage.Service.Wrappers
{
    public interface ISessionWrapper
    {
        int UserId { get; set; }
        string UserName { get; set; }
        string UserEmail { get; set; }

        void StartSession(int userId, string userName, string userEmail);
        void EndSession();
    }
}


text:
/**
 * @author Jon Carey
 * @author Dan Nuffer
 */

#include "OW_config.h"
#include "OW_CIMScope.hpp"
#include "OW_String.hpp"
#include "OW_BinarySerialization.hpp"

namespace OW_NAMESPACE
{

using std::istream;
using std::ostream;
//////////////////////////////////////////////////////////////////////////////
String
CIMScope::toString() const
{
	return toMOF();
}
//////////////////////////////////////////////////////////////////////////////
String
CIMScope::toMOF() const
{
	switch (m_val)
	{
		case SCHEMA:
		return "schema";
		break;

		case CLASS:
		return "class";
		break;

		case ASSOCIATION:
		return "association";
		break;

		case INDICATION:
		return "indication";
		break;

		case QUALIFIER:
		return "qualifier";
		break;

		case PROPERTY:
		return "property";
		break;

		case REFERENCE:
		return "reference";
		break;

		case METHOD:
		return "method";
		break;

		case PARAMETER:
		return "parameter";
		break;

		case ANY:
		return "any";
		break;

		default:
		return "BAD SCOPE";
		break;
	}

}
//////////////////////////////////////////////////////////////////////////////
void
CIMScope::readObject(istream &istrm)
{
	// Don't do this, it'll double the size CIMBase::readSig( istrm, CIMSCOPESIG );
	UInt32 v;
	BinarySerialization::readLen(istrm, v);
	m_val = Scope(v);
}
//////////////////////////////////////////////////////////////////////////////
void
CIMScope::writeObject(ostream &ostrm) const
{
	// Don't do this, it'll double the size CIMBase::writeSig( ostrm, CIMSCOPESIG );
	BinarySerialization::writeLen(ostrm, m_val);
}

//////////////////////////////////////////////////////////////////////////////
void
CIMScope::setNull()
{
	m_val = BAD;
}

} // end namespace OW_NAMESPACE


text:
package org.apache.camel.impl;

import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

public class CompositeRegistryTest {
    private CompositeRegistry registry;
    @Before
    public void createContext() throws Exception {
        SimpleRegistry sr1 = new SimpleRegistry();
        sr1.put("name", new Integer(12));
        SimpleRegistry sr2 = new SimpleRegistry();
        sr2.put("name", "12");
        registry = new CompositeRegistry();
        registry.addRegistry(sr2);
        registry.addRegistry(sr1);
    }

    @Test
    public void testGetNameAndType() throws Exception {
        Object result = registry.lookupByNameAndType("name", String.class);
        assertNotNull(result);
        assertEquals("Get a wrong result", result, "12");

        result = registry.lookupByNameAndType("test", Integer.class);
        assertNull(result);
    }

}


text:
@interface MOBProjectionEPSG102646 : MOBProjection

@end


text:
package me.kirimin.kumin.ui.activity;

import me.kirimin.kumin.R;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

public class AboutActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        setSupportActionBar((Toolbar) findViewById(R.id.tool_bar));
        ActionBar actionBar = getSupportActionBar();
        actionBar.setTitle(R.string.setting_main_about);
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeButtonEnabled(true);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (android.R.id.home == item.getItemId()) {
            finish();
        }
        return super.onOptionsItemSelected(item);
    }
}


text:
const gtString hostName = L"127.0.0.1";
unsigned short portNumber = 2015;

const gtString msg1FromClient = L"Client says: I'm looking for someone.";
const gtString msg1FromServer = L"Server says: Looking? Found someone, you have, I would say, hmmm?";

const gtString msg2FromClient = L"Client says: They tried and failed?";
const gtString msg2FromServer = L"Server says: They tried and died!";

const gtString msg3FromClient = L"Client says: A hospital? what is it?";
const gtString msg3FromServer = L"Server says: It's a big building with patients, but that's not important right now.";

// ---------------------------------------------------------------------------
// Test the open() method
// ---------------------------------------------------------------------------
TEST(TCPSocketTest, Open)
{
    osTCPSocketClient socketClient;
    bool retVal = socketClient.open();
    EXPECT_EQ(true, retVal);
}

// ---------------------------------------------------------------------------
// A thread that creates a server socket, waits for a client to connect and then
// read a string from the client and write a string to the client.
// This is used in the test case 'ReadAndWriteStrings' below.
// ---------------------------------------------------------------------------
class TCPSocketServerThread : public osThread
{
public:
    TCPSocketServerThread(const gtString& threadName, bool syncTermination = false)
        : osThread(threadName, syncTermination) {}
protected:
    int entryPoint()
    {
        osTCPSocketServerConnectionHandler clientCallHandler;
        osPortAddress serverAddress(hostName, portNumber);
        osTCPSocketServer socketServer;
        bool retVal = socketServer.open();
        retVal = socketServer.bind(serverAddress);
        EXPECT_EQ(true, retVal);

        retVal = socketServer.listen(1);
        EXPECT_EQ(true, retVal);

        retVal = socketServer.accept(clientCallHandler);
        EXPECT_EQ(true, retVal);

        // Exchange 1st pair of messages
        retVal = exchangeMessagesWithClient(clientCallHandler, msg1FromClient, msg1FromServer);

        // Exchange 2nd pair of messages
        if (true == retVal)
        {
            retVal = exchangeMessagesWithClient(clientCallHandler, msg2FromClient, msg2FromServer);
        }

        // Exchange 3rd pair of messages
        if (true == retVal)
        {
            retVal = exchangeMessagesWithClient(clientCallHandler, msg3FromClient, msg3FromServer);
        }

        retVal = socketServer.close();
        EXPECT_EQ(true, retVal);

        return 0;
    }

    bool exchangeMessagesWithClient(osTCPSocketServerConnectionHandler& connectedServerSocket,
                                    const gtString& expectedClientMsg,
                                    const gtString& serverMsg)
    {
        gtString fromClient;
        bool retVal = connectedServerSocket.readString(fromClient);
        EXPECT_EQ(true, retVal);
        EXPECT_TRUE(fromClient == expectedClientMsg);

        if (true == retVal)
        {
            retVal = connectedServerSocket.writeString(serverMsg);
            EXPECT_EQ(true, retVal);
        }

        return retVal;
    }
};

// ---------------------------------------------------------------------------
// Run a thread that creates a server socket. In the main thread create a client
// socket and test its connection to the server socket, writing and reading strings
// across the connection.
// ---------------------------------------------------------------------------
TEST(TCPSocketTest, ReadAndWriteStrings)
{
    osTCPSocketClient socketClient;
    osPortAddress serverAddress(hostName, portNumber);
    bool retVal = socketClient.open();
    EXPECT_EQ(true, retVal);

    gtString threadName(L"TcpServerThread");
    TCPSocketServerThread serverThread(threadName);
    serverThread.execute();

    retVal = socketClient.connect(serverAddress);
    EXPECT_EQ(true, retVal);

    osSleep(150);

    // Msg1
    retVal = socketClient.writeString(msg1FromClient);
    EXPECT_EQ(true, retVal);

    gtString fromServer;
    retVal = socketClient.readString(fromServer);
    EXPECT_TRUE(fromServer == msg1FromServer);

    osSleep(150);

    // Msg2
    retVal = socketClient.writeString(msg2FromClient);
    EXPECT_EQ(true, retVal);

    retVal = socketClient.readString(fromServer);
    EXPECT_TRUE(fromServer == msg2FromServer);

    osSleep(150);

    // Msg1
    retVal = socketClient.writeString(msg3FromClient);
    EXPECT_EQ(true, retVal);

    retVal = socketClient.readString(fromServer);
    EXPECT_TRUE(fromServer == msg3FromServer);

    osSleep(150);

    retVal = socketClient.close();
    EXPECT_EQ(true, retVal);
}


text:
<!DOCTYPE HTML>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <title>ScreenCat</title>
    <meta name="author" content="max ogden">
    <meta name="description" content="cool appz">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="stylesheets/css/tachyons.css" />
    <link rel="stylesheet" href="stylesheets/css/screencat.css" />

        You are now sharing your screen.
        Stop

        You are now viewing a remote screen.

        Stop Viewing
        Show Window

ScreenCat

While sharing the remote person will have full access to your desktop, mouse and keyboard.

            Share Your Screen

            Join Remote Screen

Select the window you want to share:

Share

            <input type="text" class="code-copy-input pam brs ba b--light-gray w-100 mw-fill" autofocus></input>

Copy

Send this code to the person you want to share your screen with. They can use ScreenCat.app or http://maxogden.github.io/screencat/remote in Chrome/Firefox. Please wait here until they connect.

join

            <input type="text" class="code-paste-input pam brs ba b--light-gray w-100 mw-fill" value="Loading..." autofocus></input>

Connect

Enter a code to connect to a remote screen. Found  near you


text:
The Browbeat Ansible checks playbook will
scan a given deployment to check for known
configuration issues.

## Output from Checks
Once the Checks playbook completes there will
be a report generated in the checks directory.

```
bug_report.log
```

This will contain each of the hosts that were
scanned, and their known issues. Some of the
issues will have BZ's associated with them, use
the BZ link to learn more about the bug, and how
it can impact your deployment. There will be
Checks that do not have a BZ associated, these
are simply suggestions.


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://code.google.com/p/firefly/beans"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://code.google.com/p/firefly/beans http://firefly.googlecode.com/files/beans.xsd">

	<component-scan base-package="test"/>
	<mvc view-path="/template" view-encoding="UTF-8"/>

</beans>


text:
package com.hazelcast.simulator.protocol.processors;

import com.hazelcast.simulator.agent.Agent;
import com.hazelcast.simulator.agent.workerprocess.WorkerProcessLauncher;
import com.hazelcast.simulator.agent.workerprocess.WorkerProcessManager;
import com.hazelcast.simulator.agent.workerprocess.WorkerProcessSettings;
import com.hazelcast.simulator.common.WorkerType;
import com.hazelcast.simulator.protocol.core.Response;
import com.hazelcast.simulator.protocol.core.ResponseFuture;
import com.hazelcast.simulator.protocol.core.SimulatorAddress;
import com.hazelcast.simulator.protocol.exception.ProcessException;
import com.hazelcast.simulator.protocol.operation.CreateWorkerOperation;
import com.hazelcast.simulator.protocol.operation.InitSessionOperation;
import com.hazelcast.simulator.protocol.operation.IntegrationTestOperation;
import com.hazelcast.simulator.protocol.operation.LogOperation;
import com.hazelcast.simulator.protocol.operation.OperationType;
import com.hazelcast.simulator.protocol.operation.SimulatorOperation;
import com.hazelcast.simulator.worker.Promise;
import org.apache.log4j.Logger;

import java.util.ArrayList;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;

import static com.hazelcast.simulator.protocol.core.ResponseType.EXCEPTION_DURING_OPERATION_EXECUTION;
import static com.hazelcast.simulator.protocol.core.ResponseType.SUCCESS;
import static com.hazelcast.simulator.protocol.core.ResponseType.UNSUPPORTED_OPERATION_ON_THIS_PROCESSOR;
import static com.hazelcast.simulator.protocol.core.SimulatorAddress.COORDINATOR;
import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.apache.log4j.Level.DEBUG;
import static org.apache.log4j.Level.FATAL;

/**
 * An {@link OperationProcessor} implementation to process {@link SimulatorOperation} instances on a Simulator Agent.
 */
public class AgentOperationProcessor extends AbstractOperationProcessor {

    private static final Logger LOGGER = Logger.getLogger(AgentOperationProcessor.class);

    private final Agent agent;
    private final WorkerProcessManager workerProcessManager;
    private final ScheduledExecutorService executorService;

    public AgentOperationProcessor(Agent agent,
                                   WorkerProcessManager workerProcessManager,
                                   ScheduledExecutorService executorService) {
        this.agent = agent;
        this.workerProcessManager = workerProcessManager;
        this.executorService = executorService;
    }

    @Override
    protected void processOperation(OperationType operationType, SimulatorOperation op,
                                    SimulatorAddress sourceAddress, Promise promise) throws Exception {
        switch (operationType) {
            case INTEGRATION_TEST:
                processIntegrationTest((IntegrationTestOperation) op, sourceAddress, promise);
                return;
            case INIT_SESSION:
                agent.setSessionId(((InitSessionOperation) op).getSessionId());
                promise.answer(SUCCESS);
                return;
            case CREATE_WORKER:
                processCreateWorker((CreateWorkerOperation) op, promise);
                return;
            case START_TIMEOUT_DETECTION:
                processStartTimeoutDetection();
                promise.answer(SUCCESS);
                return;
            case STOP_TIMEOUT_DETECTION:
                processStopTimeoutDetection();
                promise.answer(SUCCESS);
                return;
            default:
                throw new ProcessException(UNSUPPORTED_OPERATION_ON_THIS_PROCESSOR);
        }
    }

    private void processIntegrationTest(
            IntegrationTestOperation op, SimulatorAddress sourceAddress, Promise promise) throws Exception {
        SimulatorOperation nestedOperation;
        Response response;
        ResponseFuture future;
        switch (op.getType()) {
            case NESTED_SYNC:
                nestedOperation = new LogOperation("Sync nested integration test message");
                response = agent.getAgentConnector().invoke(sourceAddress, nestedOperation);
                LOGGER.debug("Got response for sync nested message: " + response);
                promise.answer(response.getFirstErrorResponseType());
                return;
            case NESTED_ASYNC:
                nestedOperation = new LogOperation("Async nested integration test message");
                future = agent.getAgentConnector().submit(sourceAddress, nestedOperation);
                response = future.get();
                LOGGER.debug("Got response for async nested message: " + response);
                promise.answer(response.getFirstErrorResponseType());
                return;
            case DEEP_NESTED_SYNC:
                nestedOperation = new LogOperation("Sync deep nested integration test message");
                response = agent.getAgentConnector().invoke(COORDINATOR, nestedOperation);
                LOGGER.debug("Got response for sync deep nested message: " + response);
                promise.answer(response.getFirstErrorResponseType());
                return;
            case DEEP_NESTED_ASYNC:
                nestedOperation = new LogOperation("Sync deep nested integration test message");
                future = agent.getAgentConnector().submit(COORDINATOR, nestedOperation);
                response = future.get();
                LOGGER.debug("Got response for async deep nested message: " + response);
                promise.answer(response.getFirstErrorResponseType());
                return;
            default:
                throw new ProcessException(UNSUPPORTED_OPERATION_ON_THIS_PROCESSOR);
        }
    }

    private void processCreateWorker(CreateWorkerOperation op, Promise promise) throws Exception {
        ArrayList<Future<Boolean>> futures = new ArrayList<Future<Boolean>>();
        for (WorkerProcessSettings workerProcessSettings : op.getWorkerProcessSettings()) {
            WorkerProcessLauncher launcher = new WorkerProcessLauncher(agent, workerProcessManager, workerProcessSettings);
            LaunchWorkerCallable task = new LaunchWorkerCallable(launcher, workerProcessSettings);
            Future<Boolean> future = executorService.schedule(task, op.getDelayMs(), MILLISECONDS);
            futures.add(future);
        }
        for (Future<Boolean> future : futures) {
            if (!future.get()) {
                LOGGER.error("Failed to start Worker, settings response type EXCEPTION_DURING_OPERATION_EXECUTION...");
                throw new ProcessException(EXCEPTION_DURING_OPERATION_EXECUTION);
            }
        }
        promise.answer(SUCCESS);
    }

    private void processStartTimeoutDetection() {
        agent.getWorkerProcessFailureMonitor().startTimeoutDetection();
    }

    private void processStopTimeoutDetection() {
        agent.getWorkerProcessFailureMonitor().stopTimeoutDetection();
    }

    private final class LaunchWorkerCallable implements Callable<Boolean> {

        private final WorkerProcessLauncher launcher;
        private final WorkerProcessSettings workerProcessSettings;

        private LaunchWorkerCallable(WorkerProcessLauncher launcher, WorkerProcessSettings workerProcessSettings) {
            this.launcher = launcher;
            this.workerProcessSettings = workerProcessSettings;
        }

        @Override
        public Boolean call() {
            try {
                launcher.launch();

                int workerIndex = workerProcessSettings.getWorkerIndex();
                int workerPort = agent.getPort() + workerIndex;
                SimulatorAddress workerAddress = agent.getAgentConnector().addWorker(workerIndex, "127.0.0.1", workerPort);

                WorkerType workerType = workerProcessSettings.getWorkerType();

                LogOperation logOperation = new LogOperation(format("Created %s Worker %s", workerType, workerAddress), DEBUG);
                agent.getAgentConnector().submit(COORDINATOR, logOperation);

                return true;
            } catch (Exception e) {
                LOGGER.error("Failed to start Worker", e);

                LogOperation logOperation = new LogOperation("Failed to start Worker: " + e.getMessage(), FATAL);
                agent.getAgentConnector().submit(COORDINATOR, logOperation);

                return false;
            }
        }
    }
}


text:
import * as React from 'react'

import * as JSONPointer from 'utils/JSONPointer'
import type { JsonRecord } from 'utils/types'

export interface ToolbarProps {
  columnPath: JSONPointer.Path
  onChange: (func: (v: JsonRecord) => JsonRecord) => void
}

interface ToolbarOptions {
  Toolbar: React.FC<ToolbarProps>
}

const Ctx = React.createContext<ToolbarOptions | null>(null)

interface ProviderProps {
  children: React.ReactNode
  value: ToolbarOptions
}

export function Provider({ children, value }: ProviderProps) {
  return <Ctx.Provider value={value}>{children}</Ctx.Provider>
}

export const useToolbar = () => React.useContext(Ctx)
export const use = useToolbar


text:
/**************************************************************************************************
 *** This file was autogenerated from GrHSLToRGBFilterEffect.fp; do not modify.
 **************************************************************************************************/
#include "GrHSLToRGBFilterEffect.h"

#include "include/gpu/GrTexture.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/glsl/GrGLSLProgramBuilder.h"
#include "src/sksl/SkSLCPP.h"
#include "src/sksl/SkSLUtil.h"
class GrGLSLHSLToRGBFilterEffect : public GrGLSLFragmentProcessor {
public:
    GrGLSLHSLToRGBFilterEffect() {}
    void emitCode(EmitArgs& args) override {
        GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
        const GrHSLToRGBFilterEffect& _outer = args.fFp.cast<GrHSLToRGBFilterEffect>();
        (void)_outer;
        fragBuilder->codeAppendf(
                "half3 hsl = %s.xyz;\nhalf C = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\nhalf3 p = "
                "hsl.xxx + half3(0.0, 0.66666666666666663, 0.33333333333333331);\nhalf3 q = "
                "clamp(abs(fract(p) * 6.0 - 3.0) - 1.0, 0.0, 1.0);\nhalf3 rgb = (q - 0.5) * C + "
                "hsl.z;\n%s = clamp(half4(rgb, %s.w), 0.0, 1.0);\n%s.xyz *= %s.w;\n",
                args.fInputColor, args.fOutputColor, args.fInputColor, args.fOutputColor,
                args.fOutputColor);
    }

private:
    void onSetData(const GrGLSLProgramDataManager& pdman,
                   const GrFragmentProcessor& _proc) override {}
};
GrGLSLFragmentProcessor* GrHSLToRGBFilterEffect::onCreateGLSLInstance() const {
    return new GrGLSLHSLToRGBFilterEffect();
}
void GrHSLToRGBFilterEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
                                                   GrProcessorKeyBuilder* b) const {}
bool GrHSLToRGBFilterEffect::onIsEqual(const GrFragmentProcessor& other) const {
    const GrHSLToRGBFilterEffect& that = other.cast<GrHSLToRGBFilterEffect>();
    (void)that;
    return true;
}
GrHSLToRGBFilterEffect::GrHSLToRGBFilterEffect(const GrHSLToRGBFilterEffect& src)
        : INHERITED(kGrHSLToRGBFilterEffect_ClassID, src.optimizationFlags()) {}
std::unique_ptr<GrFragmentProcessor> GrHSLToRGBFilterEffect::clone() const {
    return std::unique_ptr<GrFragmentProcessor>(new GrHSLToRGBFilterEffect(*this));
}


text:
  //对象
  var object = {
    assignIn: function(target){
        'use strict';
        if (target == null) {
        throw new TypeError('Cannot convert undefined or null to object');
        }

        target = Object(target);
        for (var index = 1; index < arguments.length; index++) {
        var source = arguments[index];
        if (source != null) {
            for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
                target[key] = source[key];
            }
            }
        }
        }
        return target;
  },
  isObjectValueEqual: function(a,b){
      var aProps = Object.getOwnPropertyNames(a);
      var bProps = Object.getOwnPropertyNames(b);
      if (aProps.length != bProps.length) {
          return false;
      }
      for (var i = 0; i < aProps.length; i++) {
          var propName = aProps[i];
            if (a[propName] !== b[propName]) {
                return false;
            }
      }
      return true;
  }
}

module.exports = {
  object: object
}


text:
package com.facebook.drawee.drawable;

/**
 * Interface for Drawables that round corners or form a circle.
 */
public interface Rounded {

  void setCircle(boolean isCircle);
  boolean isCircle();

  void setRadius(float radius);
  void setRadii(float[] radii);
  float[] getRadii();

  void setBorder(int color, float width);
  int getBorderColor();
  float getBorderWidth();

  void setPadding(float padding);
  float getPadding();

  void setScaleDownInsideBorders(boolean scaleDownInsideBorders);
  boolean getScaleDownInsideBorders();
}


text:
#ifndef COMPILE_HEADER_H_
#define COMPILE_HEADER_H_

#include "key_values.h"

class CompileHeader {
  protected:
    KeysValues key_values;

  public:
    bool HasName() {
      return key_values.HasKey("name");
    }

    bool HasMethod() {
      return key_values.HasKey("method");
    }

    const char* GetName() {
      const std::vector<Value>& values = key_values.GetValues("name");

      // Suppose we have a single one.
      if (values.size() == 1) {
        const Value& value = values[0];

        if (value.type != String || value.type != Identifier) {
          return nullptr;
        } else {
          return values[0].element.name;
        }
      } else {
        return 0;
      }
    }
};
#endif


text:
package sqldb

import (
	"context"
	"fmt"
	"log"
	"strings"

	infrav1alpha1 "github.com/k8s-sqldb-operator/pkg/apis/infra/v1alpha1"
	"github.com/k8s-sqldb-operator/pkg/utils"
	appsv1 "k8s.io/api/apps/v1"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/types"
	"k8s.io/apimachinery/pkg/util/intstr"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"sigs.k8s.io/controller-runtime/pkg/controller"
	"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
	"sigs.k8s.io/controller-runtime/pkg/handler"
	"sigs.k8s.io/controller-runtime/pkg/manager"
	"sigs.k8s.io/controller-runtime/pkg/reconcile"
	"sigs.k8s.io/controller-runtime/pkg/source"
)

const (
	DefaultUsername = "john"
	DefaultPassword = "abc"
)

// Add creates a new SqlDB Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller
// and Start it when the Manager is Started.
func Add(mgr manager.Manager) error {
	return add(mgr, newReconciler(mgr))
}

// newReconciler returns a new reconcile.Reconciler
func newReconciler(mgr manager.Manager) reconcile.Reconciler {
	return &ReconcileSqlDB{Client: mgr.GetClient(), scheme: mgr.GetScheme()}
}

// add adds a new Controller to mgr with r as the reconcile.Reconciler
func add(mgr manager.Manager, r reconcile.Reconciler) error {
	// Create a new controller
	c, err := controller.New("sqldb-controller", mgr, controller.Options{Reconciler: r})
	if err != nil {
		return err
	}

	// Watch for changes to SqlDB
	err = c.Watch(&source.Kind{Type: &infrav1alpha1.SqlDB{}}, &handler.EnqueueRequestForObject{})
	if err != nil {
		return err
	}

	// Watch a StatefulSet created by SqlDB
	err = c.Watch(&source.Kind{Type: &appsv1.StatefulSet{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &infrav1alpha1.SqlDB{},
	})
	if err != nil {
		return err
	}

	// Watch a Service created by SqlDB
	err = c.Watch(&source.Kind{Type: &corev1.Service{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &infrav1alpha1.SqlDB{},
	})
	if err != nil {
		return err
	}

	return nil
}

var _ reconcile.Reconciler = &ReconcileSqlDB{}

// ReconcileSqlDB reconciles a SqlDB object
type ReconcileSqlDB struct {
	client.Client
	scheme *runtime.Scheme
}

func (r *ReconcileSqlDB) defaultFields(instance *infrav1alpha1.SqlDB) error {
	var defaulted bool

	if instance.Spec.Version == nil {
		defaultVersion := "latest"
		instance.Spec.Version = &defaultVersion
		defaulted = true
	}

	if instance.Spec.Replicas == nil {
		defaultReplicaNumber := int32(1)
		instance.Spec.Replicas = &defaultReplicaNumber
		defaulted = true
	}

	if instance.Spec.Disk.Type == nil {
		defaultDiskType := infrav1alpha1.ZonalPersistentDisk
		instance.Spec.Disk.Type = &defaultDiskType
		defaulted = true
	}

	if instance.Spec.Disk.SizeGB == nil {
		defaultDiskSizeGB := int32(1)
		instance.Spec.Disk.SizeGB = &defaultDiskSizeGB
		defaulted = true
	}

	if defaulted {
		return r.Update(context.TODO(), instance)
	}
	return nil
}

func validateFields(instance *infrav1alpha1.SqlDB) error {
	if instance.Spec.Type != infrav1alpha1.PostgreSQL {
		return fmt.Errorf(".spec.type must be either %q", infrav1alpha1.PostgreSQL)
	}
	return nil
}

func getImageName(dbType string) string {
	// For PostgreSQL database.
	if dbType == string(infrav1alpha1.PostgreSQL) {
		return "postgres"
	}
	// For other databases, return empty string for now.
	return ""
}

// getSVCTemplate returns a Service template.
func getSVCTemplate(instanceName string) *corev1.Service {
	return &corev1.Service{
		TypeMeta: metav1.TypeMeta{
			APIVersion: "v1",
			Kind:       "Service",
		},
		ObjectMeta: metav1.ObjectMeta{
			Name:      "sqldb-" + instanceName + "-svc",
			Namespace: "default",
		},
		Spec: corev1.ServiceSpec{
			Selector: map[string]string{
				"sqldb": instanceName,
			},
			Ports: []corev1.ServicePort{
				{
					Protocol:   "TCP",
					Port:       5432,
					TargetPort: intstr.FromInt(5432),
				},
			},
		},
	}
}

// Reconcile reads that state of the cluster for a SqlDB object and makes changes based on the state read
// and what is in the SqlDB.Spec
// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=infra.example.com,resources=sqldbs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=infra.example.com,resources=sqlbackups,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=core,resources=pods/exec,verbs=create;get
// +kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;delete
func (r *ReconcileSqlDB) Reconcile(request reconcile.Request) (reconcile.Result, error) {
	// Fetch the SqlDB instance.
	instance := &infrav1alpha1.SqlDB{}
	err := r.Get(context.TODO(), request.NamespacedName, instance)
	if err != nil {
		if errors.IsNotFound(err) {
			// Object not found, return.  Created objects are automatically garbage collected.
			// For additional cleanup logic use finalizers.
			return reconcile.Result{}, nil
		}
		// Error reading the object - requeue the request.
		return reconcile.Result{}, err
	}

	if err = r.defaultFields(instance); err != nil {
		return reconcile.Result{}, err
	}
	if err = validateFields(instance); err != nil {
		return reconcile.Result{}, err
	}

	// Create a load-balancer Service if the Service is not yet created.
	svc := getSVCTemplate(instance.Name)
	// Set SqlDB resource to own the service resource.
	if err := controllerutil.SetControllerReference(instance, svc, r.scheme); err != nil {
		return reconcile.Result{}, err
	}
	foundSvc := &corev1.Service{}
	err = r.Get(context.TODO(), types.NamespacedName{Name: svc.Name, Namespace: svc.Namespace}, foundSvc)
	if err != nil && errors.IsNotFound(err) {
		log.Printf("Creating Service %s/%s\n", svc.Namespace, svc.Name)
		err = r.Create(context.TODO(), svc)
		if err != nil {
			return reconcile.Result{}, err
		}
	} else if err != nil {
		return reconcile.Result{}, err
	}

	// Define the desired StatefulSet object.
	sts := &appsv1.StatefulSet{
		ObjectMeta: metav1.ObjectMeta{
			Name:      instance.Name + "-statefulset",
			Namespace: instance.Namespace,
		},
		Spec: appsv1.StatefulSetSpec{
			Replicas: instance.Spec.Replicas,
			Selector: &metav1.LabelSelector{
				MatchLabels: map[string]string{
					"sqldb": instance.Name,
				},
			},
			Template: corev1.PodTemplateSpec{
				ObjectMeta: metav1.ObjectMeta{
					Labels: map[string]string{
						"sqldb": instance.Name,
					},
				},
				Spec: corev1.PodSpec{
					Containers: []corev1.Container{
						{
							Name:  strings.ToLower(fmt.Sprintf("%s-db", instance.Spec.Type)),
							Image: fmt.Sprintf("%s:%s", getImageName(string(instance.Spec.Type)), *instance.Spec.Version),
							// Note: Change username and password credentials accordingly.
							Env: []corev1.EnvVar{
								{
									Name:  "POSTGRES_USER",
									Value: DefaultUsername,
								},
								{
									Name:  "POSTGRES_PASSWORD",
									Value: DefaultPassword,
								},
							},
							VolumeMounts: []corev1.VolumeMount{
								{
									Name:      "nfs-volume",
									MountPath: "/sqldb",
								},
							},
						},
					},
					Volumes: []corev1.Volume{
						{
							Name: "nfs-volume",
							VolumeSource: corev1.VolumeSource{
								NFS: &corev1.NFSVolumeSource{
									Server: "nfs-svc.default.svc.cluster.local",
									Path:   "/",
								},
							},
						},
					},
				},
			},
			ServiceName: "sqldb-" + instance.Name + "-svc",
		},
	}

	// Set SqlDB resource to own the StatefulSet resource.
	if err := controllerutil.SetControllerReference(instance, sts, r.scheme); err != nil {
		return reconcile.Result{}, err
	}

	// Create a StatefulSet if the StatefulSet is not yet created.
	foundSts := &appsv1.StatefulSet{}
	err = r.Get(context.TODO(), types.NamespacedName{Name: sts.Name, Namespace: sts.Namespace}, foundSts)
	if err != nil && errors.IsNotFound(err) {
		log.Printf("Creating StatefulSet %s/%s\n", sts.Namespace, sts.Name)
		err = r.Create(context.TODO(), sts)
		if err != nil {
			return reconcile.Result{}, err
		}
		instance.Status.Phase = infrav1alpha1.ServerDeploymentInProgress
		return reconcile.Result{}, r.Update(context.TODO(), instance)
	} else if err != nil {
		return reconcile.Result{}, err
	}

	// The StatefulSet is not ready yet, so reconcile immediately.
	if foundSts.Status.ReadyReplicas != *foundSts.Spec.Replicas {
		return reconcile.Result{}, nil
	}

	// Update status of SqlDB accordingly when the StatefulSet is ready.
	instance.Status.Phase = infrav1alpha1.ServerReady
	instance.Status.Endpoint = "sqldb-" + instance.Name + "-svc." + instance.Namespace
	if err = r.Update(context.TODO(), instance); err != nil {
		return reconcile.Result{}, err
	}

	// After starting the PostgreSQL server, handle from-restore deployment
	// if it is not yet performed (.status.phase field != ServerRestored)
	// and .spec.backupName field is specified.
	if instance.Status.Phase != infrav1alpha1.ServerRestored && instance.Spec.BackupName != nil {
		sqlBackup := &infrav1alpha1.SqlBackup{}
		sqlBackupName := *instance.Spec.BackupName
		err = r.Get(context.TODO(), types.NamespacedName{Name: sqlBackupName, Namespace: instance.Namespace}, sqlBackup)
		if err != nil && errors.IsNotFound(err) {
			return reconcile.Result{},
				fmt.Errorf("SqlBackup resource named %q does not exist although it is specified by .spec.backupName field", sqlBackupName)
		}
		backupFileName := *sqlBackup.Spec.FileName
		if backupFileName == "" {
			backupFileName = "db.dump"
		}
		var cmd string
		if instance.Spec.Type == infrav1alpha1.PostgreSQL {
			// Note: Username will be used as database name.
			cmd = fmt.Sprintf("pg_restore -U %s -d %s sqldb/%s", DefaultUsername, DefaultUsername, backupFileName)
			if err = utils.PerformOperation("postgresql-db", instance.Name, cmd); err != nil {
				return reconcile.Result{}, err
			}
		}
		// Update status of SqlDB accordingly.
		instance.Status.Phase = infrav1alpha1.ServerRestored
		if err = r.Update(context.TODO(), instance); err != nil {
			return reconcile.Result{}, err
		}
	}

	return reconcile.Result{}, nil
}


text:
#include "Main.h"
#include "GuildMember.h"
#include "Character.h"
#include "Client.h"

GuildMember::GuildMember(Character* character, Shared::GuildRanks rank,
						 const String& note)
	: _rank(rank), _note(note)
{
	setOnline(character);
}

GuildMember::GuildMember(const String& characterName, u16 characterLevel,
						 Shared::GuildRanks rank, const String& note)
	:  _onlineCharacter(nullptr), _rank(rank), _note(note)
{
	_offlineCharacter.name = characterName;
	_offlineCharacter.level = characterLevel;
}

GuildMember::~GuildMember() {
	_queriesQueue.flush();
}

void GuildMember::promote() {
	setRank(static_cast<Shared::GuildRanks>(static_cast<u8>(_rank) + 1u));
}

void GuildMember::degrade() {
	setRank(static_cast<Shared::GuildRanks>(static_cast<u8>(_rank) - 1u));
}

cchar* GuildMember::getName() const {
	return isOnline() ? _onlineCharacter->getName() : _offlineCharacter.name.c_str();
}

u16 GuildMember::getLevel() const {
	return isOnline() ? _onlineCharacter->getLevel() : _offlineCharacter.level;
}

void GuildMember::setOnline(Character* onlineCharacter)
{
	// Will character be offline?
	if (onlineCharacter == nullptr) {
		_queriesQueue.flush();
		_offlineCharacter.name = _onlineCharacter->getName();
		_offlineCharacter.level = _onlineCharacter->getLevel();
		sendGuildMemberBecomeOfflinePacket();
		_onlineCharacter = nullptr;
	} else {
		_offlineCharacter.name = "";
		_offlineCharacter.level = 0u;
		_onlineCharacter = onlineCharacter;
		sendGuildMemberBecomeOnlinePacket();
	}
}

void GuildMember::setRank(Shared::GuildRanks rank)
{
	_rank = rank;
	_queriesQueue.addQueryData(QueryData(QueryData::ID::GUILD_SET_MEMBER_RANK, this));
}

void GuildMember::setNote(const String& note)
{
	_note = note;
	_queriesQueue.addQueryData(QueryData(QueryData::ID::GUILD_SET_MEMBER_NOTE, this));
}

void GuildMember::sendGuildMemberBecomeOnlinePacket()
{
	BITSTREAM(bitStream, Shared::PacketID::GUILD_MEMBER_BECOME_ONLINE);
	bitStream.write(getName());
	_onlineCharacter->getGuild()->sendPacketToAllOnlineMembersInGuildExcept(
		&bitStream, _onlineCharacter->getClient()->getGUID());
}

void GuildMember::sendGuildMemberBecomeOfflinePacket()
{
	BITSTREAM(bitStream, Shared::PacketID::GUILD_MEMBER_BECOME_OFFLINE);
	bitStream.write(getName());
	_onlineCharacter->getGuild()->sendPacketToAllOnlineMembersInGuildExcept(
		&bitStream, _onlineCharacter->getClient()->getGUID());
}


text:
package org.eulerframework.web.module.authentication.entity;

import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.springframework.util.CollectionUtils;

import org.eulerframework.web.core.base.entity.UUIDEntity;

@Entity
@Table(name = "sys_user")
public class User extends UUIDEntity<User> implements EulerUserEntity {

    @Column(name = "username", nullable = false, unique = true)
    private String username;
    @Column(name = "email", unique = true)
    private String email;
    @Column(name = "mobile", unique = true)
    private String mobile;
    @Column(name = "password", nullable = false)
    private String password;
    @Column(name = "enabled", nullable = false)
    private Boolean enabled;
    @Column(name = "account_non_expired", nullable = false)
    private Boolean accountNonExpired;
    @Column(name = "account_non_locked", nullable = false)
    private Boolean accountNonLocked;
    @Column(name = "credentials_non_expired", nullable = false)
    private Boolean credentialsNonExpired;
    @Column(name = "root")
    private Boolean root;
    @Column(name = "regist_time")
    private Date registTime;

    @Transient
    private Set<Authority> authorities;

    @ManyToMany(fetch = FetchType.EAGER)
    @Fetch(FetchMode.SELECT)
    @JoinTable(name = "sys_user_group", joinColumns = {
            @JoinColumn(name = "user_id")
    }, inverseJoinColumns = {
            @JoinColumn(name = "group_id")
    })
    private Set<Group> groups;

    @Override
    public Boolean isRoot() {
        return this.root;
    }

    @Override
    public Collection<Authority> getAuthorities() {
        Collection<Authority> result =  new HashSet<>();

        if(!CollectionUtils.isEmpty(this.groups)) {
            result.addAll(this.groups
                    .stream()
                    .flatMap(group -> group.getAuthorities().stream())
                    .collect(Collectors.toSet()));
        }

        if(!CollectionUtils.isEmpty(this.authorities)) {
            result.addAll(this.authorities);
        }

        return result;
    }

    @Override
    public String getPassword() {
        return this.password;
    }

    @Override
    public String getUsername() {
        return this.username;
    }

    @Override
    public Boolean isAccountNonExpired() {
        return this.accountNonExpired;
    }

    @Override
    public Boolean isAccountNonLocked() {
        return this.accountNonLocked;
    }

    @Override
    public Boolean isCredentialsNonExpired() {
        return this.credentialsNonExpired;
    }

    @Override
    public Boolean isEnabled() {
        return this.enabled;
    }

    @Override
    public void eraseCredentials() {
        this.password = "";
    }

    @Override
    public String getUserId() {
        return this.getId();
    }

    @Override
    public String getEmail() {
        return email;
    }

    @Override
    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public String getMobile() {
        return mobile;
    }

    @Override
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Override
    public void setUsername(String username) {
        this.username = username;
    }

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

    @Override
    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    @Override
    public void setAccountNonExpired(Boolean accountNonExpired) {
        this.accountNonExpired = accountNonExpired;
    }

    @Override
    public void setAccountNonLocked(Boolean accountNonLocked) {
        this.accountNonLocked = accountNonLocked;
    }

    @Override
    public void setCredentialsNonExpired(Boolean credentialsNonExpired) {
        this.credentialsNonExpired = credentialsNonExpired;
    }

    @Override
    public void setRegistTime(Date registTime) {
        this.registTime = registTime;
    }

    @Override
    public Date getRegistTime() {
        return this.registTime;
    }

    public Set<Group> getGroups() {
        return groups;
    }

    public void setGroups(Set<Group> groups) {
        this.groups = groups;
    }
}


text:
module MarkdownUI
  class HorizontalSegment
    def initialize(element, content)
      @element = element
      @content = content
    end

    def render
      element = @element.strip
      content = @content.strip
      klass   = "ui #{element} horizontal segment"

      MarkdownUI::SectionTag.new(content, klass).render
    end
  end
end


text:
package com.slickqa.slickqaweb.web;

import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.slickqa.slickqaweb.MongoFactory;
import com.slickqa.slickqaweb.web.startupComponentType.OnStartup;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.json.JsonObject;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import io.vertx.ext.auth.mongo.MongoAuth;
import io.vertx.ext.mongo.MongoClient;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.handler.BodyHandler;
import io.vertx.ext.web.handler.StaticHandler;

import java.util.Set;

/**
 * Starts Slick Web Interface
 */
public class SlickWebVerticle extends AbstractVerticle {

    @Inject
    private Set<OnStartup> startupSet;

    @Inject
    private Router router;

    @Inject
    Configuration config;

    @Override
    public void start() throws Exception {
        Logger logger = LoggerFactory.getLogger(SlickWebVerticle.class);

        // configure mongo client
        MongoClient mongo = MongoFactory.buildMongo(vertx);

        // create authentication handler
        MongoAuth mongoAuth = MongoFactory.buildMongoAuth(vertx, mongo);

        // startup
        logger.debug("Configuring Guice Injector");
        Injector injector = Guice.createInjector(new SlickGuiceModule(vertx, mongo, mongoAuth));
        injector.injectMembers(this);

        // add body handler to the necessary routes
        BodyHandler bodyHandler = BodyHandler.create();
        router.route(HttpMethod.POST, config.getUrlBasePath() + "api/*").handler(bodyHandler);
        router.route(HttpMethod.PUT, config.getUrlBasePath() + "api/*").handler(bodyHandler);

        // perform startup
        for(OnStartup startupComponent: startupSet) {
            startupComponent.onStartup();
        }

        // handle static resources
        router.route(config.getUrlBasePath() + "*").handler(StaticHandler.create());

        // finally start http server
        vertx.createHttpServer()
                .requestHandler(router::accept)
                .listen(config.getPort());

        logger.info("Slick listening on port " + config.getPort());
    }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
      "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="MS2ScanCharge">

	<typeAlias alias="ScanChargeOut" type="org.yeastrc.ms.domain.run.ms2file.impl.ScanCharge"/>
	<typeAlias alias="ScanChargeIn" type="org.yeastrc.ms.dao.run.ms2file.ibatis.MS2ScanChargeWrap"/>

	<resultMap class="ScanChargeOut" id="scanChargeResult">
		<result property="charge" column="charge" nullValue="0"/>
		<result property="mass" column="mass" />
		<result property="chargeDependentAnalysisList" column="id" select="MS2ChgDAnalysis.selectAnalysisForCharge" />
	</resultMap>

	<parameterMap class="ScanChargeIn" id="scanChargeParam">
		<parameter property="scanId" jdbcType="INTEGER" nullValue="0"/>
		<parameter property="charge" jdbcType="INTEGER" nullValue="0"/>
		<parameter property="mass" jdbcType="DECIMAL" />
	</parameterMap>

	<select id="selectIdsForScan" resultClass="Integer">
        SELECT id FROM MS2FileScanCharge WHERE scanID=#scanId#
    </select>

    <select id="selectForScan" resultMap="scanChargeResult">
        SELECT * FROM MS2FileScanCharge WHERE scanID=#scanId#
    </select>

    <select id="selectForScanAndCharge" resultMap="scanChargeResult" parameterClass="java.util.Map">
    	SELECT * FROM MS2FileScanCharge WHERE scanID = #id# AND charge = #charge#
    </select>

    <insert id="insert" parameterMap="scanChargeParam">
    	INSERT INTO MS2FileScanCharge (scanID, charge, mass) VALUES (?,?,?)
    	<selectKey resultClass="int">
      		select last_insert_id() as id
    	</selectKey>
    </insert>

    <delete id="deleteByScanId" parameterClass="Integer">
    	DELETE FROM MS2FileScanCharge WHERE scanID=#id#
    </delete>

</sqlMap>


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>libshapedraw</groupId>
        <artifactId>LibShapeDraw-all</artifactId>
        <version>0</version>
        <relativePath>../all/pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>LibShapeDraw-demos</artifactId>
    <packaging>jar</packaging>

    <build>
        <finalName>${libshapedraw.name}-${libshapedraw.version}-demos</finalName>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <dependencies>
        <dependency>
            <groupId>libshapedraw</groupId>
            <artifactId>LibShapeDraw</artifactId>
            <version>0</version>
        </dependency>
    </dependencies>

</project>


text:
namespace chrono {
namespace geometry {

/// A conical geometric object for collisions and visualization.
class ChApi ChCone : public ChGeometry {
  public:
    ChVector<> center;  ///< base center
    ChVector<> rad;     ///< cone radius

  public:
    ChCone() : center(VNULL), rad(0) {}
    ChCone(const ChVector<>& mc, const ChVector<>& mrad) : center(mc), rad(mrad) {}
    ChCone(const ChCone& source);
    ~ChCone() {}

    /// "Virtual" copy constructor (covariant return type).
    virtual ChCone* Clone() const override { return new ChCone(*this); }

    virtual GeometryType GetClassType() const override { return CONE; }

    /// Compute bounding box along the directions defined by the given rotation matrix.
    /// Note: 'rot' is currently ignored.
    virtual void GetBoundingBox(ChVector<>& cmin, ChVector<>& cmax, const ChMatrix33<>& rot) const override;

    virtual ChVector<> Baricenter() const override { return center; }

    /// This is a solid
    virtual int GetManifoldDimension() const override { return 3; }

    /// Method to allow serialization of transient data to archives.
    virtual void ArchiveOUT(ChArchiveOut& marchive) override;

    /// Method to allow de-serialization of transient data from archives.
    virtual void ArchiveIN(ChArchiveIn& marchive) override;
};

}  // end namespace geometry

CH_CLASS_VERSION(geometry::ChCone, 0)

}  // end namespace chrono

#endif


text:
import Model from '../../core/model/Model';

export default class HeaderModel extends Model {

  constructor(...args) {
    super(args);
  }

}


text:
package com.locauto.controller;

import java.io.IOException;
import java.text.ParseException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.locauto.dao.UsuarioDao;
import com.locauto.model.Usuario;

/**
 * Servlet implementation class UserController
 */
@WebServlet("/UserController")
public class UserController extends HttpServlet {
	private static final long serialVersionUID = 1L;

    public UserController() {
        super();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		processaRequisicao(request, response);
		}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		processaRequisicao(request, response);
		}

	private void processaRequisicao(HttpServletRequest request,
			HttpServletResponse response) {

		HttpSession sessao = request.getSession();

		String acao = request.getParameter("acao");

		Usuario usuario ;

		if (acao.equals("incluir_funcionario")) {
			try {
				//-- padrão cadastra funcionário
				usuario = new Usuario(request);
				sessao.setAttribute("error", create_user(usuario));

				try {
					getServletContext().getRequestDispatcher("/novo_funcionario.jsp").forward(request, response);
				} catch (ServletException e) {
					e.printStackTrace();
				} catch (IOException e) {
					e.printStackTrace();
				}

			} catch (ParseException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}

		}else{
			sessao.setAttribute("mensagem", "Nenhuma ação foi selecionada");
		}

	}

	private String create_user(Usuario usuario){
		 	UsuarioDao usuarioDao;
			usuarioDao = new UsuarioDao();
			usuarioDao.conectar();
			return  usuarioDao.novo_usuario(usuario,usuario.getTipo_usuario());
	}

}


text:
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*
Package math provides optimized mathematical functions for processing Arrow arrays.
*/
package math

//go:generate go run ../_tools/tmpl/main.go -i -data=float64.tmpldata type.go.tmpl=float64.go type_amd64.go.tmpl=float64_amd64.go type_test.go.tmpl=float64_test.go
//go:generate go run ../_tools/tmpl/main.go -i -data=float64.tmpldata -d arch=avx2 type_simd_amd64.go.tmpl=float64_avx2_amd64.go
//go:generate go run ../_tools/tmpl/main.go -i -data=float64.tmpldata -d arch=sse4 type_simd_amd64.go.tmpl=float64_sse4_amd64.go
//go:generate go run ../_tools/tmpl/main.go -i -data=int64.tmpldata type.go.tmpl=int64.go type_amd64.go.tmpl=int64_amd64.go type_test.go.tmpl=int64_test.go
//go:generate go run ../_tools/tmpl/main.go -i -data=int64.tmpldata -d arch=avx2 type_simd_amd64.go.tmpl=int64_avx2_amd64.go
//go:generate go run ../_tools/tmpl/main.go -i -data=int64.tmpldata -d arch=sse4 type_simd_amd64.go.tmpl=int64_sse4_amd64.go
//go:generate go run ../_tools/tmpl/main.go -i -data=uint64.tmpldata type.go.tmpl=uint64.go type_amd64.go.tmpl=uint64_amd64.go type_test.go.tmpl=uint64_test.go
//go:generate go run ../_tools/tmpl/main.go -i -data=uint64.tmpldata -d arch=avx2 type_simd_amd64.go.tmpl=uint64_avx2_amd64.go
//go:generate go run ../_tools/tmpl/main.go -i -data=uint64.tmpldata -d arch=sse4 type_simd_amd64.go.tmpl=uint64_sse4_amd64.go


text:
<?php

namespace WindowsAzure\MediaServices\Authentication;

/**
 * Represents an Azure AD client username & password
 *
 * @category  Microsoft
 *
 * @author    Azure PHP SDK <azurephpsdk@microsoft.com>
 * @copyright Microsoft Corporation
 * @license   http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 *
 * @version   Release: 0.5.0_2016-11
 *
 * @link      https://github.com/WindowsAzure/azure-sdk-for-php
 */
class AzureAdClientUserCredentials
{
    /**
     * Username
     *
     * @var string
     */
    private $_username;

    /**
     * Password
     *
     * @var string
     */
    private $_password;

    /**
     * Create an AzureAdClientUserCredentials
     *
     * @param string $username The username
     * @param string $password The password
     */
    public function __construct($username, $password)
    {
        $this->_username = $username;
        $this->_password = $password;
    }

    /**
     * Get the username
     *
     * @return string
     */
    public function getUsername()
    {
        return $this->_username;
    }

    /**
     * Get the password
     *
     * @return string
     */
    public function getPassword()
    {
        return $this->_password;
    }
}


text:
var GameBuilder = (function() {
	function GameBuilder(editorCanvas) {
		this.gameManager = new engine.GameManager(editorCanvas.getContext('2d'));
		this.gameManager.paused = true;

		// start rendering
		this.gameManager.startInterval(1);

		this.game = null;
	}
	GameBuilder.prototype = {
		createGame: function() {
			this.game = engine.Game.create('default');

			// provide it with a default scene
			var defaultScene = engine.Scene.create('default');

			// provide it with a default SceneObject
			var sceneObject = engine.SceneObject.create('default');
			defaultScene.addSceneObject(sceneObject);

			// add the scene to the game, and start the game
			this.game.addScene(defaultScene);
			this.game.startSceneName = 'default';
			this.game.init();

			this.gameManager.setGame(this.game);
		},
		createScene: function() {

		},
		createSceneObject: function(behaviorScript) { //hack for demo purposes only

			// TODO: we should pass in a model here instead of setting properties directly
			// the game editor should ONLY interact with the model, and NOT state properties
			// any game editing behaviors should ONLY interact with the model as well
			// the update() function should NOT be called when in edit mode
			// the model could probably have an event subscribed to by the host that
			// triggers a host update on model updates

			var sceneObject = engine.SceneObject.create('' + Math.random() * 6000);
			sceneObject.model.position.x = Math.random() * 640;
			sceneObject.model.position.y = Math.random() * 480;
			sceneObject.model.behavior = behaviorScript;
			sceneObject.resetFromModel();
			this.game.getCurrentScene().addSceneObject(sceneObject);
		},
		saveGame: function() {
			//console.log(this.game.save());
			console.log(this.game.getModel());
		},
		play: function() {
			console.log("Playing...");
			this.gameManager.paused = false;
		},
		stop: function() {
			console.log("Pausing...");
			this.gameManager.paused = true;
			this.game.resetFromModel();
		}
	};

	return GameBuilder;
}());


text:
namespace chromeos {
namespace bluetooth_config {
namespace {
DevicePairingHandlerImpl::Factory* g_test_factory = nullptr;
}  // namespace

// static
std::unique_ptr<DevicePairingHandler> DevicePairingHandlerImpl::Factory::Create(
    mojo::PendingReceiver<mojom::DevicePairingHandler> pending_receiver,
    AdapterStateController* adapter_state_controller,
    scoped_refptr<device::BluetoothAdapter> bluetooth_adapter,
    base::OnceClosure finished_pairing_callback) {
  if (g_test_factory) {
    return g_test_factory->CreateInstance(
        std::move(pending_receiver), adapter_state_controller,
        bluetooth_adapter, std::move(finished_pairing_callback));
  }

  return base::WrapUnique(new DevicePairingHandlerImpl(
      std::move(pending_receiver), adapter_state_controller, bluetooth_adapter,
      std::move(finished_pairing_callback)));
}

// static
void DevicePairingHandlerImpl::Factory::SetFactoryForTesting(
    Factory* test_factory) {
  g_test_factory = test_factory;
}

DevicePairingHandlerImpl::Factory::~Factory() = default;

DevicePairingHandlerImpl::DevicePairingHandlerImpl(
    mojo::PendingReceiver<mojom::DevicePairingHandler> pending_receiver,
    AdapterStateController* adapter_state_controller,
    scoped_refptr<device::BluetoothAdapter> bluetooth_adapter,
    base::OnceClosure finished_pairing_callback)
    : DevicePairingHandler(std::move(pending_receiver),
                           adapter_state_controller,
                           std::move(finished_pairing_callback)),
      bluetooth_adapter_(std::move(bluetooth_adapter)) {}

DevicePairingHandlerImpl::~DevicePairingHandlerImpl() {
  // If we have a pairing attempt and this class is destroyed, cancel the
  // pairing.
  if (!current_pairing_device_id().empty())
    CancelPairing();

  NotifyFinished();
}

device::BluetoothDevice* DevicePairingHandlerImpl::FindDevice(
    const std::string& device_id) const {
  for (auto* device : bluetooth_adapter_->GetDevices()) {
    if (device->GetIdentifier() != device_id)
      continue;
    return device;
  }
  return nullptr;
}

}  // namespace bluetooth_config
}  // namespace chromeos


text:
package mil.army.usace.ehlschlaeger.rgik.test;

import static org.junit.Assert.assertEquals;

import java.io.IOException;
import java.util.Vector;

import mil.army.usace.ehlschlaeger.rgik.core.CSVTable;
import mil.army.usace.ehlschlaeger.rgik.core.GISClass;
import mil.army.usace.ehlschlaeger.rgik.core.Reclass;

import org.junit.Test;

public class ReclassTest {

    @Test
    public void testRun() throws IOException {
        GISClass map = new GISClass(100, 100, 10, 10, 2, 2);
        map.setCellValue(0, 0, 1);
        map.setCellValue(0, 1, 2);
        map.setCellValue(1, 0, 3);
        map.setCellValue(1, 1, 4);

        String[][] testData = {
                { "col1", "1", "2", "3", "4" },
                { "col2", "5", "6", "7", "8" }
            };

        CSVTable table = new CSVTable();
        for (String[] col : testData) {
            Vector<String> vcol = new Vector<String>();
            for (int r = 1; r < col.length; r++)
                vcol.add(col[r]);
            table.addColumn(col[0], vcol);
        }

        String keyColumn = "col1";
        String newColumn = "col2";

        GISClass newmap = Reclass.reclass(map, table, keyColumn, newColumn);

        assertEquals("0,0", 5, newmap.getCellValue(0, 0));
        assertEquals("0,1", 6, newmap.getCellValue(0, 1));
        assertEquals("1,0", 7, newmap.getCellValue(1, 0));
        assertEquals("1,1", 8, newmap.getCellValue(1, 1));
    }
}


text:
angular.module('techNodeApp').controller('RoomsCtrl', ['$scope', '$location', 'server', function($scope, $location, server) {
  $scope.searchRoom = function() {
    if ($scope.searchKey) {
      $scope.filteredRooms = $scope.rooms.filter(function(room) {
        return room.name.indexOf($scope.searchKey) > -1
      })
    } else {
      $scope.filteredRooms = $scope.rooms
    }

  }
  $scope.createRoom = function() {
    server.createRoom({
      name: $scope.searchKey
    })
  }
  $scope.enterRoom = function(room) {
    $location.path('/rooms/' + room._id)
  }

  $scope.filteredRooms = $scope.rooms = server.getRooms()

  $scope.$watchCollection('rooms', function() {
    $scope.searchRoom()
  });
}])


text:
[![GoDoc](https://godoc.org/github.com/travis-ci/jupiter-brain?status.svg)](https://godoc.org/github.com/travis-ci/jupiter-brain)
[![Build Status](https://travis-ci.org/travis-ci/jupiter-brain.svg?branch=master)](https://travis-ci.org/travis-ci/jupiter-brain)

Jupiter Brain is a virtual machine cloud manager backed by vSphere,
prioritizing fast boot times for ephemeral VMs.


text:
'use strict';

var BBPromise = require('bluebird');
var util = require('util');
var express = require('express');
var uuid = require('cassandra-uuid');
var bunyan = require('bunyan');

/**
 * Error instance wrapping HTTP error responses
 */
function HTTPError(response) {

    Error.call(this);
    Error.captureStackTrace(this, HTTPError);

    if(response.constructor !== Object) {
        // just assume this is just the error message
        var msg = response;
        response = {
            status: 500,
            type: 'internal_error',
            title: 'InternalError',
            detail: msg
        };
    }

    this.name = this.constructor.name;
    this.message = response.status + '';
    if(response.type) {
        this.message += ': ' + response.type;
    }

    for (var key in response) {
        this[key] = response[key];
    }

}

util.inherits(HTTPError, Error);

/**
 * Generates an object suitable for logging out of a request object
 *
 * @param {Request} req          the request
 * @param {RegExp}  whitelistRE  the RegExp used to filter headers
 * @return {Object} an object containing the key components of the request
 */
function reqForLog(req, whitelistRE) {

    var ret = {
        url: req.originalUrl,
        headers: {},
        method: req.method,
        params: req.params,
        query: req.query,
        body: req.body,
        remoteAddress: req.connection.remoteAddress,
        remotePort: req.connection.remotePort
    };

    if(req.headers && whitelistRE) {
        Object.keys(req.headers).forEach(function(hdr) {
            if(whitelistRE.test(hdr)) {
                ret.headers[hdr] = req.headers[hdr];
            }
        });
    }

    return ret;

}

/**
 * Serialises an error object in a form suitable for logging
 *
 * @param {Error} err error to serialise
 * @return {Object} the serialised version of the error
 */
function errForLog(err) {

    var ret = bunyan.stdSerializers.err(err);
    ret.status = err.status;
    ret.type = err.type;
    ret.detail = err.detail;

    // log the stack trace only for 500 errors
    if(Number.parseInt(ret.status) !== 500) {
        ret.stack = undefined;
    }

    return ret;

}

/**
 * Generates a unique request ID
 *
 * @return {String} the generated request ID
 */
function generateRequestId() {

    return uuid.TimeUuid.now().toString();

}

/**
 * Wraps all of the given router's handler functions with
 * promised try blocks so as to allow catching all errors,
 * regardless of whether a handler returns/uses promises
 * or not.
 *
 * @param {Router} router object
 */
function wrapRouteHandlers(router) {

    router.stack.forEach(function(routerLayer) {
        routerLayer.route.stack.forEach(function(layer) {
            var origHandler = layer.handle;
            layer.handle = function(req, res, next) {
                BBPromise.try(function() {
                    return origHandler(req, res, next);
                })
                .catch(next);
            };
        });
    });

}

/**
 * Generates an error handler for the given applications
 * and installs it. Usage:
 *
 * @param {Application} app the application object to add the handler to
 */
function setErrorHandler(app) {

    app.use(function(err, req, res, next) {
        var errObj;
        // ensure this is an HTTPError object
        if(err.constructor === HTTPError) {
            errObj = err;
        } else if(err instanceof Error) {
            // is this an HTTPError defined elsewhere? (preq)
            if(err.constructor.name === 'HTTPError') {
                var o = { status: err.status };
                if(err.body && err.body.constructor === Object) {
                    Object.keys(err.body).forEach(function(key) {
                        o[key] = err.body[key];
                    });
                } else {
                    o.detail = err.body;
                }
                o.message = err.message;
                errObj = new HTTPError(o);
            } else {
                // this is a standard error, convert it
                errObj = new HTTPError({
                    status: 500,
                    type: 'internal_error',
                    title: err.name,
                    detail: err.message,
                    stack: err.stack
                });
            }
        } else if(err.constructor === Object) {
            // this is a regular object, suppose it's a response
            errObj = new HTTPError(err);
        } else {
            // just assume this is just the error message
            errObj = new HTTPError({
                status: 500,
                type: 'internal_error',
                title: 'InternalError',
                detail: err
            });
        }
        // ensure some important error fields are present
        if(!errObj.status) { errObj.status = 500; }
        if(!errObj.type) { errObj.type = 'internal_error'; }
        // add the offending URI and method as well
        if(!errObj.method) { errObj.method = req.method; }
        if(!errObj.uri) { errObj.uri = req.url; }
        // some set 'message' or 'description' instead of 'detail'
        errObj.detail = errObj.detail || errObj.message || errObj.description || '';
        // adjust the log level based on the status code
        var level = 'error';
        if(Number.parseInt(errObj.status) < 400) {
            level = 'trace';
        } else if(Number.parseInt(errObj.status) < 500) {
            level = 'info';
        }
        // log the error
        (req.logger || app.logger).log(level + '/' +
                (errObj.component ? errObj.component : errObj.status),
                errForLog(errObj));
        // let through only non-sensitive info
        var respBody = {
            status: errObj.status,
            type: errObj.type,
            title: errObj.title,
            detail: errObj.detail,
            method: errObj.method,
            uri: errObj.uri
        };
        res.status(errObj.status).json(respBody);
    });

}

/**
 * Creates a new router with some default options.
 *
 * @param {Object=} opts additional options to pass to express.Router()
 * @return {Router} a new router object
 */
function createRouter(opts) {

    var options = {
        mergeParams: true
    };

    if(opts && opts.constructor === Object) {
        Object.keys(opts).forEach(function(key) {
            options[key] = opts[key];
        });
    }

    return express.Router(options);

}

/**
 * Adds logger to the request and logs it
 *
 * @param {*} req request object
 * @param {Application} app application object
 */
function initAndLogRequest(req, app) {
    req.headers = req.headers || {};
    req.headers['x-request-id'] = req.headers['x-request-id'] || generateRequestId();
    req.logger = app.logger.child({request_id: req.headers['x-request-id']});
    req.logger.log('trace/req', {req: reqForLog(req, app.conf.log_header_whitelist), msg: 'incoming request'});
}

module.exports = {
    HTTPError: HTTPError,
    initAndLogRequest: initAndLogRequest,
    wrapRouteHandlers: wrapRouteHandlers,
    setErrorHandler: setErrorHandler,
    router: createRouter
};


text:
package com.weblyzard.api.serialize.json;

import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.weblyzard.api.model.document.Sentence;

public class SerializationTest {

    private static final ObjectMapper mapper = new ObjectMapper();

    @Test
    public void test() throws IOException {
        final Sentence sentence = new Sentence(
                        "McChain (former US presidente candidate) stated that he would strongly support such actions.",
                        "0,7 8,9 9,15 16,18 19,29 30,39 39,40 41,47 48,52 53,55 56,61 62,70 71,78 79,83 84,91 91,92",
                        "NNP ( JJ NNP NN NN ) VBD IN PRP MD RB VB JJ NNS .");

        // test sentence id/md5sum (MD5Digest)
        testSerialization(sentence);

        // test isTitle attribute (BooleanAdapter)
        sentence.setTitle(false);
        testSerialization(sentence);

        sentence.setTitle(true);
        testSerialization(sentence);
    }

    private static void testSerialization(Sentence sentence) throws IOException {
        String json = mapper.writeValueAsString(sentence);
        Sentence deserializedSentence = mapper.readValue(json, Sentence.class);
        assertEquals(sentence, deserializedSentence);
    }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>ELSYSER</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
    crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-sweetalert/1.0.1/sweetalert.min.css">