text:
require File::expand_path('../../spec_helper', __FILE__)
require 'opbeat'

describe Opbeat::Logger do
  context 'without a backend logger' do
    before do
      allow(Opbeat.configuration).to receive(:logger) { nil }
    end

    it 'should not error' do
      subject.fatal 'fatalmsg'
      subject.error 'errormsg'
      subject.warn 'warnmsg'
      subject.info 'infomsg'
      subject.debug 'debugmsg'
    end
  end

  context 'with a backend logger' do
    before do
      @logger = double('logger')
      allow(Opbeat.configuration).to receive(:logger) { @logger }
    end

    it 'should log fatal messages' do
      expect(@logger).to receive(:fatal).with('** [Opbeat] fatalmsg')
      subject.fatal 'fatalmsg'
    end

    it 'should log error messages' do
      expect(@logger).to receive(:error).with('** [Opbeat] errormsg')
      subject.error 'errormsg'
    end

    it 'should log warning messages' do
      expect(@logger).to receive(:warn).with('** [Opbeat] warnmsg')
      subject.warn 'warnmsg'
    end

    it 'should log info messages' do
      expect(@logger).to receive(:info).with('** [Opbeat] infomsg')
      subject.info 'infomsg'
    end

    it 'should log debug messages' do
      expect(@logger).to receive(:debug).with('** [Opbeat] debugmsg')
      subject.debug 'debugmsg'
    end

    it 'should log messages from blocks' do
      expect(@logger).to receive(:info).with('** [Opbeat] infoblock')
      subject.info { 'infoblock' }
    end
  end
end


text:
package com.jsonde.gui.action;

import com.jsonde.gui.ApplicationUserInterface;
import com.jsonde.gui.dialog.about.AboutDialog;
import com.jsonde.gui.sdedit.SdEditUIAdapter;
import net.sf.sdedit.icons.Icons;

import javax.swing.*;
import java.awt.event.ActionEvent;

public class AboutAction extends AbstractAction {

    private ApplicationUserInterface applicationUserInterface;

    public AboutAction(SdEditUIAdapter sdEditUIAdapter) {
        this.applicationUserInterface = sdEditUIAdapter;
    }

    {
        putValue(Action.SMALL_ICON,
                new ImageIcon(
                        Icons.class.getResource("help.png")
                ));
        putValue(Action.NAME, "About");
        putValue(Action.SHORT_DESCRIPTION, "About jSonde");
    }

    public void actionPerformed(ActionEvent e) {

        AboutDialog aboutDialog = new AboutDialog();

        aboutDialog.setVisible(true);

    }

}

redpajama_set_name: RedPajamaGithub


text:
title: Derivatives
localeTitle: Derivados
---
## Derivados

La derivada es la tasa instantánea de cambio de una función, o la tasa de cambio de una función en cualquier momento particular en el tiempo. La derivada es una herramienta de cálculo y puedes determinarla tomando un límite.

Puede entender el concepto de derivado comparándolo con el concepto de pendiente (la tasa promedio de cambio) en el álgebra.

Echemos un vistazo a un ejemplo:

Decide conducir desde San Francisco a Santa Rosa, California, una distancia de aproximadamente 60 millas. Usted hace el viaje en una hora; por lo tanto, su tasa promedio de cambio (velocidad) es de 60 millas por hora.

Sin embargo, no viajó a una velocidad de 60 millas por hora por cada instante de su viaje. Comenzó más despacio, luego aumentó su velocidad y la varió en el camino, y luego redujo la velocidad hasta detenerse por completo cuando llegó a su destino.

Veamos la gráfica de su viaje, donde el eje x representa el tiempo (en minutos) y el eje y representa la distancia (en millas). Pt. A representa a San Francisco, con coordenadas (0, 0) y pt. B representa a Santa Rosa, con coordenadas (60, 60). La línea curva representa su ubicación, en el espacio y en el tiempo, mientras viajaba desde San Francisco a Santa Rosa.

