text:
import unittest
import numpy as np
import paddle
import paddle.fluid.dygraph as dg
import paddle.fluid.core as core
from paddle.fluid.framework import convert_np_dtype_to_dtype_
from paddle.fluid.data_feeder import convert_dtype
from paddle.fluid.framework import _test_eager_guard

class TestComplexVariable(unittest.TestCase):
    def compare(self):
        a = np.array(
            [[1.0 + 1.0j, 2.0 + 1.0j], [3.0 + 1.0j, 4.0 + 1.0j]]
        ).astype(self._dtype)
        b = np.array([[1.0 + 1.0j, 1.0 + 1.0j]]).astype(self._dtype)

        with dg.guard():
            x = dg.to_variable(a, "x")
            y = dg.to_variable(b)
            out = paddle.fluid.layers.elementwise_add(x, y)
            self.assertIsNotNone("{}".format(out))

        np.testing.assert_allclose(out.numpy(), a + b, rtol=1e-05)
        self.assertEqual(out.dtype, convert_np_dtype_to_dtype_(self._dtype))
        self.assertEqual(out.shape, x.shape)

    def test_attrs(self):
        self._dtype = "complex64"
        self.compare()
        self._dtype = "complex128"
        self.compare()

    def test_convert_np_dtype_to_dtype(self):
        self.assertEqual(
            convert_np_dtype_to_dtype_(np.complex64),
            core.VarDesc.VarType.COMPLEX64,
        )
        self.assertEqual(
            convert_np_dtype_to_dtype_(np.complex64),
            core.VarDesc.VarType.COMPLEX64,
        )

    def test_convert_dtype(self):
        self.assertEqual(
            convert_dtype(core.VarDesc.VarType.COMPLEX64), "complex64"
        )
        self.assertEqual(
            convert_dtype(core.VarDesc.VarType.COMPLEX128), "complex128"
        )

    def test_eager(self):
        with _test_eager_guard():
            self.test_attrs()
            self.test_convert_np_dtype_to_dtype()
            self.test_convert_dtype()

if __name__ == '__main__':
    unittest.main()


text:
.class public abstract Lcom/google/ads/mediation/MediationServerParameters;
.super Ljava/lang/Object;
.source "SourceFile"

# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 33
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 49
    return-void
.end method

# virtual methods
.method protected a()V
    .registers 1

    .prologue
    .line 112
    return-void
.end method

.method public load(Ljava/util/Map;)V
    .registers 8
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 61
    new-instance v3, Ljava/util/HashMap;

    invoke-direct {v3}, Ljava/util/HashMap;-><init>()V

    .line 62
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Class;->getFields()[Ljava/lang/reflect/Field;

    move-result-object v2

    array-length v4, v2

    const/4 v0, 0x0

    move v1, v0

    :goto_10
    if-ge v1, v4, :cond_29

    aget-object v5, v2, v1

    .line 63
    const-class v0, Lcom/google/ads/mediation/MediationServerParameters$Parameter;

    invoke-virtual {v5, v0}, Ljava/lang/reflect/Field;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;

    move-result-object v0

    check-cast v0, Lcom/google/ads/mediation/MediationServerParameters$Parameter;

    .line 64
    if-eqz v0, :cond_25

    .line 65
    invoke-interface {v0}, Lcom/google/ads/mediation/MediationServerParameters$Parameter;->name()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v3, v0, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 62
    :cond_25
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_10

    .line 69
    :cond_29
    invoke-interface {v3}, Ljava/util/Map;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_34

    .line 70
    const-string v0, "No server options fields detected.  To suppress this message either add a field with the @Parameter annotation, or override the load() method"

    invoke-static {v0}, Lcom/google/ads/util/b;->e(Ljava/lang/String;)V

    .line 74
    :cond_34
    invoke-interface {p1}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_3c
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_d9

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    move-object v1, v0

    check-cast v1, Ljava/util/Map$Entry;

    .line 75
    invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v0

    invoke-interface {v3, v0}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/reflect/Field;

    .line 76
    if-eqz v0, :cond_a5

    .line 78
    :try_start_55
    invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v4

    invoke-virtual {v0, p0, v4}, Ljava/lang/reflect/Field;->set(Ljava/lang/Object;Ljava/lang/Object;)V
    :try_end_5c
    .catch Ljava/lang/IllegalAccessException; {:try_start_55 .. :try_end_5c} :catch_5d
    .catch Ljava/lang/IllegalArgumentException; {:try_start_55 .. :try_end_5c} :catch_81

    goto :goto_3c

    .line 79
    :catch_5d
    move-exception v0

    .line 80
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Server Option \'"

    invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "\' could not be set: Illegal Access"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/google/ads/util/b;->b(Ljava/lang/String;)V

    goto :goto_3c

    .line 81
    :catch_81
    move-exception v0

    .line 82
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Server Option \'"

    invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "\' could not be set: Bad Type"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/google/ads/util/b;->b(Ljava/lang/String;)V

    goto :goto_3c

    .line 85
    :cond_a5
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Unexpected Server Option: "

    invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v4, " = \'"

    invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "\'"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/google/ads/util/b;->e(Ljava/lang/String;)V

    goto/16 :goto_3c

    .line 90
    :cond_d9
    const/4 v2, 0x0

    .line 91
    invoke-interface {v3}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_e2
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_155

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/reflect/Field;

    .line 92
    const-class v1, Lcom/google/ads/mediation/MediationServerParameters$Parameter;

    invoke-virtual {v0, v1}, Ljava/lang/reflect/Field;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;

    move-result-object v1

    check-cast v1, Lcom/google/ads/mediation/MediationServerParameters$Parameter;

    invoke-interface {v1}, Lcom/google/ads/mediation/MediationServerParameters$Parameter;->required()Z

    move-result v1

    if-eqz v1, :cond_174

    .line 93
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Required Server Option missing: "

    invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-class v1, Lcom/google/ads/mediation/MediationServerParameters$Parameter;

    invoke-virtual {v0, v1}, Ljava/lang/reflect/Field;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;

    move-result-object v1

    check-cast v1, Lcom/google/ads/mediation/MediationServerParameters$Parameter;

    invoke-interface {v1}, Lcom/google/ads/mediation/MediationServerParameters$Parameter;->name()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/google/ads/util/b;->b(Ljava/lang/String;)V

    .line 95
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    if-nez v2, :cond_141

    const-string v1, ""

    :goto_127
    invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-class v2, Lcom/google/ads/mediation/MediationServerParameters$Parameter;

    invoke-virtual {v0, v2}, Ljava/lang/reflect/Field;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;

    move-result-object v0

    check-cast v0, Lcom/google/ads/mediation/MediationServerParameters$Parameter;

    invoke-interface {v0}, Lcom/google/ads/mediation/MediationServerParameters$Parameter;->name()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    :goto_13f
    move-object v2, v0

    goto :goto_e2

    :cond_141
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    goto :goto_127

    .line 101
    :cond_155
    if-eqz v2, :cond_170

    .line 102
    new-instance v0, Lcom/google/ads/mediation/MediationServerParameters$MappingException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Required Server Option(s) missing: "

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/google/ads/mediation/MediationServerParameters$MappingException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 105
    :cond_170
    invoke-virtual {p0}, Lcom/google/ads/mediation/MediationServerParameters;->a()V

    .line 106
    return-void

    :cond_174
    move-object v0, v2

    goto :goto_13f
.end method

redpajama_set_name: RedPajamaGithub


text:
import threading
from utils.decorators import Override

__author__ = 'Danyang'

def print_msg(name, msg):
    print "%s says: %s" % (name, msg)

class AbstractThread(threading.Thread):
    @Override(threading.Thread)
    def __init__(self, name, production=False):
        super(AbstractThread, self).__init__()
        self.name = name
        self.production = production

    def print_msg(self, msg):
        print_msg(self.name, msg)


text:
<!DOCTYPE html>
<!DOCTYPE html>

    <title>GitSearch - A source code search engine for GitHub</title>

Study 3/3

					Scenario:
					{{queries[i].title}}

					Description:
					{{queries[i].description}}

You are nearly finished with the survey

Formulate queries that describe the above mentioned search scenario above

You can use any keywords as they deem appropriate

Results might take time to load

			<form>
			<input type="text" name="q" style="padding:17px; width: 50%; height: 35px; color:#858c91; height:24px; font-size: 25px" />
			<input type="submit" value="Search" style="background-color: #3f4b55; padding:17px 30px 17px; font-weight: 600; font-size: 25px; color: white; border: none"/>
			<input type="hidden" name="n" value="{{i}}" />
			</form>


text:
using System;
using System.Web.Mvc;
using Newtonsoft.Json;
using Shuhari.Framework.Utils;

namespace Shuhari.Framework.Web.Mvc
{
    /// <summary>
    /// Custom json result
    /// </summary>
    public class CustomJsonResult : JsonResult
    {
        /// <summary>
        /// Initialize
        /// </summary>
        /// <param name="data"></param>
        /// <param name="behavior"></param>
        public CustomJsonResult(object data, JsonRequestBehavior behavior)
        {
            Data = data;
            JsonRequestBehavior = behavior;
        }

        /// <summary>
        /// Execute result
        /// </summary>
        /// <param name="context"></param>
        public override void ExecuteResult(ControllerContext context)
        {
            Expect.IsNotNull(context, nameof(context));

            var request = context.HttpContext.Request;
            var response = context.HttpContext.Response;
            if (JsonRequestBehavior == JsonRequestBehavior.DenyGet && request.HttpMethod.EqualsNoCase("GET"))
                throw new InvalidOperationException("JSON GET is not allowed");

            response.ContentType = string.IsNullOrEmpty(ContentType) ? "application/json" : ContentType;
            if (ContentEncoding != null)
                response.ContentEncoding = ContentEncoding;
            if (Data == null)
                return;

            var settings = new JsonSerializerSettings();
            var json = JsonConvert.SerializeObject(Data, settings);
            response.Write(json);
        }
    }
}


text:
<?php

namespace Harp\Harp\Test\Repo;

use Harp\Harp\Repo\LinkMap;
use Harp\Harp\Repo\LinkOne;
use Harp\Harp\Rel\BelongsTo;
use Harp\Harp\Test\AbstractTestCase;
use Harp\Harp\Test\TestModel\City;
use Harp\Harp\Test\TestModel\Country;

class LinkMapTest extends AbstractTestCase
{
    /**
     * @covers ::get
     * @covers ::has
     * @covers ::getRepo
     * @covers ::isEmpty
     * @covers ::__construct
     * @covers ::clear
     */
    public function testTest()
    {
        $map = new LinkMap(City::getRepo());
        $model = new City();

        $this->assertFalse($map->has($model));
        $this->assertSame(City::getRepo(), $map->getRepo());
        $this->assertTrue($map->isEmpty($model));

        $links = $map->get($model);

        $this->assertInstanceOf('Harp\Harp\Repo\Links', $links);
        $this->assertEmpty($links->all());
        $this->assertTrue($map->has($model));
        $this->assertTrue($map->isEmpty($model));

        $link = new LinkOne(
            $model,
            new BelongsTo('one', City::getRepo()->getConfig(), City::getRepo()),
            new City()
        );

        $links->add($link);

        $this->assertTrue($map->has($model));
        $this->assertFalse($map->isEmpty($model));

        $links2 = $map->get($model);

        $this->assertSame($links, $links2);

        $map->clear();

        $this->assertFalse($map->has($model));
    }

    /**
     * @covers ::addLink
     */
    public function testAddLink()
    {
        $model = new City();
        $foreign = new City();
        $link = new LinkOne(
            $model,
            new BelongsTo('one', City::getRepo()->getConfig(), City::getRepo()),
            $foreign
        );

        $map = new LinkMap(City::getRepo());

        $map->addLink($link);

        $this->assertSame($link, $map->get($model)->get('one'));
    }

    /**
     * @covers ::get
     * @expectedException InvalidArgumentException
     */
    public function testInvalidModel()
    {
        $map = new LinkMap(City::getRepo());
        $model = new Country();

        $map->get($model);
    }
}


text:
namespace content {
class BrowserContext;
}

namespace ui {
class WebDialogDelegate;
}

// Platform-agnostic base implementation of ConstrainedWebDialogDelegate.
class ConstrainedWebDialogDelegateBase
    : public ConstrainedWebDialogDelegate,
      public ui::WebDialogWebContentsDelegate {
 public:
  ConstrainedWebDialogDelegateBase(
      content::BrowserContext* browser_context,
      ui::WebDialogDelegate* delegate,
      WebDialogWebContentsDelegate* tab_delegate);
  virtual ~ConstrainedWebDialogDelegateBase();

  bool closed_via_webui() const;

  // ConstrainedWebDialogDelegate interface.
  virtual const ui::WebDialogDelegate*
      GetWebDialogDelegate() const OVERRIDE;
  virtual ui::WebDialogDelegate* GetWebDialogDelegate() OVERRIDE;
  virtual void OnDialogCloseFromWebUI() OVERRIDE;
  virtual void ReleaseWebContentsOnDialogClose() OVERRIDE;
  virtual NativeWebContentsModalDialog GetNativeDialog() OVERRIDE;
  virtual content::WebContents* GetWebContents() OVERRIDE;

  // WebDialogWebContentsDelegate interface.
  virtual void HandleKeyboardEvent(
      content::WebContents* source,
      const content::NativeWebKeyboardEvent& event) OVERRIDE;

 private:
  scoped_ptr<ui::WebDialogDelegate> web_dialog_delegate_;

  // Holds the HTML to display in the constrained dialog.
  scoped_ptr<content::WebContents> web_contents_;

  // Was the dialog closed from WebUI (in which case |web_dialog_delegate_|'s
  // OnDialogClosed() method has already been called)?
  bool closed_via_webui_;

  // If true, release |web_contents_| on close instead of destroying it.
  bool release_contents_on_close_;

  scoped_ptr<WebDialogWebContentsDelegate> override_tab_delegate_;

  DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateBase);
};

