text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="538px"
    android:layout_height="796px"
    android:background="#1874CD" >

    <TextView
        android:id="@+id/option_tips_two"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10px"
        android:text="@string/optiontips"
        android:textColor="#FFFFFF"
        android:textSize="28sp" />

    <TextView
        android:id="@+id/option_tips_01_two"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10px"
        android:layout_marginTop="40px"
        android:text="@string/tipsone"
        android:textColor="#FFFFFF"
        android:textSize="28sp" />

    <TextView
        android:id="@+id/option_tips_02_two"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10px"
        android:layout_marginTop="80px"
        android:text="@string/tipstwo"
        android:textColor="#FFFFFF"
        android:textSize="28sp" />
    <TextView
        android:id="@+id/tv_lastmoney_two"
        android:layout_width="match_parent"
        android:layout_height="40px"
        android:layout_marginTop="120px"
        android:text="卡余额:"
        android:textColor="#FFFFFF"
        android:textSize="28sp" />

    <ImageView
        android:id="@+id/iv_setmoney_two"
        android:layout_width="175px"
        android:layout_height="93px"
        android:layout_marginLeft="2.5px"
        android:layout_marginTop="180px"
        android:src="@drawable/set_money_01" />

    <ImageView
        android:id="@+id/iv_setfill_two"
        android:layout_width="175px"
        android:layout_height="93px"
        android:layout_marginLeft="181.5px"
        android:layout_marginTop="180px"
        android:src="@drawable/set_fill_01" />

    <ImageView
        android:id="@+id/iv_full_two"
        android:layout_width="175px"
        android:layout_height="93px"
        android:layout_marginLeft="360.5px"
        android:layout_marginTop="180px"
        android:src="@drawable/set_full_01" />

    <LinearLayout
        android:id="@+id/linearLayout1_two"
        android:layout_width="match_parent"
        android:layout_height="80px"
        android:layout_marginLeft="60px"
        android:layout_marginTop="263px"
        android:gravity="center_vertical"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/inpress"
            android:textColor="#FFFFFF"
            android:textSize="28sp" />

        <TextView
            android:id="@+id/tv_kindoftext_two"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/kindone"
            android:textColor="#FFFFFF"
            android:textSize="28sp" />

        <TextView
            android:id="@+id/tv_param_two"
            android:layout_width="110px"
            android:layout_height="50px"
            android:background="#FFFFFF"
            android:gravity="center_vertical|left"
            android:textColor="#000000"
            android:textSize="28sp" />

        <TextView
            android:id="@+id/tv_danwei_two"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/danweione"
            android:textColor="#FFFFFF"
            android:textSize="28sp" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayout2_two"
        android:layout_width="match_parent"
        android:layout_height="180px"
        android:layout_below="@+id/linearLayout1_two"
        android:orientation="horizontal">

        <Button
            android:id="@+id/btn_cardout_two"
            android:layout_width="120px"
            android:layout_height="120px"
            android:layout_marginLeft="20px"
            android:text="@string/cardout"
            android:textSize="36sp"/>

        <LinearLayout
            android:layout_width="300px"
            android:layout_height="180px"
            android:orientation="vertical"
            android:layout_marginLeft="130px">

            <LinearLayout
                android:layout_width="300px"
                android:layout_height="60px"
                android:orientation="horizontal"
                android:gravity="center_vertical">
                <Button
                    android:id="@+id/btn_100_two"
                    android:layout_width="100px"
                    android:layout_height="50px"
                    android:text="100"
                    android:textSize="28sp"
                    android:textColor="#000000"/>
                <Button
                    android:id="@+id/btn_200_two"
                    android:layout_width="100px"
                    android:layout_height="50px"
                    android:text="200"
                    android:textSize="28sp"
                    android:textColor="#000000"/>
            </LinearLayout>

            <LinearLayout
                android:layout_width="300px"
                android:layout_height="60px"
                android:orientation="horizontal"
                android:gravity="center_vertical">
                <Button
                    android:id="@+id/btn_500_two"
                    android:layout_width="100px"
                    android:layout_height="50px"
                    android:text="500"
                    android:textSize="28sp"
                    android:textColor="#000000"/>
                <Button
                    android:id="@+id/btn_1000_two"
                    android:layout_width="100px"
                    android:layout_height="50px"
                    android:text="1000"
                    android:textSize="28sp"
                    android:textColor="#000000"/>
            </LinearLayout>

            <LinearLayout
                android:layout_width="300px"
                android:layout_height="60px"
                android:orientation="horizontal">
                <Button
                    android:id="@+id/btn_cancel_two"
                    android:layout_width="100px"
                    android:layout_height="50px"
                    android:text="取消"
                    android:textSize="28sp"
                    android:textColor="#000000"/>
                <Button
                    android:id="@+id/btn_confirm_two"
                    android:layout_width="100px"
                    android:layout_height="50px"
                    android:text="确定"
                    android:textSize="28sp"
                    android:textColor="#000000"/>
            </LinearLayout>
        </LinearLayout>

    </LinearLayout>
    <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@+id/linearLayout2_two"
            android:layout_marginTop="10px">

        <Button
            android:id="@+id/btn_1_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:gravity="center"
            android:layout_marginLeft="131px"
            android:text="1"
            android:textColor="#000000"
            android:textSize="30sp"/>

        <Button
            android:id="@+id/btn_2_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_alignParentTop="true"
            android:layout_marginLeft="15px"
            android:layout_toRightOf="@+id/btn_1_two"
            android:gravity="center"
            android:text="2"
            android:textColor="#000000"
            android:textSize="30sp" />

        <Button
            android:id="@+id/btn_3_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_alignParentTop="true"
            android:layout_toRightOf="@+id/btn_2_two"
            android:layout_marginLeft="15px"
            android:gravity="center"
            android:text="3"
            android:textColor="#000000"
            android:textSize="30sp"/>

        <Button
            android:id="@+id/btn_4_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_alignLeft="@+id/btn_1_two"
            android:layout_below="@+id/btn_1_two"
            android:layout_marginTop="10px"
            android:text="4"
            android:textColor="#000000"
            android:textSize="30sp" />

        <Button
            android:id="@+id/btn_5_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_toRightOf="@+id/btn_4_two"
            android:layout_below="@+id/btn_2_two"
            android:layout_marginTop="10px"
            android:layout_marginLeft="15px"
            android:text="5"
            android:textColor="#000000"
            android:textSize="30sp"/>

        <Button
            android:id="@+id/btn_6_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_toRightOf="@+id/btn_5_two"
            android:layout_below="@+id/btn_3_two"
            android:layout_marginTop="10px"
            android:layout_marginLeft="15px"
            android:text="6"
            android:textColor="#000000"
            android:textSize="30sp"/>

        <Button
            android:id="@+id/btn_7_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_alignLeft="@+id/btn_4_two"
            android:layout_below="@+id/btn_4_two"
            android:layout_marginTop="10px"
            android:text="7"
            android:textColor="#000000"
            android:textSize="30sp" />

        <Button
            android:id="@+id/btn_8_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_toRightOf="@+id/btn_7_two"
            android:layout_below="@+id/btn_5_two"
            android:layout_marginTop="10px"
            android:layout_marginLeft="15px"
            android:text="8"
            android:textColor="#000000"
            android:textSize="30sp"/>

        <Button
            android:id="@+id/btn_9_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_toRightOf="@+id/btn_8_two"
            android:layout_below="@+id/btn_6_two"
            android:layout_marginTop="10px"
            android:layout_marginLeft="15px"
            android:text="9"
            android:textColor="#000000"
            android:textSize="30sp"/>

        <Button
            android:id="@+id/btn_delete_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_alignLeft="@+id/btn_7_two"
            android:layout_below="@+id/btn_7_two"
            android:layout_marginTop="10px"
            android:text="删除"
            android:textColor="#000000"
            android:textSize="28sp" />

        <Button
            android:id="@+id/btn_0_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_toRightOf="@+id/btn_delete_two"
            android:layout_below="@+id/btn_8_two"
            android:layout_marginTop="10px"
            android:layout_marginLeft="15px"
            android:text="0"
            android:textColor="#000000"
            android:textSize="30sp"/>

        <Button
            android:id="@+id/btn_sure_two"
            android:layout_width="80px"
            android:layout_height="50px"
            android:layout_toRightOf="@+id/btn_0_two"
            android:layout_below="@+id/btn_9_two"
            android:layout_marginTop="10px"
            android:layout_marginLeft="15px"
            android:text="确认"
            android:textColor="#000000"
            android:textSize="28sp"/>

    </RelativeLayout>

</RelativeLayout>


text:
package gov.hhs.onc.sdcct.xml;

public interface XmlEncodeOptions extends XmlCodecOptions<XmlEncodeOptions> {
}

redpajama_set_name: RedPajamaGithub


text:
package org.insightech.er.editor.controller.command.diagram_contents.element.connection.relation;

import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.EditPart;
import org.insightech.er.editor.controller.editpart.element.node.TableViewEditPart;
import org.insightech.er.editor.model.ERDiagram;
import org.insightech.er.editor.model.diagram_contents.element.connection.Relation;
import org.insightech.er.editor.model.diagram_contents.element.node.Location;
import org.insightech.er.editor.model.diagram_contents.element.node.NodeElement;
import org.insightech.er.editor.model.diagram_contents.element.node.category.Category;
import org.insightech.er.editor.model.diagram_contents.element.node.table.ERTable;
import org.insightech.er.editor.model.settings.Settings;

public class CreateRelatedTableCommand extends AbstractCreateRelationCommand {

	private Relation relation1;

	private Relation relation2;

	private ERTable relatedTable;

	private ERDiagram diagram;

	private int sourceX;

	private int sourceY;

	private int targetX;

	private int targetY;

	private Category category;

	protected Location newCategoryLocation;

	protected Location oldCategoryLocation;

	private Settings oldSettings;

	public CreateRelatedTableCommand(ERDiagram diagram) {
		super();

		this.relatedTable = new ERTable();

		this.diagram = diagram;
		this.category = this.diagram.getCurrentCategory();
		if (this.category != null) {
			this.oldCategoryLocation = this.category.getLocation();
		}
	}

	public void setSourcePoint(int x, int y) {
		this.sourceX = x;
		this.sourceY = y;
	}