![imagen](https://github.com/MarkMikow/MyFiles/blob/master/img1.png?raw=true)

Puede determinar la velocidad promedio (tasa de cambio en la distancia por tiempo) de su viaje tomando la pendiente de álgebra ("ascender sobre la carrera"):

![imagen](https://github.com/MarkMikow/MyFiles/blob/master/img2.png?raw=true)

Usando el mismo gráfico, puedes elegir dos puntos, C (x1, y1) y D (x2, y2) y encontrar la pendiente entre ellos. Además, puede etiquetar cada punto usando la notación de función, de modo que (x1, y1) se convierta en (x, f (x)) y (x2, y2) se convierta en ((x + h), f (x + h)), con siendo h la distancia horizontal que pt. D es de pt. DO:

![imagen](https://github.com/MarkMikow/MyFiles/blob/master/img3.png?raw=true)

La pendiente de pt. C a pt. D es:

![imagen](https://github.com/MarkMikow/MyFiles/blob/master/img4.png?raw=true)

La expresion ![imagen](https://github.com/MarkMikow/MyFiles/blob/master/img5.png?raw=true) se denomina cociente de diferencias y puede usarlo para encontrar la tasa promedio de cambio desde cualquier punto en una gráfica a cualquier otro punto a una distancia horizontal de h unidades de distancia.

Para convertir la tasa de cambio promedio (la pendiente) en una tasa de cambio instantánea (la derivada, anotada como f (x)), toma el límite del cociente de diferencias:

![imagen](https://github.com/MarkMikow/MyFiles/blob/master/img6.png?raw=true)

Esta es la definición formal de la derivada y significa que está tomando la distancia h y reduciéndola a una cantidad infinitesimalmente pequeña. Todavía tienes una pendiente, pero sus puntos finales están infinitamente próximos entre sí. Tan cerca, de hecho, que aparecen como un punto, o como un instante, en el tiempo.

Dado que una línea tangente a un punto en un gráfico cruza el gráfico en solo un punto, la derivada también se define como la pendiente de la línea tangente a cualquier punto en un gráfico. En el ejemplo del gráfico anterior, la derivada de cada punto es la velocidad instantánea a la que está viajando.

Los derivados tienen una amplia gama de aplicaciones y se utilizan en física, ingeniería, economía y otras disciplinas.


text:
package org.josql.filters;

import java.util.logging.Filter;
import java.util.logging.LogRecord;

import org.josql.Query;
import org.josql.QueryParseException;

/**
 * A {@link Filter} that uses a JoSQL statement to provide the filtering.
 * The value returned by the {@link #isLoggable(LogRecord)} method is determined by executing the
 * WHERE clause of a JoSQL statement on each {@link LogRecord} passed in.
 *

 * Since this uses a sub-set of the JoSQL functionality certain restrictions apply:
 *

 *
The SELECT clause is ignored.

 *
The object defined in the FROM clause must be java.util.logging.LogRecord

 *
EXECUTE ON functions are not supported here since there is no way to get the entire set
 *       of objects to work on.

 *
ORDER BY, GROUP BY, HAVING and LIMIT clauses are ignored.

 *

 * Examples:
 *

 *

 *   SELECT *
 *   FROM   {@link LogRecord java.tuil.logging.LogRecord}
 *   WHERE  name $LIKE '%.html'
 *   AND    millis > {@link org.josql.functions.ConversionFunctions#toDateMillis(String,String) toDateMillis}('12-04-2004')
 *   AND    sequenceNumber BETWEEN (10000 AND 20000)
 *   AND    message $LIKE '%internal%'
 *   AND    loggerName = 'internal_logger'
 *   AND    level.name IN ('SEVERE', 'WARNING')
 *

 *

 * If you are using a custom log record then you can always just extend this class and override
 * the {@link #getExpectedClass()} method to return your specific sub-class.
 */
public class JoSQLLogRecordFilter extends DefaultObjectFilter
{

    protected Class expected = LogRecord.class;

    /**
     * Init this filter with the query.
     *
     * @param q The query.
     * @throws QueryParseException If there is an issue with the parsing of the query,
     *                             or if the FROM class is not {@link LogRecord}.
     */
    public JoSQLLogRecordFilter (String q)
	                         throws QueryParseException
    {

	super (q,
               LogRecord.class);

    }

    /**
     * Init this filter with the query already built and parsed.
     *
     * @param q The query.
     * @throws IllegalStateException If the Query object has not been parsed.
     * @throws QueryParseException If the FROM class is not {@link LogRecord}.
     */
    public JoSQLLogRecordFilter (Query  q)
	                         throws IllegalStateException,
	                                QueryParseException
    {

	super (q);

    }

    public boolean accept (Object o)
    {

	if (!(o instanceof LogRecord))
	{

	    throw new IllegalArgumentException ("Expected object to be of type: " +
						LogRecord.class.getName () +
						", got: " +
						o.getClass ().getName ());

	}

	return super.accept ((LogRecord) o);

    }

    /**
     * Apply the WHERE clause of the statement to the {@link LogRecord} passed in.
     * If an exception is thrown by the execution of the WHERE clause the Query
     * is marked as "dirty" and the where clause is no longer executed on the passed in
     * files (since it is likely that the WHERE clause will fail for all LogRecord objects).
     * You can get access to exception by using: {@link #getException()}.
     *
     * @param l The log record to evaluate the WHERE on.
     * @return true if the WHERE clause evaluates to true.
     */
    public boolean isLoggable (LogRecord l)
    {

	if (this.badQuery)
	{

	    return false;

	}

	try
	{

	    return this.q.getWhereClause ().isTrue (l,
						    this.q);

	} catch (Exception e) {

	    this.badQuery = true;

	    this.exp = e;

	}

	return false;

    }

    /**
     * Always returns {@link LogRecord}.
     *
     * @return The log record class.
     */
    public Class getExpectedClass ()
    {

	return LogRecord.class;

    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using NogginBox.MailChimp.Services;

namespace NogginBox.MailChimp.Models
{
	public class ApiKeyValidAttribute : ValidationAttribute
	{
		private readonly IMailChimpService _mailChimpService;

		public ApiKeyValidAttribute() {
			// Todo: Figure out how to inject this service
			_mailChimpService = new MailChimpService(null, null, null);
		}

		public override bool IsValid(object value)
		{
			try
			{
				var apiKey = (String)value;

				return _mailChimpService.IsApiKeyValid(apiKey);
			}
			catch(InvalidCastException)
			{
				return false;
			}
		}
	}
}


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

    <group android:checkableBehavior="single">
        <item
            android:id="@+id/nav_read"
            android:icon="@drawable/ic_chrome_reader_mode_black_36dp"
            android:title="@string/read"/>
        <item
            android:id="@+id/nav_pic"
            android:icon="@drawable/picture"
            android:title="@string/picture"/>
        <item
            android:id="@+id/nav_weather"
            android:icon="@drawable/weather"
            android:title="@string/weather"/>
        <!--<item-->
            <!--android:id="@+id/nav_music"-->
            <!--android:icon="@drawable/ic_music_note_black_36dp"-->
            <!--android:title="@string/music"/>-->
    </group>

    <!--<item android:title="设置">-->
        <!--<menu>-->
            <!--<item-->
                <!--android:id="@+id/nav_share"-->
                <!--android:icon="@drawable/ic_menu_share"-->
                <!--android:title="分享"/>-->
            <!--<item-->
                <!--android:id="@+id/nav_send"-->
                <!--android:icon="@drawable/ic_menu_send"-->
                <!--android:title="关于"/>-->
        <!--</menu>-->
    <!--</item>-->

</menu>


text:
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2020 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/**
 A 128-bit IEEE 754-2008 decimal floating point number.

 This type is similar to Swift's built-in Decimal type, but allocates bits
 differently, resulting in a different representable range. (NS)Decimal stores a
 significand of up to 38 digits long and an exponent from -128 to 127, while
 this type stores up to 34 digits of significand and an exponent from -6143 to
 6144.
 */
@interface RLMDecimal128 : NSObject
/// Creates a new zero-initialized decimal128.
- (instancetype)init;

/// Converts the given value to a RLMDecimal128.
///
/// The following types can be converted to RLMDecimal128:
/// - NSNumber
/// - NSString
/// - NSDecimalNumber
///
/// Passing a value with a type not in this list is a fatal error. Passing a
/// string which cannot be parsed as a valid Decimal128 is a fatal error.
- (instancetype)initWithValue:(id)value;

/// Converts the given number to a RLMDecimal128.
- (instancetype)initWithNumber:(NSNumber *)number;

/// Parses the given string to a RLMDecimal128.
///
/// Returns a decimal where `isNaN` is `YES` if the string cannot be parsed as a decimal. `error` is never set
/// and this will never actually return `nil`.
- (nullable instancetype)initWithString:(NSString *)string error:(NSError **)error;

/// Converts the given number to a RLMDecimal128.
+ (instancetype)decimalWithNumber:(NSNumber *)number;

/// The minimum value for RLMDecimal128.
@property (class, readonly, copy) RLMDecimal128 *minimumDecimalNumber NS_REFINED_FOR_SWIFT;

/// The maximum value for RLMDecimal128.
@property (class, readonly, copy) RLMDecimal128 *maximumDecimalNumber NS_REFINED_FOR_SWIFT;

/// Convert this value to a double. This is a lossy conversion.
@property (nonatomic, readonly) double doubleValue;

/// Convert this value to a NSDecimal. This may be a lossy conversion.
@property (nonatomic, readonly) NSDecimal decimalValue;

/// Convert this value to a string.
@property (nonatomic, readonly) NSString *stringValue;

/// Gets if this Decimal128 represents a NaN value.
@property (nonatomic, readonly) BOOL isNaN;

/// The magnitude of this RLMDecimal128.
@property (nonatomic, readonly) RLMDecimal128 *magnitude NS_REFINED_FOR_SWIFT;

/// Replaces this RLMDecimal128 value with its additive inverse.
- (void)negate;

/// Adds the right hand side to the current value and returns the result.
- (RLMDecimal128 *)decimalNumberByAdding:(RLMDecimal128 *)decimalNumber;

/// Divides the right hand side to the current value and returns the result.
- (RLMDecimal128 *)decimalNumberByDividingBy:(RLMDecimal128 *)decimalNumber;

/// Subtracts the right hand side to the current value and returns the result.
- (RLMDecimal128 *)decimalNumberBySubtracting:(RLMDecimal128 *)decimalNumber;

/// Multiply the right hand side to the current value and returns the result.
- (RLMDecimal128 *)decimalNumberByMultiplyingBy:(RLMDecimal128 *)decimalNumber;

/// Comparision operator to check if the right hand side is greater than the current value.
- (BOOL)isGreaterThan:(nullable RLMDecimal128 *)decimalNumber;

/// Comparision operator to check if the right hand side is greater than or equal to the current value.
- (BOOL)isGreaterThanOrEqualTo:(nullable RLMDecimal128 *)decimalNumber;

/// Comparision operator to check if the right hand side is less than the current value.
- (BOOL)isLessThan:(nullable RLMDecimal128 *)decimalNumber;

/// Comparision operator to check if the right hand side is less than or equal to the current value.
- (BOOL)isLessThanOrEqualTo:(nullable RLMDecimal128 *)decimalNumber;

@end

NS_ASSUME_NONNULL_END


text:
<?php

namespace Google\Service\Document\Resource;

use Google\Service\Document\GoogleCloudDocumentaiV1BatchProcessRequest;
use Google\Service\Document\GoogleCloudDocumentaiV1DeployProcessorVersionRequest;
use Google\Service\Document\GoogleCloudDocumentaiV1ListProcessorVersionsResponse;
use Google\Service\Document\GoogleCloudDocumentaiV1ProcessRequest;
use Google\Service\Document\GoogleCloudDocumentaiV1ProcessResponse;
use Google\Service\Document\GoogleCloudDocumentaiV1ProcessorVersion;
use Google\Service\Document\GoogleCloudDocumentaiV1UndeployProcessorVersionRequest;
use Google\Service\Document\GoogleLongrunningOperation;

/**
 * The "processorVersions" collection of methods.
 * Typical usage is:
 *  <code>
 *   $documentaiService = new Google\Service\Document(...);
 *   $processorVersions = $documentaiService->processorVersions;
 *  </code>
 */
class ProjectsLocationsProcessorsProcessorVersions extends \Google\Service\Resource
{
  /**
   * LRO endpoint to batch process many documents. The output is written to Cloud
   * Storage as JSON in the [Document] format. (processorVersions.batchProcess)
   *
   * @param string $name Required. The resource name of Processor or
   * ProcessorVersion. Format:
   * `projects/{project}/locations/{location}/processors/{processor}`, or `project
   * s/{project}/locations/{location}/processors/{processor}/processorVersions/{pr
   * ocessorVersion}`
   * @param GoogleCloudDocumentaiV1BatchProcessRequest $postBody
   * @param array $optParams Optional parameters.
   * @return GoogleLongrunningOperation
   */
  public function batchProcess($name, GoogleCloudDocumentaiV1BatchProcessRequest $postBody, $optParams = [])
  {
    $params = ['name' => $name, 'postBody' => $postBody];
    $params = array_merge($params, $optParams);
    return $this->call('batchProcess', [$params], GoogleLongrunningOperation::class);
  }
  /**
   * Deletes the processor version, all artifacts under the processor version will
   * be deleted. (processorVersions.delete)
   *
   * @param string $name Required. The processor version resource name to be
   * deleted.
   * @param array $optParams Optional parameters.
   * @return GoogleLongrunningOperation
   */
  public function delete($name, $optParams = [])
  {
    $params = ['name' => $name];
    $params = array_merge($params, $optParams);
    return $this->call('delete', [$params], GoogleLongrunningOperation::class);
  }
  /**
   * Deploys the processor version. (processorVersions.deploy)
   *
   * @param string $name Required. The processor version resource name to be
   * deployed.
   * @param GoogleCloudDocumentaiV1DeployProcessorVersionRequest $postBody
   * @param array $optParams Optional parameters.
   * @return GoogleLongrunningOperation
   */
  public function deploy($name, GoogleCloudDocumentaiV1DeployProcessorVersionRequest $postBody, $optParams = [])
  {
    $params = ['name' => $name, 'postBody' => $postBody];
    $params = array_merge($params, $optParams);
    return $this->call('deploy', [$params], GoogleLongrunningOperation::class);
  }
  /**
   * Gets a processor version detail. (processorVersions.get)
   *
   * @param string $name Required. The processor resource name.
   * @param array $optParams Optional parameters.
   * @return GoogleCloudDocumentaiV1ProcessorVersion
   */
  public function get($name, $optParams = [])
  {
    $params = ['name' => $name];
    $params = array_merge($params, $optParams);
    return $this->call('get', [$params], GoogleCloudDocumentaiV1ProcessorVersion::class);
  }
  /**
   * Lists all versions of a processor.
   * (processorVersions.listProjectsLocationsProcessorsProcessorVersions)
   *
   * @param string $parent Required. The parent (project, location and processor)
   * to list all versions. Format:
   * `projects/{project}/locations/{location}/processors/{processor}`
   * @param array $optParams Optional parameters.
   *
   * @opt_param int pageSize The maximum number of processor versions to return.
   * If unspecified, at most 10 processor versions will be returned. The maximum
   * value is 20; values above 20 will be coerced to 20.
   * @opt_param string pageToken We will return the processor versions sorted by
   * creation time. The page token will point to the next processor version.
   * @return GoogleCloudDocumentaiV1ListProcessorVersionsResponse
   */
  public function listProjectsLocationsProcessorsProcessorVersions($parent, $optParams = [])
  {
    $params = ['parent' => $parent];
    $params = array_merge($params, $optParams);
    return $this->call('list', [$params], GoogleCloudDocumentaiV1ListProcessorVersionsResponse::class);
  }
  /**
   * Processes a single document. (processorVersions.process)
   *
   * @param string $name Required. The resource name of the Processor or
   * ProcessorVersion to use for processing. If a Processor is specified, the
   * server will use its default version. Format:
   * `projects/{project}/locations/{location}/processors/{processor}`, or `project
   * s/{project}/locations/{location}/processors/{processor}/processorVersions/{pr
   * ocessorVersion}`
   * @param GoogleCloudDocumentaiV1ProcessRequest $postBody
   * @param array $optParams Optional parameters.
   * @return GoogleCloudDocumentaiV1ProcessResponse
   */
  public function process($name, GoogleCloudDocumentaiV1ProcessRequest $postBody, $optParams = [])
  {
    $params = ['name' => $name, 'postBody' => $postBody];
    $params = array_merge($params, $optParams);
    return $this->call('process', [$params], GoogleCloudDocumentaiV1ProcessResponse::class);
  }
  /**
   * Undeploys the processor version. (processorVersions.undeploy)
   *
   * @param string $name Required. The processor version resource name to be
   * undeployed.
   * @param GoogleCloudDocumentaiV1UndeployProcessorVersionRequest $postBody
   * @param array $optParams Optional parameters.
   * @return GoogleLongrunningOperation
   */
  public function undeploy($name, GoogleCloudDocumentaiV1UndeployProcessorVersionRequest $postBody, $optParams = [])
  {
    $params = ['name' => $name, 'postBody' => $postBody];
    $params = array_merge($params, $optParams);
    return $this->call('undeploy', [$params], GoogleLongrunningOperation::class);
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsProcessorsProcessorVersions::class, 'Google_Service_Document_Resource_ProjectsLocationsProcessorsProcessorVersions');


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="category_names">
        <item>@string/category_tv</item>
        <item>@string/category_movies</item>
        <item>@string/category_anime</item>
        <item>@string/category_music</item>
        <item>@string/category_history</item>
        <item>@string/category_favorite</item>
        <item>@string/category_about</item>
    </string-array>

    <string-array name="provider_names">
        <item>SeriesYonkis</item>
        <item>Watchseries</item>
        <item>Pordede</item>
        <item>GNula</item>
        <item>ZPeliculas</item>
        <item>Pordede</item>
        <item>JKAnime</item>
        <item>AnimeFLV</item>
        <item>Soundcloud</item>
    </string-array>

    <string-array name="dialog_names">
        <item>@string/dialog_chromecast</item>
        <item>@string/dialog_download</item>
        <item>@string/dialog_clipboard</item>
        <item>@string/dialog_browser</item>
        <item>@string/dialog_external</item>
    </string-array>

    <string-array name="dialog_mini_names">
        <item>@string/dialog_mini_favorite</item>
        <item>@string/dialog_mini_open</item>
        <item>@string/dialog_mini_download_multiple</item>
        <item>@string/dialog_mini_cast_multiple</item>
    </string-array>

    <string-array name="dialog_chromecast">
        <item>@string/dialog_chromecast_override</item>
        <item>@string/dialog_chromecast_queue</item>
    </string-array>

    <string-array name="about_names">
        <item>@string/about_community</item>
        <item>@string/about_website</item>
    </string-array>

    <string-array name="about_links">
        <item>https://plus.google.com/u/0/communities/117989078772127331921</item>
        <item>http://danacast.me</item>
    </string-array>
</resources>


text:
package net.java.sip.communicator.impl.protocol.jabber;

import java.io.*;

/**
 * A <tt>ThumbnailedFile</tt> is a file with a thumbnail.
 *
 * @author Yana Stamcheva
 */
public class ThumbnailedFile
    extends File
{
    /**
     * Serial version UID.
     */
    private static final long serialVersionUID = 0L;

    private final int thumbnailWidth;

    private final int thumbnailHeight;

    private final String thumbnailMimeType;

    private final byte[] thumbnail;

    /**
     * Creates a <tt>ThumbnailedFile</tt>, by specifying the base <tt>file</tt>,
     * the <tt>thumbnailWidth</tt> and <tt>thumbnailHeight</tt>, the
     * <tt>thumbnailMimeType</tt> and the <tt>thumbnail</tt> itself.
     * @param file the base file
     * @param thumbnailWidth the width of the thumbnail
     * @param thumbnailHeight the height of the thumbnail
     * @param thumbnailMimeType the mime type
     * @param thumbnail the thumbnail
     */
    public ThumbnailedFile( File file,
                            int thumbnailWidth,
                            int thumbnailHeight,
                            String thumbnailMimeType,
                            byte[] thumbnail)
    {
        super(file.getPath());

        this.thumbnailWidth = thumbnailWidth;
        this.thumbnailHeight = thumbnailHeight;
        this.thumbnailMimeType = thumbnailMimeType;
        this.thumbnail = thumbnail;
    }

    /**
     * Returns the thumbnail of this file.
     * @return the thumbnail of this file
     */
    public byte[] getThumbnailData()
    {
        return thumbnail;
    }

    /**
     * Returns the thumbnail width.
     * @return the thumbnail width
     */
    public int getThumbnailWidth()
    {
        return thumbnailWidth;
    }

    /**
     * Returns the thumbnail height.
     * @return the thumbnail height
     */
    public int getThumbnailHeight()
    {
        return thumbnailHeight;
    }

    /**
     * Returns the thumbnail mime type.
     * @return the thumbnail mime type
     */
    public String getThumbnailMimeType()
    {
        return thumbnailMimeType;
    }
}


text:
using namespace CLDEParser;

int main() {

    std::string example{
            "{ 'a\\t01' : { \"first\\u1ab4Name\": 'Le', age : 134, \"lastName\" : \"Duc-Anh\" }, array : [1.3E-2, 312.05 ,3.0 , 4.0, 5.0]}"};

    Version version{};
    Scanner scanner{};
    ParserSingle parser{Parsing::ParserFactory::CreateJsonDerivativeInstance()};

    version.Print();

    // Scanning
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateSpace());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateTab());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateNull());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateBoolTrue());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateBoolFalse());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateNumberInteger());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateNumber());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateId());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateString());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateColon());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateComma());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateCurlyBraceOpen());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateCurlyBraceClosing());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateBracketOpen());
    scanner.Tokenizers().push_back(Scanning::TokenizerFactory::CreateBracketClosing());

    try {

        // Scanning
        auto tokens = scanner.Scan(example);
        auto filteredCodes = Scanning::TokenHelper::DefaultFilterCodes();
        auto filteredTokens = Scanning::TokenHelper::Filter(filteredCodes, tokens);

        // Parsing
        auto sptrSyntaxModel = parser.ParseCast<Parsing::Json::JsonSyntaxModel>(filteredTokens);
        auto sptrJsonEntity = sptrSyntaxModel->CreateSPtrJsonEnity();

        std::cout << "Input:  " << example << std::endl;
        std::cout << "Output: " << sptrJsonEntity->CopyToString() << std::endl;

    } catch (Exceptions::Exception &ex) {

        std::cerr << ex.what() << std::endl;

    }

    return EXIT_SUCCESS;
}