#endif  // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_DELEGATE_BASE_H_


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

<title>ZipEntry (Apache Ant API)</title>
<meta name="date" content="2015-06-29">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.tools.zip

Class ZipEntry

java.lang.Object

java.util.zip.ZipEntry

org.apache.tools.zip.ZipEntry

All Implemented Interfaces:

java.lang.Cloneable

public class ZipEntry
extends java.util.zip.ZipEntry
implements java.lang.Cloneable

Extension that adds better handling of extra fields and provides
 access to the internal and external file attributes.

The extra data is expected to follow the recommendation of

 APPNOTE.txt:

the extra byte array consists of a sequence of extra fields

each extra fields starts by a two byte header id followed by
   a two byte sequence holding the length of the remainder of
   data.

Any extra data that cannot be parsed by the rules above will be
 consumed as "unparseable" extra data and treated differently by the
 methods of this class.  Older versions would have thrown an
 exception if any attempt was made to read or write extra data not
 conforming to the recommendation.

Field Summary

Fields

Modifier and Type
Field and Description

static int
CENATT

static int
CENATX

static int
CENCOM

static int
CENCRC

static int
CENDSK

static int
CENEXT

static int
CENFLG

static int
CENHDR

static int
CENHOW

static int
CENLEN

static int
CENNAM

static int
CENOFF

static long
CENSIG

static int
CENSIZ

static int
CENTIM

static int
CENVEM

static int
CENVER

static int
CRC_UNKNOWN

static int
ENDCOM

static int
ENDHDR

static int
ENDOFF

static long
ENDSIG

static int
ENDSIZ

static int
ENDSUB

static int
ENDTOT

static int
EXTCRC

static int
EXTHDR

static int
EXTLEN

static long
EXTSIG

static int
EXTSIZ

static int
LOCCRC

static int
LOCEXT

static int
LOCFLG

static int
LOCHDR

static int
LOCHOW

static int
LOCLEN

static int
LOCNAM

static long
LOCSIG

static int
LOCSIZ

static int
LOCTIM

static int
LOCVER

static int
PLATFORM_FAT

static int
PLATFORM_UNIX

Fields inherited from class java.util.zip.ZipEntry

DEFLATED, STORED

Constructor Summary

Constructors

Modifier
Constructor and Description

protected
ZipEntry()

ZipEntry(java.io.File inputFile,
        java.lang.String entryName)

Creates a new zip entry taking some information from the given
 file and using the provided name.

ZipEntry(java.lang.String name)

Creates a new zip entry with the specified name.

ZipEntry(java.util.zip.ZipEntry entry)

Creates a new zip entry with fields taken from the specified zip entry.

ZipEntry(ZipEntry entry)

Creates a new zip entry with fields taken from the specified zip entry.

Method Summary

Methods

Modifier and Type
Method and Description

void
addAsFirstExtraField(ZipExtraField ze)

Adds an extra field - replacing an already present extra field
 of the same type.

void
addExtraField(ZipExtraField ze)

Adds an extra field - replacing an already present extra field
 of the same type.

java.lang.Object
clone()

Overwrite clone.

boolean
equals(java.lang.Object obj)

byte[]
getCentralDirectoryExtra()

Retrieves the extra data for the central directory.

long
getExternalAttributes()

Retrieves the external file attributes.

ZipExtraField
getExtraField(ZipShort type)

Looks up an extra field by its header id.

ZipExtraField[]
getExtraFields()

Retrieves all extra fields that have been parsed successfully.

ZipExtraField[]
getExtraFields(boolean includeUnparseable)

Retrieves extra fields.

GeneralPurposeBit
getGeneralPurposeBit()

The "general purpose bit" field.

int
getInternalAttributes()

Retrieves the internal file attributes.

java.util.Date
getLastModifiedDate()

byte[]
getLocalFileDataExtra()

Retrieves the extra data for the local file data.

int
getMethod()

Returns the compression method of this entry, or -1 if the
 compression method has not been specified.

java.lang.String
getName()

Get the name of the entry.

int
getPlatform()

Platform specification to put into the "version made
 by" part of the central file header.

byte[]
getRawName()

Returns the raw bytes that made up the name before it has been
 converted using the configured or guessed encoding.

long
getSize()

Gets the uncompressed size of the entry data.

int
getUnixMode()

Unix permission.

UnparseableExtraFieldData
getUnparseableExtraFieldData()

Looks up extra field data that couldn't be parsed correctly.

int
hashCode()

Get the hashCode of the entry.

boolean
isDirectory()

