text:
using System;
using System.Collections.Generic;
using System.Linq;

using Xunit;
using JohnChess.Moves;
using JohnChess.Pieces;

namespace JohnChess.Tests.Pieces
{
    public class PawnTests
    {
        private Board CreateBoardWithPawnAt(PieceColor color, Position position)
        {
            var board = Board.NewEmptyBoard();
            board.AddPiece(new PieceBuilder(PieceType.Pawn)
                .As(color)
                .At(position)
                .Create());

            return board;
        }

        [Fact]
        public void WhiteHasCorrectNormalMovesOnRank2()
        {
            var wPawnC2Board = CreateBoardWithPawnAt(PieceColor.White, new Position(File.C, Rank._2));
            var wPawnC2Moves = wPawnC2Board.GetPossibleMoves(PieceColor.White);
            var wPawnC2NormalMoves = (from m in wPawnC2Moves where m.Type == MoveType.NormalPiece select m).ToList();
            var wPawnC2Positions = (from m in wPawnC2Moves select m.NormalPieceMove.NewPosition).ToList();
            // For this scenario, all moves should be normal.
            Assert.Equal(wPawnC2NormalMoves.Count, wPawnC2Moves.Count);
            Assert.Equal(wPawnC2Moves.Count, 2);
            // This pawn can go C3 and C4
            Assert.Contains(new Position(File.C, Rank._3), wPawnC2Positions);
            Assert.Contains(new Position(File.C, Rank._4), wPawnC2Positions);

            var takesMoves = (from m in wPawnC2NormalMoves where m.PieceCaptured select m).ToList();
            Assert.Equal(takesMoves.Count, 0);
        }

        [Fact]
        public void WhiteHasCorrectNormalMovesOnNonRank2()
        {
            var wPawnC3Board = CreateBoardWithPawnAt(PieceColor.White, new Position(File.C, Rank._3));
            var wPawnC3Moves = wPawnC3Board.GetPossibleMoves(PieceColor.White);
            var wPawnC3NormalMoves = (from m in wPawnC3Moves where m.Type == MoveType.NormalPiece select m).ToList();
            var wPawnC3Positions = (from m in wPawnC3Moves select m.NormalPieceMove.NewPosition).ToList();
            // For this scenario, all moves should be normal.
            Assert.Equal(wPawnC3NormalMoves.Count, wPawnC3Moves.Count);
            Assert.Equal(wPawnC3Moves.Count, 1);
            // This pawn can only go C4
            var onlyMove = wPawnC3Positions[0];
            Assert.Equal(new Position(File.C, Rank._4), onlyMove);

            var takesMoves = (from m in wPawnC3NormalMoves where m.PieceCaptured select m).ToList();
            Assert.Equal(takesMoves.Count, 0);
        }

        [Fact]
        public void BlackHasCorrectNormalMovesOnRank7()
        {
            var bPawnC7Board = CreateBoardWithPawnAt(PieceColor.Black, new Position(File.C, Rank._7));
            var bPawnC7Moves = bPawnC7Board.GetPossibleMoves(PieceColor.Black);
            var bPawnC7NormalMoves = (from m in bPawnC7Moves where m.Type == MoveType.NormalPiece select m).ToList();
            var bPawnC7Positions = (from m in bPawnC7Moves select m.NormalPieceMove.NewPosition).ToList();
            // For this scenario, all moves should be normal.
            Assert.Equal(bPawnC7NormalMoves.Count, bPawnC7Moves.Count);
            Assert.Equal(bPawnC7Moves.Count, 2);
            // This pawn can go C3 and C4
            Assert.Contains(new Position(File.C, Rank._6), bPawnC7Positions);
            Assert.Contains(new Position(File.C, Rank._5), bPawnC7Positions);

            var takesMoves = (from m in bPawnC7NormalMoves where m.PieceCaptured select m).ToList();
            Assert.Equal(takesMoves.Count, 0);
        }

        [Fact]
        public void BlackHasCorrectNormalMovesOnNonRank7()
        {
            var bPawnC6Board = CreateBoardWithPawnAt(PieceColor.Black, new Position(File.C, Rank._6));
            var bPawnC6Moves = bPawnC6Board.GetPossibleMoves(PieceColor.Black);
            var bPawnC6NormalMoves = (from m in bPawnC6Moves where m.Type == MoveType.NormalPiece select m).ToList();
            var bPawnC6Positions = (from m in bPawnC6Moves select m.NormalPieceMove.NewPosition).ToList();
            // For this scenario, all moves should be normal.
            Assert.Equal(bPawnC6NormalMoves.Count, bPawnC6Moves.Count);
            Assert.Equal(bPawnC6Moves.Count, 1);
            // This pawn can only go C5
            var onlyMove = bPawnC6Positions[0];
            Assert.Equal(new Position(File.C, Rank._5), onlyMove);

            var takesMoves = (from m in bPawnC6NormalMoves where m.PieceCaptured select m).ToList();
            Assert.Equal(takesMoves.Count, 0);
        }

        [Fact]
        public void HasCorrectCaptureMoves()
        {
            var pawnC2Board = CreateBoardWithPawnAt(PieceColor.White, new Position(File.C, Rank._2));
            var enemyPawnPos1 = new Position(File.B, Rank._3);
            var enemyPawnPos2 = new Position(File.D, Rank._3);
            pawnC2Board.AddPiece(new PieceBuilder(PieceType.Pawn)
                .As(PieceColor.Black)
                .At(enemyPawnPos1)
                .Create());
            pawnC2Board.AddPiece(new PieceBuilder(PieceType.Pawn)
                .As(PieceColor.Black)
                .At(enemyPawnPos2)
                .Create());

            var moves = pawnC2Board.GetPossibleMoves(PieceColor.White);
            var normalMoves = (from m in moves where m.Type == MoveType.NormalPiece select m).ToList();
            Assert.Equal(moves.Count, normalMoves.Count);

            var takesMoves = (from m in normalMoves where m.PieceCaptured select m.NormalPieceMove).ToList();
            var takesMovesPositions = (from m in takesMoves select m.NewPosition).ToList();
            Assert.Equal(takesMovesPositions.Count, 2);
            Assert.Contains(new Position(File.B, Rank._3), takesMovesPositions);
            Assert.Contains(new Position(File.D, Rank._3), takesMovesPositions);
        }

        [Fact]
        public void PromotionsAvailableStraightAhead()
        {
            var pawnD7Board = CreateBoardWithPawnAt(PieceColor.White, new Position(File.D, Rank._7));
            var moves = pawnD7Board.GetPossibleMoves(PieceColor.White);

            // There should be 4 moves - one for each promoting
            // piece type for pD7 promotes on D8
            Assert.Equal(moves.Count, 4);
            var promotingMoves = (from m in moves
                                  where m.Type == MoveType.Promotion
                                  select m.Promotion).ToList();
            var promotingTypes = (from m in promotingMoves select m.NewPieceType).ToList();
            Assert.Equal(moves.Count, promotingMoves.Count);

            foreach (var promotingPieceType in PromotionMove.PromotingPieceType.PromotingPieceTypes)
            {
                Assert.Contains(promotingPieceType, promotingTypes);
            }
        }

        [Fact]
        public void PawnDoesntMoveToLastRankWithoutPromoting()
        {
            var pawnC7Board = CreateBoardWithPawnAt(PieceColor.White, new Position(File.C, Rank._7));

            var enemyKnight1Pos = new Position(File.B, Rank._8);
            var enemyKnight2Pos = new Position(File.D, Rank._8);

            pawnC7Board.AddPiece(new PieceBuilder(PieceType.Knight)
                .As(PieceColor.Black)
                .At(enemyKnight1Pos)
                .Create());

            pawnC7Board.AddPiece(new PieceBuilder(PieceType.Knight)
                .As(PieceColor.Black)
                .At(enemyKnight2Pos)
                .Create());

            var moves = pawnC7Board.GetPossibleMoves(PieceColor.White);
            // Pawn can take on B7 or D8, or advance to C8. All are promotions,
            // and there should be four moves per (for the four different promoting
            // piece types), so 12 total.
            Assert.Equal(moves.Count, 12);
            var promotingMoves = (from m in moves
                                  where m.Type == MoveType.Promotion
                                  select m.Promotion).ToList();
            // All moves must be promotions, a pawn can't reach the last rank
            // without promoting
            Assert.Equal(promotingMoves.Count, moves.Count);
        }