text:
<?php

declare(strict_types=1);

namespace Comandi\Encryption\Exception;

use RuntimeException;

final class CannotEncryptStream extends RuntimeException implements ComandiEncryptionException
{
    public static function create()
    {
        return new self('Streaming encryption / decryption is not yet supported.');
    }
}


text:
package com.medal.weixin.sdk.menu;

import lombok.Data;

/**
 * view类型的按钮
 *
 * Created by xhuji on 2016/9/3.
 */
@Data
public class ViewButton extends Button {

    private String type;

    private String url;

}


text:
"""
General project forms used
"""
from urllib.parse import urlparse, urljoin

from flask import request, url_for, redirect
from flask_wtf import Form
from wtforms import HiddenField

def is_safe_url(target):
    ref_url = urlparse(request.host_url)
    test_url = urlparse(urljoin(request.host_url, target))
    return test_url.scheme in ('http', 'https') and ref_url.netloc == test_url.netloc

def get_redirect_target():
    for target in [request.args.get('next')]:
        if not target:
            continue
        if is_safe_url(target):
            return target

# see http://flask.pocoo.org/snippets/63/
class RedirectForm(Form):
    """
    Safely redirect from a page to the next, by keeping sure the the next argument is valid
    """
    next = HiddenField()

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        if not self.next.data:
            self.next.data = get_redirect_target() or ''

    def redirect(self, endpoint='index', **values):
        if is_safe_url(self.next.data):
            return redirect(self.next.data)
        target = get_redirect_target()
        return redirect(target or url_for(endpoint, **values))


text:
namespace extensions {

ScriptContextSet::ScriptContextSet(ExtensionSet* extensions,
                                   ExtensionIdSet* active_extension_ids)
    : extensions_(extensions), active_extension_ids_(active_extension_ids) {
}

ScriptContextSet::~ScriptContextSet() {
}

ScriptContext* ScriptContextSet::Register(
    blink::WebLocalFrame* frame,
    const v8::Local<v8::Context>& v8_context,
    int extension_group,
    int world_id) {
  const Extension* extension =
      GetExtensionFromFrameAndWorld(frame, world_id, false);
  const Extension* effective_extension =
      GetExtensionFromFrameAndWorld(frame, world_id, true);

  GURL frame_url = ScriptContext::GetDataSourceURLForFrame(frame);
  Feature::Context context_type =
      ClassifyJavaScriptContext(extension, extension_group, frame_url,
                                frame->document().securityOrigin());
  Feature::Context effective_context_type = ClassifyJavaScriptContext(
      effective_extension, extension_group,
      ScriptContext::GetEffectiveDocumentURL(frame, frame_url, true),
      frame->document().securityOrigin());

  ScriptContext* context =
      new ScriptContext(v8_context, frame, extension, context_type,
                        effective_extension, effective_context_type);
  contexts_.insert(context);  // takes ownership
  return context;
}

void ScriptContextSet::Remove(ScriptContext* context) {
  if (contexts_.erase(context)) {
    context->Invalidate();
    base::MessageLoop::current()->DeleteSoon(FROM_HERE, context);
  }
}

ScriptContext* ScriptContextSet::GetCurrent() const {
  v8::Isolate* isolate = v8::Isolate::GetCurrent();
  return isolate->InContext() ? GetByV8Context(isolate->GetCurrentContext())
                              : nullptr;
}

ScriptContext* ScriptContextSet::GetCalling() const {
  v8::Isolate* isolate = v8::Isolate::GetCurrent();
  v8::Local<v8::Context> calling = isolate->GetCallingContext();
  return calling.IsEmpty() ? nullptr : GetByV8Context(calling);
}

ScriptContext* ScriptContextSet::GetByV8Context(
    const v8::Local<v8::Context>& v8_context) const {
  for (ScriptContext* script_context : contexts_) {
    if (script_context->v8_context() == v8_context)
      return script_context;
  }
  return nullptr;
}

void ScriptContextSet::ForEach(
    const std::string& extension_id,
    content::RenderView* render_view,
    const base::Callback<void(ScriptContext*)>& callback) const {
  // We copy the context list, because calling into javascript may modify it
  // out from under us.
  std::set<ScriptContext*> contexts_copy = contexts_;

  for (ScriptContext* context : contexts_copy) {
    // For the same reason as above, contexts may become invalid while we run.
    if (!context->is_valid())
      continue;

    if (!extension_id.empty()) {
      const Extension* extension = context->extension();
      if (!extension || (extension_id != extension->id()))
        continue;
    }

    content::RenderView* context_render_view = context->GetRenderView();
    if (!context_render_view)
      continue;

    if (render_view && render_view != context_render_view)
      continue;

    callback.Run(context);
  }
}

std::set<ScriptContext*> ScriptContextSet::OnExtensionUnloaded(
    const std::string& extension_id) {
  std::set<ScriptContext*> removed;
  ForEach(extension_id,
          base::Bind(&ScriptContextSet::DispatchOnUnloadEventAndRemove,
                     base::Unretained(this), &removed));
  return removed;
}

const Extension* ScriptContextSet::GetExtensionFromFrameAndWorld(
    const blink::WebLocalFrame* frame,
    int world_id,
    bool use_effective_url) {
  std::string extension_id;
  if (world_id != 0) {
    // Isolated worlds (content script).
    extension_id = ScriptInjection::GetHostIdForIsolatedWorld(world_id);
  } else if (!frame->document().securityOrigin().isUnique()) {
    // TODO(kalman): Delete the above check.
    // Extension pages (chrome-extension:// URLs).
    GURL frame_url = ScriptContext::GetDataSourceURLForFrame(frame);
    frame_url = ScriptContext::GetEffectiveDocumentURL(frame, frame_url,
                                                       use_effective_url);
    extension_id = extensions_->GetExtensionOrAppIDByURL(frame_url);
  }

  // There are conditions where despite a context being associated with an
  // extension, no extension actually gets found. Ignore "invalid" because CSP
  // blocks extension page loading by switching the extension ID to "invalid".
  const Extension* extension = extensions_->GetByID(extension_id);
  if (!extension && !extension_id.empty() && extension_id != "invalid") {
    // TODO(kalman): Do something here?
  }
  return extension;
}

Feature::Context ScriptContextSet::ClassifyJavaScriptContext(
    const Extension* extension,
    int extension_group,
    const GURL& url,
    const blink::WebSecurityOrigin& origin) {
  // WARNING: This logic must match ProcessMap::GetContextType, as much as
  // possible.

  DCHECK_GE(extension_group, 0);
  if (extension_group == EXTENSION_GROUP_CONTENT_SCRIPTS) {
    return extension ?  // TODO(kalman): when does this happen?
               Feature::CONTENT_SCRIPT_CONTEXT
                     : Feature::UNSPECIFIED_CONTEXT;
  }

  // We have an explicit check for sandboxed pages before checking whether the
  // extension is active in this process because:
  // 1. Sandboxed pages run in the same process as regular extension pages, so
  //    the extension is considered active.
  // 2. ScriptContext creation (which triggers bindings injection) happens
  //    before the SecurityContext is updated with the sandbox flags (after
  //    reading the CSP header), so the caller can't check if the context's
  //    security origin is unique yet.
  if (ScriptContext::IsSandboxedPage(*extensions_, url))
    return Feature::WEB_PAGE_CONTEXT;

  if (extension && active_extension_ids_->count(extension->id()) > 0) {
    // |extension| is active in this process, but it could be either a true
    // extension process or within the extent of a hosted app. In the latter
    // case this would usually be considered a (blessed) web page context,
    // unless the extension in question is a component extension, in which case
    // we cheat and call it blessed.
    return (extension->is_hosted_app() &&
            extension->location() != Manifest::COMPONENT)
               ? Feature::BLESSED_WEB_PAGE_CONTEXT
               : Feature::BLESSED_EXTENSION_CONTEXT;
  }

  // TODO(kalman): This isUnique() check is wrong, it should be performed as
  // part of ScriptContext::IsSandboxedPage().
  if (!origin.isUnique() && extensions_->ExtensionBindingsAllowed(url)) {
    if (!extension)  // TODO(kalman): when does this happen?
      return Feature::UNSPECIFIED_CONTEXT;
    return extension->is_hosted_app() ? Feature::BLESSED_WEB_PAGE_CONTEXT
                                      : Feature::UNBLESSED_EXTENSION_CONTEXT;
  }

  if (!url.is_valid())
    return Feature::UNSPECIFIED_CONTEXT;

  if (url.SchemeIs(content::kChromeUIScheme))
    return Feature::WEBUI_CONTEXT;

  return Feature::WEB_PAGE_CONTEXT;
}

void ScriptContextSet::DispatchOnUnloadEventAndRemove(
    std::set<ScriptContext*>* out,
    ScriptContext* context) {
  context->DispatchOnUnloadEvent();
  Remove(context);  // deleted asynchronously
  out->insert(context);
}

}  // namespace extensions


text:
/**
 * @file
 *
 * @date Dec 18, 2013
 * @author: Anton Bondarev
 */
#include <assert.h>
#include <poll.h>
#include <sys/types.h>

#include <util/err.h>

#include <mem/misc/pool.h>
#include <fs/idesc.h>

#include <framework/mod/options.h>