	private void setTargetPoint(int x, int y) {
		this.targetX = x;
		this.targetY = y;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void setTarget(EditPart target) {
		super.setTarget(target);

		if (target != null) {
			if (target instanceof TableViewEditPart) {
				TableViewEditPart tableEditPart = (TableViewEditPart) target;

				Point point = tableEditPart.getFigure().getBounds().getCenter();
				this.setTargetPoint(point.x, point.y);
			}
		}
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	protected void doExecute() {
		// ERDiagramEditPart.setUpdateable(false);

		this.init();

		Settings settings = diagram.getDiagramContents().getSettings();
		this.oldSettings = settings.clone();

		this.diagram.addNewContent(this.relatedTable);
		this.addToCategory(this.relatedTable);

		this.relation1.setSource((ERTable) this.source.getModel());
		this.relation1.setTargetTableView(this.relatedTable);

		this.relation2.setSource((ERTable) this.target.getModel());
		this.relation2.setTargetTableView(this.relatedTable);

		for (Category category : settings.getCategorySetting().getAllCategories()) {
			this.relation1.removeCategory(category);
			this.relation1.addCategory(category);
			this.relation2.removeCategory(category);
			this.relation2.addCategory(category);
		}

		this.diagram.refreshChildren();
		this.getTargetModel().refresh();
		this.getSourceModel().refresh();

		if (this.category != null) {
			this.category.refresh();
		}
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	protected void doUndo() {
		this.diagram.removeContent(this.relatedTable);
		this.removeFromCategory(this.category);

		this.relation1.setSource(null);
		this.relation1.setTargetTableView(null);

		this.relation2.setSource(null);
		this.relation2.setTargetTableView(null);

		this.diagram.getDiagramContents().setSettings(oldSettings);

		this.diagram.refreshChildren();
		this.getTargetModel().refresh();
		this.getSourceModel().refresh();

		if (this.category != null) {
			this.category.refresh();
		}
	}

	private void init() {
		ERTable sourceTable = (ERTable) this.getSourceModel();

		this.relation1 = sourceTable.createRelation();

		ERTable targetTable = (ERTable) this.getTargetModel();
		this.relation2 = targetTable.createRelation();

		this.relatedTable.setLocation(category, new Location(
				(this.sourceX + this.targetX - ERTable.DEFAULT_WIDTH) / 2,
				(this.sourceY + this.targetY - ERTable.DEFAULT_HEIGHT) / 2,
				ERTable.DEFAULT_WIDTH, ERTable.DEFAULT_HEIGHT));

		this.relatedTable.setLogicalName(ERTable.NEW_LOGICAL_NAME);
		this.relatedTable.setPhysicalName(ERTable.NEW_PHYSICAL_NAME);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean canExecute() {
		if (!super.canExecute()) {
			return false;
		}

		if (!(this.getSourceModel() instanceof ERTable)
				|| !(this.getTargetModel() instanceof ERTable)) {
			return false;
		}

		return true;
	}

	protected void addToCategory(NodeElement nodeElement) {
		if (this.category != null) {
			this.category.add(nodeElement);
			Location newLocation = category.getNewCategoryLocation(nodeElement);

			if (newLocation != null) {
				this.newCategoryLocation = newLocation;
				this.category.setLocation(this.newCategoryLocation);
			}
		}
	}

	protected void removeFromCategory(NodeElement nodeElement) {
		if (this.category != null) {
			this.category.remove(nodeElement);

			if (this.newCategoryLocation != null) {
				this.category.setLocation(this.oldCategoryLocation);
			}
		}
	}

}


text:
using System;
using System.IO;
using PeterO.Cbor;

namespace DSInternals.Common.Data.Fido
{
    public class AuthenticatorData
    {
        /// <summary>
        /// Minimum length of the authenticator data structure.
        /// <see cref="https://www.w3.org/TR/webauthn/#sec-authenticator-data"/>
        /// </summary>
        private const int MinLength = SHA256HashLenBytes + sizeof(AuthenticatorFlags) + sizeof(UInt32);

        private const int SHA256HashLenBytes = 32; // 256 bits, 8 bits per byte

        /// <summary>
        /// SHA-256 hash of the RP ID the credential is scoped to.
        /// </summary>
        public byte[] RelyingPartyIdHash
        {
            get;
            private set;
        }

        /// <summary>
        /// Flags contains information from the authenticator about the authentication
        /// and whether or not certain data is present in the authenticator data.
        /// </summary>
        public AuthenticatorFlags Flags
        {
            get;
            private set;
        }

        /// <summary>
        /// Signature counter, 32-bit unsigned big-endian integer.
        /// </summary>
        public uint SignatureCount {
            get;
            private set;
        }

        /// <summary>
        /// Attested credential data is a variable-length byte array added to the
        /// authenticator data when generating an attestation object for a given credential.
        /// </summary>
        public AttestedCredentialData AttestedCredentialData
        {
            get;
            private set;
        }

        /// <summary>
        /// Optional extensions to suit particular use cases.
        /// </summary>
        /// <see cref="https://www.w3.org/TR/webauthn/#extensions"/>
        public CBORObject Extensions
        {
            get;
            private set;
        }

        public AuthenticatorData(byte[] authData)
        {
            // Input validation
            Validator.AssertNotNull(authData, nameof(authData));
            Validator.AssertMinLength(authData, MinLength, nameof(authData));

            // Input parsing
            using (var stream = new MemoryStream(authData, false))
            {
                using (var reader = new BinaryReader(stream))
                {
                    this.RelyingPartyIdHash = reader.ReadBytes(SHA256HashLenBytes);

                    this.Flags = (AuthenticatorFlags)reader.ReadByte();

                    // Sign count is provided by the authenticator as big endian, convert if we are on little endian system
                    byte[] signCountBytes = reader.ReadBytes(sizeof(UInt32));
                    this.SignatureCount = signCountBytes.ToUInt32BigEndian();

                    // Attested credential data is only present if the AT flag is set
                    if (this.Flags.HasFlag(AuthenticatorFlags.AttestationData))
                    {
                        // Decode attested credential data, which starts at the next byte past the minimum length of the structure.
                        this.AttestedCredentialData = new AttestedCredentialData(reader);
                    }

                    // Extensions data is only present if the ED flag is set
                    if (this.Flags.HasFlag(AuthenticatorFlags.ExtensionData))
                    {

                        // "CBORObject.Read: This method will read from the stream until the end
                        // of the CBOR object is reached or an error occurs, whichever happens first."
                        //
                        // Read the CBOR object from the stream
                        this.Extensions = CBORObject.Read(reader.BaseStream);
                    }

                    if(stream.Position != stream.Length)
                    {
                        // There should be no bytes left over after decoding all data from the structure
                        throw new ArgumentException("Unexpected FIDO authenticator data format.", nameof(authData));
                    }
                }
            }
        }
    }
}


text:
var fs = require('fs')
,   karol = require('../lib/compiler/karol')

fs.readFile(process.ARGV[2], 'utf-8', function (err, contents) {
  if (err) throw err
  console.log(karol.compile(contents))
})


text:
Build instructions for the Apache Lucy C library
================================================

Clownfish dependency
--------------------

**IMPORTANT:** The Apache Lucy C library depends on the Clownfish object system
which must be built first. Please read this section, or your build will
probably **FAIL**.

Lucy needs the following Clownfish components:

* The command-line Clownfish compiler 'cfc'.
* The Clownfish header files of the Clownfish runtime.
* The 'libcfish' shared library.

If you installed Clownfish to /usr/local or /usr on UNIX, no further action
should be required. If you installed Clownfish to an alternate location,
make sure to use the `--clownfish-prefix` configure option:

    ./configure --clownfish-prefix=[clownfish-install-dir]

It's also possible to build Lucy with an uninstalled Clownfish build from
the Clownfish source directory. To setup the required environment variables,
source the file `devel/bin/setup_env.sh` from the Clownfish source tree:

    source [path_to_clownfish]/devel/bin/setup_env.sh

Or, if you're on the Windows shell:

    [path_to_clownfish]/devel/bin/setup_env.bat

Building under UNIX and derivatives or Cygwin
---------------------------------------------

    ./configure --prefix [install-prefix]
    make
    make test
    make install

Building under Windows
----------------------

You need MSVC or gcc as C compiler and nmake, mingw32-make, or standard
GNU make as make utility. When building under cmd.exe, configure with:

    configure.bat --prefix [install-prefix]

Configuration
-------------

    [environment] ./configure [options] [-- [cflags]]

### Options

    --enable-coverage

Enable code coverage. Create HTML pages with coverage data using
lcov by running "make coverage".

    --clownfish-prefix=[path]

Specify an alternative location for Clownfish if it isn't installed
in a system directory.

### Environment variables

    CC

The C compiler.

    TARGET_CC

The target compiler when cross-compiling. `CC` can be set in addition
to specify the host compiler.


text:
class Hash
  def rename_key(old_key, key)
    dup.rename_key! old_key, key
  end

  def rename_key!(old_key, key)
    store(key, delete(old_key))
    self
  end

  def rename_keys(replacements={})
    dup.rename_keys! replacements
  end

  def rename_keys!(replacements={})
    replacements.each do |old_key, key|
      rename_key!(old_key, key)
    end
    self
  end
end


text:
module ActiveService
  module Model
    module Attributes
      class AttributeMap
        attr_reader :attributes

        def initialize(attributes)
          @attributes = attributes.inject({}) do |result, attr|
            result[attr.name] = attr.source
            result
          end
        end

        def by_source
          attributes.invert
        end

        def map(hash, options={})
          mapping = (options[:to] == :source ? attributes : by_source).with_indifferent_access
          hash.inject({}) do |result, (k, v)|
            key = mapping.has_key?(k) ? mapping[k] : k
            result[key] = v
            result
          end
        end
      end
    end
  end
end


text:
require 'spec_helper'

describe CacheAndFetch::Fetchable do
  class FetchableResource < ActiveResource::Base
    include CacheAndFetch::Fetchable
    register_cache_client Rails.cache
    self.site = 'http://test.example.com'
  end

  describe "custom finder" do
    before :each do
      module Finder
        def find(key)
          "mutilated-#{key.to_s}"
        end
      end

      class PatheticFetchableDummy < ActiveResource::Base
        self.site = 'http://test.example.com'
        include CacheAndFetch::Fetchable
        register_cache_client Rails.cache
        register_finder Finder
      end
    end

    it "finds the cached content" do
      PatheticFetchableDummy.send(:find, 'body').should eq('mutilated-body')
    end
  end

  describe ".fetch" do
    context "when the object does not exist in the cache" do
      before :each do
        stub_request(:get, "http://test.example.com/fetchable_resources/1.json") \
          .with(:headers => {'Accept'=>'application/json'}) \
          .to_return(:status => 200, :body => {'id' => 1, 'name' => 'test'}.to_json, :headers => {})
      end

      it "fetches the object from the remote application" do
        obj = FetchableResource.fetch(1)
        obj.id.should eq(1)
        obj.name.should eq('test')
      end
    end

    context "when the object already exists in the cache" do
      context "when the cache has not yet expired" do
        before :each do
          @obj = FetchableResource.new(:id => 1, :name => 'test')
          @obj.cache
        end

        it "fetches the object from the cache" do
          FetchableResource.fetch(1).should eq(@obj)
        end
      end

      context "when the cache has expired" do
        before :each do
          @obj = FetchableResource.new(:id => 1, :name => 'test')
          @obj.cache_expires_at = 10.minutes.ago.to_i
          FetchableResource.cache_client.write('fetchable_resource/1', @obj)
        end

        context "when the fetch method receives no custom block" do
          before :each do
            stub_request(:get, "http://test.example.com/fetchable_resources/1.json") \
              .with(:headers => {'Accept'=>'application/json'}) \
              .to_return(:status => 200, :body => {'id' => 1, 'name' => 'another_test'}.to_json, :headers => {})
          end

          it "fetches the object from the cache" do
            FetchableResource.fetch(1).should eq(@obj)
          end

          it "recaches the object" do
            FetchableResource.fetch(1).name.should eq('test')
            sleep 1
            FetchableResource.fetch(1).name.should eq('another_test')
          end
        end

        context "when the fetch method receives a custom block" do
          it "fetches the object from the cache" do
            catch(:foo) do
              FetchableResource.fetch(1) do |resource|
                throw :foo
              end.should eq(@obj)
            end
          end
        end
      end
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <item type="string" name="test_crossType_bool2str">true</item>
    <item type="string" name="test_crossType_int2str">5</item>
</resources>


text:
/* vim: set sw=4 sts=4 et foldmethod=syntax : */

#include <graph/bit_graph.hh>

using namespace parasols;

GraphTooBig::GraphTooBig() throw () = default;


text:
version: 0.7.8
title: Version 0.7.8 (unstable)
author: Isaac Schlueter
date: 2012-04-18T17:39:02.000Z
status: publish
category: release
slug: version-0-7-8-unstable
layout: blog-post.hbs
---

2012.04.18, Version 0.7.8, (unstable)

Upgrade V8 to 3.9.24.9

Upgrade OpenSSL to 1.0.0f

Upgrade npm to 1.1.18

Show licenses in Binary installers

Domains (isaacs)

readline: rename "end" to "close" (Nathan Rajlich)

tcp: make getsockname() return address family as string (Shigeki Ohtsu)

http, https: fix .setTimeout() (ssuda)

os: add cross platform EOL character (Mustansir Golawala)

typed arrays: unexport SizeOfArrayElementForType() (Aaron Jacobs)

net: honor 'enable' flag in .setNoDelay() (Ben Noordhuis)

child_process: emit error when .kill fails (Andreas Madsen)

gyp: fix 'argument list too long' build error (Ben Noordhuis)

fs.WriteStream: Handle modifications to fs.open (isaacs)

repl, readline: Handle newlines better (Nathan Rajlich, Nathan Friedly)

build: target OSX 10.5 when building on darwin (Nathan Rajlich)

Fix #3052 Handle errors properly in zlib (isaacs)

build: add support for DTrace and postmortem (Dave Pacheco)

core: add reusable Slab allocator (Ben Noordhuis)

Source Code: https://nodejs.org/dist/v0.7.8/node-v0.7.8.tar.gz

Windows Installer: https://nodejs.org/dist/v0.7.8/node-v0.7.8.msi

Windows x64 Files: https://nodejs.org/dist/v0.7.8/x64/

Macintosh Installer (Universal): https://nodejs.org/dist/v0.7.8/node-v0.7.8.pkg

Other release files: https://nodejs.org/dist/v0.7.8/

Website: https://nodejs.org/docs/v0.7.8/

Documentation: https://nodejs.org/docs/v0.7.8/api/


text:
static const char *mbfl_language_uni_aliases[] = {"universal", NULL};

const mbfl_language mbfl_language_uni = {
	mbfl_no_language_uni,
	"uni",
	"uni",
	(const char *(*)[])&mbfl_language_uni_aliases,
	mbfl_no_encoding_utf8,
	mbfl_no_encoding_base64,
	mbfl_no_encoding_base64
};


text:
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;

using AssignmentNotificationEmailWKKI.Models;
using AssignmentNotificationEmailWKKI.Properties;

namespace AssignmentNotificationEmailWKKI
{
    //public class MockEmailProvider<T> : IUnsentEmailProvider<T>
    //    where T:IEmailModel
    //{
    //    private Func<IEnumerable<T>> resultFunc;

    //    public MockEmailProvider(Func<IEnumerable<T>> getEmails)
    //    {
    //        resultFunc = getEmails;
    //    }

    //    public System.Collections.Immutable.ImmutableArray<T> GetUnsentEmails()
    //    {
    //        return resultFunc().ToImmutableArray();
    //    }

    //    public Task<System.Collections.Immutable.ImmutableArray<T>> GetUnsentEmailsAsync(System.Threading.CancellationToken token)
    //    {
    //        return Task.FromResult(resultFunc().ToImmutableArray());
    //    }

    //    public bool UpdateEmailAsSent()
    //    {
    //        return true;
    //    }

    //    public Task UpdateEmailAsSentAsync(System.Threading.CancellationToken token)
    //    {
    //        return Task.FromResult(true);
    //    }

    //    public void Dispose() { }
    //}

    //public static class MockEmailProvider
    //{
    //    public static MockEmailProvider<T> Create<T>(Func<IEnumerable<T>> getUnsentEmails) where T: IEmailModel
    //    {
    //        return new MockEmailProvider<T>(getUnsentEmails);
    //    }
    //}

    public class SpecialEmailProviderDSD : IUnsentEmailProvider<July4SafetyModel>
    {
        public string ConnectionString { get; set; }
        public SpecialEmailProviderDSD(string connectionString)
        {
            ConnectionString = connectionString;
        }

        //public

        public ImmutableArray<July4SafetyModel> GetUnsentEmails()
        {
            using (var connection = new SqlConnection(ConnectionString))
            {
                using (var command = new SqlCommand(Resources.SqlSpecialEmailDSD, connection))
                {
                    connection.Open();
                    var results = new List<July4SafetyModel>();
                    using (var reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            try
                            {
                                var email = reader.GetString(reader.GetOrdinal("EmailAddress"));
                                if (String.IsNullOrWhiteSpace(email))
                                    continue;

                                var firstName = reader.GetString(reader.GetOrdinal("Firstname"));
                                var lastName = reader.GetString(reader.GetOrdinal("Lastname"));

                                MailAddress toAddress;
                                if (!String.IsNullOrWhiteSpace(firstName))
                                {
                                    if (!String.IsNullOrWhiteSpace(lastName))
                                        toAddress = new MailAddress(email, firstName + " " + lastName);
                                    else
                                        toAddress = new MailAddress(email, firstName);
                                }
                                else if (!String.IsNullOrWhiteSpace(lastName))
                                    toAddress = new MailAddress(email, lastName);
                                else
                                    toAddress = new MailAddress(email);

                                var model = new July4SafetyModel(toAddress);
                                results.Add(model);

                                model.EmployeeID = reader.GetString(reader.GetOrdinal("EmployeeId"));
                            }
                            catch(Exception ex)
                            {
                                throw;
                            }
                        }
                    }
                    return results.ToImmutableArray();
                }

            }
            return ImmutableArray<July4SafetyModel>.Empty;
        }

        public Task<System.Collections.Immutable.ImmutableArray<July4SafetyModel>> GetUnsentEmailsAsync(System.Threading.CancellationToken token)
        {
            throw new NotImplementedException();
        }

        public bool UpdateEmailAsSent()
        {
            return true;
        }

        public Task UpdateEmailAsSentAsync(System.Threading.CancellationToken token)
        {
            throw new NotImplementedException();
        }

        public void Dispose()
        {
            //throw new NotImplementedException();
        }
    }
}


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta http-equiv="last-modified" content="2018-04-10T11:55:09.1126164+01:00" />
    <meta name="google-site-verification" content="9bvoj2jXRyykef2Tg72C0Am15YBTqDF0RgeZ84tUytE" />
        <title>
    Jonathan Channon Blog - Publishing to Windows Azure from Github
</title>
    <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700%7CCourgette' rel='stylesheet' type='text/css'>
    <link href="/css/style.css" media="screen" rel="stylesheet">
    <link href="/css/screen.css" media="screen" rel="stylesheet">
    <link rel="alternate" type="application/rss+xml" title="Jonathan Channon Blog" href="/feed.xml" />

        Blog

curated by Jonathan Channon

Home

About Me

Resume

Archive

Contact

            <select id="topm-select" onChange="location = this.value">
                <option value="">Site Navigation</option>
                <option value="/">Home</option>
                <option value="/about">About Me</option>
                <option value="http://www.jonathanchannon.com">Resume</option>
                <option value="/archive">Archive</option>
                <option value="/contact">Contact</option>
            </select>

Publishing to Windows Azure from Github

        November 06, 2012

Back in July 2012 Microsoft announced improvements to Azure Web Sites. One of those improvements was to Git publishing so when you pushed changes to your Github repository Azure would automatically pick that up and deploy the project. I even mentioned it in my DinnerParty blog post but have only just looked at implementing it.

Preparation

As I said in my previous post Azure supported Git publishing but it was a two step process. You push to Github and then push to Azure and it gets deployed. If you already have Git setup on your Azure account there is nowhere in the dashboard that allows to you setup Github integration. I thought I was going to have reset my deployment credentials and set it all up again when I asked the question on Jabbr. Luckily David Fowler was online. Why is that lucky? He wrote the Github integration feature of Azure.

To setup your Azure account to enable Github integration you have to FTP into your Azure account and delete the deployment history by deleting all contents in the /site/deployments folder.

Deployment History

Setup

Once the history is deleted, if you go to the Deployments tab in the Azure account you will now see a link to "Deploy from my GitHub repository".

Setup

By clicking the link it will inform you that you need to authorize Azure to have access to your Github repository and that if there is code already in your repository it will be deployed again.

Authorize

Once you authorize Azure to read your Github account you need to tell it which repository it should watch.

Repository

As stated earlier, if there is code in the repo it will begin to deploy automatically and confirm deployment once this has been done.

Deploying

Deployed

From now on, once you push changes to your Github repository Azure will pick them up and deploy the project to your web site! Could it get any easier?

UPDATE 7th Nov 2012: After speaking to David Fowler again he remembered that you could take the Git webservice hook and enter that into the Github repository account settings.

Go to the Configure tab in Azure and copy the Git hoook URL.

Azure Hook

Then go to your Github repo and into the Admin section and under Service Hooks enter the copied Azure URL

Github Hook

Away you go!

     .net
     deployment
     dinnerparty
     git
     github
     windowsazure

        <meta itemprop="name" content="Jonathan Channon">

Please enable JavaScript to view the comments powered by Disqus.
comments powered by Disqus

                Twitter
                Github
                Linked In
                RSS Feed

Powered by Sandra.Snow


text:
import pika
import simplejson as json
from libUpdate import UpdateClass
import pymongo
import time
def mUpdate(r,k,id):
    T=0
    S=0
    if r is not 0:
        T=r["Tiered"]
        S=r["Stock"]

    uri="mongodb://hqjf:aa88OO00@172.168.16.104/hqchip"
    if r==0:
        return -1
    try:
        con=pymongo.MongoClient(uri)
        db=con.hqchip
        if k==2:
            data=db.mouser.update({"GoodsId":id},{"$set":{"Tiered":T,"Stock":S,"time":int(time.time())}})
        elif k==3:
            data=db.digikey.update({"GoodsId":id},{"$set":{"Tiered":T,"Stock":S,"time":int(time.time())}})
        elif k==4:
            data=db.future.update({"GoodsId":id},{"$set":{"Tiered":T,"Stock":S,"time":int(time.time())}})
        else:
            data=db.test.update({"GoodsId":id},{"$set":{"Tired":T,"Stock":S,"time":int(time.time())}})
        return 0
    except pymongo.errors.ConnectionFailure:
        print("fail to connect mongodb,try after 3s")
        time.sleep(3)
        con=pymongo.MongoClient(uri)
    except pymongo.errors.ConfigurationError:
        print("Your password config is not right,fail to connect mongodb!")
        print("The formate should be 'mongodb://user:password@example.com/the_database'")
        print("Please try again!")
    except pymongo.errors.InvalidURI:
        print("Your uri is not write,fail to connect mongodb!")
        print("The formate should be 'mongodb://user:password@example.com/the_database'")
        print("Please try again!")
    except pymongo.errors.AutoReconnect(message='Lose connection,reconnect.....', errors=None):
        print("reconnect .......")
    pass
connection = pika.BlockingConnection(pika.ConnectionParameters(
        host='172.168.16.102'))

channel = connection.channel()

channel.queue_declare(queue='rpc_queue')
"""
to_update is for get the URL and update the price and quantity
the return value is the json data

"""
UC=UpdateClass()
def on_request(ch, method, props, body):
    body=body.decode('utf-8')
    IU=json.loads(body)
    print(IU)
  #  ch.basic_ack(delivery_tag = method.delivery_tag)
  #  return
    url=IU["URL"].replace("www.mouser.cn","cn.mouser.com")
    k=IU["k"]
    id=IU["ID"]
    print (" [.] ID(%s)"  % (id,))
    response =UC.toGetData(ID=id,url=url,k=k)
    print(response)
    mUpdate(response,k,id)
    ch.basic_publish(exchange='',
                     routing_key=props.reply_to,
                     properties=pika.BasicProperties(correlation_id = \
                                                         props.correlation_id),
                     body=json.dumps(response))
    ch.basic_ack(delivery_tag = method.delivery_tag)

channel.basic_qos(prefetch_count=1)
channel.basic_consume(on_request, queue='rpc_queue')

print (" [x] Awaiting RPC requests to update the hqchip data!")
channel.start_consuming()


text:
Using block
===========

Adding to the model
-------------------

To add a property of type ``node`` to your resource model, add a one-to-one association to your doctrine definition and update your entity. In this case, the property is called "content".

.. code-block:: yaml

    oneToOne:
        content:
            cascade: ['persist', 'refresh', 'remove']
            targetEntity: Enhavo\Bundle\BlockBundle\Model\NodeInterface

.. code-block:: php

    <?php

    //...

    class Foo {

    //...

    /**
     * @var NodeInterface
     */
    protected $content;

    public function getContent() {...}
    public function setContent(...) {...}

    //...

    }

Adding to form
--------------

To properly edit a property of the type ``node`` in your form, use the form type ``BlockNodeType::class`` or ``enhavo_block_block_node``.

.. code-block:: php

    $builder->add('content', BlockNodeType::class);

Limit node types for a FormType
-------------

If you don't add any options, all item types configured in config/packages/enhavo_block.yaml will be available in the form

items (array)
~~~~~

You can restrict the available types by setting the option ``items``.

.. code-block:: php

    $builder->add('content', BlockNodeType::class, array(
        'items' => ['text','my_block_node_name']
    ));

item_groups (array)
~~~~~~~~~~~

You can restrict the available types also by setting the option ``item_groups``. Beforehand you need to define these ``item_groups`` in each block node definition in config/packages/enhavo_block.yaml like so:

.. code-block:: yaml

    enhavo_block:
        blocks:
            my_block_node:
                groups: [ my_group, maybe_a_second_group ]
            my_second_block_node:
                groups: [ maybe_a_second_group ]

Afterwards you can use these groups in your FormType:

.. code-block:: php

    $builder->add('content', BlockNodeType::class, array(
        'item_groups' => ['my_group']
    ));

In this case, only "my_block_node" would be available, as "my_second_block_node" does not belong to that group.


text:
package pl.java.scalatech.metamodel;

import java.util.Set;

import javax.persistence.EntityManagerFactory;
import javax.persistence.metamodel.ManagedType;
import javax.persistence.metamodel.Metamodel;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import lombok.extern.slf4j.Slf4j;
import pl.java.scalatech.config.TestJpaConfig;

@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { TestJpaConfig.class })
@ActiveProfiles(value={"logger","dev"})
public class PersonMetaModelTest {

    @Autowired
    private EntityManagerFactory emf;

    @Test
    public void shouldBootstrap() {

    }

    @Test
    public void shouldMetaModelWork() {
        Metamodel mm = emf.getMetamodel();
        Set<ManagedType<?>> managedTypes = mm.getManagedTypes();
        for(ManagedType<?> mType: managedTypes){
            log.info("{},{}",mType.getJavaType(),mType.getPersistenceType());
        }

    }

}


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.firebase.geofire">
  <uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="24" />

  <uses-permission android:name="android.permission.INTERNET" />
</manifest>


text: """Tests for the uvc component."""


text:
<!DOCTYPE html>

    <title>Structs  Reference</title>
    <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="css/highlight.css" />
    <meta charset='utf-8'>

 Docs

View on GitHub

         Reference

        Structs  Reference

            Classes

                Dialog

            Enums

                Format

            Structs

                Conversation

                ConversationResponse

                DialogModel

                HitNode

                Message

                Node

                Parameter

                Profile

            Typealiases

                DialogID

Structs

The following structs are available globally.

                    ConversationResponse

A dialog conversation response.

                        See more

Declaration

Swift

public struct ConversationResponse: JSONDecodable

                    DialogModel

A dialog associated with a particular service instance.

                        See more

Declaration

Swift

public struct DialogModel: JSONDecodable

                    Conversation

A dialog conversation.

                        See more

Declaration

Swift

public struct Conversation: JSONDecodable

                    HitNode

A dialog hit node.

                        See more

Declaration

Swift

public struct HitNode: JSONDecodable

                    Message

A dialog message.

                        See more

Declaration

Swift

public struct Message: JSONDecodable

                    Node

A dialog node.

                        See more

Declaration

Swift

public struct Node: JSONEncodable, JSONDecodable

                    Profile

A dialog profile.

                        See more

Declaration

Swift

public struct Profile: JSONEncodable, JSONDecodable

                    Parameter

A dialog parameter.

                        See more

Declaration

Swift

public struct Parameter: JSONEncodable, JSONDecodable

© 2017 . All rights reserved. (Last updated: 2017-03-02)

Generated by jazzy ♪♫ v0.7.3, a Realm project.


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Czech Mycol. 47(4): 251 (1994)

#### Original name
Melastiza flavida K.S. Thind & R. Kaushal, 1979

### Remarks
null


text:
class Auth0Controller < ApplicationController
  skip_before_action :load_current_fan

  def callback
    auth = request.env['omniauth.auth']

    if identity = Identity.find_by_user_id(auth.uid)
      session[:fan_id] = identity.fan_id
    else
      fan = Fan.new(handle: auth.extra.raw_info.screen_name || auth.info.nickname, picture: auth.info.image)
      fan.identities.build(user_id: auth.uid)
      fan.save!
      session[:fan_id] = fan.id
    end

    redirect_back
  end

  def failure
    @error_msg = request.params['message']
    render text: @error_msg
  end

  def logout
    reset_session
    self.current_fan = NullFan.new
    redirect_back
  end

  private

  def redirect_back
    if params[:back_to] =~ %r{\A/}
      redirect_to params[:back_to]
    else
      redirect_to root_path
    end
  end
end


text:
from crowdsourcing.forms import *
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from rest_framework import views as rest_framework_views
from rest_framework.views import APIView
from rest_framework.renderers import JSONRenderer
from crowdsourcing.serializers.user import *
from crowdsourcing.serializers.project import *
from crowdsourcing.utils import *
from crowdsourcing.models import *
from rest_framework.exceptions import AuthenticationFailed
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.csrf import csrf_protect
from django.utils.decorators import method_decorator
from crowdsourcing.utils import get_model_or_none

class JSONResponse(HttpResponse):
    """
    An HttpResponse that renders its content into JSON.
    """

    def __init__(self, data, **kwargs):
        content = JSONRenderer().render(data)
        kwargs['content_type'] = 'application/json'
        super(JSONResponse, self).__init__(content, **kwargs)

class Logout(APIView):
    def post(self, request, *args, **kwargs):
        from django.contrib.auth import logout
        logout(request)
        return Response({}, status=status.HTTP_204_NO_CONTENT)

class Login(APIView):
    method_decorator(csrf_protect)

    def post(self, request, *args, **kwargs):
        from django.contrib.auth import authenticate as auth_authenticate, login
        # self.redirect_to = request.POST.get('next', '') #to be changed, POST does not contain any data

        username = request.data.get('username', '')
        password = request.data.get('password', '')
        email_or_username = username

        # match with username if not email
        if not re.match(r"[^@]+@[^@]+\.[^@]+", email_or_username):
            username = email_or_username
        else:
            user = get_model_or_none(User, email=email_or_username)
            if user is not None:
                username = user.username

        user = auth_authenticate(username=username, password=password)

        if user is not None:
            if user.is_active:
                login(request, user)
                response_data = dict()
                response_data["username"] = user.username
                response_data["email"] = user.email
                response_data["first_name"] = user.first_name
                response_data["last_name"] = user.last_name
                response_data["date_joined"] = user.date_joined
                response_data["last_login"] = user.last_login
                response_data["is_requester"] = hasattr(request.user.userprofile, 'requester')
                response_data["is_worker"] = hasattr(request.user.userprofile, 'worker')

                return Response(response_data, status.HTTP_200_OK)
            else:
                raise AuthenticationFailed(_('Account is not activated yet.'))
        else:
            raise AuthenticationFailed(_('Username or password is incorrect.'))

class Oauth2TokenView(rest_framework_views.APIView):
    def post(self, request, *args, **kwargs):
        oauth2_login = Oauth2Utils()
        response_data, oauth2_status = oauth2_login.get_token(request)
        return Response(response_data, status=oauth2_status)

# Will be moved to Class Views
#################################################
def registration_successful(request):
    return render(request, 'registration/registration_successful.html')

def home(request):
    return render(request, 'base/index.html')


text:
namespace BullsAndCows.Observer
{
    public interface IObservable
    {
        void OnCommandHelpEvent();

        void OnCommandRestartEvent();

        void OnCommandTopEvent();

        void OnCommandExitEvent();

        void OnCommmandGuessNumberEvent(int guessNumber);
    }
}


text:
package info.gianlucacosta.eighthbridge.graphs

import java.util.UUID

/**
  * A general-purpose, read-only graph.
  *
  * Every status-changing operation returns a new graph.
  *
  * @tparam V Vertex type
  * @tparam L Link type
  * @tparam B Binding type
  */
trait Graph[V <: Vertex, L <: Link, B <: Binding, G <: Graph[V, L, B, G]] {
  this: G =>
  def vertexes: Set[V]

  def links: Set[L]

  def bindings: Set[B]

  /**
    * Copies the graph.
    *
    * If you implement this trait as a "case class", you can implement this method just by using the Scala-provided copy() method.
    *
    * @param vertexes The new vertexes
    * @param links    The new links
    * @param bindings The new bindings
    * @return The resulting new graph
    */
  protected def graphCopy(vertexes: Set[V] = vertexes, links: Set[L] = links, bindings: Set[B] = bindings): G

  @transient
  private lazy val vertexMap =
    vertexes.map(vertex =>
      vertex.id -> vertex
    )
      .toMap

  @transient
  private lazy val linkMap =
    links.map(
      link => link.id -> link
    )
      .toMap

  def addVertexes(vertexesToAdd: Set[V]): G = {
    val newVertexes =
      vertexes ++ vertexesToAdd

    require(
      newVertexes.size == vertexes.size + vertexesToAdd.size,
      "The vertexes to add must not belong to the graph"
    )

    graphCopy(vertexes = newVertexes)
  }

  def addVertex(vertex: V) =
    addVertexes(Set(vertex))

  def replaceVertexes(replacingVertexes: Set[V]): G = {
    val newVertexes =
      vertexes.diff(replacingVertexes) ++ replacingVertexes

    require(
      newVertexes.size == vertexes.size,
      "The replacing vertexes must match vertexes belonging to the graph"
    )

    graphCopy(vertexes = newVertexes)
  }

  def replaceVertex(vertex: V) =
    replaceVertexes(Set(vertex))

  def removeVertexes(vertexesToRemove: Set[V]): G = {
    val newVertexes =
      vertexes.diff(vertexesToRemove)

    require(
      newVertexes.size == vertexes.size - vertexesToRemove.size,
      "All the vertexes to remove must belong to the graph"
    )

    val vertexIdsToRemove =
      vertexesToRemove.map(_.id)

    val (newBindings, bindingsToRemove) = bindings.partition(
      binding => binding.vertexIds.intersect(vertexIdsToRemove).isEmpty
    )

    val linkIdsToRemove =
      bindingsToRemove.map(_.linkId)

    val newLinks =
      links.filter(link =>
        !linkIdsToRemove.contains(link.id)
      )

    graphCopy(
      vertexes = newVertexes,
      links = newLinks,
      bindings = newBindings
    )
  }

  def removeVertex(vertex: V) =
    removeVertexes(Set(vertex))

  def addLinks(bindingMapToAdd: Map[L, B]): G = {
    bindingMapToAdd.foreach {
      case (link, binding) =>
        require(
          link.id == binding.linkId,
          "Each binding must reference its associated link"
        )
    }

    val linksToAdd =
      bindingMapToAdd.keySet

    val bindingsToAdd =
      bindingMapToAdd.values.toSet

    require(
      linksToAdd.size == bindingsToAdd.size,
      "The bindings must be distinct"
    )

    bindingsToAdd.foreach(binding => {
      binding.vertexIds.foreach(vertexId =>
        require(
          vertexMap.contains(vertexId),
          "Each binding's vertexes must belong to the graph"
        )
      )
    })

    val newLinks =
      links.union(linksToAdd)

    val newBindings =
      bindings.union(bindingsToAdd)

    require(
      newLinks.size == links.size + linksToAdd.size,
      "The links to add must not belong to the graph"
    )

    require(
      newBindings.size == bindings.size + bindingsToAdd.size,
      "The bindings to add must not belong to the graph"
    )

    graphCopy(
      links = newLinks,
      bindings = newBindings
    )
  }

  def addLink(linkToAdd: L, bindingToAdd: B) =
    addLinks(
      Map(linkToAdd -> bindingToAdd)
    )

  def replaceLinks(replacingLinks: Set[L]): G = {
    val newLinks =
      links.diff(replacingLinks) ++ replacingLinks

    require(
      newLinks.size == links.size,
      "The replacing links must match links belonging to the graph"
    )

    graphCopy(links = newLinks)
  }

  def replaceLink(replacingLink: L) =
    replaceLinks(Set(replacingLink))

  def removeLinks(linksToRemove: Set[L]): G = {
    val newLinks =
      links.diff(linksToRemove)

    require(
      newLinks.size == links.size - linksToRemove.size,
      "All the links to remove must belong to the graph"
    )

    val linkIdsToRemove =
      linksToRemove.map(_.id)

    val newBindings = bindings.filter(binding =>
      !linkIdsToRemove.contains(binding.linkId)
    )

    graphCopy(
      links = newLinks,
      bindings = newBindings
    )
  }

  def removeLink(linkToRemove: L) =
    removeLinks(Set(linkToRemove))

  def getVertex(id: UUID): Option[V] =
    vertexMap.get(id)

  def containsVertex(id: UUID): Boolean =
    getVertex(id).isDefined

  def getLink(id: UUID): Option[L] =
    linkMap.get(id)

  def containsLink(id: UUID): Boolean =
    getLink(id).isDefined

  @transient
  lazy val linkedVertexes: Set[V] =
    bindings
      .flatMap(binding =>
        binding.vertexIds.map(vertexId =>
          getVertex(vertexId).get
        )
      )

  @transient
  lazy val unlinkedVertexes: Set[V] =
    vertexes.diff(linkedVertexes)

  /**
    * Returns the set of links connecting the given vertexes
    *
    * @param linkVertexes A set of vertexes
    * @return A set of links connecting the vertexes
    */
  def getLinksBetween(linkVertexes: Set[V]): Set[L] = {
    val linkVertexIds =
      linkVertexes.map(_.id)

    bindings
      .filter(binding =>
        linkVertexIds.subsetOf(binding.vertexIds)
      )
      .map(binding =>
        getLink(binding.linkId).get
      )
  }

  def getLinksBetween(linkVertexes: V*): Set[L] =
    getLinksBetween(linkVertexes.toSet)

  /**
    * Returns a set of vertexes connected to the given vertex
    *
    * @param vertex A vertex in the graph
    * @return The set of all the vertexes connected to the given vertex
    */
  def getLinkedVertexes(vertex: V): Set[V] =
    bindings
      .filter(binding => binding.vertexIds.contains(vertex.id))
      .flatMap(binding => binding.vertexIds - vertex.id)
      .map(vertexId => getVertex(vertexId).get)

}


text:
const path = require('path');

module.exports = {
  entry: './src/boleto.js',
  mode: 'development',
  optimization: {
    minimizer: [],
  },
  output: {
    filename: 'boleto.js',
    path: path.resolve(__dirname, 'lib'),
    library: 'Boleto',
  },
};


text:
'use strict';

const cloneRelayHandleSourceField = require('../cloneRelayHandleSourceField');
const getRelayHandleKey = require('../../util/getRelayHandleKey');

const {LINKED_FIELD, LINKED_HANDLE} = require('../../util/RelayConcreteNode');
const {generateWithTransforms, matchers} = require('RelayModernTestUtils');

describe('cloneRelayHandleSourceField()', () => {
  let selections;

  beforeEach(() => {
    expect.extend(matchers);
    const {TestQuery} = generateWithTransforms(`
      query TestQuery {
        me {
          address @__clientField(handle: "test") {
            street
          }
        }
      }
    `);
    // Get the selections on `me`.
    selections = TestQuery.operation.selections[0].selections;
  });

  it('returns a clone of the source, with the same name as the handle', () => {
    const handleField = selections.find(node => node.kind === LINKED_HANDLE);
    const sourceField = selections.find(node => node.kind === LINKED_FIELD);
    const clone = cloneRelayHandleSourceField(handleField, selections);

    expect(clone.kind).toBe(LINKED_FIELD);
    expect(clone.name).toBe(getRelayHandleKey('test', null, 'address'));
    expect(clone.selections).toEqual(sourceField.selections);
  });

  it('throws if the source field is not present', () => {
    const handleField = selections.find(node => node.kind === LINKED_HANDLE);
    selections = selections.filter(node => node.kind === LINKED_HANDLE);

    expect(() =>
      cloneRelayHandleSourceField(handleField, selections),
    ).toFailInvariant(
      'cloneRelayHandleSourceField: Expected a corresponding source field ' +
        'for handle `test`.',
    );
  });
});


text:
package com.orpc.example.server;

import com.orpc.example.api.HelloService;
import com.orpc.server.annotion.RpcService;

@RpcService(HelloService.class)
public class HelloServiceImpl implements HelloService {

	@Override
	public String say(String name) {
		System.out.println("收到---> " + name);
		return "hello " + name;
	}

}


text:
<?php header('Access-Control-Allow-Origin: *'); ?>
<!DOCTYPE html>

        <meta encoding="utf8">
        <title>DnD</title>
        <link rel="stylesheet" href="resources/html/css/style_reset.css">
        <link rel="stylesheet" href="resources/bower_components/bootstrap/dist/css/bootstrap.min.css">
        <link rel="stylesheet" href="resources/html/css/bb5-skin03.css">
        <link rel="stylesheet" href="resources/html/css/jquery-ui.css">
        <link rel="stylesheet" href="resources/html/css/font-awesome.min.css">
        <link rel="stylesheet" href="resources/html/css/bb5-ui.css">

drag me

drag me

drag me

            <button id="btn">add new block</button>


text:
""" Implement pp calculation features using pyttanko.
    https://github.com/Francesco149/pyttanko
"""

import os
from collections import namedtuple
import logging

from pcbot import utils
from . import api
from .args import parse as parse_options

try:
    import pyttanko
except:
    pyttanko = None

host = "https://osu.ppy.sh/"

CachedBeatmap = namedtuple("CachedBeatmap", "url_or_id beatmap")
PPStats = namedtuple("PPStats", "pp stars artist title version")
ClosestPPStats = namedtuple("ClosestPPStats", "acc pp stars artist title version")

plugin_path = "plugins/osulib/"
beatmap_path = os.path.join(plugin_path, "map.osu")
cached_beatmap = CachedBeatmap(url_or_id=None, beatmap=None)

async def is_osu_file(url: str):
    """ Returns True if the url links to a .osu file. """
    headers = await utils.retrieve_headers(url)
    return "text/plain" in headers.get("Content-Type", "") and ".osu" in headers.get("Content-Disposition", "")

async def download_beatmap(beatmap_url_or_id):
    """ Download the .osu file of the beatmap with the given url, and save it to beatmap_path.

    :param beatmap_url_or_id: beatmap_url as str or the id as int
    """
    # Parse the url and find the link to the .osu file
    try:
        if type(beatmap_url_or_id) is str:
            beatmap_id = await api.beatmap_from_url(beatmap_url_or_id, return_type="id")
        else:
            beatmap_id = beatmap_url_or_id
    except SyntaxError as e:
        # Since the beatmap isn't an osu.ppy.sh url, we'll see if it's a .osu file
        if not await is_osu_file(beatmap_url_or_id):
            raise ValueError(e)

        file_url = beatmap_url_or_id
    else:
        file_url = host + "osu/" + str(beatmap_id)

    # Download the beatmap using the url
    beatmap_file = await utils.download_file(file_url)
    if not beatmap_file:
        raise ValueError("The given URL is invalid.")

    with open(beatmap_path, "wb") as f:
        f.write(beatmap_file)

    # one map apparently had a /ufeff at the very beginning of the file???
    # https://osu.ppy.sh/b/1820921
    if not beatmap_file.decode().strip("\ufeff \t").startswith("osu file format"):
        logging.error("Invalid file received from {}\nCheck {}".format(file_url, beatmap_path))
        raise ValueError("Could not download the .osu file.")

async def parse_map(beatmap_url_or_id, ignore_cache: bool=False):
    """ Download and parse the map with the given url or id, or return a newly parsed cached version.

    :param beatmap_url_or_id: beatmap_url as str or the id as int
    :param ignore_cache: When true, the .osu will always be downloaded
    """
    global cached_beatmap

    parser = pyttanko.parser()

    # Parse from cache or load the .osu and parse new
    if not ignore_cache and beatmap_url_or_id == cached_beatmap.url_or_id:
        with open(beatmap_path, encoding="utf-8") as fp:
            beatmap = parser.map(fp, bmap=cached_beatmap.beatmap)
    else:
        await download_beatmap(beatmap_url_or_id)

        with open(beatmap_path, encoding="utf-8") as fp:
            beatmap = parser.map(fp)

        cached_beatmap = CachedBeatmap(url_or_id=beatmap_url_or_id, beatmap=beatmap)

    return beatmap

def apply_settings(beatmap, args):
    """ Applies difficulty settings to beatmap, and return the mods bitmask. """
    mods_bitmask = sum(mod.value for mod in args.mods) if args.mods else 0

    if args.ar:
        beatmap.ar = float(args.ar)
    if args.hp:
        beatmap.hp = float(args.hp)
    if args.od:
        beatmap.od = float(args.od)
    if args.cs:
        beatmap.cs = float(args.cs)

    return mods_bitmask

async def calculate_pp(beatmap_url_or_id, *options, ignore_cache: bool=False):
    """ Return a PPStats namedtuple from this beatmap, or a ClosestPPStats namedtuple
    when [pp_value]pp is given in the options.

    :param beatmap_url_or_id: beatmap_url as str or the id as int
    :param ignore_cache: When true, the .osu will always be downloaded
    """
    if pyttanko is None:
        return None

    beatmap = await parse_map(beatmap_url_or_id, ignore_cache=ignore_cache)
    args = parse_options(*options)

    # When acc is provided, calculate the 300s, 100s and 50s
    c300, c100, c50 = args.c300, args.c100, args.c50
    if args.acc is not None:
        c300, c100, c50 = pyttanko.acc_round(args.acc, len(beatmap.hitobjects), args.misses)

    # Change the beatmap's difficulty settings if provided, and calculate the mod bitmask
    mods_bitmask = apply_settings(beatmap, args)

    # Calculate the star difficulty
    stars = pyttanko.diff_calc().calc(beatmap, mods_bitmask)

    # # If the pp arg is given, return using the closest pp function
    # if args.pp is not None:
    #     return await find_closest_pp(beatmap, args)

    # Calculate the pp
    pp, _, _, _, _ = pyttanko.ppv2(stars.aim, stars.speed, bmap=beatmap, mods=mods_bitmask, combo=args.combo,
                                   n300=c300, n100=c100, n50=c50, nmiss=args.misses,  score_version=args.score_version)

    return PPStats(pp, stars.total, beatmap.artist, beatmap.title, beatmap.version)

# async def find_closest_pp(beatmap, args):
#     """ Find the accuracy required to get the given amount of pp from this map. """
#     if pyttanko is None:
#         return None
#
#     ctx, beatmap_ctx = create_ctx(beatmap)
#
#     # Create the difficulty context for calculating
#     diff_ctx = pyoppai.new_d_calc_ctx(ctx)
#     mods_bitmask = apply_settings(beatmap_ctx, args)
#     stars, aim, speed, _, _, _, _ = pyoppai.d_calc(diff_ctx, beatmap_ctx)
#
#     # Define a partial command for easily setting the pp value by 100s count
#     def calc(accuracy: float):
#         return pyoppai.pp_calc_acc(
#             ctx, aim, speed, beatmap_ctx, accuracy, mods_bitmask, args.combo, args.misses, args.score_version)[1]
#
#     # Find the smallest possible value oppai is willing to give
#     min_pp = calc(accuracy=0.0)
#     if args.pp <= min_pp:
#         raise ValueError("The given pp value is too low (oppai gives **{:.02f}pp** at **0% acc**).".format(min_pp))
#
#     # Calculate the max pp value by using 100% acc
#     previous_pp = calc(accuracy=100.0)
#
#     if args.pp >= previous_pp:
#         raise ValueError("PP value should be below **{:.02f}pp** for this map.".format(previous_pp))
#
#     dec = .05
#     acc = 100.0 - dec
#     while True:
#         current_pp = calc(accuracy=acc)
#
#         # Stop when we find a pp value between the current 100 count and the previous one
#         if current_pp <= args.pp <= previous_pp:
#             break
#         else:
#             previous_pp = current_pp
#             acc -= dec
#
#     # Find the closest pp of our two values, and return the amount of 100s
#     closest_pp = min([previous_pp, current_pp], key=lambda v: abs(args.pp - v))
#     acc = acc if closest_pp == current_pp else acc + dec
#     return ClosestPPStats(round(acc, 2), closest_pp, stars, pyoppai.artist(beatmap_ctx), pyoppai.title(beatmap_ctx),
#                           pyoppai.version(beatmap_ctx))


text:
#ifndef UserTypingGestureIndicator_h
#define UserTypingGestureIndicator_h

#include "wtf/Noncopyable.h"
#include "wtf/RefPtr.h"

namespace WebCore {

class Frame;
class Element;

class UserTypingGestureIndicator {
    WTF_MAKE_NONCOPYABLE(UserTypingGestureIndicator);
public:
    static bool processingUserTypingGesture();
    static Element* focusedElementAtGestureStart();

    explicit UserTypingGestureIndicator(Frame*);
    ~UserTypingGestureIndicator();

private:
    bool m_previousProcessingUserTypingGesture;
    RefPtr<Element> m_previousFocusedElement;
};

} // namespace WebCore

#endif // UserTypingGestureIndicator_h


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

  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <title></title>

  <FORM name="searchform">

  <INPUT name="search"  style="width:90px" onKeyPress="if ( event.keyCode==13 || event.which  == 13) return perform_search(); else return true;"/>
  </INPUT name="search"  style="width:100px" onKeyPress="window.alert('down');"/>

  </FORM>


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Canad. J. Bot. 38:429. 1960

#### Original name
null

### Remarks
null


text:
Admin Center for big data processing and reporting

The application is released by the MIT license.


text:
package com.hazelcast.internal.partition.operation;

import com.hazelcast.core.HazelcastException;
import com.hazelcast.internal.cluster.ClusterService;
import com.hazelcast.internal.partition.MigrationInfo;
import com.hazelcast.internal.partition.impl.InternalMigrationListener.MigrationParticipant;
import com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl;
import com.hazelcast.internal.partition.impl.PartitionDataSerializerHook;
import com.hazelcast.internal.partition.impl.PartitionReplicaManager;
import com.hazelcast.logging.ILogger;
import com.hazelcast.nio.Address;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.spi.MigrationAwareService;
import com.hazelcast.spi.NodeEngine;
import com.hazelcast.spi.Operation;
import com.hazelcast.spi.OperationAccessor;
import com.hazelcast.spi.OperationResponseHandler;
import com.hazelcast.spi.PartitionMigrationEvent;
import com.hazelcast.spi.exception.RetryableHazelcastException;
import com.hazelcast.spi.partition.MigrationEndpoint;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.logging.Level;

import static com.hazelcast.internal.cluster.Versions.V3_9;

/**
 * Sent by the partition owner to the migration destination to start the migration process on the destination.
 * Contains the operations which will be executed on the destination node to migrate the data and the replica versions to be set.
 */
@SuppressFBWarnings("EI_EXPOSE_REP")
public final class MigrationOperation extends BaseMigrationOperation {

    private static final OperationResponseHandler ERROR_RESPONSE_HANDLER = new OperationResponseHandler() {
        @Override
        public void sendResponse(Operation op, Object obj) {
            throw new HazelcastException("Migration operations can not send response!");
        }
    };

    private long[] replicaVersions;
    private Collection<Operation> tasks;

    private Throwable failureReason;

    public MigrationOperation() {
    }

    public MigrationOperation(MigrationInfo migrationInfo, long[] replicaVersions, Collection<Operation> tasks,
            int partitionStateVersion) {
        super(migrationInfo, partitionStateVersion);
        this.replicaVersions = replicaVersions;
        this.tasks = tasks;
    }

    @Override
    protected MigrationParticipant getMigrationParticipantType() {
        return MigrationParticipant.DESTINATION;
    }

    /**
     * {@inheritDoc}
     * Sets the active migration and the migration flag for the partition, notifies {@link MigrationAwareService}s that
     * the migration is starting and runs the sent replication operations.
     * If the migration was successful, set the replica versions. If it failed, notify the sent migration tasks.
     */
    @Override
    public void run() throws Exception {
        checkMigrationInitiatorIsMaster();
        setActiveMigration();

        try {
            doRun();
        } catch (Throwable t) {
            logMigrationFailure(t);
            success = false;
            failureReason = t;
        } finally {
            onMigrationComplete();
            if (!success) {
                onExecutionFailure(failureReason);
            }
        }
    }

    /** Notifies services that migration started, invokes all sent migration tasks and updates the replica versions. */
    private void doRun() throws Exception {
        if (migrationInfo.startProcessing()) {
            try {
                executeBeforeMigrations();

                for (Operation op : tasks) {
                    runMigrationOperation(op);
                }
                success = true;
            } catch (Throwable e) {
                success = false;
                failureReason = e;
                getLogger().severe("Error while executing replication operations " + migrationInfo, e);
            } finally {
                afterMigrate();
            }
        } else {
            success = false;
            logMigrationCancelled();
        }
    }

    private void checkMigrationInitiatorIsMaster() {
        NodeEngine nodeEngine = getNodeEngine();
        Address masterAddress = nodeEngine.getMasterAddress();
        if (!masterAddress.equals(migrationInfo.getMaster())) {
            ClusterService clusterService = nodeEngine.getClusterService();
            if (clusterService.getClusterVersion().isGreaterOrEqual(V3_9)) {
                throw new IllegalStateException("Migration initiator is not master node! => " + toString());
            } else {
                throw new RetryableHazelcastException("Migration initiator is not master node! => " + toString());
            }
        }
    }

    private void logMigrationCancelled() {
        getLogger().warning("Migration is cancelled -> " + migrationInfo);
    }

    /** Sets the partition replica versions from the destination replica index onwards, if the migration was successful. */
    private void afterMigrate() {
        if (success) {
            InternalPartitionServiceImpl partitionService = getService();
            PartitionReplicaManager replicaManager = partitionService.getReplicaManager();
            int destinationNewReplicaIndex = migrationInfo.getDestinationNewReplicaIndex();
            int replicaOffset = destinationNewReplicaIndex <= 1 ? 1 : destinationNewReplicaIndex;
            replicaManager.setPartitionReplicaVersions(migrationInfo.getPartitionId(), replicaVersions, replicaOffset);
            if (getLogger().isFinestEnabled()) {
                getLogger().finest("ReplicaVersions are set after migration. partitionId="
                        + migrationInfo.getPartitionId() + " replicaVersions=" + Arrays.toString(replicaVersions));
            }
        } else if (getLogger().isFinestEnabled()) {
            getLogger().finest("ReplicaVersions are not set since migration failed. partitionId="
                    + migrationInfo.getPartitionId());
        }

        migrationInfo.doneProcessing();
    }

    private void logMigrationFailure(Throwable e) {
        Level level = Level.WARNING;
        if (e instanceof IllegalStateException) {
            level = Level.FINEST;
        }
        ILogger logger = getLogger();
        if (logger.isLoggable(level)) {
            logger.log(level, e.getMessage(), e);
        }
    }

    @Override
    protected PartitionMigrationEvent getMigrationEvent() {
        return new PartitionMigrationEvent(MigrationEndpoint.DESTINATION,
                migrationInfo.getPartitionId(), migrationInfo.getDestinationCurrentReplicaIndex(),
                migrationInfo.getDestinationNewReplicaIndex());
    }

    private void runMigrationOperation(Operation op) throws Exception {
        prepareOperation(op);
        op.beforeRun();
        op.run();
        op.afterRun();
    }

    private void prepareOperation(Operation op) {
        op.setNodeEngine(getNodeEngine())
                .setPartitionId(getPartitionId())
                .setReplicaIndex(getReplicaIndex());
        op.setOperationResponseHandler(ERROR_RESPONSE_HANDLER);
        OperationAccessor.setCallerAddress(op, migrationInfo.getSource());
    }

    /**
     * {@inheritDoc}
     * Notifies all sent migration tasks that the migration failed.
     */
    @Override
    public void onExecutionFailure(Throwable e) {
        if (tasks != null) {
            for (Operation op : tasks) {
                prepareOperation(op);
                onOperationFailure(op, e);
            }
        }
    }

    private void onOperationFailure(Operation op, Throwable e) {
        try {
            op.onExecutionFailure(e);
        } catch (Throwable t) {
            getLogger().warning("While calling operation.onFailure(). op: " + op, t);
        }
    }

    @Override
    protected void writeInternal(ObjectDataOutput out) throws IOException {
        super.writeInternal(out);
        out.writeLongArray(replicaVersions);
        int size = tasks != null ? tasks.size() : 0;
        out.writeInt(size);
        if (size > 0) {
            for (Operation task : tasks) {
                out.writeObject(task);
            }
        }
    }

    @Override
    protected void readInternal(ObjectDataInput in) throws IOException {
        super.readInternal(in);
        replicaVersions = in.readLongArray();
        int size = in.readInt();
        if (size > 0) {
            tasks = new ArrayList<Operation>(size);
            for (int i = 0; i < size; i++) {
                Operation op = in.readObject();
                tasks.add(op);
            }
        } else {
            tasks = Collections.emptyList();
        }
    }

    @Override
    protected void toString(StringBuilder sb) {
        int numberOfTasks = tasks == null ? 0 : tasks.size();
        sb.append(", migration=").append(migrationInfo);
        sb.append(", replicaVersions=").append(Arrays.toString(replicaVersions));
        sb.append(", numberOfTasks=").append(numberOfTasks);
    }

    @Override
    public int getId() {
        return PartitionDataSerializerHook.MIGRATION;
    }
}


text:
<?php

namespace MyGED\Testing\Application;

use MyGED\Business\Categorie as Categorie;
use MyGED\Application\App as App;
use MyGED\Core\Exceptions as AppExceptions;

/**
 * CategorieTest Class testing Categorie class.
 *
 * @author polux <polux@poluxfr.org>
 */
class CategorieTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        App::setAppParam('TEMPLATES_ROOT', '/home/polux/Projects/php-myged/application/templates');
        App::setAppParam('SQLITE_DB_FILEPATH', '/home/polux/Projects/php-myged/data/app.db');
        App::setAppParam('VAULT_ROOT', '/home/polux/Projects/php-myged/data/vault');

        App::resetApplicationDBFile();

        // Database init...
        App::initDatabase();

        // Vault init...
        App::initVault();
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    /**
     * testAddNewCategorie.
     *
     * @test
     */
    public function testAddNewCategorie()
    {
        $lObjDoc = new Categorie();

        $this->assertTrue($lObjDoc instanceof \MyGED\Business\Categorie, 'Categorie class object not valid!');

        $lStrTitre = 'Cat #1';
        $lStrCode = 'cat-phpunit-test01';

        $lObjDoc->setTitle($lStrTitre);
        $lObjDoc->setAttributeValue('cat_code', $lStrCode);

        $lObjDoc->store();
        $lStrIdDoc = $lObjDoc->getId();

        // Reload same doc as new Object !
        $lObjDoc2 = new Categorie($lStrIdDoc);

        // Title validating!
        $this->assertEquals($lObjDoc2->getTitle(), $lStrTitre, 'Title invalid ! #1');
        $this->assertEquals($lObjDoc->getTitle(), $lStrTitre, 'Title invalid ! #2');

    }

    /**
     * @covers MyGED\Business\Document::getDocById
     *
     * @test
     */
    public function testGetDocById()
    {
        $lObjDoc = new Categorie();

        $this->assertTrue($lObjDoc instanceof \MyGED\Business\Categorie, 'Categorie class object not valid!');

        $lStrTitre = 'Cat #2';
        $lStrCode = 'cat-phpunit-test03';

        $lObjDoc->setTitle($lStrTitre);
        $lObjDoc->setAttributeValue('cat_code', $lStrCode);

        $lObjDoc->store();
        $lStrIdDoc = $lObjDoc->getId();

        // Reload same doc as new Object !
        $lObjDoc2 = Categorie::getDocById($lStrIdDoc);

        // Title validating!
        $this->assertEquals($lObjDoc2->getTitle(), $lStrTitre, 'Title invalid ! #1');
        $this->assertEquals($lObjDoc->getTitle(), $lStrTitre, 'Title invalid ! #2');

    }
}


text:
<?php

namespace Symfony\Cmf\Bundle\CoreBundle\EventListener;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

use Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishWorkflowChecker;

use Symfony\Cmf\Bundle\RoutingBundle\Routing\DynamicRouter;

/**
 * A request listener that makes sure only published routes and content can be
 * accessed.
 *
 * @author David Buchmann <mail@davidbu.ch>
 */
class PublishWorkflowListener implements EventSubscriberInterface
{
    /**
     * @var PublishWorkflowChecker
     */
    protected $publishWorkflowChecker;

