text:
/** \file algebra/matrix_difference.h
 *
 * \brief Proxy class for computing differences of matrices.
 *
 * Contains the class invlib::MatrixDifference which is a proxy class
 * for computing the difference of marices and vectors.
 *
 */

#ifndef ALGEBRA_MATRIX_DIFFERENCE_H
#define ALGEBRA_MATRIX_DIFFERENCE_H

#include "invlib/traits.h"

namespace invlib
{

// -------------------- //
// Forward Declarations //
// -------------------- //

template
<
typename T1,
typename T2
>
class MatrixProduct;

template
<
typename T1,
typename T2
>
class MatrixSum;

/** \brief Proxy class for computing differences of matrices.
 *
 * The MatrixDifference class template provides a template proxy class
 * for computing the difference of two algebraic expressions.
 *
 * For given type @T1, @T2, for the difference to be evaluatable to
 * type MatrixType, @T1 must be convertible to the @MatrixType type and provide
 * a subtract(const T2&) member function.
 *
 * \tparam T1 The type of the left operand of the difference.
 * \tparam T2 The type of the right operand of the difference.
 * \tparam MatrixType The underlying matrix type.
 *
 */
template
<
typename T1,
typename T2
>
class MatrixDifference
{

public:

    /*! The basic scalar type. */
    using RealType   = typename decay<T2>::RealType;
    /*! The basic vector type  */
    using VectorType = typename decay<T2>::VectorType;
    /*! The basic matrix type. */
    using MatrixType = typename decay<T2>::MatrixType;
    /*! The type of the result of the expression */
    using ResultType = typename decay<T2>::ResultType;

    // ------------------------------- //
    //  Constructors and Destructors   //
    // ------------------------------- //

    /*! Create arithmetic expression for the difference of the two
     * operands \$fA\f$ and \$fB\$f.
     *
     * \param A The left hand operand of the difference.
     * \param B The right hand operand of the difference.
     * \return Arithmetic expression representing the difference \f$A - B\f$.
     */
    MatrixDifference(T1 A, T2 B);

    /*! Default copy constructor.
     *
     * Proxy objects are lightweight and can be efficiently copied. However,
     * note that there is no caching in place to reuse the results from identical
     * arithmetic operations.
     *
     * \todo Enable caching.
     *
     */
    MatrixDifference(const MatrixDifference &) = default;

    /*! Default move operator. */
    MatrixDifference(MatrixDifference &&) = default;

    /*! Default assignment operator. */
    MatrixDifference & operator=(const MatrixDifference &) = default;

    /*! Default move assignment operator. */
    MatrixDifference & operator=(MatrixDifference &&) = default;

    // --------------------- //
    //   Nested Evaluation   //
    // --------------------- //

    /*! Compute product of this difference expression and a vector.
     *
     * Avoids explicit evaluation of the difference by passing the vector down
     * the expression tree and returning the difference of the matrix-vector products
     * of both operands \f$A\f$ and \f$B\f$ and the given vector \f$v\f$. This
     * is done by calling the multiply(const VectorType&) member function of the
     * summands.
     *
     * \param v The vector v to multiply the sum by.
     * \return The matrix-vector product \f$(A - B)v\f$
     */
    VectorType multiply(const VectorType &v) const;

    /*! Compute product of this difference expression and a matrix.
     *
     * Evaluates the difference \f$D = A - B\$f represented by this
     * object and multiplies the result \f$D\f$ by the given matrix
     * \f$C\f$.
     *
     * \param C The matrix \f$C\f$ to multiply the difference by.
     * \return The matrix-matrix product \f$(A - B)C\f$
     */
    MatrixType multiply(const MatrixType &C) const;

    /*! Solve this linear system.
     *
     * Solve the linear system \f$Cx = v\f$ for the linear system
     * corresponding to this matrix difference \f$C = A - B\f$. The solution
     * requires the evaluation of the matrix difference and thus the
     * allocation of an additional matrix. The solution of the linear
     * system is delegated to the fundamental matrix type by calling
     * the solve(const VectorType&) member function of the result of
     * this sum.
     *
     * \param The right hand side vector \f$v\f$ \return The solution
     * vector of the linear system \f$x\f$
     */
    VectorType solve(const VectorType &v) const;

    /*! Invert this matrix difference.
     *
     * Invert the linear system represented by this difference algebraic
     * expression \f$C = A - B\f$. The inversion requires the evaluation of the
     * matrix sum and thus the allocation of an additional matrix. The
     * solution of the linear system is delegated to the fundamental
     * matrix type by calling the invert() member function of the
     * result of this sum.
     *
     * \return The inverse of the matrix represented by this algebraic
     * expression.
     */
    MatrixType invert() const;