#include <drivers/tty.h>
#include <fs/file_desc.h>
#include <fs/idesc_serial.h>
#include <drivers/serial/uart_device.h>
#include <fs/dvfs.h>
#include <util/dlist.h>
#include <kernel/sched/schedee_priority.h>
#include <kernel/lthread/lthread.h>
#include <embox/unit.h>
#include <hal/ipl.h>

#define MAX_SERIALS \
	OPTION_GET(NUMBER, serial_quantity)

#define idesc_to_uart(desc) \
	(((struct  tty_uart*)desc)->uart)

#define UART_DATA_BUFF_SZ 8
#define UART_RX_HND_PRIORITY 128

EMBOX_UNIT_INIT(serial_common_init);

static const struct idesc_ops idesc_serial_ops;

struct tty_uart {
	struct idesc idesc;
	struct tty tty;
	struct uart *uart;
};

struct uart_rx {
	struct uart *uart;
	int data;
	struct dlist_head lnk;
};

POOL_DEF(uart_ttys, struct tty_uart, MAX_SERIALS);
POOL_DEF(uart_rx_buff, struct uart_rx, UART_DATA_BUFF_SZ);

static DLIST_DEFINE(uart_rx_list);

static struct lthread uart_rx_irq_handler;

static inline struct uart *tty2uart(struct tty *tty) {
	struct tty_uart *tu;
	tu = member_cast_out(tty, struct tty_uart, tty);
	return tu->uart;
}

static void uart_out_wake(struct tty *t) {
	struct uart *uart_dev = tty2uart(t);
	int ich;

	irq_lock();

	while ((ich = tty_out_getc(t)) != -1)
		uart_putc(uart_dev, (char) ich);

	irq_unlock();
}

static void uart_term_setup(struct tty *tty, struct termios *termios) {
	struct uart *uart_dev = tty2uart(tty);
	struct uart_params params;

	uart_get_params(uart_dev, &params);

	/* TODO baud rate is ospeed. What's with ispeed ? */
	params.baud_rate = termios->c_ospeed;

	uart_set_params(uart_dev, &params);
}

static struct tty_ops uart_tty_ops = {
	.setup = uart_term_setup,
	.out_wake = uart_out_wake,
};

static int uart_rx_buff_put(struct uart *dev, int c) {
	struct uart_rx *rx;

	irq_lock();
	{
		rx = pool_alloc(&uart_rx_buff);
		if (!rx) {
			irq_unlock();
			return -1;
		}

		rx->uart = dev;
		rx->data = c;
		dlist_add_prev(dlist_head_init(&rx->lnk), &uart_rx_list);
	}
	irq_unlock();

	return 0;
}

static int uart_rx_buff_get(struct uart_rx *rx_data) {
	struct uart_rx *rx;

	if (dlist_empty(&uart_rx_list)) {
		return -1;
	}

	irq_lock();
	{
		rx = dlist_next_entry_or_null(&uart_rx_list, struct uart_rx, lnk);
		if (!rx) {
			irq_unlock();
			return -1;
		}

		*rx_data = *rx;
		dlist_del(&rx->lnk);
		pool_free(&uart_rx_buff, rx);
	}
	irq_unlock();

	return 0;
}

static int uart_rx_action(struct lthread *self) {
	struct uart_rx rx;

	while (!uart_rx_buff_get(&rx)) {
		tty_rx_locked(rx.uart->tty, rx.data, 0);
	}

	return 0;
}

static irq_return_t uart_irq_handler(unsigned int irq_nr, void *data) {
	struct uart *dev = data;

	if (dev->tty) {
		while (uart_hasrx(dev)) {
			uart_rx_buff_put(dev, uart_getc(dev));
		}
		lthread_launch(&uart_rx_irq_handler);
	}

	return IRQ_HANDLED;
}

struct idesc *idesc_serial_create(struct uart *uart,
		mode_t mod) {
	struct tty_uart *tu;

	assert(uart);

	tu = pool_alloc(&uart_ttys);
	if (!tu) {
		return err_ptr(ENOMEM);
	}

	tty_init(&tu->tty, &uart_tty_ops);

	tu->uart = uart;
	uart->tty = &tu->tty;
	uart->tty->idesc = &tu->idesc;
	uart->irq_handler = uart_irq_handler;

	idesc_init(&tu->idesc, &idesc_serial_ops, mod);

	return &tu->idesc;
}

static ssize_t serial_read(struct idesc *idesc, void *buf, size_t nbyte) {
	struct uart *uart;

	assert(buf);
	assert(idesc);
	assert(idesc->idesc_ops == &idesc_serial_ops);
	assert(idesc->idesc_amode & S_IROTH);

	if (!nbyte) {
		return 0;
	}

	uart = idesc_to_uart(idesc);
	assert(uart);
	assert(uart->tty);

	return tty_read(uart->tty, (char *) buf, nbyte);
}

static ssize_t serial_write(struct idesc *idesc, const void *buf, size_t nbyte) {
	int ch;
	struct uart *uart;
	size_t written, left = nbyte;

	assert(buf);
	assert(idesc);
	assert(idesc->idesc_ops == &idesc_serial_ops);
	assert(idesc->idesc_amode & S_IWOTH);

	uart = idesc_to_uart(idesc);
	assert(uart);
	assert(uart->tty);

	do {
		written = tty_write(uart->tty, buf, left);

		while (-1 != (ch = tty_out_getc(uart->tty))) {
			uart_putc(uart, ch);
		}

		left -= written;
		buf = (void *)((char *)buf + written);
	} while (left != 0);

	return (ssize_t)nbyte;
}

static void serial_close(struct idesc *idesc) {
	struct uart *uart;
	int res;

	assert(idesc);
	assert(idesc->idesc_ops == &idesc_serial_ops);

	uart = idesc_to_uart(idesc);
	assert(uart);
	res = uart_close(uart);
	assert(res == 0); /* TODO */

	pool_free(&uart_ttys, idesc);
}

static int serial_ioctl(struct idesc *idesc, int request, void *data) {
	struct uart *uart;

	assert(idesc);
	assert(idesc->idesc_ops == &idesc_serial_ops);

	uart = idesc_to_uart(idesc);
	assert(uart);

	return tty_ioctl(uart->tty, request, data);
}

static int serial_status(struct idesc *idesc, int mask) {
	struct uart *uart;
	int res = 0;

	assert(idesc);

	if (!mask) {
		return 0;
	}
	uart = idesc_to_uart(idesc);
	assert(uart);

	if (mask & POLLIN) {
		/* how many we can read */
		res += tty_status(uart->tty, POLLIN);
	}

	if (mask & POLLOUT) {
		/* how many we can write */
		res += INT_MAX;
	}

	if (mask & POLLERR) {
		/* is there any exeptions */
		res += 0; //TODO Where is errors counter
	}

	return res;
}

static int serial_fstat(struct idesc *data, void *buff) {
	struct stat *st = buff;

	st->st_mode = S_IFCHR;

	return 0;

}

static int serial_common_init(void) {
	lthread_init(&uart_rx_irq_handler, &uart_rx_action);
	schedee_priority_set(&uart_rx_irq_handler.schedee, UART_RX_HND_PRIORITY);
	return 0;
}

static const struct idesc_ops idesc_serial_ops = {
		.read = serial_read,
		.write = serial_write,
		.ioctl = serial_ioctl,
		.close = serial_close,
		.status = serial_status,
		.fstat = serial_fstat,
};


text:
layout: kanji
v4: 1779
v6: 1918
kanji: 祖
keyword: ancestor
elements: ancestor, altar, shelf, my bookshelves
strokes: 9
image: E7A596
on-yomi: ソ
permalink: /rtk/祖/
prev: 狙
next: 阻
---

1) [Immacolata] 8-5-2006(184): The ancestor worship is so common in Daoist and buddhist countries that you can buy tiny altars to put on the shelves, one for each deceased family member.

2) [kodama] 5-11-2007(99): The urns of ancestors are kept on shelves next to the altar.

3) [Filip] 2-3-2008(32): At the partents of my wife's house (she is Japanese) they have a shelf with pictures of their ancestors. Its like a little shrine and they often pray to it.

4) [coverup] 16-2-2009(13): An altar on the shelf to remember your ancestors.

5) [peacemik] 24-2-2009(10): Ancestors are revered in Japan. Some homes have large family altars ( 仏壇 (ぶつだん)) with several shelves to accommodate the name plaques (and these days photographs) of all the ancestors. 祖母 (そぼ): grandmother 祖父 (そふ): grandfather 祖国 (そこく): motherland, fatherland, native country 先祖 (せんぞ): ancestor 祖先 (そせん): ancestor [also used in a broader sense, such as apes were the ancestors of humans].


text:
package middleware

import (
	"net/http"

	"github.com/weaveworks/common/user"
)

// AuthenticateUser propagates the user ID from HTTP headers back to the request's context.
var AuthenticateUser = Func(func(next http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		_, ctx, err := user.ExtractOrgIDFromHTTPRequest(r)
		if err != nil {
			http.Error(w, err.Error(), http.StatusUnauthorized)
			return
		}
		next.ServeHTTP(w, r.WithContext(ctx))
	})
})


text:
from importlib import import_module
import re
from copy import deepcopy
from collections import OrderedDict

import numpy as np

from astropy.utils.data_info import MixinInfo
from .column import Column, MaskedColumn
from .table import Table, QTable, has_info_class
from astropy.units.quantity import QuantityInfo

# TODO: some of this might be better done programmatically, through
# code like
# __construct_mixin_classes += tuple(
#        f'astropy.coordinates.representation.{cls.__name__}'
#        for cls in (list(coorep.REPRESENTATION_CLASSES.values())
#                    + list(coorep.DIFFERENTIAL_CLASSES.values()))
#        if cls.__name__ in coorep.__all__)
# However, to avoid very hard to track import issues, the definition
# should then be done at the point where it is actually needed,
# using local imports.  See also
# https://github.com/astropy/astropy/pull/10210#discussion_r419087286
__construct_mixin_classes = (
    'astropy.time.core.Time',
    'astropy.time.core.TimeDelta',
    'astropy.units.quantity.Quantity',
    'astropy.units.function.logarithmic.Magnitude',
    'astropy.units.function.logarithmic.Decibel',
    'astropy.units.function.logarithmic.Dex',
    'astropy.coordinates.angles.Latitude',
    'astropy.coordinates.angles.Longitude',
    'astropy.coordinates.angles.Angle',
    'astropy.coordinates.distances.Distance',
    'astropy.coordinates.earth.EarthLocation',
    'astropy.coordinates.sky_coordinate.SkyCoord',
    'astropy.table.ndarray_mixin.NdarrayMixin',
    'astropy.table.table_helpers.ArrayWrapper',
    'astropy.table.column.MaskedColumn',
    'astropy.coordinates.representation.CartesianRepresentation',
    'astropy.coordinates.representation.UnitSphericalRepresentation',
    'astropy.coordinates.representation.RadialRepresentation',
    'astropy.coordinates.representation.SphericalRepresentation',
    'astropy.coordinates.representation.PhysicsSphericalRepresentation',
    'astropy.coordinates.representation.CylindricalRepresentation',
    'astropy.coordinates.representation.CartesianDifferential',
    'astropy.coordinates.representation.UnitSphericalDifferential',
    'astropy.coordinates.representation.SphericalDifferential',
    'astropy.coordinates.representation.UnitSphericalCosLatDifferential',
    'astropy.coordinates.representation.SphericalCosLatDifferential',
    'astropy.coordinates.representation.RadialDifferential',
    'astropy.coordinates.representation.PhysicsSphericalDifferential',
    'astropy.coordinates.representation.CylindricalDifferential',
    'astropy.utils.masked.core.MaskedNDArray',
)

class SerializedColumn(dict):
    """
    Subclass of dict that is a used in the representation to contain the name
    (and possible other info) for a mixin attribute (either primary data or an
    array-like attribute) that is serialized as a column in the table.

    Normally contains the single key ``name`` with the name of the column in the
    table.
    """
    pass