    /**
     * The attribute to check with the workflow checker, typically VIEW or VIEW_ANONYMOUS
     *
     * @var string
     */
    private $publishWorkflowPermission;

    /**
     * @param PublishWorkflowChecker $publishWorkflowChecker
     * @param string                 $attribute              the attribute name to check
     */
    public function __construct(PublishWorkflowChecker $publishWorkflowChecker, $attribute = PublishWorkflowChecker::VIEW_ATTRIBUTE)
    {
        $this->publishWorkflowChecker = $publishWorkflowChecker;
        $this->publishWorkflowPermission = $attribute;
    }

    /**
     * @return string
     */
    public function getPublishWorkflowPermission()
    {
        return $this->publishWorkflowPermission;
    }

    /**
     * @param string $attribute specify what permission to check, typically VIEW or VIEW_ANONYMOUS
     */
    public function setPublishWorkflowPermission($attribute)
    {
        $this->publishWorkflowPermission = $attribute;
    }

    /**
     * Handling the request event
     *
     * @param GetResponseEvent $event
     */
    public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();

        $route = $request->attributes->get(DynamicRouter::ROUTE_KEY);
        if ($route && !$this->publishWorkflowChecker->isGranted($this->getPublishWorkflowPermission(), $route)) {
            throw new NotFoundHttpException('Route not found at: ' . $request->getPathInfo());
        }