        [Fact]
        public void PawnPromotionPerformedSuccessfully()
        {
            var pawnD7Board = CreateBoardWithPawnAt(PieceColor.White, new Position(File.D, Rank._7));
            var moves = pawnD7Board.GetPossibleMoves(PieceColor.White);
            var promotingMoves = (from m in moves
                                  where m.Type == MoveType.Promotion
                                  select m).ToList();
            var promotion = promotingMoves[0];
            pawnD7Board = pawnD7Board.PerformMove(promotion);

            Assert.Equal(pawnD7Board.WhitePieces.Count, 1);
            var whitePiece = pawnD7Board.WhitePieces[0];
            Assert.Equal(whitePiece.Type, promotion.Promotion.NewPieceType.Type);
            Assert.Equal(whitePiece.MoveHistory.Count, promotion.Promotion.PromotingPiece.MoveHistory.Count + 1);
            Assert.Equal(pawnD7Board[File.D, Rank._8], whitePiece);
        }

        [Fact]
        public void PawnSeesEnPassant()
        {
            var pawnD5Board = CreateEnPassantBoardSetup();

            var whitePawnResponses = pawnD5Board.GetPossibleMoves(PieceColor.White);
            var enPassantMoves = (from m in whitePawnResponses
                                  where m.Type == MoveType.EnPassant
                                  select m.EnPassant).ToList();
            Assert.Equal(enPassantMoves.Count, 1);
            var enPassantMove = enPassantMoves[0];
            Assert.Equal(enPassantMove.DestinationPosition, new Position(File.C, Rank._6));
            Assert.Equal(enPassantMove.CapturePosition, new Position(File.C, Rank._5));
        }

        [Fact]
        public void PawnCantEnPassantWhenAdvanceWasntLatestMove()
        {
            var pawnD5Board = CreateEnPassantBoardSetup();
            var blackPiece = pawnD5Board.BlackPieces[0];
            blackPiece.ClearHistory();

            var whitePawnResponses = pawnD5Board.GetPossibleMoves(PieceColor.White);
            var enPassantMoves = (from m in whitePawnResponses
                                  where m.Type == MoveType.EnPassant
                                  select m.EnPassant).ToList();
            Assert.Equal(enPassantMoves.Count, 0);
        }

        [Fact]
        public void PawnEnPassantPerformedSuccessfully()
        {
            var enPassantBoard = CreateEnPassantBoardSetup();
            var moves = enPassantBoard.GetPossibleMoves(PieceColor.White);
            var enPassantMove = (from m in moves
                                 where m.Type == MoveType.EnPassant
                                 select m).First();
            enPassantBoard = enPassantBoard.PerformMove(enPassantMove);

            var whitePieces = enPassantBoard.WhitePieces;
            Assert.Equal(whitePieces.Count, 1);
            var wp = whitePieces[0];
            Assert.Equal(wp.Position, new Position(File.C, Rank._6));
        }

        private Board CreateEnPassantBoardSetup()
        {
            var pawnD5Board = CreateBoardWithPawnAt(PieceColor.White, new Position(File.D, Rank._5));
            var enemyPawnPosition = new Position(File.C, Rank._7);
            pawnD5Board.AddPiece(new PieceBuilder(PieceType.Pawn)
                .As(PieceColor.Black)
                .At(enemyPawnPosition)
                .Create());

            var blackMoves = pawnD5Board.GetPossibleMoves(PieceColor.Black);
            var blackPawnAdvance2Move = (from m in blackMoves
                                         where m.Type == MoveType.NormalPiece &&
                                         m.NormalPieceMove.NewPosition.Equals(new Position(File.C, Rank._5))
                                         select m).First();

            return pawnD5Board.PerformMove(blackPawnAdvance2Move);
        }
    }
}


text:
/*
 * 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
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.pgasync.impl;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;

import java.sql.Date;
import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.TimeZone;

import static com.github.pgasync.impl.io.IO.bytes;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

/**
 * Tests for parameter binding.
 *
 * @author Antti Laisi
 */
public class PreparedStatementTest {

    @ClassRule
    public static DatabaseRule dbr = new DatabaseRule();

    @BeforeClass
    public static void create() {
        drop();
        dbr.query("CREATE TABLE PS_TEST("
                + "LONG INT8,INT INT4,SHORT INT2, BYTE INT2,"
                + "CHAR CHAR(1), STRING VARCHAR(255), CLOB TEXT,"
                + "TIME TIME, DATE DATE, TS TIMESTAMP,"
                + "BYTEA BYTEA" + ")");
    }

    @AfterClass
    public static void drop() {
        dbr.query("DROP TABLE IF EXISTS PS_TEST");
    }

    @Test
    public void shouldBindLong() {
        dbr.query("INSERT INTO PS_TEST(LONG) VALUES ($1)", asList(Long.MIN_VALUE));
        assertEquals(Long.MIN_VALUE, dbr.query("SELECT LONG FROM PS_TEST WHERE LONG = $1", asList(Long.MIN_VALUE))
                .row(0).getLong(0).longValue());
    }

    @Test
    public void shouldBindInt() {
        dbr.query("INSERT INTO PS_TEST(INT) VALUES ($1)", asList(Integer.MAX_VALUE));
        assertEquals(Integer.MAX_VALUE, dbr.query("SELECT INT FROM PS_TEST WHERE INT = $1", asList(Integer.MAX_VALUE))
                .row(0).getInt(0).intValue());
    }

    @Test
    public void shouldBindShort() {
        dbr.query("INSERT INTO PS_TEST(SHORT) VALUES ($1)", asList(Short.MIN_VALUE));
        assertEquals(Short.MIN_VALUE, dbr.query("SELECT SHORT FROM PS_TEST WHERE SHORT = $1", asList(Short.MIN_VALUE))
                .row(0).getLong(0).shortValue());
    }

    @Test
    public void shouldBindByte() {
        dbr.query("INSERT INTO PS_TEST(BYTE) VALUES ($1)", asList(0x41));
        assertEquals(0x41, dbr.query("SELECT BYTE FROM PS_TEST WHERE BYTE = $1", asList(0x41)).row(0).getByte(0)
                .byteValue());
    }

    @Test
    public void shouldBindChar() {
        dbr.query("INSERT INTO PS_TEST(CHAR) VALUES ($1)", asList('€'));
        assertEquals('€', dbr.query("SELECT CHAR FROM PS_TEST WHERE CHAR = $1", asList('€')).row(0).getChar(0)
                .charValue());
    }

    @Test
    public void shouldBindString() {
        dbr.query("INSERT INTO PS_TEST(STRING) VALUES ($1)", asList("val"));
        assertEquals("val",
                dbr.query("SELECT STRING FROM PS_TEST WHERE STRING = $1", asList("val")).row(0).getString(0));
    }

    @Test
    public void shouldBindClob() {
        StringBuilder s = new StringBuilder();
        for (int i = 0; i < 10000; i++) {
            s.append(getClass());
        }
        String text = s.toString();
        dbr.query("INSERT INTO PS_TEST(CLOB) VALUES ($1)", asList(text));
        assertEquals(text, dbr.query("SELECT CLOB FROM PS_TEST WHERE CLOB = $1", asList(text)).row(0).getString(0));
    }

    @Test
    public void shouldBindTime() throws Exception {
        Time time = new Time(dateFormat("yyyy-MM-dd HH:mm:ss.SSS").parse("1970-01-01 16:47:59.897")
                .getTime());
        dbr.query("INSERT INTO PS_TEST(TIME) VALUES ($1)", asList(time));
        assertEquals(time, dbr.query("SELECT TIME FROM PS_TEST WHERE TIME = $1", asList(time)).row(0).getTime(0));
    }

    @Test
    public void shouldBindDate() throws Exception {
        Date date = new Date(dateFormat("yyyy-MM-dd").parse("2014-01-19").getTime());
        dbr.query("INSERT INTO PS_TEST(DATE) VALUES ($1)", asList(date));
        assertEquals(date, dbr.query("SELECT DATE FROM PS_TEST WHERE DATE = $1", asList(date)).row(0).getDate(0));
    }

    @Test
    public void shouldBindBytes() throws Exception {
        byte[] b = bytes("blob content");
        dbr.query("INSERT INTO PS_TEST(BYTEA) VALUES ($1)", asList(b));
        assertArrayEquals(b, dbr.query("SELECT BYTEA FROM PS_TEST WHERE BYTEA = $1", asList(b)).row(0).getBytes(0));
    }

    static SimpleDateFormat dateFormat(String pattern) {
        SimpleDateFormat format = new SimpleDateFormat(pattern);
        format.setTimeZone(TimeZone.getTimeZone("UTC"));
        return format;
    }
}

redpajama_set_name: RedPajamaGithub


text:
@interface RamblerBarFooObject : NSObject <RamblerBarProtocol, RamblerFooProtocol>
@end