    /*! Diagonal of this matrix difference.
     *
     * Compute the diagonal of this matrix difference as the difference of the
     * diagonals of the two operands of the difference. Delegates the computation
     * of the operand diagonals to the diagonal() member functions of the operands.
     *
     * \result A VectorType object representing the diagonal of this matrix difference.
     */
    VectorType diagonal() const;

    /*! Extract row.
     *
     * Returns the ith row of this matrix difference as an object of VectorType. The row
     * is computed as the difference of the corresponding rows of the operands of the
     * difference. Calls the row member functions of the operands.
     *
     * \return A VectorType object representing the ith row of this matrix expression.
     */
    VectorType row(size_t i) const;

    /*! Extract columns.
     *
     * Returns the ith columns of this matrix difference as an object of VectorType. The columns
     * is computed as the difference of the corresponding columns of the operands of the
     * difference. Calls the columns member functions of the operands.
     *
     * \return A VectorType object representing the ith columns of this matrix expression.
     */
    VectorType col(size_t i) const;

    // --------------------- //
    // Arithmetic Operators  //
    // --------------------- //

    /*!
     * Proxy type template for a product of this difference expression
     * and another algebraic expression of given type.
     */
    template <typename T3>
    using Product = MatrixProduct<MatrixDifference, T3>;

    /*! Create product arithmetic expression.
     *
     * \tparam T3 The type of the object to multiply this difference with.
     * \param C   The object to multiply this difference with.
     * \return An algebraic expression object representing the product of
     * this difference and the provided argument.
     *
     * \todo Add static asserts.
     */
    template<typename T3>
    Product<T3> operator*(T3 &&C) const;

    /*!
     * Proxy type template for a sum of this difference expression
     * and another algebraic expression of given type.
     */
    template <typename T3>
    using Sum = MatrixSum<MatrixDifference, T3>;

    /*! Create sum arithmetic expression.
     *
     * \tparam T3 The type of the object to add to this difference with.
     * \param C   The object to add to this difference with.
     * \return An algebraic expression object representing the sum of
     * this difference and the provided argument.
     *
     * \todo Add static asserts.
     */
    template <typename T3>
    Sum<T3> operator+(T3 &&C) const;

    /*!
     * Proxy type template for a nested difference of this difference and
     * another algebraic expression of given type.
     */
    template <typename T3>
    using Difference = MatrixDifference<MatrixDifference, T3>;

    /*! Create difference arithmetic expression.
     *
     * \tparam T3 The type of the object to subtract from this difference.
     * \param C   The object to subtract from this difference.
     * \return An algebraic expression object representing the difference of
     * this difference and the provided argument.
     *
     * \todo Add static asserts.
     */
    template <typename T3>
    Difference<T3> operator-(T3 &&C) const;

    operator ResultType() const;

private:

    T1 A;
    T2 B;

};

#include "matrix_difference.cpp"

}

#endif // ALGEBRA_MATRIX_DIFFERENCE_H


text:
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=com.codenotfound%3Aspring-kafka-hello-world&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.codenotfound%3Aspring-kafka-hello-world)

A detailed step-by-step tutorial on how to implement an Apache Kafka Consumer and Producer using Spring Kafka and Spring Boot.