        $content = $request->attributes->get(DynamicRouter::CONTENT_KEY);
        if ($content && !$this->publishWorkflowChecker->isGranted($this->getPublishWorkflowPermission(), $content)) {
            throw new NotFoundHttpException('Content not found for: ' . $request->getPathInfo());
        }
    }

    /**
     * We are only interested in request events.
     *
     * @return array
     */
    public static function getSubscribedEvents()
    {
        return array(
            KernelEvents::REQUEST => array(array('onKernelRequest', 1)),
        );
    }
}


text:
namespace base {
class FilePath;
}

namespace fileapi {
class FileSystemURL;
}

namespace fileapi {

// Manages external filesystem namespaces that are identified by 'mount name'
// and are persisted until RevokeFileSystem is called.
// Files in an external filesystem are identified by a filesystem URL like:
//
//   filesystem:<origin>/external/<mount_name>/relative/path
//
class WEBKIT_STORAGE_BROWSER_EXPORT ExternalMountPoints
    : public base::RefCountedThreadSafe<ExternalMountPoints>,
      public MountPoints {
 public:
  static ExternalMountPoints* GetSystemInstance();
  static scoped_refptr<ExternalMountPoints> CreateRefCounted();

  // Registers a new named external filesystem.
  // The |path| is registered as the root path of the mount point which
  // is identified by a URL "filesystem:.../external/mount_name".
  //
  // For example, if the path "/media/removable" is registered with
  // the mount_name "removable", a filesystem URL like
  // "filesystem:.../external/removable/a/b" will be resolved as
  // "/media/removable/a/b".
  //
  // The |mount_name| should NOT contain a path separator '/'.
  // Returns false if the given name is already registered.
  //
  // Overlapping mount points in a single MountPoints instance are not allowed.
  // Adding mount point whose path overlaps with an existing mount point will
  // fail.
  //
  // If not empty, |path| must be absolute. It is allowed for the path to be
  // empty, but |GetVirtualPath| will not work for those mount points.
  //
  // An external file system registered by this method can be revoked
  // by calling RevokeFileSystem with |mount_name|.
  bool RegisterFileSystem(const std::string& mount_name,
                          FileSystemType type,
                          const base::FilePath& path);

  // MountPoints overrides.
  virtual bool HandlesFileSystemMountType(FileSystemType type) const OVERRIDE;
  virtual bool RevokeFileSystem(const std::string& mount_name) OVERRIDE;
  virtual bool GetRegisteredPath(const std::string& mount_name,
                                 base::FilePath* path) const OVERRIDE;
  virtual bool CrackVirtualPath(const base::FilePath& virtual_path,
                                std::string* mount_name,
                                FileSystemType* type,
                                base::FilePath* path) const OVERRIDE;
  virtual FileSystemURL CrackURL(const GURL& url) const OVERRIDE;
  virtual FileSystemURL CreateCrackedFileSystemURL(
      const GURL& origin,
      FileSystemType type,
      const base::FilePath& path) const OVERRIDE;

  // Returns a list of registered MountPointInfos (of <mount_name, path>).
  void AddMountPointInfosTo(std::vector<MountPointInfo>* mount_points) const;

  // Converts a path on a registered file system to virtual path relative to the
  // file system root. E.g. if 'Downloads' file system is mapped to
  // '/usr/local/home/Downloads', and |absolute| path is set to
  // '/usr/local/home/Downloads/foo', the method will set |virtual_path| to
  // 'Downloads/foo'.
  // Returns false if the path cannot be resolved (e.g. if the path is not
  // part of any registered filesystem).
  //
  // Returned virtual_path will have normalized path separators.
  bool GetVirtualPath(const base::FilePath& absolute_path,
                      base::FilePath* virtual_path) const;

  // Returns the virtual root path that looks like /<mount_name>.
  base::FilePath CreateVirtualRootPath(const std::string& mount_name) const;

  FileSystemURL CreateExternalFileSystemURL(
      const GURL& origin,
      const std::string& mount_name,
      const base::FilePath& path) const;

 private:
  friend class base::RefCountedThreadSafe<ExternalMountPoints>;

  // Represents each file system instance (defined in the .cc).
  class Instance;

  typedef std::map<std::string, Instance*> NameToInstance;

  // Reverse map from registered path to its corresponding mount name.
  typedef std::map<base::FilePath, std::string> PathToName;

  // Use |GetSystemInstance| of |CreateRefCounted| to get an instance.
  ExternalMountPoints();
  virtual ~ExternalMountPoints();

  // MountPoint overrides.
  virtual FileSystemURL CrackFileSystemURL(
      const FileSystemURL& url) const OVERRIDE;

  // Performs sanity checks on the new mount point.
  // Checks the following:
  //  - there is no registered mount point with mount_name
  //  - path does not contain a reference to a parent
  //  - path is absolute
  //  - path does not overlap with an existing mount point path.
  //
  // |lock_| should be taken before calling this method.
  bool ValidateNewMountPoint(const std::string& mount_name,
                             const base::FilePath& path);

  // This lock needs to be obtained when accessing the instance_map_.
  mutable base::Lock lock_;

  NameToInstance instance_map_;
  PathToName path_to_name_map_;

  DISALLOW_COPY_AND_ASSIGN(ExternalMountPoints);
};

// Registers a scoped external filesystem which gets revoked when it scopes out.
class WEBKIT_STORAGE_BROWSER_EXPORT ScopedExternalFileSystem {
 public:
  ScopedExternalFileSystem(const std::string& mount_name,
                           FileSystemType type,
                           const base::FilePath& path);
  ~ScopedExternalFileSystem();