text:
{% load i18n %}
<!DOCTYPE html>

        <link rel="icon" href="/static/favicon.ico" type="image/x-icon" />
        <link rel="stylesheet" href="/static/style.css" media="all" />
        <link rel="stylesheet" href="/static/js/css/jquery-ui-1.css" media="all" />
        <link rel="stylesheet" href="/static/js/css/datepicker.css" media="all" />
        <title>{% block title %}{% endblock %}. Anaf</title>
        <meta name="description" content="{% block meta_description %} {% endblock %}" />
        <meta name="keywords" content="{% block meta_keywords %} {% endblock %}" />
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

        <base target="_parent" />

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

            {% block widget_title %}{% endblock %}

            {% block widget_content %}{% endblock %}


text:
package proto;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

// tag::anotations[]
@EnableEurekaServer  // <1>
@SpringBootApplication
public class DemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
}
// end::anotations[]


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Interface com.hazelcast.core.ManagedContext (Hazelcast Root 3.3.3 API)</title>
<meta name="date" content="2014-11-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
com.hazelcast.core.ManagedContext

Packages that use ManagedContext

Package
Description

com.hazelcast.client.config

Contains classes related to config for com.hazelcast.client

com.hazelcast.config

Provides classes for configuring HazelcastInstance.

com.hazelcast.instance

This package contains Hazelcast Instance functionality.

com.hazelcast.nio.serialization

Contains interfaces/classes related to serialization;
 such as serializer interfaces, input/output streams.

com.hazelcast.spring.context

Contains context classes for Spring.

Uses of ManagedContext in com.hazelcast.client.config

Methods in com.hazelcast.client.config that return ManagedContext

Modifier and Type
Method and Description

ManagedContext
ClientConfig.getManagedContext()

Gets ManagedContext

Methods in com.hazelcast.client.config with parameters of type ManagedContext

Modifier and Type
Method and Description

ClientConfig
ClientConfig.setManagedContext(ManagedContext managedContext)

Sets ManagedContext

Uses of ManagedContext in com.hazelcast.config

Methods in com.hazelcast.config that return ManagedContext

Modifier and Type
Method and Description

ManagedContext
Config.getManagedContext()

Methods in com.hazelcast.config with parameters of type ManagedContext

Modifier and Type
Method and Description

Config
Config.setManagedContext(ManagedContext managedContext)

Uses of ManagedContext in com.hazelcast.instance

Classes in com.hazelcast.instance that implement ManagedContext

Modifier and Type
Class and Description

class
HazelcastManagedContext

Constructors in com.hazelcast.instance with parameters of type ManagedContext

Constructor and Description

HazelcastManagedContext(HazelcastInstanceImpl instance,
                       ManagedContext externalContext)

Uses of ManagedContext in com.hazelcast.nio.serialization

Methods in com.hazelcast.nio.serialization that return ManagedContext

Modifier and Type
Method and Description

ManagedContext
PortableContext.getManagedContext()

ManagedContext
SerializationServiceImpl.getManagedContext()

ManagedContext
SerializationService.getManagedContext()

Methods in com.hazelcast.nio.serialization with parameters of type ManagedContext

Modifier and Type
Method and Description

SerializationServiceBuilder
SerializationServiceBuilder.setManagedContext(ManagedContext managedContext)

Uses of ManagedContext in com.hazelcast.spring.context

Classes in com.hazelcast.spring.context that implement ManagedContext

Modifier and Type
Class and Description

class
SpringManagedContext

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.


text:
package ru.otus.l161.server;

import ru.otus.l161.app.Msg;
import ru.otus.l161.app.MsgClient;
import ru.otus.l161.channel.SocketMsgClient;

import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.logging.Logger;

/**
 * Created by tully.
 */
public class MirrorSocketMsgServer implements MirrorSocketMsgServerMBean {
    private static final Logger logger = Logger.getLogger(MirrorSocketMsgServer.class.getName());

    private static final int THREADS_NUMBER = 1;
    private static final int PORT = 5050;
    private static final int MIRROR_DELAY = 100;

    private final ExecutorService executor;
    private final List<MsgClient> clients;

    public MirrorSocketMsgServer() {
        executor = Executors.newFixedThreadPool(THREADS_NUMBER);
        clients = new ArrayList<>();
    }

    public void start() throws Exception {
        executor.submit(this::mirror);

        try (ServerSocket serverSocket = new ServerSocket(PORT)) {
            logger.info("Server started on port: " + serverSocket.getLocalPort());
            while (!executor.isShutdown()) {
                Socket socket = serverSocket.accept(); //blocks
                SocketMsgClient client = new SocketMsgClient(socket);
                client.init();
                clients.add(client);
            }
        }
    }

    @SuppressWarnings("InfiniteLoopStatement")
    private Object mirror() throws InterruptedException {
        while (true) {
            for (MsgClient client : clients) {
                Msg msg = client.pool();
                while (msg != null) {
                    System.out.println("Mirroring the message: " + msg.toString());
                    client.send(msg);
                    msg = client.pool();
                }
            }
            Thread.sleep(MIRROR_DELAY);
        }
    }

    @Override
    public boolean getRunning() {
        return true;
    }

    @Override
    public void setRunning(boolean running) {
        if (!running) {
            executor.shutdown();
            logger.info("Bye.");
        }
    }
}


text:
An elastic QUIC client and benchmark tool written in golang.

## quickstart

* Prepare goquic

```
$ go get -u -d github.com/devsisters/goquic
$ cd $GOPATH/src/github.com/devsisters/goquic/
$ ./build_libs.sh
```

* Write definitions

```
$ vim definitions.json
```

* run elastiquic

```
$ go run elastiquic.go
..

Total requests: 2, successed: 2, failed: 0
```


text:
/*
//
//  Purpose:
//     Cryptography Primitive.
//     Internal Definitions and
//     Internal Pseudo Random Generator Function Prototypes
//
*/

#if !defined(_CP_PRNG_H)
#define _CP_PRNG_H

/*
// Pseudo-random generation context
*/

#define MAX_XKEY_SIZE       512
#define DEFAULT_XKEY_SIZE   512 /* must be >=160 || <=512 */

struct _cpPRNG {
   Ipp32u      idCtx;                                 /* PRNG identifier            */
   cpSize      seedBits;                              /* secret seed-key bitsize    */
   BNU_CHUNK_T Q[BITS_BNU_CHUNK(160)];                /* modulus                    */
   BNU_CHUNK_T T[BITS_BNU_CHUNK(160)];                /* parameter of SHA_G() funct */
   BNU_CHUNK_T xAug[BITS_BNU_CHUNK(MAX_XKEY_SIZE)];   /* optional entropy augment   */
   BNU_CHUNK_T xKey[BITS_BNU_CHUNK(MAX_XKEY_SIZE)];   /* secret seed-key            */
};

/* alignment */
#define PRNG_ALIGNMENT ((int)(sizeof(void*)))

#define RAND_SET_ID(ctx)   ((ctx)->idCtx = (Ipp32u)idCtxPRNG ^ (Ipp32u)IPP_UINT_PTR(ctx))
#define RAND_SEEDBITS(ctx) ((ctx)->seedBits)
#define RAND_Q(ctx)        ((ctx)->Q)
#define RAND_T(ctx)        ((ctx)->T)
#define RAND_XAUGMENT(ctx) ((ctx)->xAug)
#define RAND_XKEY(ctx)     ((ctx)->xKey)

#define RAND_VALID_ID(ctx)  ((((ctx)->idCtx) ^ (Ipp32u)IPP_UINT_PTR((ctx))) == (Ipp32u)idCtxPRNG)

#define cpPRNGen OWNAPI(cpPRNGen)
   IPP_OWN_DECL (int, cpPRNGen, (Ipp32u* pBuffer, cpSize bitLen, IppsPRNGState* pCtx))
#define cpPRNGenPattern OWNAPI(cpPRNGenPattern)
   IPP_OWN_DECL (int, cpPRNGenPattern, (BNU_CHUNK_T* pRand, int bitSize, BNU_CHUNK_T botPattern, BNU_CHUNK_T topPattern, IppBitSupplier rndFunc, void* pRndParam))
#define cpPRNGenRange OWNAPI(cpPRNGenRange)
   IPP_OWN_DECL (int, cpPRNGenRange, (BNU_CHUNK_T* pRand, const BNU_CHUNK_T* pLo, cpSize loLen, const BNU_CHUNK_T* pHi, cpSize hiLen, IppBitSupplier rndFunc, void* pRndParam))

#endif /* _CP_PRNG_H */


text: from wedding.app import create_app, init_db


text:
extern void do_enter_userspace(uintptr_t location, uintptr_t stack);