def _represent_mixin_as_column(col, name, new_cols, mixin_cols,
                               exclude_classes=()):
    """Carry out processing needed to serialize ``col`` in an output table
    consisting purely of plain ``Column`` or ``MaskedColumn`` columns.  This
    relies on the object determine if any transformation is required and may
    depend on the ``serialize_method`` and ``serialize_context`` context
    variables.  For instance a ``MaskedColumn`` may be stored directly to
    FITS, but can also be serialized as separate data and mask columns.

    This function builds up a list of plain columns in the ``new_cols`` arg (which
    is passed as a persistent list).  This includes both plain columns from the
    original table and plain columns that represent data from serialized columns
    (e.g. ``jd1`` and ``jd2`` arrays from a ``Time`` column).

    For serialized columns the ``mixin_cols`` dict is updated with required
    attributes and information to subsequently reconstruct the table.

    Table mixin columns are always serialized and get represented by one
    or more data columns.  In earlier versions of the code *only* mixin
    columns were serialized, hence the use within this code of "mixin"
    to imply serialization.  Starting with version 3.1, the non-mixin
    ``MaskedColumn`` can also be serialized.
    """
    obj_attrs = col.info._represent_as_dict()

    # If serialization is not required (see function docstring above)
    # or explicitly specified as excluded, then treat as a normal column.
    if not obj_attrs or col.__class__ in exclude_classes:
        new_cols.append(col)
        return

    # Subtlety here is handling mixin info attributes.  The basic list of such
    # attributes is: 'name', 'unit', 'dtype', 'format', 'description', 'meta'.
    # - name: handled directly [DON'T store]
    # - unit: DON'T store if this is a parent attribute
    # - dtype: captured in plain Column if relevant [DON'T store]
    # - format: possibly irrelevant but settable post-object creation [DO store]
    # - description: DO store
    # - meta: DO store
    info = {}
    for attr, nontrivial in (('unit', lambda x: x is not None and x != ''),
                             ('format', lambda x: x is not None),
                             ('description', lambda x: x is not None),
                             ('meta', lambda x: x)):
        col_attr = getattr(col.info, attr)
        if nontrivial(col_attr):
            info[attr] = col_attr

    # Find column attributes that have the same length as the column itself.
    # These will be stored in the table as new columns (aka "data attributes").
    # Examples include SkyCoord.ra (what is typically considered the data and is
    # always an array) and Skycoord.obs_time (which can be a scalar or an
    # array).
    data_attrs = [key for key, value in obj_attrs.items() if
                  getattr(value, 'shape', ())[:1] == col.shape[:1]]

    for data_attr in data_attrs:
        data = obj_attrs[data_attr]

        # New column name combines the old name and attribute
        # (e.g. skycoord.ra, skycoord.dec).unless it is the primary data
        # attribute for the column (e.g. value for Quantity or data for
        # MaskedColumn).  For primary data, we attempt to store any info on
        # the format, etc., on the column, but not for ancilliary data (e.g.,
        # no sense to use a float format for a mask).
        if data_attr == col.info._represent_as_dict_primary_data:
            new_name = name
            new_info = info
        else:
            new_name = name + '.' + data_attr
            new_info = {}

        if not has_info_class(data, MixinInfo):
            col_cls = MaskedColumn if (hasattr(data, 'mask')
                                       and np.any(data.mask)) else Column
            new_cols.append(col_cls(data, name=new_name, **new_info))
            obj_attrs[data_attr] = SerializedColumn({'name': new_name})
        else:
            # recurse. This will define obj_attrs[new_name].
            _represent_mixin_as_column(data, new_name, new_cols, obj_attrs)
            obj_attrs[data_attr] = SerializedColumn(obj_attrs.pop(new_name))

    # Strip out from info any attributes defined by the parent,
    # and store whatever remains.
    for attr in col.info.attrs_from_parent:
        if attr in info:
            del info[attr]
    if info:
        obj_attrs['__info__'] = info

    # Store the fully qualified class name
    obj_attrs.setdefault('__class__',
                         col.__module__ + '.' + col.__class__.__name__)

    mixin_cols[name] = obj_attrs

def represent_mixins_as_columns(tbl, exclude_classes=()):
    """Represent input Table ``tbl`` using only `~astropy.table.Column`
    or  `~astropy.table.MaskedColumn` objects.

    This function represents any mixin columns like `~astropy.time.Time` in
    ``tbl`` to one or more plain ``~astropy.table.Column`` objects and returns
    a new Table.  A single mixin column may be split into multiple column
    components as needed for fully representing the column.  This includes the
    possibility of recursive splitting, as shown in the example below.  The
    new column names are formed as ``<column_name>.<component>``, e.g.
    ``sc.ra`` for a `~astropy.coordinates.SkyCoord` column named ``sc``.

    In addition to splitting columns, this function updates the table ``meta``
    dictionary to include a dict named ``__serialized_columns__`` which provides
    additional information needed to construct the original mixin columns from
    the split columns.

    This function is used by astropy I/O when writing tables to ECSV, FITS,
    HDF5 formats.

    Note that if the table does not include any mixin columns then the original
    table is returned with no update to ``meta``.

    Parameters
    ----------
    tbl : `~astropy.table.Table` or subclass
        Table to represent mixins as Columns
    exclude_classes : tuple of class
        Exclude any mixin columns which are instannces of any classes in the tuple

    Returns
    -------
    tbl : `~astropy.table.Table`
        New Table with updated columns, or else the original input ``tbl``

    Examples
    --------
    >>> from astropy.table import Table, represent_mixins_as_columns
    >>> from astropy.time import Time
    >>> from astropy.coordinates import SkyCoord

    >>> x = [100.0, 200.0]
    >>> obstime = Time([1999.0, 2000.0], format='jyear')
    >>> sc = SkyCoord([1, 2], [3, 4], unit='deg', obstime=obstime)
    >>> tbl = Table([sc, x], names=['sc', 'x'])
    >>> represent_mixins_as_columns(tbl)
    <Table length=2>
     sc.ra   sc.dec sc.obstime.jd1 sc.obstime.jd2    x
      deg     deg
    float64 float64    float64        float64     float64
    ------- ------- -------------- -------------- -------
        1.0     3.0      2451180.0          -0.25   100.0
        2.0     4.0      2451545.0            0.0   200.0

    """
    # Dict of metadata for serializing each column, keyed by column name.
    # Gets filled in place by _represent_mixin_as_column().
    mixin_cols = {}

    # List of columns for the output table.  For plain Column objects
    # this will just be the original column object.
    new_cols = []

    # Go through table columns and represent each column as one or more
    # plain Column objects (in new_cols) + metadata (in mixin_cols).
    for col in tbl.itercols():
        _represent_mixin_as_column(col, col.info.name, new_cols, mixin_cols,
                                   exclude_classes=exclude_classes)

    # If no metadata was created then just return the original table.
    if mixin_cols:
        meta = deepcopy(tbl.meta)
        meta['__serialized_columns__'] = mixin_cols
        out = Table(new_cols, meta=meta, copy=False)
    else:
        out = tbl

    for col in out.itercols():
        if not isinstance(col, Column) and col.__class__ not in exclude_classes:
            # This catches columns for which info has not been set up right and
            # therefore were not converted. See the corresponding test in
            # test_mixin.py for an example.
            raise TypeError(
                'failed to represent column '
                f'{col.info.name!r} ({col.__class__.__name__}) as one '
                'or more Column subclasses. This looks like a mixin class '
                'that does not have the correct _represent_as_dict() method '
                'in the class `info` attribute.')

    return out

def _construct_mixin_from_obj_attrs_and_info(obj_attrs, info):
    cls_full_name = obj_attrs.pop('__class__')

    # If this is a supported class then import the class and run
    # the _construct_from_col method.  Prevent accidentally running
    # untrusted code by only importing known astropy classes.
    if cls_full_name not in __construct_mixin_classes:
        raise ValueError(f'unsupported class for construct {cls_full_name}')

    mod_name, cls_name = re.match(r'(.+)\.(\w+)', cls_full_name).groups()
    module = import_module(mod_name)
    cls = getattr(module, cls_name)
    for attr, value in info.items():
        if attr in cls.info.attrs_from_parent:
            obj_attrs[attr] = value
    mixin = cls.info._construct_from_dict(obj_attrs)
    for attr, value in info.items():
        if attr not in obj_attrs:
            setattr(mixin.info, attr, value)
    return mixin

class _TableLite(OrderedDict):
    """
    Minimal table-like object for _construct_mixin_from_columns.  This allows
    manipulating the object like a Table but without the actual overhead
    for a full Table.

    More pressing, there is an issue with constructing MaskedColumn, where the
    encoded Column components (data, mask) are turned into a MaskedColumn.
    When this happens in a real table then all other columns are immediately
    Masked and a warning is issued. This is not desirable.
    """

    def add_column(self, col, index=0):
        colnames = self.colnames
        self[col.info.name] = col
        for ii, name in enumerate(colnames):
            if ii >= index:
                self.move_to_end(name)

    @property
    def colnames(self):
        return list(self.keys())

    def itercols(self):
        return self.values()

def _construct_mixin_from_columns(new_name, obj_attrs, out):
    data_attrs_map = {}
    for name, val in obj_attrs.items():
        if isinstance(val, SerializedColumn):
            if 'name' in val:
                data_attrs_map[val['name']] = name
            else:
                out_name = f'{new_name}.{name}'
                _construct_mixin_from_columns(out_name, val, out)
                data_attrs_map[out_name] = name

    for name in data_attrs_map.values():
        del obj_attrs[name]

    # Get the index where to add new column
    idx = min(out.colnames.index(name) for name in data_attrs_map)

    # Name is the column name in the table (e.g. "coord.ra") and
    # data_attr is the object attribute name  (e.g. "ra").  A different
    # example would be a formatted time object that would have (e.g.)
    # "time_col" and "value", respectively.
    for name, data_attr in data_attrs_map.items():
        col = out[name]
        obj_attrs[data_attr] = col
        del out[name]

    info = obj_attrs.pop('__info__', {})
    if len(data_attrs_map) == 1:
        # col is the first and only serialized column; in that case, use info
        # stored on the column.
        for attr, nontrivial in (('unit', lambda x: x not in (None, '')),
                                 ('format', lambda x: x is not None),
                                 ('description', lambda x: x is not None),
                                 ('meta', lambda x: x)):
            col_attr = getattr(col.info, attr)
            if nontrivial(col_attr):
                info[attr] = col_attr

    info['name'] = new_name
    col = _construct_mixin_from_obj_attrs_and_info(obj_attrs, info)
    out.add_column(col, index=idx)

def _construct_mixins_from_columns(tbl):
    if '__serialized_columns__' not in tbl.meta:
        return tbl

    meta = tbl.meta.copy()
    mixin_cols = meta.pop('__serialized_columns__')

    out = _TableLite(tbl.columns)

    for new_name, obj_attrs in mixin_cols.items():
        _construct_mixin_from_columns(new_name, obj_attrs, out)

    # If no quantity subclasses are in the output then output as Table.
    # For instance ascii.read(file, format='ecsv') doesn't specify an
    # output class and should return the minimal table class that
    # represents the table file.
    has_quantities = any(isinstance(col.info, QuantityInfo)
                         for col in out.itercols())
    out_cls = QTable if has_quantities else Table

    return out_cls(list(out.values()), names=out.colnames, copy=False, meta=meta)


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Encoding Hint: 雀の往来 -->
<project>
 <property name="jnlp.title"    value="JST 点滅のテスト" />
 <property name="jnlp.Name"     value="BlinkLabel" />
 <property name="jnlp.name"     value="blinklabel" />
 <property name="jnlp.codebase" value="http://ateraimemo.com/swing/${jnlp.name}/" />
 <property name="jnlp.homepage" value="http://ateraimemo.com/Swing/${jnlp.Name}.html" />
</project>


text:
[travis]: https://travis-ci.org/SquareBracketAssociates/Booklet-Scraping
[badge]: https://travis-ci.org/SquareBracketAssociates/Booklet-Scraping.svg?branch=master