  base::FilePath GetVirtualRootPath() const;

 private:
  const std::string mount_name_;
};

}  // namespace fileapi

#endif  // WEBKIT_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_


text:
package net.spy.memcached.protocol.binary;

import net.spy.memcached.OperationFactory;
import net.spy.memcached.OperationFactoryTestBase;

public class OperationFactoryTest extends OperationFactoryTestBase {

  @Override
  protected OperationFactory getOperationFactory() {
    return new BinaryOperationFactory();
  }

  @Override
  public void testMultipleGetsOperationCloning() {
    assertTrue(true);
  }

  @Override
  public void testMultipleGetsOperationFanout() {
    assertTrue(true);
  }
}


text:
package com.github.xfumihiro.rxbinding.support.v7.widget;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.jakewharton.rxbinding.internal.MainThreadSubscription;
import rx.Observable;
import rx.Subscriber;

import static com.jakewharton.rxbinding.internal.Preconditions.checkUiThread;

final class RecyclerViewItemClickOnSubscribe implements Observable.OnSubscribe<Integer> {

  private final RecyclerView recyclerView;

  RecyclerViewItemClickOnSubscribe(RecyclerView recyclerView) {
    this.recyclerView = recyclerView;
  }

  @Override public void call(final Subscriber<? super Integer> subscriber) {
    checkUiThread();

    final RecyclerView.OnChildAttachStateChangeListener childAttachStateChangeListener =
        new RecyclerView.OnChildAttachStateChangeListener() {
          @Override public void onChildViewAttachedToWindow(View view) {
            recyclerView.getChildViewHolder(view).itemView.setOnClickListener(
                new View.OnClickListener() {
                  @Override public void onClick(View v) {
                    if (!subscriber.isUnsubscribed()) {
                      subscriber.onNext(recyclerView.getChildAdapterPosition(v));
                    }
                  }
                });
          }

          @Override public void onChildViewDetachedFromWindow(View view) {
          }
        };

    recyclerView.addOnChildAttachStateChangeListener(childAttachStateChangeListener);
    recyclerView.swapAdapter(recyclerView.getAdapter(), true);

    subscriber.add(new MainThreadSubscription() {
      @Override protected void onUnsubscribe() {
        recyclerView.removeOnChildAttachStateChangeListener(childAttachStateChangeListener);
      }
    });
  }
}