Is this entry a directory?

void
removeExtraField(ZipShort type)

Remove an extra field.

void
removeUnparseableExtraFieldData()

Removes unparseable extra field data.

void
setCentralDirectoryExtra(byte[] b)

Sets the central directory part of extra fields.

void
setComprSize(long size)

Deprecated.

since 1.7.
             Use setCompressedSize directly.

void
setExternalAttributes(long value)

Sets the external file attributes.

protected void
setExtra()

Unfortunately java.util.zip.ZipOutputStream seems to access the extra data
 directly, so overriding getExtra doesn't help - we need to
 modify super's data directly.

void
setExtra(byte[] extra)

Parses the given bytes as extra field data and consumes any
 unparseable data as an UnparseableExtraFieldData
 instance.

void
setExtraFields(ZipExtraField[] fields)

Replaces all currently attached extra fields with the new array.

void
setGeneralPurposeBit(GeneralPurposeBit b)

The "general purpose bit" field.

void
setInternalAttributes(int value)

Sets the internal file attributes.

void
setMethod(int method)

Sets the compression method of this entry.

protected void
setName(java.lang.String name)

Set the name of the entry.

protected void
setName(java.lang.String name,
       byte[] rawName)

Sets the name using the raw bytes and the string created from
 it by guessing or using the configured encoding.

protected void
setPlatform(int platform)

Set the platform (UNIX or FAT).

void
setSize(long size)

Sets the uncompressed size of the entry data.

void
setUnixMode(int mode)

Sets Unix permissions in a way that is understood by Info-Zip's
 unzip command.

Methods inherited from class java.util.zip.ZipEntry

getComment, getCompressedSize, getCrc, getExtra, getTime, setComment, setCompressedSize, setCrc, setTime, toString

Methods inherited from class java.lang.Object

finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

PLATFORM_UNIX

public static final int PLATFORM_UNIX

See Also:

Constant Field Values

PLATFORM_FAT

public static final int PLATFORM_FAT

See Also:

Constant Field Values

CRC_UNKNOWN

public static final int CRC_UNKNOWN

See Also:

Constant Field Values

LOCSIG

public static final long LOCSIG

See Also:

Constant Field Values

EXTSIG

public static final long EXTSIG

See Also:

Constant Field Values

CENSIG

public static final long CENSIG

See Also:

Constant Field Values

ENDSIG

public static final long ENDSIG

See Also:

Constant Field Values

LOCHDR

public static final int LOCHDR

See Also:

Constant Field Values

EXTHDR

public static final int EXTHDR

See Also:

Constant Field Values

CENHDR

public static final int CENHDR

See Also:

Constant Field Values

ENDHDR

public static final int ENDHDR

See Also:

Constant Field Values

LOCVER

public static final int LOCVER

See Also:

Constant Field Values

LOCFLG

public static final int LOCFLG

See Also:

Constant Field Values

LOCHOW

public static final int LOCHOW

See Also:

Constant Field Values

LOCTIM

public static final int LOCTIM

See Also:

Constant Field Values

LOCCRC

public static final int LOCCRC

See Also:

Constant Field Values

LOCSIZ

public static final int LOCSIZ

See Also:

Constant Field Values

LOCLEN

public static final int LOCLEN

See Also:

Constant Field Values

LOCNAM

public static final int LOCNAM

See Also:

Constant Field Values

LOCEXT

public static final int LOCEXT

See Also:

Constant Field Values

EXTCRC

public static final int EXTCRC

See Also:

Constant Field Values

EXTSIZ

public static final int EXTSIZ

See Also:

Constant Field Values

EXTLEN

public static final int EXTLEN

See Also:

Constant Field Values

CENVEM

public static final int CENVEM

See Also:

Constant Field Values

CENVER

public static final int CENVER

See Also:

Constant Field Values

CENFLG

public static final int CENFLG

See Also:

Constant Field Values

CENHOW

public static final int CENHOW

See Also:

Constant Field Values

CENTIM

public static final int CENTIM

See Also:

Constant Field Values

CENCRC

public static final int CENCRC

See Also:

Constant Field Values

CENSIZ

public static final int CENSIZ

See Also:

Constant Field Values

CENLEN

public static final int CENLEN

See Also:

Constant Field Values

CENNAM

public static final int CENNAM

See Also:

Constant Field Values

CENEXT

public static final int CENEXT

See Also:

Constant Field Values

CENCOM

public static final int CENCOM

See Also:

Constant Field Values

CENDSK

public static final int CENDSK

See Also:

Constant Field Values

CENATT

public static final int CENATT

See Also:

Constant Field Values

CENATX

public static final int CENATX

See Also:

Constant Field Values

CENOFF

public static final int CENOFF

See Also:

Constant Field Values

ENDSUB

public static final int ENDSUB

See Also:

Constant Field Values

ENDTOT

public static final int ENDTOT

See Also:

Constant Field Values

ENDSIZ

public static final int ENDSIZ

See Also:

Constant Field Values

ENDOFF

public static final int ENDOFF

See Also:

Constant Field Values

ENDCOM

public static final int ENDCOM

See Also:

Constant Field Values

Constructor Detail

ZipEntry

public ZipEntry(java.lang.String name)

Creates a new zip entry with the specified name.

Assumes the entry represents a directory if and only if the
 name ends with a forward slash "/".

Parameters:

name - the name of the entry

Since:

1.1

ZipEntry

public ZipEntry(java.util.zip.ZipEntry entry)
         throws java.util.zip.ZipException

Creates a new zip entry with fields taken from the specified zip entry.

Assumes the entry represents a directory if and only if the
 name ends with a forward slash "/".

Parameters:

entry - the entry to get fields from

Throws:

java.util.zip.ZipException - on error

Since:

1.1

ZipEntry

public ZipEntry(ZipEntry entry)
         throws java.util.zip.ZipException

Creates a new zip entry with fields taken from the specified zip entry.

Assumes the entry represents a directory if and only if the
 name ends with a forward slash "/".

Parameters:

entry - the entry to get fields from

Throws:

java.util.zip.ZipException - on error

Since:

1.1

ZipEntry

protected ZipEntry()

Since:

1.9

ZipEntry

public ZipEntry(java.io.File inputFile,
        java.lang.String entryName)

Creates a new zip entry taking some information from the given
 file and using the provided name.

The name will be adjusted to end with a forward slash "/" if
 the file is a directory.  If the file is not a directory a
 potential trailing forward slash will be stripped from the
 entry name.

Method Detail

clone

public java.lang.Object clone()

Overwrite clone.

Overrides:

clone in class java.util.zip.ZipEntry

Returns:

a cloned copy of this ZipEntry

Since:

1.1

getMethod

public int getMethod()

Returns the compression method of this entry, or -1 if the
 compression method has not been specified.

Overrides:

getMethod in class java.util.zip.ZipEntry

Returns:

compression method

setMethod

public void setMethod(int method)

Sets the compression method of this entry.

Overrides:

setMethod in class java.util.zip.ZipEntry

Parameters:

method - compression method

getInternalAttributes

public int getInternalAttributes()

Retrieves the internal file attributes.

Returns:

the internal file attributes

Since:

1.1

setInternalAttributes

public void setInternalAttributes(int value)

Sets the internal file attributes.

Parameters:

value - an int value

Since:

1.1

getExternalAttributes

public long getExternalAttributes()

Retrieves the external file attributes.

Returns:

the external file attributes

Since:

1.1

setExternalAttributes

public void setExternalAttributes(long value)

Sets the external file attributes.

Parameters:

value - an long value

Since:

1.1

setUnixMode

public void setUnixMode(int mode)

Sets Unix permissions in a way that is understood by Info-Zip's
 unzip command.

Parameters:

mode - an int value

Since:

Ant 1.5.2

getUnixMode

public int getUnixMode()

Unix permission.

Returns:

the unix permissions

Since:

Ant 1.6

getPlatform

public int getPlatform()

Platform specification to put into the "version made
 by" part of the central file header.

Returns:

PLATFORM_FAT unless setUnixMode
 has been called, in which case PLATFORM_UNIX will be returned.

Since:

Ant 1.5.2

setPlatform

protected void setPlatform(int platform)

Set the platform (UNIX or FAT).

Parameters:

platform - an int value - 0 is FAT, 3 is UNIX

Since:

1.9

setExtraFields

public void setExtraFields(ZipExtraField[] fields)

Replaces all currently attached extra fields with the new array.

Parameters:

fields - an array of extra fields

Since:

1.1

getExtraFields

public ZipExtraField[] getExtraFields()

Retrieves all extra fields that have been parsed successfully.

Returns:

an array of the extra fields

getExtraFields

public ZipExtraField[] getExtraFields(boolean includeUnparseable)

Retrieves extra fields.

Parameters:

includeUnparseable - whether to also return unparseable
 extra fields as UnparseableExtraFieldData if such data
 exists.

Returns:

an array of the extra fields

Since:

1.1

addExtraField

public void addExtraField(ZipExtraField ze)

Adds an extra field - replacing an already present extra field
 of the same type.

If no extra field of the same type exists, the field will be
 added as last field.

Parameters:

ze - an extra field

Since:

1.1

addAsFirstExtraField

public void addAsFirstExtraField(ZipExtraField ze)

Adds an extra field - replacing an already present extra field
 of the same type.