void enter_user_jmp(uintptr_t location, int argc, char** argv, uintptr_t stack);


text:
/**
 * An OSC (Open Sound Control) library for processing.
 *
 * (c) 2004-2011
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA  02111-1307  USA
 *
 * @author		Andreas Schlegel http://www.sojamo.de/libraries/oscP5
 * @modified	12/19/2011
 * @version		0.9.8
 */

package oscP5;

public class OscStatus {

  public static int ERROR = -1;

  public static int DEFAULT = 0;

  public static int CONNECTION_CLOSED = 1;

  public static int CONNECTION_REFUSED = 2;

  public static int CONNECTION_TERMINATED = 4;

  public static int CONNECTION_FAILED = 8;

  public static int SERVER_CLOSED = 16;

  public static int CLIENT_CLOSED = 32;

  public static int SEND_FAILED = 64;

  public static int OSCP5_CLOSED = 1024;

  private int _myIndex = DEFAULT;

  public OscStatus(int theIndex) {
    _myIndex = theIndex;
  }

  public int id() {
    return _myIndex;
  }

}


text:
require 'spec_helper'

describe DpllSolver::Formulas::Not do
  let(:falsum) { DpllSolver::Formulas::Falsum }
  let(:verum) { DpllSolver::Formulas::Verum }
  let(:var1) { DpllSolver::Formulas::Variable.new("x1") }
  let(:var2) { DpllSolver::Formulas::Variable.new("x2") }
  let(:f1) { DpllSolver::Formulas::Not.new(var1)}
  let(:f2) { DpllSolver::Formulas::Not.new(f1)}
  let(:f3) { DpllSolver::Formulas::Not.new(DpllSolver::Formulas::Falsum)}
  it 'should convert to string' do
    expect(f1.to_s).to eql "(NOT x1)"
    expect(f2.to_s).to eql "(NOT (NOT x1))"
    expect(f3.to_s).to eql "(NOT 0)"
  end

  it 'should test syntactic eqivalenz' do
    expect(f1 == f1).to eql true
    expect(f1 == DpllSolver::Formulas::Not.new(var1)).to eql true
    expect(f1 == f2).to eql false
  end

  it 'should be a literal if contains an atomic formula' do
    expect(f1.literal?).to eql true
    expect(f2.literal?).to eql false
    expect(f3.literal?).to eql true
  end

  it 'should not be a atomic formula' do
    expect(f1.atomic_formula?).to eql false
    expect(f3.atomic_formula?).to eql false
  end

  it 'should be a min term if contains an atomic formula' do
    expect(f1.min_term?).to eql true
    expect(f3.min_term?).to eql true
    expect(f2.min_term?).to eql false
  end

  it 'should be a nnf, cnf, dnf if contains an atomic formula' do
    expect(f1.nnf?).to eql true
    expect(f1.cnf?).to eql true
    expect(f1.dnf?).to eql true
    expect(f3.nnf?).to eql true
    expect(f3.cnf?).to eql true
    expect(f3.dnf?).to eql true
    expect(f2.nnf?).to eql false
    expect(f2.cnf?).to eql false
    expect(f2.dnf?).to eql false
  end

  it 'should simplify not' do
    not_falsum = DpllSolver::Formulas::Not.new(falsum)
    not_verum = DpllSolver::Formulas::Not.new(verum)
    expect(not_falsum.simplify).to eql verum
    expect(not_verum.simplify).to eql falsum
    expect(f2.simplify).to eql var1
    not_f2 = DpllSolver::Formulas::Not.new(f2)
    expect(not_f2.simplify).to eql f1
    not_not_f2 = DpllSolver::Formulas::Not.new(DpllSolver::Formulas::Not.new(f2))
    expect(not_not_f2.simplify).to eql var1
  end

  it 'should apply DeMorgan' do
    not_var1 = DpllSolver::Formulas::Not.new(var1)
    not_var2 = DpllSolver::Formulas::Not.new(var2)
    and_f = DpllSolver::Formulas::Not.new(DpllSolver::Formulas::And.new(var1, var2))
    and_f_after = DpllSolver::Formulas::Or.new(not_var1, not_var2)
    or_f = DpllSolver::Formulas::Not.new(DpllSolver::Formulas::Or.new(var1, var2))
    or_f_after = DpllSolver::Formulas::And.new(not_var1, not_var2)
    expect(and_f.apply_DeMorgan).to eql and_f_after
    expect(or_f.apply_DeMorgan).to eql or_f_after
    expect{ f1.apply_DeMorgan }.to raise_error(ArgumentError)
    expect{ f2.apply_DeMorgan }.to raise_error(ArgumentError)
  end
end


text:
import MagicString from 'magic-string';
import { RenderOptions } from '../../utils/renderHelpers';
import { ExecutionPathOptions } from '../ExecutionPathOptions';
import { ObjectPath } from '../values';
import ThisVariable from '../variables/ThisVariable';
import * as NodeType from './NodeType';
import { NodeBase } from './shared/Node';

export default class ThisExpression extends NodeBase {
	type: NodeType.tThisExpression;

	variable: ThisVariable;
	private alias: string | null;

	bind() {
		super.bind();
		this.variable = <ThisVariable>this.scope.findVariable('this');
	}

	hasEffectsWhenAccessedAtPath(path: ObjectPath, options: ExecutionPathOptions): boolean {
		return path.length > 0 && this.variable.hasEffectsWhenAccessedAtPath(path, options);
	}

	hasEffectsWhenAssignedAtPath(path: ObjectPath, options: ExecutionPathOptions): boolean {
		return this.variable.hasEffectsWhenAssignedAtPath(path, options);
	}

	initialise() {
		this.included = false;
		this.variable = null;
		this.alias = this.scope.findLexicalBoundary().isModuleScope ? this.context.moduleContext : null;
		if (this.alias === 'undefined') {
			this.context.warn(
				{
					code: 'THIS_IS_UNDEFINED',
					message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,
					url: `https://rollupjs.org/guide/en#error-this-is-undefined`
				},
				this.start
			);
		}
	}

	render(code: MagicString, _options: RenderOptions) {
		if (this.alias !== null) {
			code.overwrite(this.start, this.end, this.alias, {
				storeName: true,
				contentOnly: false
			});
		}
	}
}


text:
require 'bsearch'
require 'time'

module Rho
	module RhoEvent
    def self.find(*args)
      if args.first == :all
        params = {}
        if args.length >= 2 and args[1].is_a? Hash
          puts "Event find params: #{args[1].inspect}"
          args[1].each do |k,v|
            params[k.to_s] = v
            puts "#{k.to_s} => #{v}"
          end
        end

        params['start_date'] = params['start_date'].to_time if !params['start_date'].nil? and !params['start_date'].is_a?(Time)
        params['end_date'] = params['end_date'].to_time if !params['end_date'].nil? and !params['end_date'].is_a?(Time)

        params['start_date'] = MIN_TIME if params['start_date'].nil? #or params['start_date'] < MIN_TIME
        params['end_date'] = MAX_TIME if params['end_date'].nil? #or params['end_date'] > MAX_TIME

        if params['start_date'] == MIN_TIME or params['end_date'] == MAX_TIME
          params['include_repeating'] = false
          puts "Resetting 'include_repeating' param to false"
        end

        puts "Rho::Calendar.fetch(params) : #{params}"
        events = Rho::Calendar.fetch(params)
        #puts "events : #{events}"
        #ret = {}
        #events.each do |e|
        #  ret[e[Rho::RhoEvent::ID]] = e
        #end
        #ret
        events
      else
        id = args.first.to_s
        id = $1 if id.is_a?(String) and id =~ /^{(.*)}$/
        Rho::Calendar.fetch_by_id(id)
      end
    end

    def self.create!(event)
      event['id'] = nil #indicate that event should be created
      event['reminder'] = event['reminder'].to_i if event['reminder'] != nil
      event['recurrence']['end'] = nil if event['recurrence'] and event['recurrence']['end'] == ""
      new_id = Rho::Calendar.save(event)
      event['id'] = new_id
      return event
    end

    def self.destroy(id)
      id = $1 if id.is_a?(String) and id =~ /^{(.*)}$/
      Rho::Calendar.delete(id)
    end

    def self.update_attributes(event)
      puts "update_attributes: #{event}"
      Rho::Calendar.save(event)
    end

	end # module RhoEvent
end # module Rho


text:
<?php

