text:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <variable
            name="bean"
            type="com.example.jingbin.cloudreader.bean.ComingFilmBean.MoviecomingsBean" />

    </data>

    <androidx.cardview.widget.CardView xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/cv_top_movie"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="6dp"
        android:layout_marginTop="6dp"
        android:layout_marginEnd="6dp"
        android:layout_marginBottom="6dp"
        android:foreground="?attr/selectableItemBackgroundBorderless"
        app:cardCornerRadius="2dp"
        app:cardElevation="2dp">

        <LinearLayout
            android:id="@+id/ll_item_top"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingBottom="3dp">

            <!--android:defaultPicType='@{0}'-->
            <!--android:displayFadeImage='@{bean.images.large}'-->
            <ImageView
                android:id="@+id/iv_top_photo"
                android:layout_width="match_parent"
                android:layout_height="135dp"
                android:scaleType="fitXY"
                android:showMovieImg='@{bean.image}'
                android:transitionName="@string/transition_movie_img"
                app:layout_collapseMode="parallax"
                app:layout_collapseParallaxMultiplier="0.7"
                tools:background="@color/color_page_bg" />

            <TextView
                android:id="@+id/tv_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginLeft="2dp"
                android:layout_marginTop="3dp"
                android:layout_marginRight="2dp"
                android:ellipsize="end"
                android:singleLine="true"
                android:text="@{bean.title}"
                android:textColor="@color/colorTitle"
                android:textSize="12sp" />

            <TextView
                android:id="@+id/tv_rate"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:text="@{bean.releaseDate}"
                android:textSize="10sp" />

        </LinearLayout>
    </androidx.cardview.widget.CardView>
</layout>


text:
from typing import TypeVar, Generic, Callable, Union

T = TypeVar('T')
U = TypeVar('U')

class Maybe(Generic[T]):
    """
    Maybe type is the most common way of representing nothingness (or the null type).
    Maybe is effectively abstract and has two concrete subtypes: Box (also Some) and Nothing.
    """

    def __init__(self, value: T, is_nothing: bool) -> None:
        self.is_nothing = is_nothing
        if not is_nothing:
            self.value = value

    def __eq__(self, other: object) -> bool:
        return isinstance(other, Maybe) and \
            self.is_nothing == other.is_nothing and \
            (self.is_nothing or self.value == other.value)

    @classmethod
    def just(cls, value: T) -> 'Maybe[T]':
        """
        Create not empty maybe.

        :param mapper: value to store in Maybe
        :type mapper: Any
        :returns: Maybe[Any]
        """
        return Maybe(value, False)

    @classmethod
    def nothing(cls) -> 'Maybe[None]':
        """
        Create empty maybe.

        :returns: Maybe[None]
        """
        return Maybe(None, True)

    def map(self, mapper: Callable[[T], U]) -> Union['Maybe[U]', 'Maybe[None]']:
        """
        If Maybe is empty return new empty Maybe, in other case
        takes mapper function and returns new instance of Maybe
        with result of mapper.

        :param mapper: function to call with Maybe value
        :type mapper: Function(A) -> B
        :returns: Maybe[B | None]
        """
        if self.is_nothing:
            return Maybe.nothing()
        return Maybe.just(
            mapper(self.value)
        )

    def bind(self, mapper: Callable[[T], 'Maybe[U]']) -> Union['Maybe[U]', 'Maybe[None]']:
        """
        If Maybe is empty return new empty Maybe, in other case
        takes mapper function and returns result of mapper.

        :param mapper: function to call with Maybe.value
        :type mapper: Function(A) -> Maybe[B]
        :returns: Maybe[B | None]
        """
        if self.is_nothing:
            return Maybe.nothing()
        return mapper(self.value)

    def ap(self, applicative):
        """
        Applies the function inside the Maybe[A] structure to another applicative type for notempty Maybe.
        For empty returns copy of itself

        :param applicative: applicative contains function
        :type applicative: Maybe[B]
        :returns: new Maybe with result of contains function
        :rtype: Maybe[A(B) | None]
        """
        if self.is_nothing:
            return Maybe.nothing()
        return applicative.map(self.value)

    def filter(self, filterer: Callable[[T], bool]) -> Union['Maybe[T]', 'Maybe[None]']:
        """
        If Maybe is empty or filterer returns False return default_value, in other case
        return new instance of Maybe with the same value.

        :param filterer:
        :type filterer: Function(A) -> Boolean
        :returns: copy of self when filterer returns True, in other case empty Maybe
        :rtype: Maybe[A] | Maybe[None]
        """
        if self.is_nothing or not filterer(self.value):
            return Maybe.nothing()
        return Maybe.just(self.value)

    def get_or_else(self, default_value: U) -> Union[T, U]:
        """
        If Maybe is empty return default_value, in other case.

        :param default_value: value to return if Maybe is empty
        :type default_value: Any
        :returns: value of Maybe or default_value
        :rtype: A
        """
        if self.is_nothing:
            return default_value
        return self.value

    def to_either(self):
        """
        Transform Maybe to Either.

        :returns: Right monad with previous value when Maybe is not empty, in other case Left with None
        :rtype: Either[A | None]
        """
        from pymonet.either import Left, Right

        if self.is_nothing:
            return Left(None)
        return Right(self.value)

    def to_box(self):
        """
        Transform Maybe to Box.

        :returns: Box monad with previous value when Maybe is not empty, in other case Box with None
        :rtype: Box[A | None]
        """
        from pymonet.box import Box

        if self.is_nothing:
            return Box(None)
        return Box(self.value)

    def to_lazy(self):
        """
        Transform Maybe to Try.

        :returns: Lazy monad with function returning previous value in other case Left with None
        :rtype: Lazy[Function() -> (A | None)]
        """
        from pymonet.lazy import Lazy

        if self.is_nothing:
            return Lazy(lambda: None)
        return Lazy(lambda: self.value)

    def to_try(self):
        """
        Transform Maybe to Try.

        :returns: successfully Try with previous value when Maybe is not empty, othercase not successfully Try with None
        :rtype: Try[A]
        """
        from pymonet.monad_try import Try

        if self.is_nothing:
            return Try(None, is_success=False)
        return Try(self.value, is_success=True)

    def to_validation(self):
        """
        Transform Maybe into Validation.

        :returns: successfull Validation monad with previous value or None when Maybe is empty
        :rtype: Validation[A, []]
        """
        from pymonet.validation import Validation

        if self.is_nothing:
            return Validation.success(None)
        return Validation.success(self.value)

redpajama_set_name: RedPajamaGithub


text:
class OrderItem < ActiveRecord::Base
  belongs_to :order
  belongs_to :product

  attr_protected

  def validate
    errors.add(:amount, "should be one or more") unless amount.nil? || amount > 0
    errors.add(:price, "should be a positive number") unless price.nil? || price > 0.0
  end
end


text:
set :application, 'atraskkauna'
set :repo_url, '#'

set :deploy_to, '/home/atraskkauna/'

set :branch, 'master'
set :scm, :archive

set :linked_files, fetch(:linked_files, []).push('.env')
set :linked_dirs, fetch(:linked_dirs, []).push('storage/logs')


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sujan.lms.ui.member;

import com.sujan.lms.bll.MemberBLL;
import com.sujan.lms.custom.Alert;
import com.sujan.lms.entity.address.Address;
import com.sujan.lms.entity.member.MemberInfo;
import com.sujan.lms.exception.CorruptedDataException;
import com.sujan.lms.exception.DuplicateRecordException;
import com.sujan.lms.exception.MissingFileException;
import com.sujan.lms.util.Logy;
import com.sujan.lms.util.Utils;
import com.sujan.lms.validation.member.MemberValidation;
import java.util.Calendar;

/**
 *
 * @author Suzn
 */
public class MemberInsertDialog extends javax.swing.JDialog {

    private final MemberValidation validation;
    private ItemAddedListener itemAddedListener;

    private void notifyDataSetChanged(MemberInfo member) {
        if (getItemAddedListener() != null) {
            getItemAddedListener().onNewItemAdded(member);
        }
    }

    private void resetFields() {
        nameTextField.setText(null);
        contactTextField.setText(null);
        addressTextField.setText(null);
        expiryDatePicker.setSelectedDate(null);
    }

    public interface ItemAddedListener {

        void onNewItemAdded(MemberInfo member);
    }