[![Build status][badge]][travis]

Soon [Browse] the directory for released versions of the booklet or
look here for more [Books and Booklets](http://files.pharo.org/books/)

You can find the PDF at
lsThe result from the latest successful Travis build can be found [on Bintray (PDF)](https://bintray.com/squarebracketassociates/wip/download_file?file_path=scrapingbook-wip.pdf).


text:
<?php

namespace Symfony\Tests\Component\Form\Extension\Core\Type;

require_once __DIR__ . '/LocalizedTestCase.php';

class IntegerTypeTest extends LocalizedTestCase
{
    public function testSubmitCastsToInteger()
    {
        $form = $this->factory->create('integer');

        $form->bind('1.678');

        $this->assertSame(1, $form->getData());
        $this->assertSame('1', $form->getClientData());
    }
}


text:
require 'spec_helper'

describe Announcr::Event do
  subject { Announcr::Event }

  describe "pattern" do
    it "should use the event name as the default pattern" do
      e = subject.new("foobar")
      e.match_pattern?("foobar").should be_true
      e.match_pattern?("FOOBAR").should be_true
      e.match_pattern?("foo").should be_false
    end

    it "should use pattern option as a replacement pattern" do
      e = subject.new("foobar", pattern: /us.*/)
      e.match_pattern?("foobar").should be_false
      e.match_pattern?("us123").should be_true
    end
  end

  describe "filters" do
    it "should have no filters by default" do
      e = subject.new("foobar")
      e.match_filters?("foobar").should be_true
    end

    it "should accept a single filter" do
      e = subject.new("foobar", filters: /.*bAr/)
      e.match_filters?("foobAr").should be_true
      e.match_filters?("foobar").should be_false
    end

    it "should accept multiple filters" do
      f1 = /.*bAr/
      f2 = ->(evt, opts) { opts[:a].is_a? Fixnum }
      e = subject.new("foobar", filters: [f1, f2])
      e.match_filters?("foobAr", a: 1).should be_true
      e.match_filters?("foobAr", a: "1").should be_false
    end
  end

  describe "requires" do
    it "should have no requires by default" do
      e = subject.new("foobar")
      e.match_requires?("foobar").should be_true
    end

    it "should accept a single require" do
      e = subject.new("foobar", requires: :a)
      e.match_requires?("foobar", a: 1).should be_true
      e.match_requires?("foobar").should be_false
    end

    it "should accept multiple requires" do
      e = subject.new("foobar", requires: [:a, :b])
      e.match_requires?("foobar", a: 1, b: 2).should be_true
      e.match_requires?("foobar", a: 1).should be_false
      e.match_requires?("foobar").should be_false
    end
  end

  describe "matching" do
    let(:event) { subject.new("foobar") }
    before :each do
      event.stub!(:match_pattern?).and_return(true)
      event.stub!(:match_requires?).and_return(true)
      event.stub!(:match_filters?).and_return(true)
      @e, @o = "foobar", {}
    end

    it "should require a pattern match" do
      event.should_receive(:match_pattern?).with(@e, @o)
      event.matches?(@e, @o)
    end

    it "should require a filter match" do
      event.should_receive(:match_filters?).with(@e, @o)
      event.matches?(@e, @o)
    end

    it "should require a requires match" do
      event.should_receive(:match_requires?).with(@e, @o)
      event.matches?(@e, @o)
    end
  end

  # make_filter should probably exist in its own module, but for now we'll test
  # it alongside Announce::Event. TODO: Factor this functionality out.
  describe "#make_filter" do
    let(:event) { Announcr::Event.new("foobar") }

    it "should make an event_name matcher by string" do
      m = event.make_filter("foobar")
      m.call("foobar", {}).should be_true
      m.call("FOOBAR", {}).should be_true
      m.call(:foobar, {}).should be_true
      m.call("foo", {}).should be_false
    end

    it "should make an event_name matcher by symbol" do
      m = event.make_filter(:foobar)
      m.call(:foobar, {}).should be_true
      m.call(:FOOBAR, {}).should be_true
      m.call("foobar", {}).should be_true
      m.call(:foo, {}).should be_false
    end

    it "should make an event_name matcher by regex" do
      m = event.make_filter(/us\d\d/)
      m.call("us99", {}).should be_true
      m.call("1234", {}).should be_false
    end

    it "should return a passed in lambda" do
      l = ->(){}
      event.make_filter(l).should be(l)
    end

    it "should error for invalid matcher type" do
      lambda do
        event.make_filter(123)
      end.should raise_error
    end
  end
end


text:
namespace AjErl.Functions
{
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using AjErl.Language;

    public class CompileModuleFunction : IFunction
    {
        private Machine machine;

        public CompileModuleFunction(Machine machine)
        {
            this.machine = machine;
        }

        public object Apply(Context context, IList<object> arguments)
        {
            Atom atom = (Atom)arguments[0];
            Module module = this.machine.LoadModule(atom.Name);
            context.SetValue(module.Name, module);
            Tuple tuple = new Tuple(new object[] { new Atom("ok"), new Atom(module.Name) });
            return tuple;
        }
    }
}


text:
package jetbrains.jetpad.model.composite;

import jetbrains.jetpad.test.BaseTestCase;
import org.junit.Before;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;

import static org.junit.Assert.assertEquals;

public class CompositesBetweenTest extends BaseTestCase {

  private SimpleComposite c;
  private SimpleComposite e;
  private SimpleComposite f;
  private SimpleComposite g;
  private SimpleComposite h;
  private SimpleComposite i;
  private SimpleComposite k;
  private SimpleComposite l;
  private SimpleComposite m;
  private SimpleComposite o;
  private SimpleComposite p;
  private SimpleComposite r;
  private SimpleComposite s;
  private SimpleComposite t;
  private SimpleComposite u;
  private SimpleComposite v;
  private SimpleComposite w;
  private SimpleComposite x;
  private SimpleComposite y;

  @Before
  public void init() {
    SimpleCompositesTree tree = new SimpleCompositesTree();
    c = tree.getC();
    e = tree.getE();
    f = tree.getF();
    g = tree.getG();
    h = tree.getH();
    i = tree.getI();
    k = tree.getK();
    l = tree.getL();
    m = tree.getM();
    o = tree.getO();
    p = tree.getP();
    r = tree.getR();
    s = tree.getS();
    t = tree.getT();
    u = tree.getU();
    v = tree.getV();
    w = tree.getW();
    x = tree.getX();
    y = tree.getY();
  }

  @Test
  public void sameRoot() {
    SimpleComposite root = new SimpleComposite("root");
    assertBetween(root, root, list());
  }

  @Test
  public void sameLeaf() {
    assertBetween(g, g, list());
  }

  @Test(expected = IllegalArgumentException.class)
  public void nonExisting() {
    Composites.allBetween(e, new SimpleComposite("alien"));
  }

  @Test(expected = IllegalArgumentException.class)
  public void reversed() {
    Composites.allBetween(f, e);
  }

  @Test
  public void twoSiblings() {
    assertConsecutiveNodes(e, f);
  }

  @Test
  public void fiveSiblings() {
    assertConsecutiveNodes(u, v, w, x, y);
  }

  @Test
  public void down() {
    assertConsecutiveNodes(k, l, r, s, t);
  }

  @Test
  public void cousins() {
    assertConsecutiveNodes(e, f, g);
  }

  @Test
  public void upSidewaysAndDown() {
    assertBetween(f, c, list());
    assertBetween(f, g, list());
    assertBetween(f, k, list(g, c));
    assertBetween(f, r, list(g, c, k, l));
    assertBetween(f, i, list(g, c, k, l, r, s, t, m, h));
  }

  @Test
  public void upAndDown() {
    assertConsecutiveNodes(s, t, i, o, p, u, v, w, x, y);
  }

  private void assertConsecutiveNodes(SimpleComposite... nodes) {
    List<SimpleComposite> nodeList = list(nodes);
    for (int i = 0; i < nodeList.size(); i++) {
      SimpleComposite left = nodeList.get(i);
      for (int j = i + 1; j < nodeList.size(); j++) {
        SimpleComposite right = nodeList.get(j);
        List<SimpleComposite> expectedSubList = nodeList.subList(i + 1, j);
        assertBetween(left, right, expectedSubList);
      }
    }
  }

  private void assertBetween(SimpleComposite left, SimpleComposite right, List<SimpleComposite> expected) {
    assertEquals("left: " + left + ", right: " + right, expected, Composites.allBetween(left, right));
  }

  private List<SimpleComposite> list(SimpleComposite... simpleComposites) {
    return Arrays.asList(simpleComposites);
  }

}


text:
dojo.provide("plugins.folders.SourceFiles");
/*
DISPLAY THE USER'S OWN SOURCES DIRECTORY AND ALLOW
THE USER TO BROWSE AND MANIPULATE FOLDERS AND FILES

LATER FOR MENU: DYNAMICALLY ENABLE / DISABLE MENU ITEM
attr('disabled', bool)
*/

// INHERITS
dojo.require("plugins.folders.Files");

dojo.declare( "plugins.folders.SourceFiles",
	[ plugins.folders.Files ], {
//Path to the template of this widget.
templatePath: dojo.moduleUrl("plugins", "folders/templates/filesystem.html"),

// Calls dijit._Templated.widgetsInTemplate
widgetsInTemplate : true,

// core: Object. { files: XxxxxFiles object, folders: Folders object, etc. }
core : null,

// PROJECT NAME AND WORKFLOW NAME IF AVAILABLE
project : null,

// DEFAULT TIME (milliseconds) TO SLEEP BETWEEN FILESYSTEM LOADS
sleep : 250,

// open: bool
// Whether or not title pane is open on load
open : false,

// self: string
// Name used to represent this object in this.core
self : "sourcefiles",

/////}}}

// CONSTRUCTOR
constructor : function(args) {
	//console.group("sourceFiles-" + this.id + "    constructor");

	////console.log("SourceFiles.constructor    plugins.folders.SourceFiles.constructor(args)");

	// SET PANE ID
	this.paneId = args.paneId;

	// SET ARGS
	this.project 	= args.project;
	this.core 		= args.core;
	this.attachNode = args.attachNode;
	////console.log("SourceFiles.constructor    this.parentWidget: " + this.parentWidget);
	////console.log("SourceFiles.constructor    this.attachNode: " + this.attachNode);
	////console.log("SourceFiles.constructor    this.project: " + this.project);

	// LOAD CSS
	////console.log("SourceFiles.constructor    Doing this.loadCSS()");
	this.loadCSS();

	//console.groupEnd("sourceFiles-" + this.id + "    constructor");
},

postCreate: function() {
	////console.log("SourceFiles.postCreate    plugins.folders.Project.postCreate()");

	this.startup();
},

startup : function () {
// START MENUS
	////console.log("SourceFiles.startup    plugins.folders.Project.startup()");

	// SET UP THE ELEMENT OBJECTS AND THEIR VALUE FUNCTIONS
	this.inherited(arguments);
},

load: function () {
	//console.group("sourceFiles-" + this.id + "    load");

	this.inherited(arguments);

	//console.groupEnd("sourceFiles-" + this.id + "    load");
},

getDirectories : function () {
// GET DIRECTORIES TO SEARCH FOR FILES
	return Agua.getSources();
},

createFileDrag : function (directory) {
// SET THE FILE SYSTEM PANE
	//console.log("SourceFiles.createFileDrag	   plugins.folders.ProjectFiles.createFileDrag(directory)");
	//console.log("SourceFiles.createFileDrag	   directory: ");
	//console.dir({directory:directory});

	// CREATE STORE
	var store = this.createSourceStore(directory);

	// SET core
	this.core[this.self] = this;

	// GENERATE NEW FileDrag OBJECT
	var fileDrag = new plugins.files.FileDrag(
		{
			style			: 	"height: auto; width: 100%; minHeight: 50px;",
			store			: 	store,
			fileMenu		: 	this.fileMenu,
			folderMenu		: 	this.folderMenu,
			workflowMenu	: 	this.workflowMenu,
			core			: 	this.core,
			parentWidget	:	this,
			owner			: 	directory.owner,
			path			:	'',
			description		:	directory.description || ''
		}
	);

	// ADD TO this.fileDrags
	this.fileDrags.push(fileDrag);

	// START UP FileDrag
	fileDrag.startup();

	return fileDrag;
},

createSourceStore : function (directory) {
// CREATE STORE FOR FILE DRAG
	//console.log("ProjectFiles.createStore     this.id: " + this.id);
	//console.log("ProjectFiles.createStore	   directory:");
	//console.dir({directory:directory});

	// SET URL
	var url 	= this.url;
	var putData	= this.getSourcePutData(directory);

	// CREATE STORE
	var store = new plugins.dojox.data.FileStore({
		url					: 	url,
		putData				: 	putData,
		pathAsQueryParam	: 	true,
		parentPath			: 	this.parentPath,
		path				: 	directory.name
	});

	return store;
},

getSourcePutData : function (directory) {
// CREATE DATA OBJECT FOR xhrPut
	//console.log("SourceFiles.getPutData    this.id: " + this.id);
	//console.log("SourceFiles.getPutData    directory:");
	//console.dir({directory:directory});

	var putData = new Object;
	putData.mode 		= 	"fileSystem";
	putData.module 		= 	"Agua::Folders";
	putData.username 	= 	Agua.cookie('username');
	putData.sessionid	=	Agua.cookie('sessionid');
	putData.location	=	directory.location;
	//console.log("SourceFiles.getPutData    putData: ");
	//console.dir({putData:putData});

	return putData;
}

});

/*

 setFileDrag : function (directory) {
	//console.log("SourceFiles.setFileDrag	   plugins.folders.SourceFiles.setFileDrag(directory)");
	//console.log("SourceFiles.setFileDrag	   directory: ");
	//console.dir({directory:directory});

	var owner = directory.username;
	var name = directory.name;
	var description = directory.description;
	var location = directory.location;
	if ( ! description ) { description = '' };

	var titlePane = this.createTitlePane(
	{
		owner: owner,
		name: name,
		description: description,
		location: location,
		open: this.open
	});

	// REMOVE NAME TO SET QUERY AS ''
	var thisStore = this.createStore(directory);

	// GENERATE NEW FileDrag OBJECT
	var fileDrag = new plugins.files.FileDrag(
		{
			style: "height: auto; width: 100%; minHeight: 50px;",
			store: thisStore,
			fileMenu: this.fileMenu,
			folderMenu: this.folderMenu,
			workflowMenu: this.workflowMenu,
			owner: owner,
			parentWidget: this
		}
	);

	// SET PATH AS LOCATION
	////console.log("SourceFiles.setFileDrag	   BEFORE replace directory.location: **" + directory.location + "**");
	directory.location = directory.location.replace(/\s+/g, '');
	//console.log("SourceFiles.setFileDrag	   AFTER replace directory.location: **" + directory.location + "**");

	fileDrag.path = directory.location;

	// START UP FileDrag
	fileDrag.startup();

//////console.log("SourceFiles.load	   ////console.dir(fileDrag): " + fileDrag);
//////console.dir(fileDrag);

	// ADD fileDrag TO TITLE PANE
	titlePane.containerNode.appendChild(fileDrag.domNode);
},

 */


text:
'''
Meshes for hamitonian Generator
'''
from numpy import *
from multithreading import mpido
from scipy.linalg import eigh,eigvalsh
from matplotlib.pyplot import *
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from utils import H2G
import pdb,time

__all__=['Emesh','Hmesh','Gmesh']

class Emesh(object):
    '''
    Energy Mesh.

    Construct
    ----------------
    Emesh(data), data is an N-D(N>=2) array or the filename of data file.

    Attributes
    ---------------
    data:
        The mesh data of energy arrange as [dim_1,...dim_n,nband].
    '''
    def __init__(self,data):
        if type(data)==str:
            self.data=loadtxt(data)
        else:
            self.data=data

    def save(filename):
        '''Save the hamiltonian data.'''
        save(filename,self.data)

    @property
    def nband(self):
        '''The number of bands'''
        return self.data.shape[-1]

    @property
    def size(self):
        '''The size of mesh.'''
        return self.data.shape[:-1]

    def show(self,kmesh=None):
        '''
        Show the dispersion relation.

        kmesh:
            N-D(N=1,3) array, The k-mesh holding this <Emesh>.
        '''
        dim=ndim(self.data)
        nband=self.nband
        colors=cm.get_cmap('autumn')(linspace(0,1,nband))
        if dim>3 or dim<=1:
            raise Exception('Not Implemented for mesh with dimension %s!'%(dim))
        elif dim==2:
            if kmesh is None:
                kmesh=arange(len(self.data))
            plot(self.data.T)
        else:
            N1,N2=self.size
            if kmesh is None:
                kx,ky=meshgrid(arange(N1),arange(N2),indexing='ij')
            else:
                kx,ky=kmesh[...,0],kmesh[...,1]
            fig=gcf()
            ax=fig.add_subplot(111,projection='3d')
            for i in xrange(nband):
                ax.scatter(kx,ky,self.data[...,i],s=5,edgecolor='none',c=colors[i])
        legend(arange(nband))

    def show_dos(self,wlist,geta=3e-2,inverse_axis=False,weights=None):
        '''
        Get a List instance of dos.

        wlist:
            the frequency space.
        geta:
            smearing factor.
        inverse_axis:
            inverse x-y axis.
        weights:
            weights of energies.
        '''
        nw=len(wlist)
        dos=List(shape=[nw],dtype='float64')
        dos[...]=(weights/(wlist[:,newaxis]+1j*geta-reshape(self.data,[1,-1]))).imag.sum(axis=-1)
        dos*=-1./pi/prod(self.data.shape)
        if inverse_axis:
            wlist,dos=dos,wlist
        plot(wlist,dos)
        return wlist,dos

class Hmesh(object):
    '''
    Mesh of Hamiltonians.

    Construct
    ----------------
    Hmesh(data), data is an N-D(N>=3) array or the filename of data file.

    Attributes
    ---------------
    data:
        The mesh data of Hamiltonian arrange as [dim_1,...dim_n,nband,nband].
    '''
    def __init__(self,data):
        if type(data)==str:
            self.data=loadtxt(data)
        else:
            self.data=data

    @property
    def size(self):
        '''The size of mesh.'''
        return self.data.shape[:-2]

    @property
    def nband(self):
        '''The number of bands'''
        return self.data.shape[-1]

    def save(filename):
        '''Save the hamiltonian data.'''
        save(filename,self.data)

    def getemesh(self,evalvk=False):
        '''
        Get an Ek(with or without vk) mesh.

        evalvk:
            Evaluate vkmesh if True.
        '''
        nband=self.nband
        dmesh=mpido(func=eigh if evalvk else eigvalsh,inputlist=self.data.reshape([-1,nband,nband]))
        if evalvk:
            ekl,vkl=[],[]
            for ek,vk in dmesh:
                ekl.append(ek)
                vkl.append(vk)
            return reshape(ekl,self.data.shape[:,-1]),reshape(vkl,self.data.shape)
        else:
            return reshape(dmesh,self.data.shape[:-1])

    def getgmesh(self,w,sigma=None,tp='r',geta=1e-2,**kwargs):
        '''
        Get the Green's function mesh(Gwmesh) instance.

        w:
            an array(or a float number) of energy(frequency).
        sigma:
            self energy correction.
        tp:
            type of green's function.

            * 'r' - retarded.(default)
            * 'a' - advanced.(default)
            * 'matsu' - finite temperature.
        geta:
            smearing factor, default is 1e-2.
        '''
        if ndim(w)==0:
            #only 1 w is to be computed
            return H2G(w=w,h=self.data,sigma=sigma,tp=tp,geta=geta)
        else:
            #generate a mesh on w-list
            gmesh=H2G(w=w[[slice(None)]+[newaxis]*ndim(self.data)],h=self.data,sigma=sigma,tp=tp,geta=geta)
        return gmesh

class Gmesh(object):
    '''
    Mesh of Green's function

    Construct
    --------------------
    Gmesh(data,geta,tp,T=None)

    Attributes
    ---------------------
    data:
        A array of Green's function data
    geta:
        The smearing factor.
    tp:
        The type of Green's function.

            * 'r' - retarded.(default)
            * 'a' - advanced.
            * 'matsu' - matsubara Green's function.
    T:
        The temperature for matsubara Green's function.
    '''
    def __init__(self,data,geta,tp,T=None):
        assert(tp=='r' or tp=='a' or (tp=='matsu' and not T is None))
        self.data=data
        self.tp=tp
        self.geta=geta
        self.T=T

    @property
    def dimension(self):
        return ndim(self.data)-2

    @property
    def Amesh(self):
        '''
        Get the spectrum function Ak-mesh
        '''
        data=self.data
        GH=swapaxes(data.conj(),axis1=-1,axis2=-1)
        if self.tp=='r':
            res= 1j/2./pi*(data-GH)
        elif self.tp=='a':
            res= -1j/2./pi*(data-GH)
        else:
            raise Exception('Error','Rules for spectrum of matsubara Green\'s function is not set.')
        return res

    def show_dos(self,lw=3,inverse=False,**kwargs):
        '''
        show dos.
        '''
        nflv=self.data.shape[-1]
        dos=trace(self.Amesh[...,:nflv,:nflv],axis1=-1,axis2=-2)
        ddim=ndim(self.data)
        if ddim!=3:
            kaxis=range(self.dimension)
            kaxis.remove(self.iaxis)
            dos=mean(dos,axis=kaxis)


text:
package com.sylvanaar.appcode.swift.intentions;

import com.intellij.CommonBundle;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.PropertyKey;

import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.util.ResourceBundle;

/**
 * @author ilyas
 */
public class SwiftIntentionsBundle {
  private static Reference<ResourceBundle> ourBundle;

  @NonNls
  private static final String BUNDLE = "com.sylvanaar.appcode.swift.intentions.SwiftIntentionsBundle";

  public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) {
    return CommonBundle.message(getBundle(), key, params);
  }

  private static ResourceBundle getBundle() {
    ResourceBundle bundle = null;

    if (ourBundle != null) bundle = ourBundle.get();

    if (bundle == null) {
      bundle = ResourceBundle.getBundle(BUNDLE);
      ourBundle = new SoftReference<>(bundle);
    }
    return bundle;
  }

}


text:
package com.lmonkiewicz.commutee.routes.adapter.out.timetable;

import com.lmonkiewicz.commutee.routes.domain.model.BusStopData;
import com.lmonkiewicz.commutee.routes.domain.model.ConnectionData;
import com.lmonkiewicz.commutee.routes.domain.out.timetable.TimetablesStore;
import org.jetbrains.annotations.NotNull;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;

import java.util.Optional;

/**
 * Created by lmonkiewicz on 14.04.2017.
 */
public class Neo4JTimetablesStore implements TimetablesStore {
    @Override
    public Optional<BusStopData> findBusStopById(@NotNull String id) {
        throw new NotImplementedException();
    }

    @Override
    public void updateBusStopData(@NotNull BusStopData busStop) {
        throw new NotImplementedException();
    }

    @Override
    public void createBusStopData(@NotNull BusStopData busStop) {
        throw new NotImplementedException();
    }

    @Override
    public void createDeparture(@NotNull BusStopData fromBS, @NotNull ConnectionData connectionData) {
        throw new NotImplementedException();
    }
}


text:
module Kreg.Options.Auth (auth) where

import           Kreg.UI.UserInput     (askLogins)
import qualified Registry.Client       as C
import Kreg.TokenFileManager (save)

auth :: IO ()
auth = do
    ids <- askLogins
    case ids of
        Nothing -> return ()
        Just (login, password) -> do
            res <- C.auth login password
            case res of
                Nothing -> putStrLn "Authentication failed"
                Just dt -> do
                    save dt
                    putStrLn "Authentication succeeded"


text:
<?php
/* wppa_widgetadmin.php
* Pachkage: wp-photo-album-plus
*
* admin sidebar widget
* version 4.6.5
*
*/

function _wppa_sidebar_page_options() {
	global $wpdb;
	global $wppa_opt;

	$options_error = false;

	if (isset($_GET['walbum'])) {
		$walbum = wppa_walbum_sanitize($_GET['walbum']);
		update_option('wppa_widget_album', $walbum);
	}
	if (isset($_POST['wppa-set-submit'])) {
		check_admin_referer( '$wppa_nonce', WPPA_NONCE );

		if (isset($_POST['wppa-widgettitle'])) update_option('wppa_widgettitle', $_POST['wppa-widgettitle']);
		if (isset($_POST['wppa-potd-align'])) update_option('wppa_potd_align', $_POST['wppa-potd-align']);
		if (isset($_POST['wppa-widget-albums'])) update_option('wppa_widget_album', wppa_walbum_sanitize($_POST['wppa-widget-albums']));
		if (isset($_POST['wppa-widget-photo'])) update_option('wppa_widget_photo', $_POST['wppa-widget-photo']);
		if (isset($_POST['wppa-widget-method'])) update_option('wppa_widget_method', $_POST['wppa-widget-method']);
		if (isset($_POST['wppa-widget-period'])) update_option('wppa_widget_period', $_POST['wppa-widget-period']);
		if (isset($_POST['wppa-widget-subtitle'])) update_option('wppa_widget_subtitle', $_POST['wppa-widget-subtitle']);
		if (isset($_POST['wppa-widget-linkpage'])) update_option('wppa_widget_linkpage', $_POST['wppa-widget-linkpage']);
		if (isset($_POST['wppa-widget-linkurl'])) update_option('wppa_widget_linkurl', $_POST['wppa-widget-linkurl']);
		if (isset($_POST['wppa-widget-linktitle'])) update_option('wppa_widget_linktitle', $_POST['wppa-widget-linktitle']);
		if (isset($_POST['wppa-widget-linktype'])) update_option('wppa_widget_linktype', $_POST['wppa-widget-linktype']);
		if (wppa_check_numeric($_POST['wppa-widget-width'], '100', __('Widget Photo Width.'))) {
			update_option('wppa_widget_width', $_POST['wppa-widget-width']);
		} else {
			$options_error = true;
		}
		if (!$options_error) wppa_update_message(__('Changes Saved. Don\'t forget to activate the widget!', 'wppa'));
	}
	wppa_initialize_runtime('force');
	?>

		<?php $iconurl = WPPA_URL.'/images/settings32.png'; ?>
		<div id="icon-album" class="icon32" style="background: transparent url(<?php echo($iconurl); ?>) no-repeat">

<?php _e('WP Photo Album Plus Sidebar Widget Settings', 'wppa'); ?>

		<form action="<?php echo(wppa_dbg_url(get_admin_url().'admin.php?page=wppa_photo_of_the_day')) ?>" method="post">
			<?php wp_nonce_field('$wppa_nonce', WPPA_NONCE); ?>

							<?php _e('Widget Title:', 'wppa'); ?>

							<input type="text" name="wppa-widgettitle" id="wppa-widgettitle" value="<?php echo $wppa_opt['wppa_widgettitle'] ?>" />

<?php _e('Enter/modify the title for the widget. This is a default and can be overriden at widget activation.', 'wppa'); ?>

							<?php _e('Widget Photo Width:', 'wppa'); ?>

							<input type="text" name="wppa-widget-width" id="wppa-widget-width" value="<?php echo $wppa_opt['wppa_widget_width'] ?>" style="width: 50px;" />
							<?php _e('pixels.', 'wppa'); echo(' '); _e('Horizontal alignment:', 'wppa'); ?>
							<select name="wppa-potd-align" id="wppa-potd-align">
								<?php $ali = $wppa_opt['wppa_potd_align'] ?>
								<?php $sel = 'selected="selected"'; ?>
								<option value="none" <?php if ($ali == 'none') echo($sel) ?>><?php _e('--- none ---', 'wppa') ?></option>
								<option value="left" <?php if ($ali == 'left') echo($sel) ?>><?php _e('left', 'wppa') ?></option>
								<option value="center" <?php if ($ali == 'center') echo($sel) ?>><?php _e('center', 'wppa') ?></option>
								<option value="right" <?php if ($ali == 'right') echo($sel) ?>><?php _e('right', 'wppa') ?></option>
							</select>

<?php _e('Enter the desired display width and alignment of the photo in the sidebar.', 'wppa'); ?>

							<?php _e('Use album(s):', 'wppa'); ?>

							<?php _e('Select:', 'wppa'); ?><select name="wppa-widget-album" id="wppa-wa" onchange="wppaCheckWa()" ><?php echo wppa_walbum_select($wppa_opt['wppa_widget_album']) ?></select>
							<img id="wppa-spin" src="<?php echo(wppa_get_imgdir()); ?>wpspin.gif" style="visibility:hidden;"/>
							<?php _e('Or Edit:', 'wppa'); ?><input type="text" name="wppa-widget-albums" id="wppa-was" value="<?php echo $wppa_opt['wppa_widget_album'] ?>" />
							<input class="button-primary" name="wppa-upd" id="wppa-upd" value="<?php _e('Update thumbnails', 'wppa'); ?>" onclick="wppaCheckWa()" />

								<?php _e('Select or edit the album(s) you want to use the photos of for the widget.', 'wppa'); ?>

								<?php _e('If you want a - special - selection or get rid of it, you may need to use - start over - first.', 'wppa'); ?>

							<?php _e('Display method:', 'wppa'); ?>

							<?php $sel = 'selected="selected"'; ?>
							<?php $method = $wppa_opt['wppa_widget_method']; ?>
							<select name="wppa-widget-method" id="wppa-wm" onchange="wppaCheckWidgetMethod()" >
								<option value="1" <?php if ($method == '1') echo($sel); ?>><?php _e('Fixed photo', 'wppa'); ?></option>
								<option value="2" <?php if ($method == '2') echo($sel); ?>><?php _e('Random', 'wppa'); ?></option>
								<option value="3" <?php if ($method == '3') echo($sel); ?>><?php _e('Last upload', 'wppa'); ?></option>
								<option value="4" <?php if ($method == '4') echo($sel); ?>><?php _e('Change every', 'wppa'); ?></option>
							</select>
							<?php $period = $wppa_opt['wppa_widget_period']; ?>
							<select name="wppa-widget-period" id="wppa-wp" >
								<option value="0" <?php if ($period == '0') echo($sel); ?>><?php _e('pageview.', 'wppa'); ?></option>
								<option value="1" <?php if ($period == '1') echo($sel); ?>><?php _e('hour.', 'wppa'); ?></option>
								<option value="24" <?php if ($period == '24') echo($sel); ?>><?php _e('day.', 'wppa'); ?></option>
								<option value="168" <?php if ($period == '168') echo($sel); ?>><?php _e('week.', 'wppa'); ?></option>
								<option value="736" <?php if ($period == '736') echo($sel); ?>><?php _e('month.', 'wppa'); ?></option>
							</select>

<?php _e('Select how the widget should display.', 'wppa'); ?>

<?php
					$linktype = $wppa_opt['wppa_widget_linktype'];
					if ($linktype != 'custom') { ?>

								<?php _e('Link to:', 'wppa'); ?>

								<?php _e('Links are set on the Photo Albums -> Settings screen.', 'wppa'); ?>

<?php				}
					else { ?>

								<?php _e('Link to:', 'wppa'); ?>

								<?php _e('Title:', 'wppa') ?>
								<input type="text" name="wppa-widget-linktitle" id="wppa-widget-linktitle" value="<?php echo $wppa_opt['wppa_widget_linktitle'] ?>"style="width:20%" />
								<?php _e('Url:', 'wppa') ?>
								<input type="text"  name="wppa-widget-linkurl" id="wppa-widget-linkurl" value="<?php echo $wppa_opt['wppa_widget_linkurl'] ?>" style="width:50%" />

<?php _e('Enter the title and the url. Do\'nt forget the HTTP://', 'wppa') ?>

<?php 				} ?>

							<?php _e('Subtitle:', 'wppa'); ?>

							<?php $subtit = $wppa_opt['wppa_widget_subtitle']; ?>
							<select name="wppa-widget-subtitle" id="wppa-st" onchange="wppaCheckWidgetSubtitle()" >
								<option value="none" <?php if ($subtit == 'none') echo($sel); ?>><?php _e('--- none ---', 'wppa'); ?></option>
								<option value="name" <?php if ($subtit == 'name') echo($sel); ?>><?php _e('Photo Name', 'wppa'); ?></option>
								<option value="desc" <?php if ($subtit == 'desc') echo($sel); ?>><?php _e('Description', 'wppa'); ?></option>
							</select>

<?php _e('Select the content of the subtitle.', 'wppa'); ?>

				<input type="submit" class="button-primary" name="wppa-set-submit" value="<?php _e('Save Changes', 'wppa'); ?>" />

			<?php $alb = $wppa_opt['wppa_widget_album'];
			$photos = wppa_get_widgetphotos($alb);
			if (empty($photos)) { ?>

<?php _e('No photos yet in this album.', 'wppa'); ?>

			<?php }
			else {
				$id = $wppa_opt['wppa_widget_photo'];
				$wi = wppa_get_minisize() + 24;
				$hi = $wi + 48;
				foreach ($photos as $photo) { ?>
					<div class="photoselect" style="width: <?php echo $wppa_opt['wppa_widget_width'] ?>px; height: <?php echo($hi); ?>px; overflow:hidden; " >
						<img src="<?php echo(WPPA_UPLOAD_URL.'/thumbs/' . $photo['id'] . '.' . $photo['ext']); ?>" style="width: <?php echo $wppa_opt['wppa_widget_width'] ?>px;" alt="<?php echo($photo['name']); ?>">
						<input type="radio" name="wppa-widget-photo" id="wppa-widget-photo<?php echo($photo['id']); ?>" value="<?php echo($photo['id']) ?>" <?php if ($photo['id'] == $id) echo('checked="checked"'); ?>/>

						<h4 style="position: absolute; top:<?php echo( $wi - 12 ); ?>px; font-size:11px; overflow:hidden;"><?php echo(wppa_qtrans(stripslashes($photo['name']))) ?>

						<h6 style="position: absolute; top:<?php echo( $wi + 6); ?>px; font-size:9px; line-height:10px;"><?php echo(wppa_qtrans(stripslashes($photo['description']))); ?>

				<?php } ?>

			<?php } ?>

				<input type="submit" class="button-primary" name="wppa-set-submit" value="<?php _e('Save Changes', 'wppa'); ?>" />

		</form>

<?php
}

require_once ('wppa-widget-functions.php');


text:
package stroom.util.servlet;

import stroom.util.NullSafe;
import stroom.util.logging.LambdaLogger;
import stroom.util.logging.LambdaLoggerFactory;
import stroom.util.logging.LogUtil;

import javax.inject.Provider;
import javax.inject.Singleton;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Singleton
public class HttpServletRequestHolder implements Provider<HttpServletRequest> {

    private static final LambdaLogger LOGGER = LambdaLoggerFactory.getLogger(HttpServletRequestHolder.class);

    private final ThreadLocal<HttpServletRequest> threadLocal = new InheritableThreadLocal<>();

    @Override
    public HttpServletRequest get() {
        return threadLocal.get();
    }

    public void set(final HttpServletRequest httpServletRequest) {

        if (LOGGER.isDebugEnabled()) {
            if (httpServletRequest == null) {
                LOGGER.debug(() ->
                        LogUtil.message("Clearing held request against thread {}",
                                Thread.currentThread().getId()));
            } else {
                LOGGER.debug(() ->
                        LogUtil.message("Holding request with session id {} against thread {}",
                                NullSafe.get(
                                        httpServletRequest,
                                        request -> request.getSession(false),
                                        HttpSession::getId),
                                Thread.currentThread().getId()));
            }
        }

        threadLocal.set(httpServletRequest);
    }
}