Route::group([
    'middleware' => [
        'web',
        'alpaca',
    ],
], function () {
    if (config('app.env') === 'testing') {
        // Authentication Routes...
        Route::get('login', '\Alpaca\Controllers\Auth\LoginController@showLoginForm')->name('login');
        Route::post('login', '\Alpaca\Controllers\Auth\LoginController@login');
        Route::post('logout', '\Alpaca\Controllers\Auth\LoginController@logout')->name('logout');

        // Registration Routes...
        Route::get('register', '\Alpaca\Controllers\Auth\RegisterController@showRegistrationForm')->name('register');
        Route::post('register', '\Alpaca\Controllers\Auth\RegisterController@register');

        // Password Reset Routes...
        Route::get('password/reset', '\Alpaca\Controllers\Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
        Route::post('password/email', '\Alpaca\Controllers\Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
        Route::get('password/reset/{token}', '\Alpaca\Controllers\Auth\ResetPasswordController@showResetForm')->name('password.reset');
        Route::post('password/reset', '\Alpaca\Controllers\Auth\ResetPasswordController@reset');
    }
});


text:
<resources>

    <string name="app_name">textureloader</string>

</resources>


text:
{-# LANGUAGE NoMonomorphismRestriction, NoImplicitPrelude #-}

module DDF.Fix (module DDF.Fix, module DDF.DBI) where

import DDF.DBI
import qualified Data.Functor.Foldable as M

class DBI r => Fix r where
  fix :: r h (f (M.Fix f) -> M.Fix f)
  runFix :: r h (M.Fix f -> f (M.Fix f))

fix1 = app fix
runFix1 = app runFix


text:
using System;

namespace Lucene.Net.Search
{

	sealed class BooleanScorer : Scorer
	{
		private void  InitBlock()
		{
			bucketTable = new BucketTable();
		}
		private SubScorer scorers = null;
		private BucketTable bucketTable;

		private int maxCoord = 1;
		private float[] coordFactors = null;

		private int requiredMask = 0;
		private int prohibitedMask = 0;
		private int nextMask = 1;

		private int minNrShouldMatch;

		internal BooleanScorer(Similarity similarity) : this(similarity, 1)
		{
		}

		internal BooleanScorer(Similarity similarity, int minNrShouldMatch) : base(similarity)
		{
			InitBlock();
			this.minNrShouldMatch = minNrShouldMatch;
		}

		internal sealed class SubScorer
		{
			public Scorer scorer;
			public bool done;
			public bool required = false;
			public bool prohibited = false;
			public HitCollector collector;
			public SubScorer next;

			public SubScorer(Scorer scorer, bool required, bool prohibited, HitCollector collector, SubScorer next)
			{
				this.scorer = scorer;
				this.done = !scorer.Next();
				this.required = required;
				this.prohibited = prohibited;
				this.collector = collector;
				this.next = next;
			}
		}

		internal void  Add(Scorer scorer, bool required, bool prohibited)
		{
			int mask = 0;
			if (required || prohibited)
			{
				if (nextMask == 0)
					throw new System.IndexOutOfRangeException("More than 32 required/prohibited clauses in query.");
				mask = nextMask;
				nextMask = nextMask << 1;
			}
			else
				mask = 0;

			if (!prohibited)
				maxCoord++;

			if (prohibited)
				prohibitedMask |= mask;
			// update prohibited mask
			else if (required)
				requiredMask |= mask; // update required mask

			scorers = new SubScorer(scorer, required, prohibited, bucketTable.NewCollector(mask), scorers);
		}

		private void  ComputeCoordFactors()
		{
			coordFactors = new float[maxCoord];
			for (int i = 0; i < maxCoord; i++)
				coordFactors[i] = GetSimilarity().Coord(i, maxCoord - 1);
		}

		private int end;
		private Bucket current;

		public override void  Score(HitCollector hc)
		{
			Next();
			Score(hc, System.Int32.MaxValue);
		}

		protected internal override bool Score(HitCollector hc, int max)
		{
			if (coordFactors == null)
				ComputeCoordFactors();

			bool more;
			Bucket tmp;

			do
			{
				bucketTable.first = null;

				while (current != null)
				{
					// more queued

					// check prohibited & required
					if ((current.bits & prohibitedMask) == 0 && (current.bits & requiredMask) == requiredMask)
					{

						if (current.doc >= max)
						{
							tmp = current;
							current = current.next;
							tmp.next = bucketTable.first;
							bucketTable.first = tmp;
							continue;
						}

						if (current.coord >= minNrShouldMatch)
						{
							hc.Collect(current.doc, current.score * coordFactors[current.coord]);
						}
					}

					current = current.next; // pop the queue
				}

				if (bucketTable.first != null)
				{
					current = bucketTable.first;
					bucketTable.first = current.next;
					return true;
				}

				// refill the queue
				more = false;
				end += BucketTable.SIZE;
				for (SubScorer sub = scorers; sub != null; sub = sub.next)
				{
					if (!sub.done)
					{
						sub.done = !sub.scorer.Score(sub.collector, end);
						if (!sub.done)
							more = true;
					}
				}
				current = bucketTable.first;
			}
			while (current != null || more);

			return false;
		}

		public override int Doc()
		{
			return current.doc;
		}

		public override bool Next()
		{
			bool more;
			do
			{
				while (bucketTable.first != null)
				{
					// more queued
					current = bucketTable.first;
					bucketTable.first = current.next; // pop the queue

					// check prohibited & required, and minNrShouldMatch
					if ((current.bits & prohibitedMask) == 0 && (current.bits & requiredMask) == requiredMask && current.coord >= minNrShouldMatch)
					{
						return true;
					}
				}

				// refill the queue
				more = false;
				end += BucketTable.SIZE;
				for (SubScorer sub = scorers; sub != null; sub = sub.next)
				{
					Scorer scorer = sub.scorer;
					while (!sub.done && scorer.Doc() < end)
					{
						sub.collector.Collect(scorer.Doc(), scorer.Score());
						sub.done = !scorer.Next();
					}
					if (!sub.done)
					{
						more = true;
					}
				}
			}
			while (bucketTable.first != null || more);

			return false;
		}

		public override float Score()
		{
			if (coordFactors == null)
				ComputeCoordFactors();
			return current.score * coordFactors[current.coord];
		}

		internal sealed class Bucket
		{
			internal int doc = - 1; // tells if bucket is valid
			internal float score; // incremental score
			internal int bits; // used for bool constraints
			internal int coord; // count of terms in score
			internal Bucket next; // next valid bucket
		}

		/// <summary>A simple hash table of document scores within a range. </summary>
		internal sealed class BucketTable
		{
			private void  InitBlock()
			{
				buckets = new Bucket[SIZE];
			}
			public const int SIZE = 1 << 11;
			public static readonly int MASK;

			internal Bucket[] buckets;
			internal Bucket first = null; // head of valid list

			public BucketTable()
			{
                InitBlock();
			}

			public int Size()
			{
				return SIZE;
			}

			public HitCollector NewCollector(int mask)
			{
				return new Collector(mask, this);
			}
			static BucketTable()
			{
				MASK = SIZE - 1;
			}
		}

		internal sealed class Collector : HitCollector
		{
			private BucketTable bucketTable;
			private int mask;
			public Collector(int mask, BucketTable bucketTable)
			{
				this.mask = mask;
				this.bucketTable = bucketTable;
			}
			public override void  Collect(int doc, float score)
			{
				BucketTable table = bucketTable;
				int i = doc & Lucene.Net.Search.BooleanScorer.BucketTable.MASK;
				Bucket bucket = table.buckets[i];
				if (bucket == null)
					table.buckets[i] = bucket = new Bucket();

				if (bucket.doc != doc)
				{
					// invalid bucket
					bucket.doc = doc; // set doc
					bucket.score = score; // initialize score
					bucket.bits = mask; // initialize mask
					bucket.coord = 1; // initialize coord

					bucket.next = table.first; // push onto valid list
					table.first = bucket;
				}
				else
				{
					// valid bucket
					bucket.score += score; // increment score
					bucket.bits |= mask; // add bits in mask
					bucket.coord++; // increment coord
				}
			}
		}

		public override bool SkipTo(int target)
		{
			throw new System.NotSupportedException();
		}

		public override Explanation Explain(int doc)
		{
			throw new System.NotSupportedException();
		}

		public override System.String ToString()
		{
			System.Text.StringBuilder buffer = new System.Text.StringBuilder();
			buffer.Append("boolean(");
			for (SubScorer sub = scorers; sub != null; sub = sub.next)
			{
				buffer.Append(sub.scorer.ToString());
				buffer.Append(" ");
			}
			buffer.Append(")");
			return buffer.ToString();
		}
	}
}


text:
package org.cloudfoundry.client.v3.applications;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.immutables.value.Value;

/**
 * The request payload for the Get Application Environment operation
 */
@Value.Immutable
abstract class _GetApplicationEnvironmentRequest {

    /**
     * The application id
     */
    @JsonIgnore
    abstract String getApplicationId();

}


text:
require 'simplecov'
SimpleCov.start

ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)

require 'spec_helper'


text:
/*---start------thumbnail-1-configurations-------------------------------------------------------------------------------------------------------*/

.section-2-thumbnail>section.thumbnail-1{
    color : white;
    background-color : #007F43;
}
.section-2-thumbnail>section.thumbnail-1>article>h2>span.background{
    background-color : #004826;
}
.section-2-thumbnail>section.thumbnail-1>article span.thumbnail-image>span.image{
    background-image : url("../images/home-thumnails/s2-thumbnail-1-image.png");
}

/*---end------thumbnail-1-configurations-------------------------------------------------------------------------------------------------------*/

/*---start------thumbnail-2-configurations-------------------------------------------------------------------------------------------------------*/
.section-2-thumbnail>section.thumbnail-2{
    color : white;
    background-color : #FDAD5B;
}
.section-2-thumbnail>section.thumbnail-2>article>h2>span.background{
    background-color : #FC8A18;
}
.section-2-thumbnail>section.thumbnail-2>article span.thumbnail-image>span.image{
    background-image : url("../images/home-thumnails/s2-thumbnail-2-image.png");
}

/*---end------thumbnail-2-configurations-------------------------------------------------------------------------------------------------------*/

/*---start------thumbnail-3-configurations-------------------------------------------------------------------------------------------------------*/
.section-2-thumbnail>section.thumbnail-3{
    color : #66A00E;
    background-color : white;
}
.section-2-thumbnail>section.thumbnail-3>article>h2>span.background{
    background-color : #DCDFE4;
}
.section-2-thumbnail>section.thumbnail-3>article span.thumbnail-image>span.image{
    background-image : url("../images/home-thumnails/s2-thumbnail-3-image.png");
}

/*---end------thumbnail-3-configurations-------------------------------------------------------------------------------------------------------*/

/*---start------thumbnail-4-configurations-------------------------------------------------------------------------------------------------------*/
.section-2-thumbnail>section.thumbnail-4{
    color : #726A38;
    background-color : #FDEAAF;
}
.section-2-thumbnail>section.thumbnail-4>article>h2>span.background{
    background-color : #F9D68C;
}
.section-2-thumbnail>section.thumbnail-4>article span.thumbnail-image>span.image{
    background-image : url("../images/home-thumnails/s2-thumbnail-4-image.png");
}

/*---end------thumbnail-4-configurations-------------------------------------------------------------------------------------------------------*/

/*---start------common-----------configurations-------------------------------------------------------------------------------------------------------*/
.section-2-thumbnail>section{
    position: relative;
    z-index: 5;
    padding-bottom: 45px;
}

.section-2-thumbnail>section>article>h2>span.background{
    width: 70%;
    display : inline-block;
    position: absolute;
    z-index: 0;
    height: 100%;
    border-radius : 16px;
    -webkit-border-radius: 16px;
    -moz-border-radius : 16px;
}

.section-2-thumbnail>section.left>article>h2>span.background{
    right: 0;
}
.section-2-thumbnail>section.right>article>h2>span.background{
    left: 0;
}

.section-2-thumbnail>section>article>h2{
    height: 90px;
    margin: 0;
    margin-top: 70px;
    line-height: 93px;
    position: relative;
    z-index: 10;
    top: 47px;
}

.section-2-thumbnail>section.left>article>h2{
    padding-left: 59%;
}

.section-2-thumbnail>section.right>article>h2{
    padding-left: 0;
}

.section-2-thumbnail>section.left>article>h2 span.title-icon{
    margin-left: -25px;
}

.section-2-thumbnail>section>article>h2 span{
    display: inline-block;
    height: 90px;
    float: left;
    position: relative;
}
.section-2-thumbnail>section>article>h2 span.title{
    font-size: 30px;
    font-family: swis;
    margin-left: 20px;
    z-index: 5;
}
.section-2-thumbnail>section>article>h2 span.title-icon{
    font-size: 90px;
    margin-left: 0;
    z-index: 5;
}

.section-2-thumbnail>section>article p.thumbnail-text{
    font-family: yanone;
    font-size: 31px;
    text-align: justify;
    /* margin-bottom: 75px; */
    margin-top: 45px;
    line-height: 37px;
    top: 25px;
    position: relative;
}

.section-2-thumbnail>section.left>article p.thumbnail-text{
    padding-left: 60%;
    margin-right: 25px;
}

.section-2-thumbnail>section.right>article p.thumbnail-text{
    padding-right: 55%;
    margin-left: 25px;
    float: left;
}

.section-2-thumbnail>section>article span.thumbnail-image>span.image{
    border: none;
    outline: none;
    background-repeat: no-repeat;
    display:  inline-block;
    width: 550px;
    height: 500px;
}

@media (max-width : 1199px){
    .section-2-thumbnail article.container{
        width: 95%;
        margin: 0 2.5%;
    }
}

@media (min-width : 630px){

    .section-2-thumbnail>section>article span.thumbnail-image{
        position: absolute;
        border: none;
        margin-top: 0;
        z-index: 30;
        top: -28px;
    }
    .section-2-thumbnail>section.left>article span.thumbnail-image{
        float : left;
    }
    .section-2-thumbnail>section.right>article span.thumbnail-image{
        position: relative;
        float: right;
        height: 0;
        display: block;
        margin-top: -400px;
    }
    .section-2-thumbnail>section.right>article span.thumbnail-image::after{
        clear : both;
    }

}

@media (max-width : 991px){
    .section-2-thumbnail>section>article span.thumbnail-image>span.image{
        background-size: 55% 55%;
    }
    .section-2-thumbnail>section.left>article span.thumbnail-image>span.image{
        background-position-x: 0;
    }
    .section-2-thumbnail>section.right>article span.thumbnail-image>span.image{
        background-position-x: 100%;
        /* margin-top: 76px; */
    }
    .section-2-thumbnail>section>article span.thumbnail-image>span.image{
        background-position-y: 50%;
    }

    .section-2-thumbnail>section.right>article span.thumbnail-image>span.image{
        /* background-position-y: 90%;*/
    }
    .section-2-thumbnail>section.right>article span.thumbnail-image{
        /* top: 0; */
        position: absolute;
        margin-top: 2%;
        right: 0;
    }

    .section-2-thumbnail>section>article>h2>span.background{
        width: 100%;
    }
    .section-2-thumbnail>section.right>article p.thumbnail-text{
        padding-right: 50%;
    }
    .section-2-thumbnail>section.left>article p.thumbnail-text{
        padding-left: 50%;
    }
    .section-2-thumbnail>section.left>article>h2{
        padding-left: 50%;
    }

    .section-2-thumbnail>section>article>h2{
        height: 70px;
        line-height: 71px;
        margin-top: 0;
    }
    .section-2-thumbnail>section>article>h2 span{
        height: 70px;
    }
    .section-2-thumbnail>section>article>h2 span.title{
        font-size: 25px;
    }
    .section-2-thumbnail>section>article>h2 span.title-icon{
        font-size: 70px;
    }
    .section-2-thumbnail>section>article p.thumbnail-text{
        font-size: 27px;
    }
    .section-2-thumbnail>section{
        /* padding-bottom: 10px; */
    }
}

@media (max-width : 629px){

    .section-2-thumbnail>section>article span.thumbnail-image{
        display : none;
    }

    .section-2-thumbnail>section.left>article p.thumbnail-text,
    .section-2-thumbnail>section.right>article p.thumbnail-text{
        padding : 30px 20px;
        margin : 0;
    }

    .section-2-thumbnail>section.left>article>h2{
        padding-left: 28px;
    }
    .section-2-thumbnail>section.right>article>h2{
        padding-left: 0px;
    }
    .section-2-thumbnail>section{
        padding-bottom: 0px;
    }
}

@media (max-width : 410px){

    .section-2-thumbnail>section>article>h2{
        height: 50px;
        line-height: 51px;
        margin-top: 0;
    }
    .section-2-thumbnail>section>article>h2 span{
        height: 50px;
    }
    .section-2-thumbnail>section>article>h2 span.title{
        font-size: 22px;
    }
    .section-2-thumbnail>section>article>h2 span.title-icon{
        font-size: 50px;
    }
    .section-2-thumbnail>section>article p.thumbnail-text{
    }
    .section-2-thumbnail>section.left>article p.thumbnail-text,
    .section-2-thumbnail>section.right>article p.thumbnail-text{
        font-size: 22px;
        padding: 25px 10px;
    }

    .section-2-thumbnail>section>article>h2 span.title{
        margin-left: -15px;
    }
    .section-2-thumbnail>section.left>article>h2 span.title-icon,
    .section-2-thumbnail>section.right>article>h2 span.title-icon
    {
        left : -5px
    }

}


text:
package com.outr.arango

case class Warning(code: Int, message: String)


text:
@implementation RCDUserListCollectionItem

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        _ivAva = [[UIImageView alloc] initWithFrame:CGRectZero];
        _ivAva.clipsToBounds = YES;
        if (RCKitConfigCenter.ui.globalConversationAvatarStyle == RC_USER_AVATAR_CYCLE &&
            RCKitConfigCenter.ui.globalMessageAvatarStyle == RC_USER_AVATAR_CYCLE) {
            _ivAva.layer.cornerRadius = ivAvaWidth/2;
        } else {
            _ivAva.layer.cornerRadius = 5.f;
        }
        [_ivAva setBackgroundColor:[UIColor clearColor]];
        [self.contentView addSubview:_ivAva];

        _titleLabel = [UILabel new];
        [_titleLabel setTextColor:[RCDUtilities generateDynamicColor:HEXCOLOR(0x999999) darkColor:[HEXCOLOR(0xffffff) colorWithAlphaComponent:0.9]]];
        [_titleLabel setFont:[UIFont systemFontOfSize:13]];
        [_titleLabel setTextAlignment:NSTextAlignmentCenter];
        [self.contentView addSubview:_titleLabel];

        _btnImg = [[UIButton alloc] initWithFrame:CGRectZero];
        [_btnImg setHidden:YES];
        [_btnImg setImage:[UIImage imageNamed:@"delete_member_tip"]
                 forState:UIControlStateNormal];
        [_btnImg addTarget:self action:@selector(deleteItem:) forControlEvents:UIControlEventTouchUpInside];
        [self.contentView addSubview:_btnImg];

        [_ivAva setTranslatesAutoresizingMaskIntoConstraints:NO];
        [_titleLabel setTranslatesAutoresizingMaskIntoConstraints:NO];
        [_btnImg setTranslatesAutoresizingMaskIntoConstraints:NO];

        [self.contentView
            addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_ivAva]|"
                                                                   options:kNilOptions
                                                                   metrics:nil
                                                                     views:NSDictionaryOfVariableBindings(_ivAva)]];

        [self.contentView addConstraints:[NSLayoutConstraint
                                             constraintsWithVisualFormat:@"H:|[_titleLabel]|"
                                                                 options:kNilOptions
                                                                 metrics:nil
                                                                   views:NSDictionaryOfVariableBindings(_titleLabel)]];
        [self.contentView
            addConstraints:[NSLayoutConstraint
                               constraintsWithVisualFormat:@"V:|[_ivAva(ivAvaWidth)]-9-[_titleLabel(==15)]"
                                                   options:kNilOptions
                            metrics:@{@"ivAvaWidth":@(ivAvaWidth)}
                                                     views:NSDictionaryOfVariableBindings(_titleLabel, _ivAva)]];

        [self.contentView
            addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_btnImg(25)]"
                                                                   options:kNilOptions
                                                                   metrics:nil
                                                                     views:NSDictionaryOfVariableBindings(_btnImg)]];
        [self.contentView
            addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_btnImg(25)]"
                                                                   options:kNilOptions
                                                                   metrics:nil
                                                                     views:NSDictionaryOfVariableBindings(_btnImg)]];

        [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:_titleLabel
                                                                     attribute:NSLayoutAttributeCenterX
                                                                     relatedBy:NSLayoutRelationEqual
                                                                        toItem:_ivAva
                                                                     attribute:NSLayoutAttributeCenterX
                                                                    multiplier:1.0f
                                                                      constant:0]];
    }
    return self;
}