[https://codenotfound.com/spring-kafka-consumer-producer-example.html](https://codenotfound.com/spring-kafka-consumer-producer-example.html)

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <base data-ice="baseUrl">
  <title data-ice="title">Index | API Document</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">

  Home

  Reference
  Source

  Repository

    <input class="search-input">

commands
CCommand

CGive

CMsg

CSay

CSpawnpoint

CTell

CW

concepts
CCoordinate

CItem

CPlayer

CTargetSelector

constants
Vitems

helpers
FtoDataTag

References

Class Summary

Static Public Class Summary

      public

           Command

The base class of all minecraft commands.

      public

           Coordinate

Represents a coordinate composed by X, Y, Z.

      public

           Give

Gives an item to a player.

      public

           Item

Represents an Item Name.

      public

           Msg

Alias of Tell command.

      public

           Player

Represents a player which can be a target selector or a plain string.

      public

           Say

Sends a message in the chat to other players.

      public

           Spawnpoint

Sets the spawn point for a player.

      public

           TargetSelector

The target selector

      public

           Tell

Sends a private message to one or more players.

      public

           W

Alias of Tell command

Function Summary

Static Public Function Summary

      public

           toDataTag(obj: object): string

Converts an javascript object to Minecraft DataTag.

Variable Summary

Static Public Variable Summary

      public

           items: *

Represents all item IDs.

  Generated by ESDoc(0.4.0)


text:
package test;

import expr.Ident;
import gui.render.Renderer;
import gui.render.State;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CommonTokenStream;

import typecheck.Typecheck;
import antlr4.QLLexer;
import antlr4.QLParser;
import ast.ASTNode;
import ast.errormsg.Error;
import ast.form.Form;
import ast.form.Question;
import ast.form.StatementList;

public class TestRenderer extends JFrame {

	private static final long serialVersionUID = 1L;
	StatementList statement;
	Renderer renderer;
	JComponent jcomp = null;

	public TestRenderer() throws FileNotFoundException, IOException {

		Form form = getinput();
		renderer = new Renderer(new State(), form);
		statement = form.getStatements();

		for (int i = 0; i < statement.getList().size(); i++) {
			if (statement.getList().get(i).getClass() == Question.class) {

				Question node = (Question) statement.getList().get(i);
				jcomp = renderer.visit(node);
				setLayout(new GridBagLayout () );
				GridBagConstraints c= new GridBagConstraints();
				c.gridx=0;
				c.gridy=1;
				add(jcomp,c);
			}

		}

		setTitle("Housing");
		setSize(1000, 300);
		setLocationRelativeTo(null);
		setDefaultCloseOperation(EXIT_ON_CLOSE);

	}

	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {

			@Override
			public void run() {
				TestRenderer r;
				try {
					r = new TestRenderer();
					r.setVisible(true);
				} catch (FileNotFoundException e) {
					e.printStackTrace();
				} catch (IOException e) {
					e.printStackTrace();
				}

			}

		});
	}

	private Form getinput() throws FileNotFoundException, IOException {

		File infile = new File(
				"C:\\Users\\nisha\\workspace\\Nisha\\src\\test1.ql");
		ANTLRInputStream input = new ANTLRInputStream(new FileInputStream(
				infile));
		QLLexer lexer = new QLLexer(input);
		CommonTokenStream tokens = new CommonTokenStream(lexer);
		QLParser parser = new QLParser(tokens);
		ASTNode tree = parser.forms().result;
		Map<Ident, ast.type.Type> mapvalue = new HashMap<Ident, ast.type.Type>();
		Error errors= new Error();
		Typecheck t = new Typecheck(mapvalue, errors);
		boolean result = t.checkId(tree, mapvalue, errors);
		System.out.println("result is " + result);
		if (result)
			return (Form) tree;
		else
			System.out.println(t.get_errorList());
		return null;

	}

}


text:
<?php

declare(strict_types=1);

namespace Sphp\Documentation\SyntaxHighlighting;

use Sphp\Html\Code\Pre;
use Sphp\Html\Code\Code;
use Sphp\Html\ContainerTag;
use Sphp\Stdlib\Filesystem;

/**
 * The Prism class
 *
 * @author  Sami Holck <sami.holck@gmail.com>
 * @license https://opensource.org/licenses/MIT MIT License
 * @link    https://github.com/samhol/SPHP-framework Github repository
 * @filesource
 */
class Prism implements SyntaxHighlighter {

  private bool $showLineNumbers = true;

  public function showLineNumbers(bool $showLineNumbers) {
    $this->showLineNumbers = $showLineNumbers;
    return $this;
  }

  public function blockFromFile(string $filename): string {
    $pre = new Pre();
    if (str_ends_with($filename, '.php')) {
      $source = Filesystem::toString($filename);
      $pre = $this->tagFromSource($source, 'php');
    } else {
      $pre->setAttribute('data-src', ltrim($filename, '.'));
    }
    if ($this->showLineNumbers) {
      $pre->addCssClass('line-numbers');
    }
    return (string) $pre;
  }

  private function parsePHP(string $source): string {
    return preg_replace(['/<(\?|\%)\=?(php)?/', '/(\%|\?)>/'], ['<?php', '?>'], $source);
  }

  private function tagFromSource(string $source, string $language): ContainerTag {
    $tag = new ContainerTag('script', $source);
    $tag->setAttribute('type', 'text/plain');
    if ($language === 'html' || $language === 'html5' || $language === 'svg') {
      $language = 'markup';
    }
    $tag->addCssClass("language-$language");
    return $tag;
  }

  public function blockFromString(string $source, string $language): string {
    return (string) $this->tagFromSource($source, $language);
  }