text:
<?php

define('__SITE_PATH', realpath(dirname(__FILE__)));

require_once('vendor/autoload.php');
require_once('src/framework/includes/configuration.php');
require_once('src/framework/includes/init.php');

//
//use Gossamer\Sockets\Utils\YAMLParser;
//use Gossamer\Horus\EventListeners\Event;
//use Gossamer\Horus\EventListeners\EventDispatcher;
//use Gossamer\Sockets\Servers\Server;
//use Gossamer\Horus\Core\Request;
//use Gossamer\Sockets\Ticker\Events;
//
////use Monolog\Logger;
////use Monolog\Handler\StreamHandler;
//
//$config = loadConfiguration();
//
//$eventDispatcher = new EventDispatcher($config, buildLogger($config), new Request() );
//
//$eventDispatcher->dispatch('server', Events::SERVER_INITIATE, new Event(Events::SERVER_INITIATE, array('host' => $config['server']['host'], 'port' => $config['server']['port'])));
//$server = new Server($config['server']['host'], $config['server']['port']);
//$server->setEventDispatcher($eventDispatcher);
//$server->execute();

use Gossamer\Horus\EventListeners\EventDispatcher;
use Gossamer\Horus\Core\Request;
use Gossamer\Tehuti\System\Kernel;
use Gossamer\Tehuti\Utils\Container;