    /**
     * Creates new form MemberInsertDialog1
     *
     * @param parent
     * @param modal
     */
    public MemberInsertDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        setLocationRelativeTo(parent);
        validation = new MemberValidation(parent);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        rootPanel = new javax.swing.JPanel();
        topPanel = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        centerPanel = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        nameTextField = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        addressTextField = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        contactTextField = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        expiryDatePicker = new datechooser.beans.DateChooserCombo();
        jPanel6 = new javax.swing.JPanel();
        cancelButton = new javax.swing.JButton();
        saveButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);
        getContentPane().setLayout(new java.awt.CardLayout());

        rootPanel.setLayout(new java.awt.BorderLayout());

        topPanel.setBackground(new java.awt.Color(39, 26, 252));
        topPanel.setPreferredSize(new java.awt.Dimension(482, 200));
        topPanel.setLayout(new java.awt.GridLayout(2, 0));

        jPanel1.setOpaque(false);
        topPanel.add(jPanel1);

        jPanel2.setOpaque(false);

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));
        jPanel3.setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 0, 1, new java.awt.Color(153, 153, 153)));
        jPanel3.setPreferredSize(new java.awt.Dimension(320, 100));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(51, 51, 51));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Add Member");
        jLabel1.setPreferredSize(new java.awt.Dimension(113, 50));

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(38, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap(83, Short.MAX_VALUE)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 386, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(83, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        topPanel.add(jPanel2);

        rootPanel.add(topPanel, java.awt.BorderLayout.PAGE_START);

        centerPanel.setBackground(new java.awt.Color(214, 215, 217));

        jPanel4.setBackground(new java.awt.Color(255, 255, 255));
        jPanel4.setBorder(javax.swing.BorderFactory.createMatteBorder(0, 1, 1, 1, new java.awt.Color(153, 153, 153)));
        jPanel4.setPreferredSize(new java.awt.Dimension(380, 200));

        jPanel5.setOpaque(false);

        jLabel2.setText("Name");

        jLabel3.setText("Address");

        jLabel4.setText("Contact");

        contactTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                char enter = evt.getKeyChar();
                if(!(Character.isDigit(enter))){
                    evt.consume();
                }
            }
        });

        jLabel5.setText("Expiry Date");

        expiryDatePicker.setSelectedDate(null);
        expiryDatePicker.setCalendarPreferredSize(new java.awt.Dimension(340, 180));

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(addressTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(contactTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(expiryDatePicker, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(addressTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(contactTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(expiryDatePicker, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jPanel6.setBorder(javax.swing.BorderFactory.createMatteBorder(1, 0, 0, 0, new java.awt.Color(255, 51, 0)));
        jPanel6.setForeground(new java.awt.Color(255, 255, 255));
        jPanel6.setOpaque(false);

        cancelButton.setText("Cancel");
        cancelButton.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });

        saveButton.setText("Save");
        saveButton.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        saveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(saveButton, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(36, 36, 36))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(saveButton, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 32, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(42, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout centerPanelLayout = new javax.swing.GroupLayout(centerPanel);
        centerPanel.setLayout(centerPanelLayout);
        centerPanelLayout.setHorizontalGroup(
            centerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, centerPanelLayout.createSequentialGroup()
                .addContainerGap(83, Short.MAX_VALUE)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 386, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(83, Short.MAX_VALUE))
        );
        centerPanelLayout.setVerticalGroup(
            centerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(centerPanelLayout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(63, 63, 63))
        );

        rootPanel.add(centerPanel, java.awt.BorderLayout.CENTER);

        getContentPane().add(rootPanel, "card2");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        this.dispose();
    }//GEN-LAST:event_cancelButtonActionPerformed

    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
        if (validation.isMemberFormValid(nameTextField.getText(), addressTextField.getText(), contactTextField.getText(),
                expiryDatePicker.getSelectedDate())) {

            MemberInfo member = new MemberInfo();
            member.setId(Utils.generateRandomID());
            member.setName(nameTextField.getText());
            member.setAddress(new Address(addressTextField.getText()));
            member.setContact(contactTextField.getText());
            member.setExpiryDate(expiryDatePicker.getSelectedDate().getTimeInMillis());
            member.setJoinedDate(Calendar.getInstance().getTimeInMillis());

            try {
                MemberBLL.insertMember(member);
                notifyDataSetChanged(member);
                Alert.showInformation(this, "Member inserted successfully!");

                resetFields();
            } catch (DuplicateRecordException | MissingFileException | CorruptedDataException ex) {
                Logy.e(ex);
                Alert.showError(this, ex.getMessage());
            }

        }
    }//GEN-LAST:event_saveButtonActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MemberInsertDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>

        //</editor-fold>
        //</editor-fold>

        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(() -> {
            MemberInsertDialog dialog = new MemberInsertDialog(new javax.swing.JFrame(), true);
            dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                @Override
                public void windowClosing(java.awt.event.WindowEvent e) {
                    System.exit(0);
                }
            });
            dialog.setVisible(true);
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField addressTextField;
    private javax.swing.JButton cancelButton;
    private javax.swing.JPanel centerPanel;
    private javax.swing.JTextField contactTextField;
    private datechooser.beans.DateChooserCombo expiryDatePicker;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JTextField nameTextField;
    private javax.swing.JPanel rootPanel;
    private javax.swing.JButton saveButton;
    private javax.swing.JPanel topPanel;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the itemAddedListener
     */
    public ItemAddedListener getItemAddedListener() {
        return itemAddedListener;
    }

    /**
     * @param itemAddedListener the itemAddedListener to set
     */
    public void setItemAddedListener(ItemAddedListener itemAddedListener) {
        this.itemAddedListener = itemAddedListener;
    }

}


text:
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Komentaras
 *
 * @ORM\Table(name="komentaras")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\KomentarasRepository")
 */
class Komentaras
{
    /**
     * @var int
     *
     * @ORM\Column(name="komentaro_numeris", type="integer")
	 * @ORM\Id
	 * @ORM\GeneratedValue(strategy="AUTO")
	 */
    private $komentaro_numeris;

    /**
     * @var string
     *
     * @ORM\Column(name="tekstas", type="text")
     */
    private $tekstas;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="sukurimo_data", type="datetime")
     */
    private $sukurimo_data;

    /**
     * @var int
     *
     * @ORM\Column(name="prekes_numeris", type="integer")
     */
    private $prekes_numeris;

    /**
     * @var int
     *
     * @ORM\Column(name="vartotojo_numeris", type="integer")
     */
    private $vartotojo_numeris;

	/**
	 * @var AppBundle\Entity\Preke
	 * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Preke", inversedBy="komentarai")
	 * @ORM\JoinColumn(name="prekes_numeris", referencedColumnName="prekes_numeris")
	 */
	private $preke;

	/**
	 * @var AppBundle\Entity\Vartotojas
	 * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Vartotojas", inversedBy="komentarai")
	 * @ORM\JoinColumn(name="vartotojo_numeris", referencedColumnName="id")
	 */
	private $vartotojas;

	/**
	 * Set vartotojas
	 *
	 * @param AppBundle\Entity\Vartotojas $vartotojas
	 *
	 * @return Komentaras
	 */
	public function setVartotojas($vartotojas)
	{
		$this->vartotojas = $vartotojas;

		return $this;
	}

	/**
	 * Get vartotojas
	 *
	 * @return AppBundle\Entity\Vartotojas $vartotojas
	 */
	public function getVartotojas()
	{
		return $this->vartotojas;
	}

	/**
	 * Set preke
	 *
	 * @param AppBundle\Entity\Preke $preke
	 *
	 * @return Komentaras
	 */
	public function setPreke($preke)
	{
		$this->preke = $preke;

		return $this;
	}

	/**
	 * Get preke
	 *
	 * @return AppBundle\Entity\Preke $preke
	 */
	public function getPreke()
	{
		return $this->preke;
	}

    /**
     * Set komentaroNumeris
     *
     * @param integer $komentaroNumeris
     *
     * @return Komentaras
     */
    public function setkomentaro_numeris($komentaroNumeris)
    {
        $this->komentaro_numeris = $komentaroNumeris;

        return $this;
    }

    /**
     * Get komentaroNumeris
     *
     * @return int
     */
    public function getkomentaro_numeris()
    {
        return $this->komentaro_numeris;
    }

    /**
     * Set tekstas
     *
     * @param string $tekstas
     *
     * @return Komentaras
     */
    public function setTekstas($tekstas)
    {
        $this->tekstas = $tekstas;

        return $this;
    }

    /**
     * Get tekstas
     *
     * @return string
     */
    public function getTekstas()
    {
        return $this->tekstas;
    }

    /**
     * Set sukurimoData
     *
     * @param \DateTime $sukurimoData
     *
     * @return Komentaras
     */
    public function setSukurimoData($sukurimoData)
    {
        $this->sukurimo_data = $sukurimoData;

        return $this;
    }

    /**
     * Get sukurimoData
     *
     * @return \DateTime
     */
    public function getSukurimoData()
    {
        return $this->sukurimo_data;
    }

    /**
     * Set prekesNumeris
     *
     * @param integer $prekesNumeris
     *
     * @return Komentaras
     */
    public function setPrekesNumeris($prekesNumeris)
    {
        $this->prekes_numeris = $prekesNumeris;

        return $this;
    }

    /**
     * Get prekesNumeris
     *
     * @return int
     */
    public function getPrekesNumeris()
    {
        return $this->prekes_numeris;
    }

    /**
     * Set vartotojoNumeris
     *
     * @param integer $vartotojoNumeris
     *
     * @return Komentaras
     */
    public function setVartotojoNumeris($vartotojoNumeris)
    {
        $this->vartotojo_numeris = $vartotojoNumeris;

        return $this;
    }

    /**
     * Get vartotojoNumeris
     *
     * @return int
     */
    public function getVartotojoNumeris()
    {
        return $this->vartotojo_numeris;
    }

	public function __toString()
	{
		return $this->tekstas;
	}
}


text:
/**
 * @file /cryptron/ecies.c
 *
 * @brief ECIES encryption/decryption functions.
 *
 * $Author: Ladar Levison $
 * $Website: http://lavabit.com $
 * $Date: 2010/08/06 06:02:03 $
 * $Revision: a51931d0f81f6abe29ca91470931d41a374508a7 $
 *
 * I hereby place the attached code in the public domain.
 * As such it comes without any warranty regarding its merchantability or
 * fitness for a particular purpose. Please use it at your own risk.
 *
 * Optimised by John Doering <ghostlander@orbitcoin.org>
 *
 */

#include <string.h> /* for memset() */

#include "ecies.h"

static EC_KEY *ecies_key_create(const EC_KEY *user, char *error) {
    const EC_GROUP *group;
    EC_KEY *key = NULL;

    if(!(key = EC_KEY_new())) {
        sprintf(error, "EC_KEY_new() failed");
        return(NULL);
    }

    if(!(group = EC_KEY_get0_group(user))) {
        sprintf(error, "EC_KEY_get0_group() failed");
        EC_KEY_free(key);
        return(NULL);
    }

    if(EC_KEY_set_group(key, group) != 1) {
        sprintf(error, "EC_KEY_set_group() failed");
        EC_KEY_free(key);
        return(NULL);
    }

    if(EC_KEY_generate_key(key) != 1) {
        sprintf(error, "EC_KEY_generate_key() failed");
        EC_KEY_free(key);
        return(NULL);
    }

    return(key);
}

static EC_KEY *ecies_key_create_public_octets(EC_KEY *user, unsigned char *octets,
  size_t length, char *error) {
    EC_KEY *key = NULL;
    EC_POINT *point = NULL;
    const EC_GROUP *group = NULL;

    if(!(key = EC_KEY_new())) {
        sprintf(error, "EC_KEY_new() failed");
        return(NULL);
    }

    if(!(group = EC_KEY_get0_group(user))) {
        sprintf(error, "EC_KEY_get0_group() failed");
        EC_KEY_free(key);
        return(NULL);
    }

    if(EC_KEY_set_group(key, group) != 1) {
        sprintf(error, "EC_KEY_set_group() failed");
        EC_KEY_free(key);
        return(NULL);
    }

    if(!(point = EC_POINT_new(group))) {
        sprintf(error, "EC_POINT_new() failed");
        EC_KEY_free(key);
        return(NULL);
    }

    if(EC_POINT_oct2point(group, point, octets, length, NULL) != 1) {
        sprintf(error, "EC_POINT_oct2point() failed");
        EC_KEY_free(key);
        return(NULL);
    }

    if(EC_KEY_set_public_key(key, point) != 1) {
        sprintf(error, "EC_KEY_set_public_key() failed");
        EC_POINT_free(point);
        EC_KEY_free(key);
        return(NULL);
    }

    EC_POINT_free(point);

    if(EC_KEY_check_key(key) != 1) {
        sprintf(error, "EC_KEY_check_key() failed");
        EC_KEY_free(key);
        return(NULL);
    }

    return(key);
}

secure_t *ecies_encrypt(const ecies_ctx_t *ctx, const unsigned char *data, size_t length,
  char *error) {
    unsigned int output_length;
    unsigned int status = 1;

    if(!ctx || !data || !length) {
        sprintf(error, "Input NULL pointer detected");
        return(NULL);
    }

    secure_t *cryptex = NULL;

    const size_t block_length = EVP_CIPHER_block_size(ctx->cipher);

    if(!block_length || (block_length > EVP_MAX_BLOCK_LENGTH)) {
        sprintf(error, "Invalid block size");
        return(NULL);
    }

    if(!(cryptex = secure_alloc(ctx->stored_key_length, EVP_MD_size(ctx->md),
      length + (length % block_length ? (block_length - (length % block_length)) : 0)))) {
        sprintf(error, "Unable to allocate a buffer for encrypted data");
        return(NULL);
    }

    /* Stage 1: envelope key creation */

    const size_t key_len = EVP_CIPHER_key_length(ctx->cipher) + EVP_MD_size(ctx->md);
    unsigned char envelope_key[key_len];

    const size_t ecdh_key_len = (EC_GROUP_get_degree(EC_KEY_get0_group(ctx->user_key)) + 7) / 8;
    unsigned char ecdh_temp_key[ecdh_key_len];

    EC_KEY *ephemeral = NULL;

    if(!(ephemeral = ecies_key_create(ctx->user_key, error))) {
        /* Error message has been set already */
        status = 0;
    } else {
        if(ECDH_compute_key(ecdh_temp_key, ecdh_key_len,
          EC_KEY_get0_public_key(ctx->user_key), ephemeral, NULL) != (int)ecdh_key_len) {
            sprintf(error, "ECDH_compute_key() failed");
            status = 0;
        } else {
            if(!ECDH_KDF_X9_62(envelope_key, key_len, ecdh_temp_key, ecdh_key_len,
              0, 0, ctx->kdf_md)) {
                sprintf(error, "ECDH_KDF_X9_62() failed to stretch the key");
                status = 0;
            } else {
                /* Verify the public key portion of the ephemeral key */
                output_length = EC_POINT_point2oct(EC_KEY_get0_group(ephemeral),
                  EC_KEY_get0_public_key(ephemeral), POINT_CONVERSION_COMPRESSED,
                  secure_key_data(cryptex), ctx->stored_key_length, NULL);
                if(output_length != ctx->stored_key_length) {
                    sprintf(error, "Incorrect length of the public portion of the envelope key");
                    status = 0;
                }
            }
        }
    }

    if(ephemeral) EC_KEY_free(ephemeral);

    if(!status) return(NULL);

    /* Stage 2: symmetric cipher context encryption */

    size_t encrypted_length;

    unsigned char iv[EVP_MAX_IV_LENGTH];
    unsigned char *body = secure_body_data(cryptex);

    EVP_CIPHER_CTX *cipher = EVP_CIPHER_CTX_new();
    if(!cipher) return(NULL);
    EVP_CIPHER_CTX_init(cipher);

    memset(iv, 0, EVP_MAX_IV_LENGTH);

    if(EVP_EncryptInit_ex(cipher, ctx->cipher, NULL, envelope_key, iv) != 1) {
        sprintf(error, "Initial context encryption failed");
        status = 0;
    } else {
        if(EVP_EncryptUpdate(cipher, body, (int *) &output_length, data, length) != 1) {
            sprintf(error, "Context encryption failed");
            status = 0;
        } else {
            encrypted_length = output_length;
            if(EVP_EncryptFinal_ex(cipher, body + encrypted_length, (int *) &output_length) != 1) {
                sprintf(error, "Final context encryption failed");
                status = 0;
            } else {
                encrypted_length += output_length;
                if(secure_body_length(cryptex) < encrypted_length) {
                    sprintf(error, "Cipher context overflow");
                    status = 0;
                }
            }
        }
    }

    EVP_CIPHER_CTX_cleanup(cipher);
    EVP_CIPHER_CTX_free(cipher);

    if(!status) {
        secure_free(cryptex);
        return(NULL);
    }

    /* Stage 3: HMAC generation */

#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
    HMAC_CTX hmac_object;
    HMAC_CTX *hmac = (HMAC_CTX *) &hmac_object;
    if(!hmac) return(NULL);
    HMAC_CTX_init(hmac);
#else
    HMAC_CTX *hmac = HMAC_CTX_new();
    if(!hmac) return(NULL);
    HMAC_CTX_reset(hmac);
#endif

    const size_t key_offset = EVP_CIPHER_key_length(ctx->cipher);
    const size_t key_length = EVP_MD_size(ctx->md);
    const size_t mac_length = secure_mac_length(cryptex);

    /* Generate an authenticated hash which can be used to validate the
     * data during decryption */

    if((HMAC_Init_ex(hmac, envelope_key + key_offset, key_length, ctx->md, NULL) != 1) ||
      (HMAC_Update(hmac, secure_body_data(cryptex), secure_body_length(cryptex)) != 1) ||
      (HMAC_Final(hmac, secure_mac_data(cryptex), &output_length) != 1)) {
        sprintf(error, "Unable to generate a HMAC tag");
        status = 0;
    } else {
        if(output_length != mac_length) {
            sprintf(error, "HMAC tag verification failed");
            status = 0;
        }
    }

#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
    HMAC_CTX_cleanup(hmac);
#else
    HMAC_CTX_reset(hmac);
    HMAC_CTX_free(hmac);
#endif

    if(!status) {
        secure_free(cryptex);
        return(NULL);
    }

    memset(envelope_key, 0, key_len);
    memset(ecdh_temp_key, 0, ecdh_key_len);

    return(cryptex);
}

unsigned char *ecies_decrypt(const ecies_ctx_t *ctx, const secure_t *cryptex, size_t *length,
  char *error) {
    unsigned int output_length;
    unsigned int status = 1;

    if(!ctx || !cryptex || !length || !error) {
        sprintf(error, "Input NULL pointer detected");
        return(NULL);
    }

    /* Stage 1: envelope key recovery */

    const size_t key_len = EVP_CIPHER_key_length(ctx->cipher) + EVP_MD_size(ctx->md);
    unsigned char envelope_key[key_len];

    const size_t ecdh_key_len = (EC_GROUP_get_degree(EC_KEY_get0_group(ctx->user_key)) + 7) / 8;
    unsigned char ecdh_temp_key[ecdh_key_len];

    EC_KEY *ephemeral = NULL, *user_copy = NULL;

    if(!(user_copy = EC_KEY_new())) {
        sprintf(error, "Failed to create a user key instance");
        status = 0;
    } else {
        if(!EC_KEY_copy(user_copy, ctx->user_key)) {
            sprintf(error, "Failed to copy user key");
            status = 0;
        } else {
            if(!(ephemeral = ecies_key_create_public_octets(user_copy, secure_key_data(cryptex),
              secure_key_length(cryptex), error))) {
                /* Error message has been set already */
                status = 0;
            } else {
                if(ECDH_compute_key(ecdh_temp_key, ecdh_key_len, EC_KEY_get0_public_key(ephemeral),
                  user_copy, NULL) != (int)ecdh_key_len) {
                    sprintf(error, "ECDH_compute_key() failed");
                    status = 0;
                } else {
                    if(!ECDH_KDF_X9_62(envelope_key, key_len, ecdh_temp_key, ecdh_key_len,
                      0, 0, ctx->kdf_md)) {
                        sprintf(error, "ECDH_KDF_X9_62() failed to stretch the key");
                        status = 0;
                    }
                }
            }
        }
    }

    if(!status) {
        if(ephemeral) EC_KEY_free(ephemeral);
        if(user_copy) EC_KEY_free(user_copy);
        return(NULL);
    }

    /* Stage 2: HMAC verification */

    unsigned char md[EVP_MAX_MD_SIZE];

#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
    HMAC_CTX hmac_object;
    HMAC_CTX *hmac = (HMAC_CTX *) &hmac_object;
    if(!hmac) return(NULL);
    HMAC_CTX_init(hmac);
#else
    HMAC_CTX *hmac = HMAC_CTX_new();
    if(!hmac) return(NULL);
    HMAC_CTX_reset(hmac);
#endif

    const size_t key_offset = EVP_CIPHER_key_length(ctx->cipher);
    const size_t key_length = EVP_MD_size(ctx->md);
    const size_t mac_length = secure_mac_length(cryptex);

    /* Use the authenticated hash of the ciphered data to ensure it was not
     * modified after being encrypted */

    if((HMAC_Init_ex(hmac, envelope_key + key_offset, key_length, ctx->md, NULL) != 1) ||
      (HMAC_Update(hmac, secure_body_data(cryptex), secure_body_length(cryptex)) != 1) ||
      (HMAC_Final(hmac, md, &output_length) != 1)) {
        sprintf(error, "Unable to generate a HMAC tag");
        status = 0;
    } else {
        if((output_length != mac_length) ||
          (memcmp(md, secure_mac_data(cryptex), mac_length) != 0)) {
             sprintf(error, "HMAC tag verification failed");
             status = 0;
        }
    }

#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
    HMAC_CTX_cleanup(hmac);
#else
    HMAC_CTX_reset(hmac);
    HMAC_CTX_free(hmac);
#endif

    if(!status) return(NULL);

    /* Stage 3: symmetric cipher context decryption */

    size_t decrypted_length;

    unsigned char iv[EVP_MAX_IV_LENGTH];
    unsigned char *output;

    EVP_CIPHER_CTX *cipher = EVP_CIPHER_CTX_new();
    if(!cipher) return(NULL);
    EVP_CIPHER_CTX_init(cipher);

    const size_t body_length = secure_body_length(cryptex);

    if(!(output = (unsigned char *) malloc(body_length + 1))) {
        sprintf(error, "Unable to allocate a buffer for decrypted data");
        return(NULL);
    }

    memset(iv, 0, EVP_MAX_IV_LENGTH);
    memset(output, 0, body_length + 1);

    if(EVP_DecryptInit_ex(cipher, ctx->cipher, NULL, envelope_key, iv) != 1) {
        sprintf(error, "Initial context decryption failed");
        status = 0;
    } else {
        if(EVP_DecryptUpdate(cipher, output, (int *) &output_length,
          secure_body_data(cryptex), body_length) != 1) {
            sprintf(error, "Context decryption failed");
            status = 0;
        } else {
            decrypted_length = output_length;
            if(EVP_DecryptFinal_ex(cipher, output + decrypted_length,
              (int *) &output_length) != 1) {
                sprintf(error, "Final context decryption failed");
                status = 0;
            } else {
                decrypted_length += output_length;
            }
        }
    }

    EVP_CIPHER_CTX_cleanup(cipher);
    EVP_CIPHER_CTX_free(cipher);

    if(!status) {
        free(output);
        return(NULL);
    }

    *length = decrypted_length;

    memset(envelope_key, 0, key_len);
    memset(ecdh_temp_key, 0, ecdh_key_len);

    return(output);
}


text:
import { Observable } from 'rx';
import debug from 'debug';

import { reportError } from '../middlewares/error-reporter';
import InMemoryCache from '../utils/in-memory-cache';

const log = debug('fcc:boot:donate');
const fiveMinutes = 1000 * 60 * 5;

export default function(Donation) {
  let activeDonationUpdateInterval = null;
  const activeDonationCountCacheTTL = fiveMinutes;
  const activeDonationCountCache = InMemoryCache(0, reportError);
  const activeDonationsQuery$ = () =>
    Donation.find$({
      // eslint-disable-next-line no-undefined
      where: { endDate: undefined }
    }).map(instances => instances.length);
  function cleanUp() {
    if (activeDonationUpdateInterval) {
      clearInterval(activeDonationUpdateInterval);
    }
    return;
  }

  process.on('exit', cleanUp);

  Donation.on('dataSourceAttached', () => {
    Donation.find$ = Observable.fromNodeCallback(Donation.find.bind(Donation));
    Donation.findOne$ = Observable.fromNodeCallback(
      Donation.findOne.bind(Donation)
    );

    seedTheCache()
      .then(setupCacheUpdateInterval)
      .catch(err => {
        const errMsg = `Error caught seeding the cache: ${err.message}`;
        err.message = errMsg;
        reportError(err);
      });
  });

  function seedTheCache() {
    return new Promise((resolve, reject) =>
      Observable.defer(activeDonationsQuery$).subscribe(count => {
        log('activeDonator count: %d', count);
        activeDonationCountCache.update(() => count);
        return resolve();
      }, reject)
    );
  }

  function setupCacheUpdateInterval() {
    activeDonationUpdateInterval = setInterval(
      () =>
        Observable.defer(activeDonationsQuery$).subscribe(
          count => {
            log('activeDonator count: %d', count);
            return activeDonationCountCache.update(() => count);
          },
          err => {
            const errMsg = `Error caught updating the cache: ${err.message}`;
            err.message = errMsg;
            reportError(err);
          }
        ),
      activeDonationCountCacheTTL
    );
    return null;
  }

  function getCurrentActiveDonationCount$() {
    return Observable.of(activeDonationCountCache.get());
  }

  Donation.getCurrentActiveDonationCount$ = getCurrentActiveDonationCount$;
}


text:
"""The Query type hierarchy for DBCore.
"""
import re
from beets import util
from datetime import datetime, timedelta

class Query(object):
    """An abstract class representing a query into the item database.
    """
    def clause(self):
        """Generate an SQLite expression implementing the query.
        Return a clause string, a sequence of substitution values for
        the clause, and a Query object representing the "remainder"
        Returns (clause, subvals) where clause is a valid sqlite
        WHERE clause implementing the query and subvals is a list of
        items to be substituted for ?s in the clause.
        """
        return None, ()

    def match(self, item):
        """Check whether this query matches a given Item. Can be used to
        perform queries on arbitrary sets of Items.
        """
        raise NotImplementedError

class FieldQuery(Query):
    """An abstract query that searches in a specific field for a
    pattern. Subclasses must provide a `value_match` class method, which
    determines whether a certain pattern string matches a certain value
    string. Subclasses may also provide `col_clause` to implement the
    same matching functionality in SQLite.
    """
    def __init__(self, field, pattern, fast=True):
        self.field = field
        self.pattern = pattern
        self.fast = fast

    def col_clause(self):
        return None, ()

    def clause(self):
        if self.fast:
            return self.col_clause()
        else:
            # Matching a flexattr. This is a slow query.
            return None, ()

    @classmethod
    def value_match(cls, pattern, value):
        """Determine whether the value matches the pattern. Both
        arguments are strings.
        """
        raise NotImplementedError()

    def match(self, item):
        return self.value_match(self.pattern, item.get(self.field))

class MatchQuery(FieldQuery):
    """A query that looks for exact matches in an item field."""
    def col_clause(self):
        return self.field + " = ?", [self.pattern]

    @classmethod
    def value_match(cls, pattern, value):
        return pattern == value

class StringFieldQuery(FieldQuery):
    """A FieldQuery that converts values to strings before matching
    them.
    """
    @classmethod
    def value_match(cls, pattern, value):
        """Determine whether the value matches the pattern. The value
        may have any type.
        """
        return cls.string_match(pattern, util.as_string(value))

    @classmethod
    def string_match(cls, pattern, value):
        """Determine whether the value matches the pattern. Both
        arguments are strings. Subclasses implement this method.
        """
        raise NotImplementedError()

class SubstringQuery(StringFieldQuery):
    """A query that matches a substring in a specific item field."""
    def col_clause(self):
        search = '%' + (self.pattern.replace('\\','\\\\').replace('%','\\%')
                            .replace('_','\\_')) + '%'
        clause = self.field + " like ? escape '\\'"
        subvals = [search]
        return clause, subvals

    @classmethod
    def string_match(cls, pattern, value):
        return pattern.lower() in value.lower()

class RegexpQuery(StringFieldQuery):
    """A query that matches a regular expression in a specific item
    field.
    """
    @classmethod
    def string_match(cls, pattern, value):
        try:
            res = re.search(pattern, value)
        except re.error:
            # Invalid regular expression.
            return False
        return res is not None

class BooleanQuery(MatchQuery):
    """Matches a boolean field. Pattern should either be a boolean or a
    string reflecting a boolean.
    """
    def __init__(self, field, pattern, fast=True):
        super(BooleanQuery, self).__init__(field, pattern, fast)
        if isinstance(pattern, basestring):
            self.pattern = util.str2bool(pattern)
        self.pattern = int(self.pattern)

class BytesQuery(MatchQuery):
    """Match a raw bytes field (i.e., a path). This is a necessary hack
    to work around the `sqlite3` module's desire to treat `str` and
    `unicode` equivalently in Python 2. Always use this query instead of
    `MatchQuery` when matching on BLOB values.
    """
    def __init__(self, field, pattern):
        super(BytesQuery, self).__init__(field, pattern)

        # Use a buffer representation of the pattern for SQLite
        # matching. This instructs SQLite to treat the blob as binary
        # rather than encoded Unicode.
        if isinstance(self.pattern, basestring):
            # Implicitly coerce Unicode strings to their bytes
            # equivalents.
            if isinstance(self.pattern, unicode):
                self.pattern = self.pattern.encode('utf8')
            self.buf_pattern = buffer(self.pattern)
        elif isinstance(self.pattern, buffer):
            self.buf_pattern = self.pattern
            self.pattern = bytes(self.pattern)

    def col_clause(self):
        return self.field + " = ?", [self.buf_pattern]

class NumericQuery(FieldQuery):
    """Matches numeric fields. A syntax using Ruby-style range ellipses
    (``..``) lets users specify one- or two-sided ranges. For example,
    ``year:2001..`` finds music released since the turn of the century.
    """
    def _convert(self, s):
        """Convert a string to a numeric type (float or int). If the
        string cannot be converted, return None.
        """
        # This is really just a bit of fun premature optimization.
        try:
            return int(s)
        except ValueError:
            try:
                return float(s)
            except ValueError:
                return None

    def __init__(self, field, pattern, fast=True):
        super(NumericQuery, self).__init__(field, pattern, fast)

        parts = pattern.split('..', 1)
        if len(parts) == 1:
            # No range.
            self.point = self._convert(parts[0])
            self.rangemin = None
            self.rangemax = None
        else:
            # One- or two-sided range.
            self.point = None
            self.rangemin = self._convert(parts[0])
            self.rangemax = self._convert(parts[1])

    def match(self, item):
        value = getattr(item, self.field)
        if isinstance(value, basestring):
            value = self._convert(value)

        if self.point is not None:
            return value == self.point
        else:
            if self.rangemin is not None and value < self.rangemin:
                return False
            if self.rangemax is not None and value > self.rangemax:
                return False
            return True

    def col_clause(self):
        if self.point is not None:
            return self.field + '=?', (self.point,)
        else:
            if self.rangemin is not None and self.rangemax is not None:
                return (u'{0} >= ? AND {0} <= ?'.format(self.field),
                        (self.rangemin, self.rangemax))
            elif self.rangemin is not None:
                return u'{0} >= ?'.format(self.field), (self.rangemin,)
            elif self.rangemax is not None:
                return u'{0} <= ?'.format(self.field), (self.rangemax,)
            else:
                return '1', ()

class CollectionQuery(Query):
    """An abstract query class that aggregates other queries. Can be
    indexed like a list to access the sub-queries.
    """
    def __init__(self, subqueries=()):
        self.subqueries = subqueries

    # Act like a sequence.
    def __len__(self):
        return len(self.subqueries)
    def __getitem__(self, key):
        return self.subqueries[key]
    def __iter__(self):
        return iter(self.subqueries)
    def __contains__(self, item):
        return item in self.subqueries

    def clause_with_joiner(self, joiner):
        """Returns a clause created by joining together the clauses of
        all subqueries with the string joiner (padded by spaces).
        """
        clause_parts = []
        subvals = []
        for subq in self.subqueries:
            subq_clause, subq_subvals = subq.clause()
            if not subq_clause:
                # Fall back to slow query.
                return None, ()
            clause_parts.append('(' + subq_clause + ')')
            subvals += subq_subvals
        clause = (' ' + joiner + ' ').join(clause_parts)
        return clause, subvals

class AnyFieldQuery(CollectionQuery):
    """A query that matches if a given FieldQuery subclass matches in
    any field. The individual field query class is provided to the
    constructor.
    """
    def __init__(self, pattern, fields, cls):
        self.pattern = pattern
        self.fields = fields
        self.query_class = cls

        subqueries = []
        for field in self.fields:
            subqueries.append(cls(field, pattern, True))
        super(AnyFieldQuery, self).__init__(subqueries)

    def clause(self):
        return self.clause_with_joiner('or')

    def match(self, item):
        for subq in self.subqueries:
            if subq.match(item):
                return True
        return False

class MutableCollectionQuery(CollectionQuery):
    """A collection query whose subqueries may be modified after the
    query is initialized.
    """
    def __setitem__(self, key, value):
        self.subqueries[key] = value

    def __delitem__(self, key):
        del self.subqueries[key]

class AndQuery(MutableCollectionQuery):
    """A conjunction of a list of other queries."""
    def clause(self):
        return self.clause_with_joiner('and')

    def match(self, item):
        return all([q.match(item) for q in self.subqueries])

class TrueQuery(Query):
    """A query that always matches."""
    def clause(self):
        return '1', ()

    def match(self, item):
        return True

class FalseQuery(Query):
    """A query that never matches."""
    def clause(self):
        return '0', ()

    def match(self, item):
        return False

# Time/date queries.

def _to_epoch_time(date):
    """Convert a `datetime` object to an integer number of seconds since
    the (local) Unix epoch.
    """
    epoch = datetime.fromtimestamp(0)
    delta = date - epoch
    try:
        return int(delta.total_seconds())
    except AttributeError:
        # datetime.timedelta.total_seconds() is not available on Python 2.6
        return delta.seconds + delta.days * 24 * 3600

def _parse_periods(pattern):
    """Parse a string containing two dates separated by two dots (..).
    Return a pair of `Period` objects.
    """
    parts = pattern.split('..', 1)
    if len(parts) == 1:
        instant = Period.parse(parts[0])
        return (instant, instant)
    else:
        start = Period.parse(parts[0])
        end = Period.parse(parts[1])
        return (start, end)

class Period(object):
    """A period of time given by a date, time and precision.

    Example: 2014-01-01 10:50:30 with precision 'month' represents all
    instants of time during January 2014.
    """

    precisions = ('year', 'month', 'day')
    date_formats = ('%Y', '%Y-%m', '%Y-%m-%d')

    def __init__(self, date, precision):
        """Create a period with the given date (a `datetime` object) and
        precision (a string, one of "year", "month", or "day").
        """
        if precision not in Period.precisions:
            raise ValueError('Invalid precision ' + str(precision))
        self.date = date
        self.precision = precision

    @classmethod
    def parse(cls, string):
        """Parse a date and return a `Period` object or `None` if the
        string is empty.
        """
        if not string:
            return None
        ordinal = string.count('-')
        if ordinal >= len(cls.date_formats):
            raise ValueError('date is not in one of the formats '
                             + ', '.join(cls.date_formats))
        date_format = cls.date_formats[ordinal]
        date = datetime.strptime(string, date_format)
        precision = cls.precisions[ordinal]
        return cls(date, precision)

    def open_right_endpoint(self):
        """Based on the precision, convert the period to a precise
        `datetime` for use as a right endpoint in a right-open interval.
        """
        precision = self.precision
        date = self.date
        if 'year' == self.precision:
            return date.replace(year=date.year + 1, month=1)
        elif 'month' == precision:
            if (date.month < 12):
                return date.replace(month=date.month + 1)
            else:
                return date.replace(year=date.year + 1, month=1)
        elif 'day' == precision:
            return date + timedelta(days=1)
        else:
            raise ValueError('unhandled precision ' + str(precision))

class DateInterval(object):
    """A closed-open interval of dates.

    A left endpoint of None means since the beginning of time.
    A right endpoint of None means towards infinity.
    """

    def __init__(self, start, end):
        if start is not None and end is not None and not start < end:
            raise ValueError("start date {0} is not before end date {1}"
                             .format(start, end))
        self.start = start
        self.end = end

    @classmethod
    def from_periods(cls, start, end):
        """Create an interval with two Periods as the endpoints.
        """
        end_date = end.open_right_endpoint() if end is not None else None
        start_date = start.date if start is not None else None
        return cls(start_date, end_date)

    def contains(self, date):
        if self.start is not None and date < self.start:
            return False
        if self.end is not None and date >= self.end:
            return False
        return True

    def __str__(self):
        return'[{0}, {1})'.format(self.start, self.end)

class DateQuery(FieldQuery):
    """Matches date fields stored as seconds since Unix epoch time.

    Dates can be specified as ``year-month-day`` strings where only year
    is mandatory.

    The value of a date field can be matched against a date interval by
    using an ellipsis interval syntax similar to that of NumericQuery.
    """
    def __init__(self, field, pattern, fast=True):
        super(DateQuery, self).__init__(field, pattern, fast)
        start, end = _parse_periods(pattern)
        self.interval = DateInterval.from_periods(start, end)

    def match(self, item):
        timestamp = float(item[self.field])
        date = datetime.utcfromtimestamp(timestamp)
        return self.interval.contains(date)

    _clause_tmpl = "{0} {1} ?"

    def col_clause(self):
        clause_parts = []
        subvals = []

        if self.interval.start:
            clause_parts.append(self._clause_tmpl.format(self.field, ">="))
            subvals.append(_to_epoch_time(self.interval.start))

        if self.interval.end:
            clause_parts.append(self._clause_tmpl.format(self.field, "<"))
            subvals.append(_to_epoch_time(self.interval.end))

        if clause_parts:
            # One- or two-sided interval.
            clause = ' AND '.join(clause_parts)
        else:
            # Match any date.
            clause = '1'
        return clause, subvals


text:
use utf8;
package eduity::Schema::Userskill;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

=head1 NAME

eduity::Schema::Userskill

=cut

use strict;
use warnings;

use Moose;
use MooseX::NonMoose;
use MooseX::MarkAsMethods autoclean => 1;
extends 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=item * L<DBIx::Class::InflateColumn::FS>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime", "InflateColumn::FS");

=head1 TABLE: C<userskills>

=cut

__PACKAGE__->table("userskills");

=head1 ACCESSORS

=head2 id

  data_type: 'integer'
  is_auto_increment: 1
  is_nullable: 0
  sequence: 'userskills_id_seq'

=head2 userid

  data_type: 'integer'
  is_nullable: 0

=head2 skill

  data_type: 'varchar'
  is_nullable: 0
  size: 20

=head2 rating

  data_type: 'smallint'
  default_value: 0
  is_nullable: 0

=cut

__PACKAGE__->add_columns(
  "id",
  {
    data_type         => "integer",
    is_auto_increment => 1,
    is_nullable       => 0,
    sequence          => "userskills_id_seq",
  },
  "userid",
  { data_type => "integer", is_nullable => 0 },
  "skill",
  { data_type => "varchar", is_nullable => 0, size => 20 },
  "rating",
  { data_type => "smallint", default_value => 0, is_nullable => 0 },
);

=head1 PRIMARY KEY

=over 4

=item * L</id>

=back

=cut

__PACKAGE__->set_primary_key("id");

# Created by DBIx::Class::Schema::Loader v0.07024 @ 2012-09-15 18:55:24
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+azTh1G5gh4SYZq5fNankw

# You can replace this text with custom code or comments, and it will be preserved on regeneration
__PACKAGE__->meta->make_immutable;
1;


text:
{%- macro cs_Table(data) %}

	{#
	   Some whitespace setup code so we can use the previously defined
	   macro to verticaly align comments in code using strRepeat
	#}
	{%- set rowWhitespace = [] -%}
	{%- for col in data.field.settings.columns -%}
		{%- set rowWhitespace = rowWhitespace|merge([col.handle|length]) -%}
	{%- endfor -%}

	{#
	   We need to pass a single string through the .codeBlock macro
	   so we're going to build our list of column names and tags before
	   we build out the full code snippet string to pass through
	#}
	{%- set rowBlock -%}
	{%- for col in data.field.settings.columns -%}
		{{-
			data.whitespace ~ data.whitespace
			~ '{{ row.' ~ col.handle ~ ' }} '
			~ _self.strRepeat(' ', max(rowWhitespace) - col.handle|length)
			~ '{# ' ~ col.type ~ ' #}\n'
		-}}
	{%- endfor -%}
	{%- endset -%}

	{{ _self.codeBlock('Table Structure', '
		{% if ' ~ data.sampleTag ~ '|length %}\n'
		~ data.whitespace
		~ '{% for row in ' ~ data.sampleTag ~ ' %}\n'
		~ rowBlock
		~ data.whitespace
		~ '{% endfor %}\n'
		~ '{% endif %}'
	, 'This the general structure of the table and column handles (and types). If there are any default row values they will are displayed below this structure code block.')}}

	{% if data.field.settings.defaults %}

Default Values

					Row #
					{%- for col in data.field.settings.columns -%}
					{{ col.heading }}
					{% endfor %}

				{%- for row, cols in data.field.settings.defaults -%}

					{{ loop.index }}
					{%- for col in cols -%}
					{{ col }}
					{%- endfor -%}

				{%- endfor -%}

	{% endif %}

{% endmacro -%}


text:
<?php

/**
 * Gets or sets the current URL of the window.
 *
 * @package    PHPUnit_Selenium
 * @author     Giorgio Sironi <giorgio.sironi@asp-poli.it>
 * @copyright  2010-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
 * @version    Release: @package_version@
 * @link       http://www.phpunit.de/
 * @since      Class available since Release 1.2.0
 */
class PHPUnit_Extensions_Selenium2TestCase_SessionCommand_Url
    extends PHPUnit_Extensions_Selenium2TestCase_Command
{
    public function __construct($url, $commandUrl, PHPUnit_Extensions_Selenium2TestCase_URL $baseUrl)
    {
        if ($url !== NULL) {
            $absoluteLocation = $baseUrl->jump($url)->getValue();
            $jsonParameters = array('url' => $absoluteLocation);
        } else {
            $jsonParameters = NULL;
        }
        parent::__construct($jsonParameters, $commandUrl);
    }

    public function httpMethod()
    {
        if ($this->jsonParameters) {
            return 'POST';
        }
        return 'GET';
    }
}


text:
var library = (function() {
	var books = [];
	var categories = [];

	function listBooks() {
		let copyOfBooks = books.slice();
		copyOfBooks.sort(function(a, b) {
			return a.ID - b.ID;
		});
		return copyOfBooks;
	}

	function addBook(book) {
		var invalidInput = false;
		var ISBNValidator = /^(97(8|9))?\d{9}(\d|X)$/;
		if (book.title === undefined || book.title.length <= 2 || book.title.length >= 100) {
			try {
				throw new Error('Invalid book name');
			} catch (e) {
				invalidInput = true;
				console.log(e);
			}
		}
		if (book.author === undefined || book.author === ' ' || book.author === null || book.author.length < 2) {
			try {
				throw new Error('Invalid author name');
			} catch (e) {
				invalidInput = true;
				console.log(e);
			}
		}
		if ((book.ISBN.length !== 10 || book.ISBN.length !== 13) && !ISBNValidator.test(book.ISBN)) {
			try {
				throw new Error('Invalid ISBN');
			} catch (e) {
				invalidInput = true;
				console.log(e);
			}
		}
		if (book.category === undefined) {
			book.category = 'default';
		}

		books.forEach(function(existingBook) {
			if ((existingBook.title === book.title) || (existingBook.ISBN === book.ISBN)) {
				try {
					throw new Error('Invalid ISBN');

				} catch (e) {
					invalidInput = true;
					console.log(e);
				}
			}
		});
		if (!invalidInput) {
			book.ID = books.length + 1;
			books.push(book);
			categories.push(book.category);
		}
		return book;
	}

	function listCategories() {
		return categories;
	}

	return {
		books: {
			list: listBooks,
			add: addBook
		},
		categories: {
			list: listCategories
		}
	};
}());
var newBook = {
	title: 'Harry Potter and the Deathly Hallows',
	author: 'J. K. Rowling',
	ISBN: '0545010225',
	category: 'Fantasy'

};
var newBook2 = {
	title: 'Harry Potter and the Goblet of Fire ',
	author: 'J.K. Rowling',
	ISBN: '9781408855928',
	category: 'mystery'

};
var newBook3 = {
	title: 'InvalidBook',
	author: 'author',
	ISBN: 3

};

library.books.add(newBook);
library.books.add(newBook2);
console.log(library.books.list());
library.books.add(newBook3);
console.log(library.books.list());
console.log(library.categories.list());


text:
package org.eclipse.collections.impl.list.mutable.primitive;

import org.eclipse.collections.impl.test.Verify;
import org.junit.Test;

public class CharArrayListSerializationTest
{
    @Test
    public void serializedForm()
    {
        Verify.assertSerializedForm(
                1L,
                "rO0ABXNyAEFvcmcuZWNsaXBzZS5jb2xsZWN0aW9ucy5pbXBsLmxpc3QubXV0YWJsZS5wcmltaXRp\n"
                        + "dmUuQ2hhckFycmF5TGlzdAAAAAAAAAABDAAAeHB3BAAAAAB4",
                new CharArrayList());
    }
}


text:
typedef struct stack Stack;

Stack *s_create();

void s_destroy(Stack *);

int s_push(Stack *, int);

int s_pop(Stack *);

int s_peek(const Stack *);

int s_size(const Stack *);

#endif


text:
package github

import (
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"os"

	"github.com/ejholmes/hookshot"
	"github.com/ejholmes/hookshot/events"
	"github.com/remind101/empire"
	"github.com/remind101/pkg/httpx"
	"golang.org/x/net/context"
)

var (
	// DefaultTemplate is a text/template string that will be used to map a
	// deployment event to a docker image to deploy.
	DefaultTemplate = `{{ .Repository.FullName }}:{{ .Deployment.Sha }}`
)

type Options struct {
	// The GitHub secret to ensure that the request was sent from GitHub.
	Secret string

	// If provided, specifies the environments that this Empire instance
	// should handle deployments for.
	Environments []string

	Deployer Deployer
}

func New(e *empire.Empire, opts Options) httpx.Handler {
	r := hookshot.NewRouter()

	secret := opts.Secret
	r.Handle("deployment", hookshot.Authorize(&DeploymentHandler{Deployer: opts.Deployer, environments: opts.Environments}, secret))
	r.Handle("ping", hookshot.Authorize(http.HandlerFunc(Ping), secret))

	return r
}

// Deployment is an http.Handler for handling the `deployment` event.
type DeploymentHandler struct {
	Deployer
	environments []string
}

func (h *DeploymentHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	panic("expected ServeHTTPContext to be called")
}

func (h *DeploymentHandler) ServeHTTPContext(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
	var p events.Deployment

	if err := json.NewDecoder(r.Body).Decode(&p); err != nil {
		http.Error(w, err.Error(), http.StatusBadRequest)
		return nil
	}

	if !currentEnvironment(p.Deployment.Environment, h.environments) {
		w.WriteHeader(http.StatusNoContent)
		fmt.Fprintf(w, "Ignore deployment to environment: %s", p.Deployment.Environment)
		return nil
	}
	if err := h.Deploy(ctx, p, os.Stdout); err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return nil
	}

	w.WriteHeader(http.StatusAccepted)
	io.WriteString(w, "Ok\n")
	return nil
}

func currentEnvironment(eventEnv string, environments []string) bool {
	for _, env := range environments {
		if env == eventEnv {
			return true
		}
	}
	return false
}

func Ping(w http.ResponseWriter, r *http.Request) {
	io.WriteString(w, "Ok\n")
}


text:
namespace blink {

class BlobDataHandle;

class WebBlobInfo {
 public:
  WebBlobInfo()
      : is_file_(false), size_(std::numeric_limits<uint64_t>::max()) {}
  BLINK_EXPORT WebBlobInfo(const WebString& uuid,
                           const WebString& type,
                           uint64_t size,
                           CrossVariantMojoRemote<mojom::BlobInterfaceBase>);
  BLINK_EXPORT WebBlobInfo(const WebString& uuid,
                           const WebString& file_name,
                           const WebString& type,
                           const absl::optional<base::Time>& last_modified,
                           uint64_t size,
                           CrossVariantMojoRemote<mojom::BlobInterfaceBase>);

  // For testing purposes, these two methods create a WebBlobInfo connected to a
  // dangling mojo message pipe. This means that any operations that actually
  // depend on the mojo connection to exist will fail, but otherwise you should
  // be able to safely pass around these blobs.
  BLINK_EXPORT static WebBlobInfo BlobForTesting(const WebString& uuid,
                                                 const WebString& type,
                                                 uint64_t size);
  BLINK_EXPORT static WebBlobInfo FileForTesting(const WebString& uuid,
                                                 const WebString& file_name,
                                                 const WebString& type);

  BLINK_EXPORT ~WebBlobInfo();

  BLINK_EXPORT WebBlobInfo(const WebBlobInfo& other);
  BLINK_EXPORT WebBlobInfo& operator=(const WebBlobInfo& other);

  bool IsFile() const { return is_file_; }
  const WebString& Uuid() const { return uuid_; }
  const WebString& GetType() const { return type_; }
  uint64_t size() const { return size_; }
  const WebString& FileName() const { return file_name_; }
  absl::optional<base::Time> LastModified() const { return last_modified_; }
  BLINK_EXPORT CrossVariantMojoRemote<mojom::BlobInterfaceBase>
  CloneBlobRemote() const;

#if INSIDE_BLINK
  BLINK_EXPORT WebBlobInfo(scoped_refptr<BlobDataHandle>);
  BLINK_EXPORT WebBlobInfo(scoped_refptr<BlobDataHandle>,
                           const WebString& file_name,
                           const absl::optional<base::Time>& last_modified);
  // TODO(mek): Get rid of these constructors after ensuring that the
  // BlobDataHandle always has the correct type and size.
  BLINK_EXPORT WebBlobInfo(scoped_refptr<BlobDataHandle>,
                           const WebString& type,
                           uint64_t size);
  BLINK_EXPORT WebBlobInfo(scoped_refptr<BlobDataHandle>,
                           const WebString& file_name,
                           const WebString& type,
                           const absl::optional<base::Time>& last_modified,
                           uint64_t size);
  BLINK_EXPORT scoped_refptr<BlobDataHandle> GetBlobHandle() const;
#endif

 private:
  bool is_file_;
  WebString uuid_;
  WebString type_;  // MIME type
  uint64_t size_;
  WebPrivatePtr<BlobDataHandle> blob_handle_;
  WebString file_name_;   // Only for File
  absl::optional<base::Time> last_modified_;  // Only for File
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_BLOB_INFO_H_


text:
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Norma.Delta.Models
{
    public class SlotReservation2
    {
        public string SlotId { get; set; }

        [Key]
        [ForeignKey(nameof(Reservation))]
        public int ReservationId { get; set; }

        public virtual Reservation Reservation { get; set; }

        public void Merge(SlotReservation2 slotReservation2)
        {
            Reservation.Merge(slotReservation2.Reservation);
        }
    }
}


text:
package com.rumblesan.reaktor

import scalaz._, Scalaz._

class EventSource[OutputEvent](
  desiredLoopsPerSecond: Int,
  source: () => OutputEvent,
  handler: OutputEvent => Unit,
  maxRepeats: Option[Int]
) {

  var running = true

  def funcLoop() = {

    var lastLoopTime: Long = System.nanoTime()
    val loopsPerSecond: Int = desiredLoopsPerSecond
    val optimalTime: Long = 1000000000L / loopsPerSecond.toLong
    var lastFpsTime: Long = 0L
    var lps: Int = 0
    var repeats = maxRepeats.getOrElse(-1)

    while(running) {

      var now: Long = System.nanoTime()
      var updateLength: Double = now - lastLoopTime
      lastLoopTime = now
      var delta: Double = updateLength / optimalTime

      lastFpsTime += updateLength.toLong
      lps += 1

      if (lastFpsTime >= 1000000000L) {
        println(s"LPS: $lps")
        lastFpsTime = 0L
        lps = 0
      }

      handler(source())

           if (repeats >  0) repeats -= 1
      else if (repeats == 0) running = false

      // we want each frame to take 10 milliseconds, to do this
      // we've recorded when we started the frame. We add 10 milliseconds
      // to this and then factor in the current time to give
      // us our final value to wait for
      // remember this is in ms, whereas our lastLoopTime etc. vars are in ns.
      try{
        Thread.sleep(
          (lastLoopTime - System.nanoTime() + optimalTime) / 1000000
        )
      }

    }

  }

  def run = {
    val loop: Thread = new Thread(){
      override def run() = {
        funcLoop()
      }
    }
    loop.start()
  }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

   <title>TUI:Instruments:TSpec</title>

TUI:Instruments:TSpec

Controls for TSpec, the Seaver Prototype Imaging camera, are distributed among two windows:

The TSpec window displays status and allows configuring TripleSpec. The status portion is always displayed. The configuration controls are hidden by default.

The TSpec Expose window controls and displays exposure sequences.

See also the TripleSpec documentation at APO.


text:
<?php
/**
 * s index view
 * @author Jon Johnson <jon.johnson@ucsf.edu>
 * @package jazzee
 * @subpackage admin
 * @subpackage setup
 */
?>
This Page Requires javascript.  Please consult your department IT support for help enabling Javascript in your browser.<?php
if ($published) { ?>

Warning: You are editing an application which has already been published.  This can result in applicant data loss.
<?php
} ?>


text:
package org.apache.ignite.spi.communication.tcp;

import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.marshaller.*;
import org.apache.ignite.marshaller.jdk.*;
import org.apache.ignite.plugin.extensions.communication.*;
import org.apache.ignite.spi.communication.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.common.*;
import org.jetbrains.annotations.*;

import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.locks.*;

import static org.apache.ignite.cache.CacheRebalanceMode.*;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;

/**
 * Special cases for GG-2329.
 */
public class GridCacheDhtLockBackupSelfTest extends GridCommonAbstractTest {
    /** Ip-finder. */
    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);

    /** Communication spi for grid start. */
    private CommunicationSpi commSpi;

    /** Marshaller used in test. */
    private Marshaller marsh = new JdkMarshaller();

    /**
     *
     */
    public GridCacheDhtLockBackupSelfTest() {
        super(false /*start grid. */);
    }

    /** {@inheritDoc} */
    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
        IgniteConfiguration cfg = super.getConfiguration(gridName);

        TcpDiscoverySpi disco = new TcpDiscoverySpi();

        disco.setIpFinder(ipFinder);

        cfg.setDiscoverySpi(disco);

        cfg.setCacheConfiguration(cacheConfiguration());

        cfg.setMarshaller(marsh);

        assert commSpi != null;

        cfg.setCommunicationSpi(commSpi);

        return cfg;
    }

    /**
     * @return Cache configuration.
     */
    protected CacheConfiguration cacheConfiguration() {
        CacheConfiguration cacheCfg = defaultCacheConfiguration();

        cacheCfg.setCacheMode(CacheMode.PARTITIONED);
        cacheCfg.setWriteSynchronizationMode(FULL_ASYNC);
        cacheCfg.setRebalanceMode(SYNC);

        return cacheCfg;
    }

    /**
     * @throws Exception If test failed.
     */
    @SuppressWarnings({"TooBroadScope"})
    public void testLock() throws Exception {
        final int kv = 1;

        Ignite ignite1 = startGridWithSpi(1, new TestCommunicationSpi(GridNearUnlockRequest.class, 1000));

        Ignite ignite2 = startGridWithSpi(2, new TestCommunicationSpi(GridNearUnlockRequest.class, 1000));

        if (!ignite1.cluster().mapKeyToNode(null, kv).id().equals(ignite1.cluster().localNode().id())) {
            Ignite tmp = ignite1;
            ignite1 = ignite2;
            ignite2 = tmp;
        }

        // Now, grid1 is always primary node for key 1.
        final IgniteCache<Integer, String> cache1 = ignite1.cache(null);
        final IgniteCache<Integer, String> cache2 = ignite2.cache(null);

        info(">>> Primary: " + ignite1.cluster().localNode().id());
        info(">>>  Backup: " + ignite2.cluster().localNode().id());

        final CountDownLatch l1 = new CountDownLatch(1);

        Thread t1 = new GridTestThread(new Callable<Object>() {
            @Nullable @Override public Object call() throws Exception {
                info("Before lock for key: " + kv);

                Lock lock = cache1.lock(kv);

                lock.lock();

                info("After lock for key: " + kv);

                try {
                    assert cache1.isLocalLocked(kv, false);
                    assert cache1.isLocalLocked(kv, true);

                    l1.countDown();

                    info("Let thread2 proceed.");

                    cache1.put(kv, Integer.toString(kv));

                    info("Put " + kv + '=' + Integer.toString(kv) + " key pair into cache.");
                }
                finally {
                    Thread.sleep(1000);

                    lock.unlock();

                    info("Unlocked key in thread 1: " + kv);
                }

                assert !cache1.isLocalLocked(kv, true);

                return null;
            }
        });

        Thread t2 = new GridTestThread(new Callable<Object>() {
            @Nullable @Override public Object call() throws Exception {
                info("Waiting for latch1...");

                l1.await();

                Lock lock = cache2.lock(kv);

                lock.lock();

                try {
                    String v = cache2.get(kv);

                    assert v != null : "Value is null for key: " + kv;
                    assertEquals(Integer.toString(kv), v);
                }
                finally {
                    lock.unlock();

                    info("Unlocked key in thread 2: " + kv);
                }

                assert !cache2.isLocalLocked(kv, true);

                return null;
            }
        });

        t1.start();
        t2.start();

        t1.join();
        t2.join();

        info("Before remove all");

        cache1.removeAll();

        info("Remove all completed");

        if (cache2.size() > 0) {
            String failMsg = cache2.toString();

            long start = System.currentTimeMillis();

            while (cache2.size() > 0)
                U.sleep(100);

            long clearDuration = System.currentTimeMillis() - start;

            assertTrue("Cache on backup is not empty (was cleared in " + clearDuration + "ms): " + failMsg,
                clearDuration < 3000);
        }
    }

    /**
     * Starts grid with given communication spi set in configuration.
     *
     * @param idx Grid index.
     * @param commSpi Communication spi.
     * @return Started grid.
     * @throws Exception If grid start failed.
     */
    private Ignite startGridWithSpi(int idx, CommunicationSpi commSpi) throws Exception {
        this.commSpi = commSpi;

        try {
            return startGrid(idx);
        }
        finally {
            this.commSpi = null;
        }
    }

    /**
     * Test communication spi that delays message sending.
     */
    private class TestCommunicationSpi extends TcpCommunicationSpi {
        /** Class of delayed messages. */
        private Class<?> delayedMsgCls;

        /** */
        private int delayTime;

        /**
         * Creates test communication spi.
         *
         * @param delayedMsgCls Messages of this class will be delayed.
         * @param delayTime Time to be delayed.
         */
        private TestCommunicationSpi(Class delayedMsgCls, int delayTime) {
            this.delayedMsgCls = delayedMsgCls;
            this.delayTime = delayTime;
        }

        /**
         * Checks message and awaits when message is allowed to be sent if it is a checked message.
         *
         * @param obj Message being  sent.
         * @param srcNodeId Sender node id.
         */
        private void checkAwaitMessageType(Message obj, UUID srcNodeId) {
            try {
                GridIoMessage plainMsg = (GridIoMessage)obj;

                Object msg = plainMsg.message();

                if (delayedMsgCls.isAssignableFrom(msg.getClass())) {
                    info(getSpiContext().localNode().id() + " received message from " + srcNodeId);

                    U.sleep(delayTime);
                }
            }
            catch (IgniteCheckedException e) {
                U.error(log, "Cannot process incoming message", e);
            }
        }

        /** {@inheritDoc} */
        @Override protected void notifyListener(UUID sndId, Message msg,
            IgniteRunnable msgC) {
            checkAwaitMessageType(msg, sndId);

            super.notifyListener(sndId, msg, msgC);
        }
    }
}


text:
from swgpy.object import *

def create(kernel):
	result = Tangible()

	result.template = "object/tangible/lair/boar_wolf/shared_lair_boar_wolf.iff"
	result.attribute_template_id = -1
	result.stfName("lair_n","boar_wolf")

	#### BEGIN MODIFICATIONS ####
	####  END MODIFICATIONS  ####

	return result


text:
/**
 * @fileoverview Standard methods invoked by containers to use the template API.
 *
 * Sample usage:
 *
 *
 *
 *
 * os.Container.registerDocumentTemplates();
 * os.Container.renderInlineTemplates();
 */

os.Container = {};

/***
 * @type {Array.<Object>} Array of registered inline templates.
 * @private
 */
os.Container.inlineTemplates_ = [];

/**
 * @type {Array.<Function>} An array of callbacks to fire when the page DOM has
 * loaded. This will be null until the first callback is added
 * @see registerDomListener_
 * @private
 */
os.Container.domLoadCallbacks_ = null;

/**
 * @type {boolean} A boolean flag determining wether the page DOM has loaded.
 * @private
 */
os.Container.domLoaded_ = false;

/**
 * Registers the DOM Load listener to fire when the page DOM is available.
 * TODO: See if we can use gadgets.util.regiterOnLoadHandler() here.
 * TODO: Currently for everything but Mozilla, this just registers an
 * onLoad listener on the window. Should use DOMContentLoaded on Opera9,
 * appropriate hacks (polling?) on IE and Safari.
 * @private
 */
os.Container.registerDomLoadListener_ = function() {
  var gadgets = window['gadgets'];
  if (gadgets && gadgets.util) {
    gadgets.util.registerOnLoadHandler(os.Container.onDomLoad_);
  } else if (navigator.product == 'Gecko') {
    window.addEventListener("DOMContentLoaded", os.Container.onDomLoad_, false);
  } if (window.addEventListener) {
    window.addEventListener("load", os.Container.onDomLoad_, false);
  } else {
    if (!document.body) {
      setTimeout(arguments.callee, 0);
      return;
    }
    var oldOnLoad = window.onload || function() {};
    window.onload = function() {
      oldOnLoad();
      os.Container.onDomLoad_();
    }
  }
};

/**
 * To be called when the page DOM is available - will fire all the callbacks
 * in os.Container.domLoadCallbacks_.
 * @private
 */
os.Container.onDomLoad_ = function() {
  if (os.Container.domLoaded_) {
    return;
  }
  while (os.Container.domLoadCallbacks_.length) {
  try {
      os.Container.domLoadCallbacks_.pop()();
    } catch (e) {
      os.log(e);
    }
  }
  os.Container.domLoaded_ = true;
};

/**
 * Adds a callback to be fired when the page DOM is available. If the page
 * is already loaded, the callback will execute asynchronously.
 * @param {Function} callback The callback to be fired when DOM is loaded.
 */
os.Container.executeOnDomLoad = function(callback) {
  if (os.Container.domLoaded_) {
    setTimeout(callback, 0);
  } else {
    if (os.Container.domLoadCallbacks_ == null) {
      os.Container.domLoadCallbacks_ = [];
      os.Container.registerDomLoadListener_();
    }
    os.Container.domLoadCallbacks_.push(callback);
  }
};

/**
 * Compiles and registers all DOM elements in the document. Templates are
 * registered as tags if they specify their name with the "tag" attribute
 * and as templates if they have a name (or id) attribute.
 * @param {Object} opt_doc Optional document to use rather than the global doc.
 */
os.Container.registerDocumentTemplates = function(opt_doc) {
  var doc = opt_doc || document;
  var nodes = doc.getElementsByTagName(os.Container.TAG_script_);
  for (var i = 0; i < nodes.length; ++i) {
    var node = nodes[i];
    if (os.Container.isTemplateType_(node.type)) {
      var tag = node.getAttribute('tag');
      if (tag) {
        os.Container.registerTagElement_(node, tag);
      } else if (node.getAttribute('name')) {
        os.Container.registerTemplateElement_(node, node.getAttribute('name'));
      }
    }
  }
};

os.Container.executeOnDomLoad(os.Container.registerDocumentTemplates);

/**
 * Compiles and registers all unnamed templates in the document.
 * @param {Object} opt_data Optional JSON data.
 * @param {Object} opt_doc Optional document to use instead of window.document.
 */
os.Container.compileInlineTemplates = function(opt_data, opt_doc) {
  var doc = opt_doc || document;
  var nodes = doc.getElementsByTagName(os.Container.TAG_script_);
  for (var i = 0; i < nodes.length; ++i) {
    var node = nodes[i];
    if (os.Container.isTemplateType_(node.type)) {
      var name = node.getAttribute('name') || node.getAttribute('tag');
      if (!name || name.length < 0) {
        var template = os.compileTemplate(node);
        if (template) {
          os.Container.inlineTemplates_.push(
              {'template': template, 'node': node});
        } else {
          os.warn('Failed compiling inline template.');
        }
      }
    }
  }
};

/**
 * Renders any registered inline templates.
 * @param {Object} opt_data Optional JSON data.
 * @param {Object} opt_doc Optional document to use instead of window.document.
 */
os.Container.renderInlineTemplates = function(opt_data, opt_doc) {
  var doc = opt_doc || document;
  var inlined = os.Container.inlineTemplates_;
  for (var i = 0; i < inlined.length; ++i) {
    var template = inlined[i].template;
    var node = inlined[i].node;
    var id = '_T_' + template.id;
    var el = doc.getElementById(id);
    if (!el) {
      el = doc.createElement('div');
      el.setAttribute('id', id);
      node.parentNode.insertBefore(el, node);
    }

    var beforeData = node.getAttribute('beforeData');
    if (beforeData) {
      // Automatically hide this template when specified data is available.
      var keys = beforeData.split(/[\, ]+/);
      os.data.DataContext.registerListener(keys,
          os.createHideElementClosure(el));
    }

    var requiredData = node.getAttribute('requireData');
    if (requiredData) {
      // This template will render when the specified data is available.
      var keys = requiredData.split(/[\, ]+/);
      os.data.DataContext.registerListener(keys,
          os.createRenderClosure(template, el, os.data.DataContext));
    } else {
      template.renderInto(el, opt_data);
    }
  }
};

/**
 * Compiles and registers a template from a DOM element.
 * @param {string} elementId Id of DOM element from which to create a template.
 * @return {Object} The compiled and registered template object.
 */
os.Container.registerTemplate = function(elementId) {
  var element = document.getElementById(elementId);
  return os.Container.registerTemplateElement_(element);
};

/**
 * Registers a custom tag from a namespaced DOM element.
 * @param {string} elementId Id of the DOM element to register.
 */
os.Container.registerTag = function(elementId) {
  var element = document.getElementById(elementId);
  os.Container.registerTagElement_(element, elementId);
};

/**
 * Renders a DOM element with a specified template and contextual data.
 * @param {string} elementId Id of DOM element to inject into.
 * @param {string} templateId Id of the template.
 * @param {Object} opt_data Data to supply to template.
 */
os.Container.renderElement = function(elementId, templateId, opt_data) {
  var template = os.getTemplate(templateId);
  if (template) {
    var element = document.getElementById(elementId);
    if (element) {
      template.renderInto(element, opt_data);
    } else {
      os.warn('Element (' + elementId + ') not found to render into.');
    }
  } else {
    os.warn('Template (' + templateId + ') not registered.');
  }
};

/**
 * Loads and executes all inline data request sections.
 * @param {Object} opt_doc Optional document to use instead of window.document.
 * TODO(davidbyttow): Currently this processes all 'script' blocks together,
 *     instead of collecting them all and then processing together. Not sure
 *     which is preferred yet.
 * TODO(davidbyttow: Figure out a way to pass in params used only for data
 *     and not for template rendering.
 */
os.Container.loadDataRequests = function(opt_doc) {
  var doc = opt_doc || document;
  var nodes = doc.getElementsByTagName(os.Container.TAG_script_);
  for (var i = 0; i < nodes.length; ++i) {
    var node = nodes[i];
    if (node.type == os.Container.dataType_) {
      os.data.loadRequests(node);
    }
  }
  os.data.executeRequests();
};

/**
 * Compiles and renders all inline templates.
 * @param {Object} opt_data Optional JSON data.
 * @param {Object} opt_doc Optional document to use instead of window.document.
 */
os.Container.processInlineTemplates = function(opt_data, opt_doc) {
  var data = opt_data || os.data.DataContext;
  os.Container.compileInlineTemplates(opt_doc);
  os.Container.renderInlineTemplates(data, opt_doc);
};

/**
 * Utility method which will automatically register all templates
 * and render all that are inline.
 * @param {Object} opt_data Optional JSON data.
 * @param {Object} opt_doc Optional document to use instead of window.document.
 */
os.Container.processDocument = function(opt_data, opt_doc) {
  os.Container.loadDataRequests(opt_doc);
  os.Container.registerDocumentTemplates(opt_doc);
  os.Container.processInlineTemplates(opt_data, opt_doc);
};

/***
 * @type {string} Tag name of a template.
 * @private
 */
os.Container.TAG_script_ = 'script';

/***
 * @type {Object} Map of allowed template content types.
 * @private
 * TODO(davidbyttow): Remove text/template.
 */
os.Container.templateTypes_ = {};
os.Container.templateTypes_['text/os-template'] = true;
os.Container.templateTypes_['text/template'] = true;

/***
 * @type {string} Type name of data request sections.
 * @private
 */
os.Container.dataType_ = 'text/os-data';

/**
 * Checks if a given type name is properly named as a template.
 * @param {string} typeName Name of a given type.
 * @return {boolean} This type is considered a template.
 * @private
 */
os.Container.isTemplateType_ = function(typeName) {
  return os.Container.templateTypes_[typeName] != null;
};

/**
 * Compiles and registers a template from a DOM element.
 * @param {Element} element DOM element from which to create a template.
 * @param {string} opt_id Optional id for template.
 * @return {Object} The compiled and registered template object.
 * @private
 */
os.Container.registerTemplateElement_ = function(element, opt_id) {
  var template = os.compileTemplate(element, opt_id);
  if (template) {
    os.registerTemplate(template);
  } else {
    os.warn('Could not compile template (' + element.id + ')');
  }
  return template;
};

/**
 * Registers a custom tag from a namespaced DOM element.
 * @param {Element} element DOM element to register.
 * @param {string} name Name of the tag.
 * @private
 */
os.Container.registerTagElement_ = function(element, name) {
  var template = os.Container.registerTemplateElement_(element);
  if (template) {
    var tagParts = name.split(':');
    var nsObj = os.getNamespace(tagParts[0]);
    if (nsObj) {
      nsObj[tagParts[1]] = os.createTemplateCustomTag(template);
    } else {
      os.warn('Namespace ' + tagParts[0] + ' is not registered.');
    }
  }
};