The new extra field will be the first one.

Parameters:

ze - an extra field

Since:

1.1

removeExtraField

public void removeExtraField(ZipShort type)

Remove an extra field.

Parameters:

type - the type of extra field to remove

Since:

1.1

removeUnparseableExtraFieldData

public void removeUnparseableExtraFieldData()

Removes unparseable extra field data.

getExtraField

public ZipExtraField getExtraField(ZipShort type)

Looks up an extra field by its header id.

Returns:

null if no such field exists.

getUnparseableExtraFieldData

public UnparseableExtraFieldData getUnparseableExtraFieldData()

Looks up extra field data that couldn't be parsed correctly.

Returns:

null if no such field exists.

setExtra

public void setExtra(byte[] extra)
              throws java.lang.RuntimeException

Parses the given bytes as extra field data and consumes any
 unparseable data as an UnparseableExtraFieldData
 instance.

Overrides:

setExtra in class java.util.zip.ZipEntry

Parameters:

extra - an array of bytes to be parsed into extra fields

Throws:

java.lang.RuntimeException - if the bytes cannot be parsed

java.lang.RuntimeException - on error

Since:

1.1

setExtra

protected void setExtra()

Unfortunately java.util.zip.ZipOutputStream seems to access the extra data
 directly, so overriding getExtra doesn't help - we need to
 modify super's data directly.

Since:

1.1

setCentralDirectoryExtra

public void setCentralDirectoryExtra(byte[] b)

Sets the central directory part of extra fields.

getLocalFileDataExtra

public byte[] getLocalFileDataExtra()

Retrieves the extra data for the local file data.

Returns:

the extra data for local file

Since:

1.1

getCentralDirectoryExtra

public byte[] getCentralDirectoryExtra()

Retrieves the extra data for the central directory.

Returns:

the central directory extra data

Since:

1.1

setComprSize

@Deprecated
public void setComprSize(long size)

Deprecated. since 1.7.
             Use setCompressedSize directly.

Make this class work in JDK 1.1 like a 1.2 class.

This either stores the size for later usage or invokes
 setCompressedSize via reflection.

Parameters:

size - the size to use

Since:

1.2

getName

public java.lang.String getName()

Get the name of the entry.

Overrides:

getName in class java.util.zip.ZipEntry

Returns:

the entry name

Since:

1.9

isDirectory

public boolean isDirectory()

Is this entry a directory?

Overrides:

isDirectory in class java.util.zip.ZipEntry

Returns:

true if the entry is a directory

Since:

1.10

setName

protected void setName(java.lang.String name)

Set the name of the entry.

Parameters:

name - the name to use

getSize

public long getSize()

Gets the uncompressed size of the entry data.

Overrides:

getSize in class java.util.zip.ZipEntry

Returns:

the entry size

setSize

public void setSize(long size)

Sets the uncompressed size of the entry data.

Overrides:

setSize in class java.util.zip.ZipEntry

Parameters:

size - the uncompressed size in bytes

Throws:

java.lang.IllegalArgumentException - if the specified size is less
            than 0

setName

protected void setName(java.lang.String name,
           byte[] rawName)

Sets the name using the raw bytes and the string created from
 it by guessing or using the configured encoding.

Parameters:

name - the name to use created from the raw bytes using
 the guessed or configured encoding

rawName - the bytes originally read as name from the
 archive

getRawName

public byte[] getRawName()

Returns the raw bytes that made up the name before it has been
 converted using the configured or guessed encoding.

This method will return null if this instance has not been
 read from an archive.

hashCode

public int hashCode()

Get the hashCode of the entry.
 This uses the name as the hashcode.

Overrides:

hashCode in class java.util.zip.ZipEntry

Returns:

a hashcode.

Since:

Ant 1.7

getGeneralPurposeBit

public GeneralPurposeBit getGeneralPurposeBit()

The "general purpose bit" field.

setGeneralPurposeBit

public void setGeneralPurposeBit(GeneralPurposeBit b)

The "general purpose bit" field.

getLastModifiedDate

public java.util.Date getLastModifiedDate()

equals

public boolean equals(java.lang.Object obj)

Overrides:

equals in class java.lang.Object

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package test.view.selfdefined.compose;

import com.test4android.R;

import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.TextView;

public class TitleView extends FrameLayout {

    private Button leftButton;

    private TextView titleText;

    public TitleView(Context context, AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater.from(context).inflate(R.layout.test_view_selfdefined_compose_title, this);
        titleText = (TextView) findViewById(R.id.title_text);
        leftButton = (Button) findViewById(R.id.button_left);
        leftButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                ((Activity) getContext()).finish();
            }
        });
    }

    public void setTitleText(String text) {
        titleText.setText(text);
    }

    public void setLeftButtonText(String text) {
        leftButton.setText(text);
    }

    public void setLeftButtonListener(OnClickListener l) {
        leftButton.setOnClickListener(l);
    }

}


text:
'use strict'

const express = require('express')
const bodyParser = require('body-parser')
const app = express()

// defaults port to 8000 if one is not given in the environment
const port = process.env.PORT || 8000

// open database and collection asyncronously
require('./model/db').initialize(collection => {
  const strings = collection

  // parse all requests bodies as text
  app.use(bodyParser.text({type: '*/*'}))

  // add routes
  app.use(require('./routes/get-all-ids.js')(strings))
  app.use(require('./routes/get-stats.js')(strings))
  app.use(require('./routes/insert-string.js')(strings))
  app.use(require('./routes/get-or-delete-id.js')(strings))

  // default response
  app.use('/*', (req, res) => {
    res.end(
`Usage: curl $domain/messages/ -d "message"
or:    curl $domain/messages/id
or:    curl $domain/messages/id -X DELETE
or:    curl $domain/messages/all
or:    curl $domain/messages/stats\n`
  )})

  // once db and collection is established, start listening
  app.listen(port, () => {
    console.log(`Server listening on port ${port}.`)
  })
})


text:
package org.neociclo.capi20.message;

import static org.neociclo.capi20.parameter.ParameterBuffers.*;

import net.sourceforge.jcapi.message.parameter.AdditionalInfo;
import net.sourceforge.jcapi.message.parameter.CalledPartyNumber;
import net.sourceforge.jcapi.message.parameter.PLCI;

import org.jboss.netty.buffer.ChannelBuffer;

/**
 * @author Rafael Marins
 */
public class InfoReq extends SendMessage {

    private PLCI plci;
    private CalledPartyNumber calledPartyNumber;
    private AdditionalInfo additionalInfo;

    public InfoReq() {
        super(MessageType.INFO_REQ);
    }

    public PLCI getPlci() {
        return plci;
    }

    public void setPlci(PLCI plci) {
        this.plci = plci;
    }

    public CalledPartyNumber getCalledPartyNumber() {
        return calledPartyNumber;
    }

    public void setCalledPartyNumber(CalledPartyNumber calledPartyNumber) {
        this.calledPartyNumber = calledPartyNumber;
    }

    public AdditionalInfo getAdditionalInfo() {
        return additionalInfo;
    }

    public void setAdditionalInfo(AdditionalInfo additionalInfo) {
        this.additionalInfo = additionalInfo;
    }

    // -------------------------------------------------------------------------
    // SendMessage implementation overriding
    // -------------------------------------------------------------------------

    @Override
    protected void writeValues(ChannelBuffer buf) {
        writePlci(buf, getPlci());
        writeCalledPartyNumber(buf, getCalledPartyNumber());
        writeAdditionalInfo(buf, getAdditionalInfo());
    }

}


text:
package ru.iv.support.rest;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import lombok.extern.slf4j.Slf4j;
import org.h2.Driver;
import org.hibernate.jpa.HibernatePersistenceProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.socket.WebSocketExtension;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
import org.springframework.web.socket.server.HandshakeFailureException;
import org.springframework.web.socket.server.RequestUpgradeStrategy;
import org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy;
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
import ru.iv.support.notify.WebNotifyController;

import javax.sql.DataSource;
import java.security.Principal;
import java.sql.SQLException;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
import java.util.Properties;

@EnableAutoConfiguration
@EnableWebSocket
@EnableWebMvc
@SpringBootApplication
@EnableAsync
@EnableConfigurationProperties
@EnableTransactionManagement
@EnableJpaRepositories(
        basePackages = {"ru.iv.support.repository"},
        basePackageClasses = {},
        entityManagerFactoryRef = "emFactory",
        transactionManagerRef = "emTransactionManager")
@Slf4j
public class Application implements WebSocketConfigurer {
    private static final DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE;

    @Autowired
    private WebNotifyController webController;

    @ComponentScan({
            "ru.iv.support.rest",
            "ru.iv.support.service",
            "ru.iv.support.dll",
            "ru.iv.support.repository",
    })
    @Configuration
    public static class SupportConfiguration {

    }

    @Bean
    @Primary
    public DataSource internalDataSource() {
        final DriverManagerDataSource dataSource = new DriverManagerDataSource();
        dataSource.setDriverClassName(Driver.class.getName());
        dataSource.setUsername("sa");
        final String url = "jdbc:h2:file:~/" + "support"/*formatter.format(LocalDate.now())*/;
        log.debug("Url: {}", url);
        dataSource.setUrl(url);
        return dataSource;
    }