- (void)deleteItem:(id)sender {
    if (self.delegate && [self.delegate respondsToSelector:@selector(deleteTipButtonClicked:)]) {
        [self.delegate deleteTipButtonClicked:self];
    }
}

- (void)setUserModel:(NSString *)userId {
    if (self.groupId.length > 0) {
        [RCDUtilities getGroupUserDisplayInfo:userId
                                      groupId:self.groupId
                                       result:^(RCUserInfo *user) {
                                           [self setUIInfo:user];
                                       }];
    } else {
        [RCDUtilities getUserDisplayInfo:userId
                                complete:^(RCUserInfo *user) {
                                    [self setUIInfo:user];
                                }];
    }
}

- (void)setUIInfo:(RCUserInfo *)user {
    if ([user.userId isEqualToString:[RCIMClient sharedRCIMClient].currentUserInfo.userId]) {
        [self.btnImg setHidden:YES];
    }
    self.ivAva.image = nil;
    self.userId = user.userId;
    self.titleLabel.text = [RCKitUtility getDisplayName:user];
    [self.ivAva sd_setImageWithURL:[NSURL URLWithString:user.portraitUri]
                  placeholderImage:[UIImage imageNamed:@"icon_person"]];
}

@end


text:
package ru.stqa.pft.addressbook.model;