  public function inlineFromString(string $source, string $language): string {
    if ($language == 'php') {
      $source = $this->parsePHP($source);
    }
    $out = new Code($source);
    $out->addCssClass("language-$language");
    return (string) $out;
  }

}


text:
#ifndef JOYSTICK_H
#define JOYSTICK_H

#include <QObject>

class QTimer;

class Joystick : public QObject
{
    Q_OBJECT

    struct JsEvent
    {
        std::uint32_t time;  /* event timestamp in milliseconds */
        std::int16_t value;  /* value */
        std::uint8_t type;   /* event type */
        std::uint8_t number; /* axis/button number */
    };

    int jsFile;
    JsEvent jsEvent;
    QTimer *readDataTimer;
public:
    enum JsEventType
    {
        JS_EVENT_TYPE_BUTTON = 0x01,
        JS_EVENT_TYPE_AXIS = 0x02,
        JS_EVENT_TYPE_INIT = 0x80
    };
    enum JsEventAxisButtonNumber
    {
        JS_EVENT_AXIS_X_WE = 0x00,
        JS_EVENT_AXIS_X_NS = 0x01,
    };

    explicit Joystick(QObject *parent = 0);
    ~Joystick();

signals:
    void joystickEvent(std::uint8_t type, std::uint8_t num,
        std::int16_t value);

public slots:
    void slotReadData();
};

#endif // JOYSTICK_H


text:
package io.opentelemetry.api.baggage.propagation;

import java.util.BitSet;
import javax.annotation.Nullable;

/**
 * Represents single element of a W3C baggage header (key or value). Allows tracking parsing of a
 * header string, keeping the state and validating allowed characters. Parsing state can be reset
 * with {@link #reset(int)} allowing instance re-use.
 */
class Element {

  private static final BitSet EXCLUDED_KEY_CHARS = new BitSet(128);
  private static final BitSet EXCLUDED_VALUE_CHARS = new BitSet(128);

  static {
    for (char c :
        new char[] {
          '(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=', '{', '}'
        }) {
      EXCLUDED_KEY_CHARS.set(c);
    }
    for (char c : new char[] {'"', ',', ';', '\\'}) {
      EXCLUDED_VALUE_CHARS.set(c);
    }
  }

  private final BitSet excluded;

  private boolean leadingSpace;
  private boolean readingValue;
  private boolean trailingSpace;
  private int start;
  private int end;
  @Nullable private String value;

  static Element createKeyElement() {
    return new Element(EXCLUDED_KEY_CHARS);
  }

  static Element createValueElement() {
    return new Element(EXCLUDED_VALUE_CHARS);
  }

  /**
   * Constructs element instance.
   *
   * @param excluded characters that are not allowed for this type of an element
   */
  private Element(BitSet excluded) {
    this.excluded = excluded;
    reset(0);
  }

  @Nullable
  String getValue() {
    return value;
  }

  void reset(int start) {
    this.start = start;
    leadingSpace = true;
    readingValue = false;
    trailingSpace = false;
    value = null;
  }

  boolean tryTerminating(int index, String header) {
    if (this.readingValue) {
      markEnd(index);
    }
    if (this.trailingSpace) {
      setValue(header);
      return true;
    } else {
      // leading spaces - no content, invalid
      return false;
    }
  }

  private void markEnd(int end) {
    this.end = end;
    this.readingValue = false;
    trailingSpace = true;
  }

  private void setValue(String header) {
    this.value = header.substring(this.start, this.end);
  }

  boolean tryNextChar(char character, int index) {
    if (isWhitespace(character)) {
      return tryNextWhitespace(index);
    } else if (isExcluded(character)) {
      return false;
    } else {
      return tryNextTokenChar(index);
    }
  }

  private static boolean isWhitespace(char character) {
    return character == ' ' || character == '\t';
  }

  private boolean tryNextWhitespace(int index) {
    if (readingValue) {
      markEnd(index);
    }
    return true;
  }

  private boolean isExcluded(char character) {
    return (character <= 32 || character >= 127 || excluded.get(character));
  }

  private boolean tryNextTokenChar(int index) {
    if (leadingSpace) {
      markStart(index);
    }
    return !trailingSpace;
  }

  private void markStart(int start) {
    this.start = start;
    readingValue = true;
    leadingSpace = false;
  }
}


text:
namespace platform
{
namespace dummy
{
////////////////////////////////////////

screen::screen( void ) {}

////////////////////////////////////////

screen::~screen( void ) {}

////////////////////////////////////////

core::size screen::bounds( void ) { return { 0, 0 }; }

////////////////////////////////////////

} // namespace dummy
} // namespace platform