    @Bean
    @Primary
    public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) {
        final ObjectMapper objectMapper = builder.createXmlMapper(false).build();
        objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
        objectMapper.configure(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, false);
        objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
        objectMapper.configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, false);
        return objectMapper;
    }

    @Bean(name = "emFactory")
    public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
        final LocalContainerEntityManagerFactoryBean emFactory = new LocalContainerEntityManagerFactoryBean();
        emFactory.setDataSource(internalDataSource());
        emFactory.setPersistenceProviderClass(HibernatePersistenceProvider.class);
        final HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
        vendorAdapter.setGenerateDdl(true);
        emFactory.setJpaVendorAdapter(vendorAdapter);
        final Properties properties = new Properties();
        properties.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
        properties.setProperty("hibernate.hbm2ddl.auto", "update");
        properties.setProperty("hibernate.show_sql", "true");
        emFactory.setJpaProperties(properties);
        emFactory.setPackagesToScan("ru.iv.support.entity");
        return emFactory;
    }

    @Bean(name = "emTransactionManager")
    @Primary
    public JpaTransactionManager transactionManager() {
        final JpaTransactionManager transactionManager = new JpaTransactionManager();
        transactionManager.setEntityManagerFactory(entityManagerFactory().getObject());
        return transactionManager;
    }

    @Bean(name = "questionTaskExecutor")
    public TaskExecutor getQuestionTaskExecutor() {
        return new SimpleAsyncTaskExecutor();
    }

    @Bean(name = "deviceTaskExecutor")
    public TaskExecutor getDeviceTaskExecutor() {
        return new SimpleAsyncTaskExecutor();
    }

    public static void main(String[] args) throws SQLException {
        SpringApplication.run(Application.class, args);
    }

    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
        registry.addHandler(webController, "/notification").setHandshakeHandler(new DefaultHandshakeHandler(new RequestUpgradeStrategy() {
            private final RequestUpgradeStrategy strategy = new TomcatRequestUpgradeStrategy();

            @Override
            public String[] getSupportedVersions() {
                return strategy.getSupportedVersions();
            }

            @Override
            public List<WebSocketExtension> getSupportedExtensions(ServerHttpRequest request) {
                return strategy.getSupportedExtensions(request);
            }

            @Override
            public void upgrade(ServerHttpRequest request,
                                ServerHttpResponse response,
                                String selectedProtocol,
                                List<WebSocketExtension> selectedExtensions,
                                Principal user,
                                WebSocketHandler wsHandler,
                                Map<String, Object> attributes) throws HandshakeFailureException {
                strategy.upgrade(request, response, selectedProtocol, selectedExtensions, user, wsHandler, attributes);
            }
        }));
    }
}


text:
<!DOCTYPE html>

		<title>three.js webgl - geometry - vertex colors</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">


text:
using UnityEngine;
using System.Collections;

public class Lever : Switch {

	private bool switched = false;

	protected new void toggleAll()
	{
		if (!switched)
		{
			base.toggleAll();
			switched = true;
		}
	}
}


text:
class Users::QuestionsMailer < ActionMailer::Base
  layout 'email'

  def new(question, user, project, asker)
    @question = question
    @user = user
    @project = project
    @asker = asker

    mail(
      from: "#{::Configuration[:company_name]} <#{::Configuration[:email_system]}>",
      reply_to: "#{asker.display_name} <#{asker.email}>",
      to: @user.email,
      subject: "Question Regarding #{@project.name}."
    )
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<!--

-->
<gradient xmlns:android="http://schemas.android.com/apk/res/android"
    android:centerX="300"
    android:centerY="300"
    android:gradientRadius="100"
    android:type="radial">
    <item android:offset="0.1" android:color="?colorPrimary"/>
    <item android:offset="0.9" android:color="?colorControlActivated"/>
</gradient>


text:
using grpc = global::Grpc.Core;

namespace Google.Cloud.MediaTranslation.V1Beta1 {
  ///
  /// Provides translation from/to media types.
  ///
  public static partial class SpeechTranslationService
  {
    static readonly string __ServiceName = "google.cloud.mediatranslation.v1beta1.SpeechTranslationService";