$logger = buildLogger();
$request = new Request();

$container = new Container();
$container->set('EventDispatcher', null, new EventDispatcher(loadConfiguration('config'), $logger, $request));
$container->set('Logger', null, $logger);
$container->set('YamlParser', 'Gossamer\\Tehuti\\Utils\\YAMLParser', new Gossamer\Tehuti\Utils\YAMLParser($logger));

$kernel = new Kernel($container);
$kernel->run(Kernel::DEBUG_MODE);
?>


text:
[![Build Status](https://secure.travis-ci.org/Gozala/coreduction.png)](http://travis-ci.org/Gozala/coreduction)

Library for correlative reductions

## Install

    npm install coreduction


text:
package org.sqsh.options;

/**
 * Thrown when there is a problem processing command line options.
 */
public class OptionException extends Exception {

    /**
     * Creates an option exception.
     *
     * @param msg Text of the exception.
     */
    public OptionException(String msg) {
        super(msg);
    }
}


text:
layout: page
title: Buckley Tech Holdings Executive Retreat
date: 2016-05-24
author: Andrea Shah
tags: weekly links, java
status: published
summary: Fusce vestibulum ornare maximus. Ut enim ex, gravida id orci.
banner: images/banner/people.jpg
booking:
  startDate: 12/24/2018
  endDate: 12/29/2018
  ctyhocn: CCGVAHX
  groupCode: BTHER
published: true
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc nec ultricies velit. Etiam vitae turpis vulputate, consequat quam nec, scelerisque risus. In varius massa sit amet hendrerit elementum. Donec dignissim pretium eleifend. In eget volutpat elit. Curabitur aliquet odio tortor, id fermentum erat rutrum eu. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer congue non eros in mattis. Aenean luctus, odio ac laoreet facilisis, metus odio viverra mi, vitae facilisis purus nisi vel turpis. Integer semper, nisi eu tincidunt rutrum, quam dui feugiat nisi, eget finibus justo lorem in lacus. Praesent viverra et purus eu venenatis.
Sed nunc nisi, mollis eu tempor id, dapibus eget arcu. Integer mattis enim leo. Mauris nec lobortis diam, ut volutpat tortor. Vestibulum quis tempus augue. Praesent faucibus justo vel turpis consectetur, quis vestibulum magna lacinia. Donec nisi tortor, venenatis ut orci eu, ornare maximus elit. Nulla facilisi. Pellentesque mi leo, tincidunt ut erat ut, varius tempor eros. Sed a dictum eros.

1 Pellentesque accumsan felis in leo mollis porta
1 Maecenas tempor urna eu nunc scelerisque, nec dapibus eros tempor
1 Donec et arcu pellentesque, pretium erat vitae, faucibus risus
1 Vivamus id lectus feugiat, euismod magna vitae, commodo nulla
1 Ut bibendum sapien vel nisl blandit porta.

Suspendisse ultricies urna ligula. Vestibulum non bibendum neque. Quisque laoreet rutrum dapibus. Nullam pulvinar et felis ut maximus. Nunc rutrum est ut tortor finibus mollis. Fusce vel dignissim mi. In ligula leo, ullamcorper volutpat leo ut, semper elementum nibh. Mauris vel augue ipsum. Sed at gravida mi, a varius ex.
Donec non ante at tortor congue pulvinar nec id risus. Nullam quis orci orci. Vestibulum vitae sapien finibus, ornare eros et, finibus nunc. Mauris ut ornare turpis. Phasellus rutrum venenatis elementum. Fusce cursus volutpat ipsum, et pretium ligula dictum sit amet. Morbi vel nibh non felis sagittis eleifend.


text:
package com.gaoyy.delivery4res.api.bean;

/**
 * Created by gaoyy on 2017/5/27 0027.
 */

public class UpdateInfo
{

    /**
     * success : true
     * errorCode : -1
     * msg :
     * body : {"androidVersion":"1","androidIsUpdate":"1","iosVersion":"1","iosIsUpdate":"1"}
     */

    private boolean success;
    private String errorCode;
    private String msg;
    private BodyBean body;

    public boolean isSuccess()
    {
        return success;
    }

    public void setSuccess(boolean success)
    {
        this.success = success;
    }

    public String getErrorCode()
    {
        return errorCode;
    }

    public void setErrorCode(String errorCode)
    {
        this.errorCode = errorCode;
    }

    public String getMsg()
    {
        return msg;
    }

    public void setMsg(String msg)
    {
        this.msg = msg;
    }

    public BodyBean getBody()
    {
        return body;
    }

    public void setBody(BodyBean body)
    {
        this.body = body;
    }

    public static class BodyBean
    {
        /**
         * androidVersion : 1
         * androidIsUpdate : 1
         * iosVersion : 1
         * iosIsUpdate : 1
         */

        private String androidVersion;
        private String androidIsUpdate;
        private String iosVersion;
        private String iosIsUpdate;

        public String getAndroidVersion()
        {
            return androidVersion;
        }

        public void setAndroidVersion(String androidVersion)
        {
            this.androidVersion = androidVersion;
        }

        public String getAndroidIsUpdate()
        {
            return androidIsUpdate;
        }

        public void setAndroidIsUpdate(String androidIsUpdate)
        {
            this.androidIsUpdate = androidIsUpdate;
        }

        public String getIosVersion()
        {
            return iosVersion;
        }

        public void setIosVersion(String iosVersion)
        {
            this.iosVersion = iosVersion;
        }

        public String getIosIsUpdate()
        {
            return iosIsUpdate;
        }

        public void setIosIsUpdate(String iosIsUpdate)
        {
            this.iosIsUpdate = iosIsUpdate;
        }
    }
}