import com.google.gson.annotations.Expose;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.io.File;
import java.util.HashSet;
import java.util.Set;

@Entity
@Table(name = "addressbook")
public class ContactData {

    @Id
    @Column(name = "id")
    private int id;

    @Expose
    @Column(name = "firstname")
    private String first_name;

    @Expose
    @Column(name = "lastname")
    private String last_name;

    @Transient
    @Expose
    private String test_address;

    @Expose
    @Column(name = "home")
    @Type(type = "text")
    private String tel_number_1;

    @Expose
    @Column(name = "mobile")
    @Type(type = "text")
    private String tel_number_2;

    @Expose
    @Column(name = "work")
    @Type(type = "text")
    private String tel_number_3;

    @Transient
    private String allPhones;

    @Expose
    @Transient
    private String email;

    @Expose
    @Transient
    private String email1;

    @Expose
    @Transient
    private String email2;

    @Transient
    private String allEmail;

    //@Transient
    //private String group;

    @Column(name = "photo")
    @Type(type = "text")
    private String photo;

    @Transient
    private String allContactData;

    @ManyToMany (fetch = FetchType.EAGER)
    @JoinTable(name = "address_in_groups",
            joinColumns = @JoinColumn(name = "id"), inverseJoinColumns = @JoinColumn(name = "group_id"))
    private Set<GroupData> groups = new HashSet<GroupData>();

    public int getId() {
        return id;
    }

    public ContactData withAllContactData(String allContactData) {
        this.allContactData = allContactData;
        return this;
    }

    public File getPhoto() {
        return new File(photo);
    }

    public ContactData withPhoto(File photo) {
        this.photo = photo.getPath();
        return this;
    }

    public ContactData withAllPhones(String allPhones) {
        this.allPhones = allPhones;
        return this;
    }

    public ContactData withAllEmail(String allEmail) {
        this.allEmail = allEmail;
        return this;
    }

    public ContactData withId(int id) {
        this.id = id;
        return this;
    }

    public ContactData withFirst_name(String first_name) {
        this.first_name = first_name;
        return this;
    }

    public ContactData withLast_name(String last_name) {
        this.last_name = last_name;
        return this;
    }

    public ContactData withTest_address(String test_address) {
        this.test_address = test_address;
        return this;
    }

    public ContactData withTel_number_home(String tel_number_1) {
        this.tel_number_1 = tel_number_1;
        return this;
    }

    public ContactData withTel_number_mobile(String tel_number_2) {
        this.tel_number_2 = tel_number_2;
        return this;
    }

    public ContactData withTel_number_work(String tel_number_3) {
        this.tel_number_3 = tel_number_3;
        return this;
    }

    public ContactData withEmail(String email) {
        this.email = email;
        return this;
    }

    public ContactData withEmail1(String email1) {
        this.email1 = email1;
        return this;
    }

    public ContactData withEmail2(String email2) {
        this.email2 = email2;
        return this;
    }

    //public ContactData withGroup(String group) {
    //    this.group = group;
    //    return this;
    //}

    public String getFirst_name() {
        return first_name;
    }

    public String getLast_name() {
        return last_name;
    }

    public String getTest_address() {
        return test_address;
    }

    public String getTel_number_1() {
        return tel_number_1;
    }

    public String getTel_number_2() {
        return tel_number_2;
    }

    public String getTel_number_3() {
        return tel_number_3;
    }

    public String getAllPhones() {
        return allPhones;
    }

    public String getAllEmail() {
        return allEmail;
    }

    public String getEmail() {
        return email;
    }

    public String getEmail1() {
        return email1;
    }

    public String getEmail2() {
        return email2;
    }

    public Groups getGroups() {
        return new Groups(groups);
    }

    public ContactData inGroup(GroupData group) {
        groups.add(group);
        return this;
    }