    [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
    static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context)
    {
      #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
      if (message is global::Google.Protobuf.IBufferMessage)
      {
        context.SetPayloadLength(message.CalculateSize());
        global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter());
        context.Complete();
        return;
      }
      #endif
      context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message));
    }

    [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
    static class __Helper_MessageCache<T>
    {
      public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T));
    }

    [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
    static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser<T> parser) where T : global::Google.Protobuf.IMessage<T>
    {
      #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
      if (__Helper_MessageCache<T>.IsBufferMessage)
      {
        return parser.ParseFrom(context.PayloadAsReadOnlySequence());
      }
      #endif
      return parser.ParseFrom(context.PayloadAsNewBuffer());
    }

    [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
    static readonly grpc::Marshaller<global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechRequest> __Marshaller_google_cloud_mediatranslation_v1beta1_StreamingTranslateSpeechRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechRequest.Parser));
    [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
    static readonly grpc::Marshaller<global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechResponse> __Marshaller_google_cloud_mediatranslation_v1beta1_StreamingTranslateSpeechResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechResponse.Parser));

    [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
    static readonly grpc::Method<global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechRequest, global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechResponse> __Method_StreamingTranslateSpeech = new grpc::Method<global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechRequest, global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechResponse>(
        grpc::MethodType.DuplexStreaming,
        __ServiceName,
        "StreamingTranslateSpeech",
        __Marshaller_google_cloud_mediatranslation_v1beta1_StreamingTranslateSpeechRequest,
        __Marshaller_google_cloud_mediatranslation_v1beta1_StreamingTranslateSpeechResponse);

    /// Service descriptor
    public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
    {
      get { return global::Google.Cloud.MediaTranslation.V1Beta1.MediaTranslationReflection.Descriptor.Services[0]; }
    }

    /// Base class for server-side implementations of SpeechTranslationService
    [grpc::BindServiceMethod(typeof(SpeechTranslationService), "BindService")]
    public abstract partial class SpeechTranslationServiceBase
    {
      ///
      /// Performs bidirectional streaming speech translation: receive results while
      /// sending audio. This method is only available via the gRPC API (not REST).
      ///
      /// <param name="requestStream">Used for reading requests from the client.</param>
      /// <param name="responseStream">Used for sending responses back to the client.</param>
      /// <param name="context">The context of the server-side call handler being invoked.</param>
      /// <returns>A task indicating completion of the handler.</returns>
      [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
      public virtual global::System.Threading.Tasks.Task StreamingTranslateSpeech(grpc::IAsyncStreamReader<global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechRequest> requestStream, grpc::IServerStreamWriter<global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechResponse> responseStream, grpc::ServerCallContext context)
      {
        throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
      }

    }

    /// Client for SpeechTranslationService
    public partial class SpeechTranslationServiceClient : grpc::ClientBase<SpeechTranslationServiceClient>
    {
      /// Creates a new client for SpeechTranslationService
      /// <param name="channel">The channel to use to make remote calls.</param>
      [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
      public SpeechTranslationServiceClient(grpc::ChannelBase channel) : base(channel)
      {
      }
      /// Creates a new client for SpeechTranslationService that uses a custom <c>CallInvoker</c>.
      /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
      [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
      public SpeechTranslationServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
      {
      }
      /// Protected parameterless constructor to allow creation of test doubles.
      [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
      protected SpeechTranslationServiceClient() : base()
      {
      }
      /// Protected constructor to allow creation of configured clients.
      /// <param name="configuration">The client configuration.</param>
      [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
      protected SpeechTranslationServiceClient(ClientBaseConfiguration configuration) : base(configuration)
      {
      }

      ///
      /// Performs bidirectional streaming speech translation: receive results while
      /// sending audio. This method is only available via the gRPC API (not REST).
      ///
      /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
      /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
      /// <param name="cancellationToken">An optional token for canceling the call.</param>
      /// <returns>The call object.</returns>
      [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
      public virtual grpc::AsyncDuplexStreamingCall<global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechRequest, global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechResponse> StreamingTranslateSpeech(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
      {
        return StreamingTranslateSpeech(new grpc::CallOptions(headers, deadline, cancellationToken));
      }
      ///
      /// Performs bidirectional streaming speech translation: receive results while
      /// sending audio. This method is only available via the gRPC API (not REST).
      ///
      /// <param name="options">The options for the call.</param>
      /// <returns>The call object.</returns>
      [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
      public virtual grpc::AsyncDuplexStreamingCall<global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechRequest, global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechResponse> StreamingTranslateSpeech(grpc::CallOptions options)
      {
        return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingTranslateSpeech, null, options);
      }
      /// Creates a new instance of client from given <c>ClientBaseConfiguration</c>.
      [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
      protected override SpeechTranslationServiceClient NewInstance(ClientBaseConfiguration configuration)
      {
        return new SpeechTranslationServiceClient(configuration);
      }
    }

    /// Creates service definition that can be registered with a server
    /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
    [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
    public static grpc::ServerServiceDefinition BindService(SpeechTranslationServiceBase serviceImpl)
    {
      return grpc::ServerServiceDefinition.CreateBuilder()
          .AddMethod(__Method_StreamingTranslateSpeech, serviceImpl.StreamingTranslateSpeech).Build();
    }

    /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
    /// Note: this method is part of an experimental API that can change or be removed without any prior notice.
    /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
    /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
    [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
    public static void BindService(grpc::ServiceBinderBase serviceBinder, SpeechTranslationServiceBase serviceImpl)
    {
      serviceBinder.AddMethod(__Method_StreamingTranslateSpeech, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod<global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechRequest, global::Google.Cloud.MediaTranslation.V1Beta1.StreamingTranslateSpeechResponse>(serviceImpl.StreamingTranslateSpeech));
    }

  }
}
#endregion


text:
/* Generated SBE (Simple Binary Encoding) message codec */
package amaethon.generated;

import uk.co.real_logic.sbe.codec.java.*;
import uk.co.real_logic.agrona.MutableDirectBuffer;

public class FixedPriceAuctionEncoder
{
    public static final int BLOCK_LENGTH = 20;
    public static final int TEMPLATE_ID = 7;
    public static final int SCHEMA_ID = 1;
    public static final int SCHEMA_VERSION = 0;

    private final FixedPriceAuctionEncoder parentMessage = this;
    private MutableDirectBuffer buffer;
    protected int offset;
    protected int limit;
    protected int actingBlockLength;
    protected int actingVersion;

    public int sbeBlockLength()
    {
        return BLOCK_LENGTH;
    }

    public int sbeTemplateId()
    {
        return TEMPLATE_ID;
    }

    public int sbeSchemaId()
    {
        return SCHEMA_ID;
    }

    public int sbeSchemaVersion()
    {
        return SCHEMA_VERSION;
    }

    public String sbeSemanticType()
    {
        return "";
    }

    public int offset()
    {
        return offset;
    }

    public FixedPriceAuctionEncoder wrap(final MutableDirectBuffer buffer, final int offset)
    {
        this.buffer = buffer;
        this.offset = offset;
        limit(offset + BLOCK_LENGTH);
        return this;
    }

    public int size()
    {
        return limit - offset;
    }

    public int limit()
    {
        return limit;
    }

    public void limit(final int limit)
    {
        buffer.checkLimit(limit);
        this.limit = limit;
    }

    public static long durationInNanosNullValue()
    {
        return -9223372036854775808L;
    }

    public static long durationInNanosMinValue()
    {
        return -9223372036854775807L;
    }

    public static long durationInNanosMaxValue()
    {
        return 9223372036854775807L;
    }
    public FixedPriceAuctionEncoder durationInNanos(final long value)
    {
        CodecUtil.int64Put(buffer, offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }

    public static long priceNullValue()
    {
        return -9223372036854775808L;
    }

    public static long priceMinValue()
    {
        return -9223372036854775807L;
    }

    public static long priceMaxValue()
    {
        return 9223372036854775807L;
    }
    public FixedPriceAuctionEncoder price(final long value)
    {
        CodecUtil.int64Put(buffer, offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }

    public static int quantityNullValue()
    {
        return -2147483648;
    }

    public static int quantityMinValue()
    {
        return -2147483647;
    }

    public static int quantityMaxValue()
    {
        return 2147483647;
    }
    public FixedPriceAuctionEncoder quantity(final int value)
    {
        CodecUtil.int32Put(buffer, offset + 16, value, java.nio.ByteOrder.LITTLE_ENDIAN);
        return this;
    }

    public static int nameId()
    {
        return 4;
    }

    public static String nameCharacterEncoding()
    {
        return "UTF-8";
    }

    public static String nameMetaAttribute(final MetaAttribute metaAttribute)
    {
        switch (metaAttribute)
        {
            case EPOCH: return "unix";
            case TIME_UNIT: return "nanosecond";
            case SEMANTIC_TYPE: return "";
        }

        return "";
    }

    public int putName(final uk.co.real_logic.agrona.DirectBuffer src, final int srcOffset, final int length)
    {
        final int sizeOfLengthField = 1;
        final int limit = limit();
        limit(limit + sizeOfLengthField + length);
        CodecUtil.uint8Put(buffer, limit, (short)length);
        buffer.putBytes(limit + sizeOfLengthField, src, srcOffset, length);

        return length;
    }

    public int putName(final byte[] src, final int srcOffset, final int length)
    {
        final int sizeOfLengthField = 1;
        final int limit = limit();
        limit(limit + sizeOfLengthField + length);
        CodecUtil.uint8Put(buffer, limit, (short)length);
        buffer.putBytes(limit + sizeOfLengthField, src, srcOffset, length);

        return length;
    }

    public void name(final String value)
    {
        final byte[] bytes;
        try
        {
            bytes = value.getBytes("UTF-8");
        }
        catch (final java.io.UnsupportedEncodingException ex)
        {
            throw new RuntimeException(ex);
        }

        final int length = bytes.length;
        final int sizeOfLengthField = 1;
        final int limit = limit();
        limit(limit + sizeOfLengthField + length);
        CodecUtil.uint8Put(buffer, limit, (short)length);
        buffer.putBytes(limit + sizeOfLengthField, bytes, 0, length);
    }
}


text:
<?php

namespace frontend\modules\news\controllers;

use common\models\News;
use yii\helpers\VarDumper;
use yii\web\HttpException;
use yii\data\ActiveDataProvider;

class DefaultController extends \yii\web\Controller
{
    public function actionIndex($year = null, $month = null, $subject_id = null)
    {

        $where = [];
        if(!empty($year) && empty($month)) {
            $where = $where + ["strftime('%Y', `publicated_at`, 'unixepoch', 'localtime' )"=>$year];
        }
        if(!empty($year) && !empty($month)) {
            $where = $where + ["strftime('%Y-%m', `publicated_at`, 'unixepoch', 'localtime' )"=>$year.'-'.$month];
        }
        if(!empty($subject_id)) {
            $where = $where + ["subject_id"=>(int)$subject_id];
        }
//VarDumper::dump($where,5,1);die;
        $dataProvider = new ActiveDataProvider([
            'query' => \common\models\News::find()->where($where),
            'pagination' => [
                'pageSize' => 5,
            ],
        ]);

        return $this->render('index', [
            'dataProvider' => $dataProvider
        ]);
    }

    public function actionView($id)
    {
        $model = News::findOne((int)$id);

        if(empty($model))
            throw new HttpException(404, 'Page not found. ');

        return $this->render('view', ['model'=>$model]);
    }

}


text:
Java tool to synchronize user data from one nextcloud server to another.

In the first step the tool copy only not existend data from the input nextcloud to the output nextcloud.

(input nextcloud) ---> (temporarly local file) ---> (output nextcloud)


text:
<?php
namespace Eloquent\Cache\Exceptions;

class InvalidSquirrelModelException extends SquirrelException
{
}


text:
/**
 * I'm going to be stripped out by our minification filter...
 */
alert("Hi! I'm from a modular js file, only included on the page when my partial template is included!");


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Nghia Luong's blog - [Achievement] Being in Top 100 Best Blogs for iOS Developers from SoftwareHow.com </title>
  <link rel="shortcut icon" href="/assets/images/favicon.ico">
  <link rel="stylesheet" href="/assets/css/style.css">
  <link rel="alternate" type="application/rss+xml" title="My Blog" href="/feed.xml">
  <link rel="stylesheet" href="/assets/css/highlight.css">

         ← Home

        About

    Subscribe

[Achievement] Being in Top 100 Best Blogs for iOS Developers from SoftwareHow.com

January 9, 2016

Starting year 2016 with a news could not be more perfect - my personal blog has listed into of Top 100 Best Blogs for iOS Developers from SoftwareHow.com; that is cool, right? You guys could take a look at this link.

This will be a big power for me to have a big jump in 2016, promise that. I will try to update this with many valuable post for iOS development field in general, and other aspects in life as well.

And … I've got this badge:

Say cheers, let's get some drinks. :)

            Nghia Luong
            Work hard, play harder

         Tweet

 Share

Read more

                [Career] Cuối năm và chuyện lương lậu.Jan 05

                [macOS] Khi Mac không thực sự sleep.Sep 09

                [Life] Sức mạnh của SỰ TẬP TRUNGJul 12

                [Objective C] EqualityApr 17

                [Code] Pass by reference.Dec 14

                [Code] Interesting BitmaskSep 25

                [Life] Câu chuyện về Micheal Phelps của tôi.Aug 14

                [Life] Phong cách làm việc của người Đan mạchJun 29

                [iOS] Switching storage filesApr 20

                [Life] Năm nay cưới chưa?Feb 17

                [Objective-c] Primitive type initialization.Jan 09

                [Achievement] Being in Top 100 Best Blogs for iOS Developers from SoftwareHow.com Jan 09

                [iOS] Retain cycle in Blocks.Dec 29

                [iOS] Pungent stuff: Retain cycleDec 20

                [iOS] How to simulate static quick actions on xcode 7Oct 16

                [Life] Văn hoá bán hàng của người Việt Nam.Sep 20

                [Objective-C] Random problems.Sep 16

                [Review] Pebble Time & Apple WatchSep 13

                [Code] Check if characters of a given string can be rearranged to form a palindromeAug 31

                [Code] Project Euler #13: Large using objective-c.Aug 25

                [Life] Just a minor happinessAug 23

                [Code] Big Number in Objective-CAug 22

                Project Euler: Problem 11 - Largest product in a grid using Objective-CAug 14

                [iOS] Lazy loading in iOSAug 05

                [Code] Intelligent Girl ProblemJul 27

                NSLog stuffJul 22

                Why Hello World?Jul 21


text:
package org.sakaiproject.nakamura.api.user;

import org.apache.sling.servlets.post.Modification;
import org.sakaiproject.nakamura.api.lite.Session;
import org.sakaiproject.nakamura.api.lite.authorizable.Authorizable;

import java.util.Map;

/**
 *
 */
public interface LiteAuthorizablePostProcessor {

  /**
   * Method which will be called after a Sakai user or group has been created or modified,
   * and before the Sakai user or group is deleted.
   *
   * @param authorizable
   * @param session
   * @param change describes what sort of change has occurred (or is about to occur)
   * @param parameters a map of non-persisted optional properties for whatever use
   *        the processing service sees fit
   * @throws Exception
   */
  void process(Authorizable authorizable, Session session, Modification change, Map<String, Object[]> parameters)
      throws Exception;

}


text:
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://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.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

'use strict';

function main(parent, endpointId, endpoint) {
  // [START ids_v1_generated_IDS_CreateEndpoint_async]
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The endpoint's parent.
   */
  // const parent = 'abc123'
  /**
   *  Required. The endpoint identifier. This will be part of the endpoint's
   *  resource name.
   *  This value must start with a lowercase letter followed by up to 62
   *  lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
   *  Values that do not match this pattern will trigger an INVALID_ARGUMENT
   *  error.
   */
  // const endpointId = 'abc123'
  /**
   *  Required. The endpoint to create.
   */
  // const endpoint = {}
  /**
   *  An optional request ID to identify requests. Specify a unique request ID
   *  so that if you must retry your request, the server will know to ignore
   *  the request if it has already been completed. The server will guarantee
   *  that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and t
   *  he request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Ids library
  const {IDSClient} = require('@google-cloud/ids').v1;

  // Instantiates a client
  const idsClient = new IDSClient();

  async function callCreateEndpoint() {
    // Construct request
    const request = {
      parent,
      endpointId,
      endpoint,
    };

    // Run request
    const [operation] = await idsClient.createEndpoint(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateEndpoint();
  // [END ids_v1_generated_IDS_CreateEndpoint_async]
}

process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});
main(...process.argv.slice(2));


text:
<?xml version="1.0" encoding="UTF-8" ?>
<schemaMeta xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schemaspy.org/xsd/schemaMeta.xsd" >
    <tables>
        <table name="ACCOUNT">
            <column name="this_is_new" type="INT" />
        </table>
    </tables>
</schemaMeta>


text:
package de.uniulm.omi.cloudiator.visor.config;

import java.util.Properties;

/**
 * Created by daniel on 08.04.15.
 */
public interface ConfigurationAccess {

    public Properties getProperties();

}


text:
Angular text animation plugin

[![npm](https://img.shields.io/badge/demo-online-ed1c46.svg)](https://murhafsousli.github.io/ngx-teximate)
[![npm](https://img.shields.io/npm/v/ngx-teximate.svg?maxAge=2592000?style=plastic)](https://www.npmjs.com/package/ngx-teximate)
[![Travis branch](https://travis-ci.org/MurhafSousli/ngx-teximate.svg?branch=master)](https://travis-ci.org/MurhafSousli/ngx-teximate)
[![npm](https://img.shields.io/npm/dt/ngx-teximate.svg?maxAge=2592000?style=plastic)](https://www.npmjs.com/package/ngx-teximate)
[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/ngx-teximate.svg)](https://bundlephobia.com/result?p=ngx-teximate)
[![npm](https://img.shields.io/npm/l/express.svg?maxAge=2592000)](https://github.com/MurhafSousli/ngx-teximate/blob/master/LICENSE)

___

A text animation plugin built on top of Angular animation engine

## Installation

**NPM**

```
npm install -S ngx-teximate ng-animate
```

**YARN**

```
yarn add ngx-teximate ng-animate
```

 > **NOTE:** `ng-animate` package is just a collection of reusable animations and it is not required for Teximate to work

## Usage

Import **TeximateModule** in your root module

```ts
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { TeximateModule } from 'ngx-teximate';

@NgModule({
  imports: [
    BrowserAnimationsModule,  // Add this only in the root module
    TeximateModule
  ]
})
```

1. Add `<teximate>` component into your template
2. Create a `TextAnimation` object and pass it to on of these inputs `[enter]` `[leave]` `[animation]`.
3. Pick the animation you like from `ng-animate` and set it in the `TextAnimation` object

#### Example:

```ts
import { Component } from '@angular/core';
import { TextAnimation } from 'ngx-teximate';
import { fadeInDown } from 'ng-animate';

@Component({
  selector: 'app-root',
  template: `
    <teximate [text]="text" [enter]="enterAnimation"></teximate>
  `
})
export class AppComponent {

  text = 'Lorem ipsum dolor sit amet.';

  enterAnimation: TextAnimation = {
    animation: fadeInDown,
    delay: 50,
    type: 'letter'
  };
}
```

There are 3 main animations inputs `[enter]`, `[leave]` and `[animation]`, but you can still register more animations

#### Example:

```ts
import { Component, ViewChild, AfterViewInit } from '@angular/core';
import { TextAnimation } from 'ngx-teximate';
import { fadeInDown } from 'ng-animate';

@Component({
  selector: 'app-root',
  template: `
    <teximate [text]="text"></teximate>
    <button (click)="play()"></button>
  `
})
export class AppComponent implements AfterViewInit {

  @ViewChild(Teximate): teximate: Teximate;

  text = 'Lorem ipsum dolor sit amet.';

  ngAfterViewInit() {
    const customAnimation: TextAnimation = {
      id: 'custom',
      animation: fadeInDown,
      delay: 50,
      type: 'letter'
    };
    this.teximate.registerAnimation(customAnimation);
  }

  play() {
    if (this.teximate.players.has('custom')) {
      this.teximate.players.get('custom').play();
    }
  }
}
```

## API

| Name                     | type          | Description                                                      |
| ------------------------ |-------------- | ---------------------------------------------------------------- |
| **[text]**               | string        | Text to animate                                                  |
| **[animation]**          | TextAnimation | Default animation, played using `teximate.defaultPlayer.play()`  |
| **[enter]**              | TextAnimation | Enter animation, played on init                                  |
| **[leave]**              | TextAnimation | Leave animation, played on destroy (WIP)                         |
| **(play)**               | string        | Stream that emits when text animation is played                  |
| **(finish)**             | string        | Stream that emits when text animation is finished                |
| **(paragraphClick)**     | MouseEvent    | Stream that emits when a paragraph is clicked                    |
| **(wordClick)**          | MouseEvent    | Stream that emits when a word is clicked                         |
| **(letterClick)**        | MouseEvent    | Stream that emits when a letter is clicked                       |
| **(paragraphHover)**     | MouseEvent    | Stream that emits when a paragraph is hovered                    |
| **(wordHover)**          | MouseEvent    | Stream that emits when a word is hovered                         |
| **(letterHover)**        | MouseEvent    | Stream that emits when a letter is hovered                       |

See the [stackblitz demo](https://stackblitz.com/edit/ngx-teximate).

## Issues

If you identify any errors in this module, or have an idea for an improvement, please open an [issue](https://github.com/MurhafSousli/ngx-teximate/issues).

## Support

Please give **Teximate** a :star:

[![npm](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/bePatron?u=5594898)

## Author

 **Murhaf Sousli**

 - [github/murhafsousli](https://github.com/MurhafSousli)
 - [twitter/murhafsousli](https://twitter.com/MurhafSousli)


text:
A dialogue engine development framework, based on response-pairs.

One response-pair consists of 3 components:
- matcher
- scorer
- generator

And, one-time response has 3 phases:
1. matching
2. scoring
3. generating

Matching is pattern-matchings by the matcher with the user utterance.
Scoring is computations the fitness of the response-pair with the user utterance.
Finally, generating is a generation of a bot utterance.

## Installation
```
pip install git+https://github.com/carrotflakes/invada.git
```

## License
This software is available under the MIT License.


text:
const co = require('co');
const _ = require('lodash');
const eventBus = require('../events/event-bus');
const SocketConnectEvent = require('../events/SocketConnectEvent');
const endpoints = require('./endpoints');
const rules = require('./rules');
const validateRequest = require('./validateRequest');
const SERVER_ERROR = { error: true };

endpoints.forEach(endpoint => {
    replaceEndpointHandle(endpoint);
    replaceEndpointRules(endpoint);
});

eventBus.register(SocketConnectEvent, onSocketConnect);

function onSocketConnect(event) {
    const socket = event.socket;

    endpoints.forEach(endpoint => {
        registerEndpoint(socket, endpoint);
    });
}

function registerEndpoint(socket, endpoint) {
    socket.on(endpoint.event, (request, callback) => {
        onEndpointEvent(endpoint, request, callback);
    });
}

function onEndpointEvent(endpoint, request, callback) {
    const rules = endpoint.rules;
    const result = validateRequest(request, rules);

    if (!result.valid) {
        return callback({error: result.error});
    }

    handleRequest(endpoint, request, callback);
}

function handleRequest(endpoint, request, callback) {
    endpoint.handle(request)
        .then(response => {
            return callback(response);
        })
        .catch(err => {
            console.error(err.stack);

            return callback(SERVER_ERROR);
        });
}

function requireEndpoint(name) {
    return require('./endpoints/' + name);
}

function requireRule(name) {
    return require('./rules/' + name);
}

function replaceEndpointHandle(endpoint) {
    endpoint.handle = co.wrap(endpoint.handle);
}

function replaceEndpointRules(endpoint) {
    const rules = endpoint.rules;
    const propertyNames = Object.keys(rules);

    propertyNames.forEach(propertyName => {
        const propertyRules = rules[propertyName];
        const ruleNames = Object.keys(propertyRules);

        ruleNames.forEach(ruleName => {
            const rule = findRuleByName(ruleName);
            const ruleOptions = propertyRules[ruleName];
            propertyRules[ruleName] = createRule(rule, ruleOptions);
        });
    });
}

function findRuleByName(name) {
    const rule = _.find(rules, { name });

    if(!rule) {
        throw new Error('No rule found for: ' + name + '!');
    }

    return rule;
}

function createRule(rule, ruleOptions) {
    return value => {
        return rule.validate(value, ruleOptions);
    };
}


text:
package org.b3mn.poem.sketching;

import java.util.*;
import org.apache.batik.svggen.SVGGeneratorContext;
import org.apache.batik.svggen.StyleHandler;
import org.w3c.dom.*;

public class CSSStyleHandler implements StyleHandler {

    // The CDATA section that holds the CSS stylesheet.
    private CDATASection styleSheet;
    private SVGGeneratorContext ctx;

    // Build the handler with a reference to the stylesheet section.
    public CSSStyleHandler(CDATASection styleSheet, SVGGeneratorContext ctx) {
        this.styleSheet = styleSheet;
        this.ctx		= ctx;
    }

    // invokes other setStyle Method with required parameter SVGGeneratorContext
    public void setStyle(Element element, Map<String,String> styleMap){
    	this.setStyle(element, styleMap, this.ctx);
    }

    // parameter context is necessary to comply with the interface StyleHandler
    @SuppressWarnings("unchecked")
	public void setStyle(Element element, Map styleMap, SVGGeneratorContext context) {
        Iterator iter = styleMap.keySet().iterator();

        // Create a new class in the style sheet.
        String id = context.getIDGenerator().generateID("C");
        styleSheet.appendData("."+ id +" {");

        // Append each key/value pair.
        while (iter.hasNext()) {
            String key = (String) iter.next();
            String value = (String) styleMap.get(key);
            styleSheet.appendData(key + ":" + value + ";");
        }

        styleSheet.appendData("}\n");

        // Reference the stylesheet class on the element to be styled.
        element.setAttributeNS(null, "class", id);
    }
}


text:
namespace aliyun {
struct YundunVulScanLogRequestType {
  std::string jst_owner_id;
  std::string page_number;
  std::string page_size;
  std::string instance_id;
  std::string vul_status;
};
struct YundunVulScanLogVulScanLogType {
  int id;
  std::string type;
  std::string url;
  std::string help_address;
  std::string vul_parameter;
  int status;
};
struct YundunVulScanLogResponseType {
  std::vector<YundunVulScanLogVulScanLogType> log_list;
  std::string start_time;
  std::string end_time;
  int page_number;
  int page_size;
  int total_count;
};
} // end namespace
#endif


text:
import {DOMElement} from './dom';

// Squashing text nodes allows to combine multiple text nodes into one and write
// to `Output` instance only once. For example, <Text>hello{' '}world</Text>
// is actually 3 text nodes, which would result 3 writes to `Output`.
//
// Also, this is necessary for libraries like ink-link (https://github.com/sindresorhus/ink-link),
// which need to wrap all children at once, instead of wrapping 3 text nodes separately.
const squashTextNodes = (node: DOMElement): string => {
	let text = '';

	if (node.childNodes.length > 0) {
		for (const childNode of node.childNodes) {
			let nodeText = '';

			if (childNode.nodeName === '#text') {
				nodeText = childNode.nodeValue;
			} else {
				if (
					childNode.nodeName === 'ink-text' ||
					childNode.nodeName === 'ink-virtual-text'
				) {
					nodeText = squashTextNodes(childNode);
				}

				// Since these text nodes are being concatenated, `Output` instance won't be able to
				// apply children transform, so we have to do it manually here for each text node
				if (
					nodeText.length > 0 &&
					typeof childNode.internal_transform === 'function'
				) {
					nodeText = childNode.internal_transform(nodeText);
				}
			}

			text += nodeText;
		}
	}

	return text;
};

export default squashTextNodes;


text:
/*
 *
 *  o                        o     o   o         o
 *  |             o          |     |\ /|         | /
 *  |    o-o o--o    o-o  oo |     | O |  oo o-o OO   o-o o   o
 *  |    | | |  | | |    | | |     |   | | | |   | \  | |  \ /
 *  O---oo-o o--O |  o-o o-o-o     o   o o-o-o   o  o o-o   o
 *              |
 *           o--o
 *  o--o              o               o--o       o    o
 *  |   |             |               |    o     |    |
 *  O-Oo   oo o-o   o-O o-o o-O-o     O-o    o-o |  o-O o-o
 *  |  \  | | |  | |  | | | | | |     |    | |-' | |  |  \
 *  o   o o-o-o  o  o-o o-o o o o     o    | o-o o  o-o o-o
 *
 *  Logical Markov Random Fields (LoMRF).
 *
 *
 */

package lomrf.app

import lomrf.mln.model.MLN
import lomrf.logic.AtomSignature
import java.io.PrintStream
import lomrf.util.logging.Implicits._

/**
  * Command line tool for knowledge base difference checking.
  */
object KBDifferenceCLI extends CLIApp {

  // Input file(s) (path)
  var inputFileName: Option[IndexedSeq[String]] = None

  // Evidence file(s) (path)
  var evidenceFileName: Option[IndexedSeq[String]] = None

  // Prefix for the output difference files
  var prefixOpt: Option[String] = None

  opt("i", "input", "<files>", "At least two comma separated input files", {
    v: String =>
      if (v.nonEmpty) {
        val fileNames = v.split(',').map(_.trim)

        if (fileNames.length < 2)
          logger.fatal("At least two input files are required in order to compute difference.")

        inputFileName = Some(fileNames)
      }
  })

  opt("e", "evidence", "<db files>", "At least two comma separated evidence database files", {
    v: String =>
      if (v.nonEmpty) {
        val fileNames = v.split(',').map(_.trim)

        if (fileNames.length < 2)
          logger.fatal("At least two evidence files are required in order to compute difference.")

        evidenceFileName = Some(fileNames)
      }
  })

  opt("p", "prefix", "<string>", "Prefix for the output difference files (<prefix>-input_filename_1-input_filename_2.diff)", {
    v: String => prefixOpt = Some(v.trim)
  })

  flagOpt("h", "help", "Print usage options.", {
    println(usage)
    sys.exit(0)
  })

  // Main:
  if (args.length == 0) println(usage)
  else if (parse(args)) compare(
    inputFileName.getOrElse(logger.fatal("Please define the input files.")),
    evidenceFileName.getOrElse(logger.fatal("Please define the evidence files.")),
    prefixOpt
  )

  private def compare(source: IndexedSeq[String], evidence: IndexedSeq[String], prefixOpt: Option[String]) {

    if (source.size != evidence.size)
      logger.fatal("The number of input files and evidence files must be the same.")

    val combinations = source.view.zip(evidence).combinations(2).zipWithIndex

    val prefix = prefixOpt.map(_.trim) match {
      case Some(p) if p.nonEmpty => p + "-"
      case _                     => ""
    }

    for {
      (combination, _) <- combinations
      (sourceAlpha, evidenceAlpha) = combination.head
      (sourceBeta, evidenceBeta) = combination.last
      mlnAlpha = MLN.fromFile(sourceAlpha, Set.empty[AtomSignature], evidenceAlpha)
      mlnBeta = MLN.fromFile(sourceBeta, Set.empty[AtomSignature], evidenceBeta)
    } {

      logger.info(s"\nSource KB 1: $sourceAlpha$mlnAlpha\nSource KB 2: $sourceBeta$mlnBeta")

      val targetFileName = prefix +
        sourceAlpha.substring(0, sourceAlpha.lastIndexOf('.')) + "-" +
        sourceBeta.substring(0, sourceBeta.lastIndexOf('.'))

      val output = new PrintStream(targetFileName)

      val diff1 = mlnAlpha.clauses.par.filter(!mlnBeta.clauses.contains(_))
      val diff2 = mlnBeta.clauses.par.filter(!mlnAlpha.clauses.contains(_))

      if (diff1.nonEmpty) {
        output.println(s"\nKB 1 ($sourceAlpha) does not contain the following clauses:\n")
        diff1.seq.foreach(clause => output.println(clause.toText()))
      }

      if (diff2.nonEmpty) {
        output.println(s"\nKB 2 ($sourceBeta) does not contain the following clauses:\n")
        diff2.seq.foreach(clause => output.println(clause.toText()))
      }

      if (diff1.isEmpty && diff2.isEmpty) logger.info("KBs are identical!")

      output.flush()
      output.close()
    }
  }
}