    //public String getGroup() {
    //    return group;
    //}

    public String getAllContactData() {
        return allContactData;
    }

    @Override //здесь можно добавить параметры для отображения при выполнении тестов в консоле
    public String toString() {
        return "ContactData{" +
                "first_name='" + first_name + '\'' +
                ", last_name='" + last_name + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ContactData that = (ContactData) o;

        if (id != that.id) return false;
        if (first_name != null ? !first_name.equals(that.first_name) : that.first_name != null) return false;
        return last_name != null ? last_name.equals(that.last_name) : that.last_name == null;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (first_name != null ? first_name.hashCode() : 0);
        result = 31 * result + (last_name != null ? last_name.hashCode() : 0);
        return result;
    }
}


text:
package compat

import (
	"github.com/influxdata/influxdb/v2/storage"
	"github.com/influxdata/influxdb/v2/toml"
	"github.com/influxdata/influxdb/v2/tsdb/tsm1"
)

// Config matches the old toml layout from the influxdb repo, so that we can read
// in those files and convert them to the new config layout.
type Config struct {
	Dir                            string        `toml:"dir"`
	WALDir                         string        `toml:"wal-dir"`
	WALFsyncDelay                  toml.Duration `toml:"wal-fsync-delay"`
	CacheMaxMemorySize             toml.Size     `toml:"cache-max-memory-size"`
	CacheSnapshotMemorySize        toml.Size     `toml:"cache-snapshot-memory-size"`
	CacheSnapshotWriteColdDuration toml.Duration `toml:"cache-snapshot-write-cold-duration"`
	CompactFullWriteColdDuration   toml.Duration `toml:"compact-full-write-cold-duration"`
	CompactThroughput              toml.Size     `toml:"compact-throughput"`
	CompactThroughputBurst         toml.Size     `toml:"compact-throughput-burst"`
	MaxConcurrentCompactions       int           `toml:"max-concurrent-compactions"`
	TSMWillNeed                    bool          `toml:"tsm-use-madv-willneed"`
}

// NewConfig constructs an old Config struct with appropriate defaults for a new Config.
func NewConfig() Config {
	return Config{
		WALFsyncDelay:                  toml.Duration(tsm1.DefaultWALFsyncDelay),
		CacheMaxMemorySize:             toml.Size(tsm1.DefaultCacheMaxMemorySize),
		CacheSnapshotMemorySize:        toml.Size(tsm1.DefaultCacheSnapshotMemorySize),
		CacheSnapshotWriteColdDuration: toml.Duration(tsm1.DefaultCacheSnapshotWriteColdDuration),
		CompactFullWriteColdDuration:   toml.Duration(tsm1.DefaultCompactFullWriteColdDuration),
		CompactThroughput:              toml.Size(tsm1.DefaultCompactThroughput),
		CompactThroughputBurst:         toml.Size(tsm1.DefaultCompactThroughputBurst),
		MaxConcurrentCompactions:       tsm1.DefaultCompactMaxConcurrent,
		TSMWillNeed:                    tsm1.DefaultMADVWillNeed,
	}
}

// Convert takes an old Config and converts it into a new Config. It also returns the value
// of the Dir key so that it can be passed through appropriately to the storage engine constructor.
func Convert(oldConfig Config) (string, storage.Config) {
	newConfig := storage.NewConfig()
	newConfig.Engine.MADVWillNeed = oldConfig.TSMWillNeed
	newConfig.Engine.Cache.MaxMemorySize = oldConfig.CacheMaxMemorySize
	newConfig.Engine.Cache.SnapshotMemorySize = oldConfig.CacheSnapshotMemorySize
	newConfig.Engine.Cache.SnapshotWriteColdDuration = oldConfig.CacheSnapshotWriteColdDuration
	newConfig.Engine.Compaction.FullWriteColdDuration = oldConfig.CompactFullWriteColdDuration
	newConfig.Engine.Compaction.Throughput = oldConfig.CompactThroughput
	newConfig.Engine.Compaction.ThroughputBurst = oldConfig.CompactThroughputBurst
	newConfig.Engine.Compaction.MaxConcurrent = oldConfig.MaxConcurrentCompactions
	newConfig.WALPath = oldConfig.WALDir
	newConfig.WAL.FsyncDelay = oldConfig.WALFsyncDelay
	return oldConfig.Dir, newConfig
}


text:
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var Page1Component = (function () {
    function Page1Component() {
    }
    Page1Component = __decorate([
        core_1.Component({
            selector: 'page1',
            template: '
Page 1 of Angular 2 App
'
        }),
        __metadata('design:paramtypes', [])
    ], Page1Component);
    return Page1Component;
}());
exports.Page1Component = Page1Component;
//# sourceMappingURL=page1.component.js.map


text:
/*
 * @author max
 */
package com.intellij.psi.impl.java.stubs;

import com.intellij.psi.*;

public abstract class StubPsiFactory {
  public abstract PsiClass createClass(PsiClassStub stub);

  public abstract PsiAnnotation createAnnotation(PsiAnnotationStub stub);

  public abstract PsiClassInitializer createClassInitializer(PsiClassInitializerStub stub);

  public abstract PsiReferenceList createClassReferenceList(PsiClassReferenceListStub stub);

  public abstract PsiField createField(PsiFieldStub stub);

  public abstract PsiImportList createImportList(PsiImportListStub stub);

  public abstract PsiImportStatementBase createImportStatement(PsiImportStatementStub stub);

  public abstract PsiMethod createMethod(PsiMethodStub stub);

  public abstract PsiModifierList createModifierList(PsiModifierListStub stub);

  public abstract PsiParameter createParameter(PsiParameterStub stub);

  public abstract PsiParameterList createParameterList(PsiParameterListStub stub);

  public abstract PsiTypeParameter createTypeParameter(PsiTypeParameterStub stub);

  public abstract PsiTypeParameterList createTypeParameterList(PsiTypeParameterListStub stub);

  public abstract PsiAnnotationParameterList createAnnotationParameterList(PsiAnnotationParameterListStub stub);

  public abstract PsiNameValuePair createNameValuePair(PsiNameValuePairStub stub);
}


text:
<component name="libraryTable">
  <library name="websocket">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/third_party/java/websocket/websocket-api-9.4.3.v20170317.jar!/" />
      <root url="jar://$PROJECT_DIR$/third_party/java/websocket/websocket-client-9.4.3.v20170317.jar!/" />
      <root url="jar://$PROJECT_DIR$/third_party/java/websocket/websocket-common-9.4.3.v20170317.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$PROJECT_DIR$/third_party/java/websocket/websocket-api-9.4.3.v20170317-sources.jar!/" />
      <root url="jar://$PROJECT_DIR$/third_party/java/websocket/websocket-client-9.4.3.v20170317-sources.jar!/" />
      <root url="jar://$PROJECT_DIR$/third_party/java/websocket/websocket-common-9.4.3.v20170317-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
require 'rails_helper'

RSpec.describe AboutController, type: :controller do

end


text:
import { defineAsyncComponent } from 'vue';
import { showModal } from '../../../../_common/modal/modal.service';

export class UserAvatarModal {
	static async show() {
		return await showModal<void>({
			modalId: 'UserAvatar',
			component: defineAsyncComponent(() => import('./avatar-modal.vue')),
			size: 'sm',
			noBackdropClose: true,
		});
	}
}


text:
%This function add an exit door to a room and calculate a distance off all
%cols to the door
%
%function mat = addExitDoor(startR,startY,sizeDoor, orientation)
%
%Parameters:
%   startR - row where the door will start
%   startC - col where the door will start
%   sizeDoor - sizeDoor of the door
%   orientation - orientation of door. 0 = vertical or 1 = horizontal
%   room - the room to distance calculate
%   cel_sizeDoor - sizeDoor of each cel in room
%
%   r = addExitDoor(52,1,2,0,createRoom(100,36),0.4)

function res = addExitDoor(start_r,start_c,sizeDoor,orientation,room,cel_sizeDoor)
%get number of rows and cols of room
[rows,cols] = size(room);

%start calculate
for d = 0:sizeDoor-1
    increment_r = 0;
    increment_c = 0;
    if orientation < 1
        increment_r = d;
    else
        increment_c =d;
    end
    room(start_r+increment_r,start_c+increment_c) = 0;

    for i = 2:rows-1
        for j = 2: cols-1
            %distance betwen the door and the roon current position
            dist = ((i-(start_r+increment_r))*cel_sizeDoor)^2+((j-(start_c+increment_c))*cel_sizeDoor)^2;
            if room(i,j) > dist | room(i,j) == -1
                room(i,j) = dist;
            end
        end
    end
end
res = room;