text:
class ProductNotesController < ApplicationController
  before_filter :gate_keeper
  before_action :set_product_note, only: [:show, :edit, :update, :destroy]

  # GET /product_notes
  # GET /product_notes.json
  def index
    @product_notes = ProductNote.all
  end

  # GET /product_notes/1
  # GET /product_notes/1.json
  def show
  end

  # GET /product_notes/new
  def new
    @product_note = ProductNote.new
  end

  # GET /product_notes/1/edit
  def edit
  end

  # POST /product_notes
  # POST /product_notes.json
  def create
    @product_note = ProductNote.new(product_note_params)

    respond_to do |format|
      if @product_note.save
        format.html { redirect_to :back, notice: 'Product note was successfully created.' }
        format.json { render :show, status: :created, location: @product_note }
      else
        format.html { render :new }
        format.json { render json: @product_note.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /product_notes/1
  # PATCH/PUT /product_notes/1.json
  def update
    respond_to do |format|
      if @product_note.update(product_note_params)
        format.html { redirect_to @product_note, notice: 'Product note was successfully updated.' }
        format.json { render :show, status: :ok, location: @product_note }
      else
        format.html { render :edit }
        format.json { render json: @product_note.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /product_notes/1
  # DELETE /product_notes/1.json
  def destroy
    @product_note.destroy
    respond_to do |format|
      format.html { redirect_to product_notes_url, notice: 'Product note was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_product_note
      @product_note = ProductNote.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def product_note_params
      params.require(:product_note).permit(:product_id, :note)
    end
end

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.storage.queue.sas;

import com.azure.core.util.Configuration;
import com.azure.storage.common.implementation.StorageImplUtils;
import com.azure.storage.common.sas.SasProtocol;
import com.azure.storage.common.implementation.Constants;
import com.azure.storage.common.sas.SasIpRange;
import com.azure.storage.common.StorageSharedKeyCredential;
import com.azure.storage.queue.QueueServiceVersion;

import java.time.OffsetDateTime;

/**
 * Used to initialize parameters for a Shared Access Signature (SAS) for an Azure Queue Storage service. Once all the
 * values here are set, use the appropriate SAS generation method on the desired queue client to obtain a
 * representation of the SAS which can then be applied to a new client using the .sasToken(String) method on the
 * desired client builder.
 *
 * @see Storage SAS overview
 * @see Constructing a Service
 * SAS
 */
public final class QueueServiceSasSignatureValues {
    private static final String VERSION = Configuration.getGlobalConfiguration()
        .get(Constants.PROPERTY_AZURE_STORAGE_SAS_SERVICE_VERSION, QueueServiceVersion.getLatest().getVersion());

    private SasProtocol protocol;

    private OffsetDateTime startTime;

    private OffsetDateTime expiryTime;

    private String permissions;

    private SasIpRange sasIpRange;

    private String queueName;

    private String identifier;

    /**
     * Creates an object with empty values for all fields.
     * @deprecated Please use {@link #QueueServiceSasSignatureValues(String)}, or
     * {@link #QueueServiceSasSignatureValues(OffsetDateTime, QueueSasPermission)}
     */
    @Deprecated
    public QueueServiceSasSignatureValues() {
    }

    /**
     * Creates an object with the specified expiry time and permissions
     *
     * @param expiryTime The time after which the SAS will no longer work.
     * @param permissions {@link QueueSasPermission} allowed by the SAS.
     */
    public QueueServiceSasSignatureValues(OffsetDateTime expiryTime, QueueSasPermission permissions) {
        StorageImplUtils.assertNotNull("expiryTime", expiryTime);
        StorageImplUtils.assertNotNull("permissions", permissions);
        this.expiryTime = expiryTime;
        this.permissions = permissions.toString();
    }

    /**
     * Creates an object with the specified identifier.
     *
     * @param identifier Name of the access policy.
     */
    public QueueServiceSasSignatureValues(String identifier) {
        StorageImplUtils.assertNotNull("identifier", identifier);
        this.identifier = identifier;
    }

    /**
     * @return the version of the service this SAS will target. If not specified, it will default to the version
     * targeted by the library.
     */
    public String getVersion() {
        return VERSION;
    }

    /**
     * Sets the version of the service this SAS will target. If not specified, it will default to the version targeted
     * by the library.
     *
     * @param version Version to target
     * @return the updated QueueServiceSasSignatureValues object
     * @deprecated The version is set to the latest version of sas. Users should stop calling this API as it is now
     * treated as a no-op.
     */
    @Deprecated
    public QueueServiceSasSignatureValues setVersion(String version) {
        // no-op
        return this;
    }

    /**
     * @return the {@link SasProtocol} which determines the protocols allowed by the SAS.
     */
    public SasProtocol getProtocol() {
        return protocol;
    }

    /**
     * Sets the {@link SasProtocol} which determines the protocols allowed by the SAS.
     *
     * @param protocol Protocol for the SAS
     * @return the updated QueueServiceSasSignatureValues object
     */
    public QueueServiceSasSignatureValues setProtocol(SasProtocol protocol) {
        this.protocol = protocol;
        return this;
    }

    /**
     * @return when the SAS will take effect.
     */
    public OffsetDateTime getStartTime() {
        return startTime;
    }

    /**
     * Sets when the SAS will take effect.
     *
     * @param startTime When the SAS takes effect
     * @return the updated QueueServiceSasSignatureValues object
     */
    public QueueServiceSasSignatureValues setStartTime(OffsetDateTime startTime) {
        this.startTime = startTime;
        return this;
    }

    /**
     * @return the time after which the SAS will no longer work.
     */
    public OffsetDateTime getExpiryTime() {
        return expiryTime;
    }

    /**
     * Sets the time after which the SAS will no longer work.
     *
     * @param expiryTime When the SAS will no longer work
     * @return the updated QueueServiceSasSignatureValues object
     */
    public QueueServiceSasSignatureValues setExpiryTime(OffsetDateTime expiryTime) {
        this.expiryTime = expiryTime;
        return this;
    }

    /**
     * @return the permissions string allowed by the SAS. Please refer to {@link QueueSasPermission} for help
     * determining the permissions allowed.
     */
    public String getPermissions() {
        return permissions;
    }

    /**
     * Sets the permissions string allowed by the SAS. Please refer to {@link QueueSasPermission} for help constructing
     * the permissions string.
     *
     * @param permissions Permissions for the SAS
     * @return the updated QueueServiceSasSignatureValues object
     * @throws NullPointerException if {@code permissions} is null.
     */
    public QueueServiceSasSignatureValues setPermissions(QueueSasPermission permissions) {
        StorageImplUtils.assertNotNull("permissions", permissions);
        this.permissions = permissions.toString();
        return this;
    }

    /**
     * @return the {@link SasIpRange} which determines the IP ranges that are allowed to use the SAS.
     */
    public SasIpRange getSasIpRange() {
        return sasIpRange;
    }

    /**
     * Sets the {@link SasIpRange} which determines the IP ranges that are allowed to use the SAS.
     *
     * @see Specifying IP Address or IP range
     * @param sasIpRange Allowed IP range to set
     * @return the updated QueueServiceSasSignatureValues object
     */
    public QueueServiceSasSignatureValues setSasIpRange(SasIpRange sasIpRange) {
        this.sasIpRange = sasIpRange;
        return this;
    }

    /**
     * Gets the name of the queue this SAS may access.
     *
     * @return The name of the queue the SAS user may access.
     * @deprecated Queue name is now auto-populated by the SAS generation methods provided on the desired queue client.
     */
    @Deprecated
    public String getQueueName() {
        return queueName;
    }

    /**
     * Sets the name of the queue this SAS may access.
     *
     * @param queueName Canonical name of the object the SAS grants access
     * @return the updated QueueServiceSasSignatureValues object
     * @deprecated Please use the generateSas methods provided on the desired queue client that will
     * auto-populate the queue name.
     */
    @Deprecated
    public QueueServiceSasSignatureValues setQueueName(String queueName) {
        this.queueName = queueName;
        return this;
    }

    /**
     * @return the name of the access policy on the queue this SAS references if any. Please see
     * here
     * for more information.
     * @deprecated Please use {@link #getIdentifier()}
     */
    @Deprecated
    public String getId() {
        return identifier;
    }

    /**
     * @return the name of the access policy on the queue this SAS references if any. Please see
     * here
     * for more information.
     */
    public String getIdentifier() {
        return identifier;
    }

    /**
     * Sets the name of the access policy on the queue this SAS references if any. Please see
     * here
     * for more information.
     *
     * @param identifier Name of the access policy
     * @return the updated QueueServiceSasSignatureValues object
     */
    public QueueServiceSasSignatureValues setIdentifier(String identifier) {
        this.identifier = identifier;
        return this;
    }

    /**
     * Uses an account's shared key credential to sign these signature values to produce the proper SAS query
     * parameters.
     *
     *
Notes on SAS generation

     *

     *
If {@link #setIdentifier(String) identifier} is set, {@link #setExpiryTime(OffsetDateTime) expiryTime} and
     * permissions should not be set. These values are inherited from the stored access policy.

     *
Otherwise, {@link #setExpiryTime(OffsetDateTime) expiryTime} and {@link #getPermissions() permissions} must
     * be set.

     *

     *
     *
For samples, see class level JavaDocs.

     *
     * @param storageSharedKeyCredentials A {@link StorageSharedKeyCredential} object used to sign the SAS values.
     * @return A new {@link QueueServiceSasQueryParameters} represented by the current builder.
     * @throws IllegalStateException If the HMAC-SHA256 algorithm isn't supported, if the key isn't a valid Base64
     * encoded string, or the UTF-8 charset isn't supported.
     * @throws NullPointerException If {@code storageSharedKeyCredentials} is null.
     * @deprecated Please use the generateSas(QueueServiceSasSignatureValues) method on the desired queue client
     * after initializing {@link QueueServiceSasSignatureValues}.
     */
    @Deprecated
    public QueueServiceSasQueryParameters generateSasQueryParameters(
        StorageSharedKeyCredential storageSharedKeyCredentials) {
        StorageImplUtils.assertNotNull("storageSharedKeyCredentials", storageSharedKeyCredentials);

        // Signature is generated on the un-url-encoded values.
        String canonicalName = getCanonicalName(storageSharedKeyCredentials.getAccountName(), queueName);
        String stringToSign = stringToSign(canonicalName);
        String signature = storageSharedKeyCredentials.computeHmac256(stringToSign);

        return new QueueServiceSasQueryParameters(VERSION, this.protocol, this.startTime, this.expiryTime,
            this.sasIpRange, this.identifier, this.permissions, signature);
    }

    /**
     * Computes the canonical name for a queue resource for SAS signing.
     * @param account Account of the storage account.
     * @param queueName Name of the queue.
     * @return Canonical name as a string.
     */
    private static String getCanonicalName(String account, String queueName) {
        // Queue: "/queue/account/queuename"
        return String.join("", new String[] { "/queue/", account, "/", queueName });
    }

    private String stringToSign(String canonicalName) {
        return String.join("\n",
            this.permissions == null ? "" : this.permissions,
            this.startTime == null ? "" : Constants.ISO_8601_UTC_DATE_FORMATTER.format(this.startTime),
            this.expiryTime == null ? "" : Constants.ISO_8601_UTC_DATE_FORMATTER.format(this.expiryTime),
            canonicalName,
            this.identifier == null ? "" : this.identifier,
            this.sasIpRange == null ? "" : this.sasIpRange.toString(),
            this.protocol == null ? "" : protocol.toString(),
            VERSION == null ? "" : VERSION
        );
    }
}


text:
/**
 * window.c.CategoryButton component
 * Return a link with a btn-category class.
 * It uses a category parameter.
 *
 * Example:
 * m.component(c.CategoryButton, {
 *     category: {
 *         id: 1,
 *         name: 'Video',
 *         online_projects: 1
 *     }
 * })
 */
import m from 'mithril';

const categoryButton = {
    view: function({attrs}) {
        const category = attrs.category;

        return m('.w-col.w-col-2.w-col-small-6.w-col-tiny-6', [
            m(`a.w-inline-block.btn-category[href='#by_category_id/${category.id}']`, [
                m('div', [
                    category.name,
                    m('span.badge.explore', category.online_projects)
                ])
            ])
        ]);
    }
};

export default categoryButton;


text:
package ic2.api.recipe;

import net.minecraft.item.ItemStack;

public interface IPatternStorage {

	boolean transferPattern(ItemStack itemstack, int amountUU , int amountEU);

	int[] getPatternvalus(ItemStack itemstack);

	short getPatternCount();

	ItemStack getPatternItemstack(int index);

}


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

<title>com.cmput301.cia.controller</title>
<meta name="date" content="2017-12-04">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package com.cmput301.cia.controller

Interface Summary

Interface
Description

FollowersRequestAdapter.OnItemClickListener

the listener interface that waits when an item is clicked

Class Summary

Class
Description

CheckableListViewAdapter

ExpandableListViewAdapter

FollowersRequestAdapter

An adapter for displaying the follow requests

HistoryAdapter

TimedAdapterViewClickListener

TimedClickListener

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
layout: page
title: Keller Scholar Enterprises Conference
date: 2016-05-24
author: Eric Hogan
tags: weekly links, java
status: published
summary: Vestibulum mattis libero et arcu sollicitudin.
banner: images/banner/people.jpg
booking:
  startDate: 07/27/2019
  endDate: 07/28/2019
  ctyhocn: PSLWEHX
  groupCode: KSEC
published: true
---
Aenean eu justo id turpis sollicitudin facilisis in at massa. Sed libero enim, maximus vel dolor sit amet, fermentum venenatis purus. Sed orci sapien, tincidunt eget mauris a, ultricies posuere quam. Sed ut bibendum mi. Cras in orci urna. Curabitur maximus neque ut velit cursus, non ultrices nisl iaculis. Mauris dictum aliquet est eu lacinia. Suspendisse a orci arcu. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Maecenas at molestie diam.
Aliquam ut quam feugiat, lacinia diam ac, egestas sem. Curabitur lacinia vestibulum est finibus condimentum. Praesent eget est odio. Quisque tristique tellus et magna efficitur convallis. Nullam ipsum orci, rutrum non enim in, aliquam dignissim neque. Sed consequat libero id ornare aliquam. Vivamus feugiat consequat lacus, maximus pretium dolor scelerisque pellentesque. Donec mollis est metus, a suscipit leo consectetur nec. Proin bibendum varius felis. Cras at sagittis nunc, vitae tristique nibh. Pellentesque in libero sapien. Donec quis libero commodo, porttitor nisi a, semper nulla. Aenean condimentum congue sem, vitae porttitor risus tempus id. Proin ornare elementum euismod.

* Fusce mattis tellus sit amet ipsum lacinia consectetur
* Suspendisse quis quam sed arcu consequat venenatis ultricies eu ligula
* Nunc fringilla ante ac lacus egestas egestas
* Praesent rhoncus felis vel condimentum blandit
* Praesent vel mi imperdiet, consequat arcu vel, tincidunt diam.

Ut viverra vestibulum ultrices. Integer viverra hendrerit varius. Mauris gravida scelerisque enim ac pharetra. Nunc non rutrum massa. Morbi at ornare ligula. Nulla facilisi. Nulla nec iaculis ex. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus pellentesque ornare eros vel placerat. Quisque molestie vulputate enim nec dapibus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Integer pharetra turpis ac nibh hendrerit viverra. Aliquam erat volutpat. Sed dapibus efficitur risus pellentesque scelerisque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.


text:
// This project deliberately references only kernel32.dll (ie. not even the CRT)
// so that when inserted into an application it has as small an overhead/impact
// as possible. Ideally it would be present only to be a pass-through hook and
// the first time only to allocate a little, check if this process should be hooked
// and load the renderdoc dll.
//
// The no-CRT restriction causes some awkward bits and pieces but the dll is simple
// enough that it's not a big issue.

#include "renderdocshim.h"
#include <windows.h>

struct CaptureOptions;
typedef void(__cdecl *pINTERNAL_SetCaptureOptions)(const CaptureOptions *opts);
typedef void(__cdecl *pINTERNAL_SetLogFile)(const char *logfile);
typedef void(__cdecl *pRENDERDOC_SetDebugLogFile)(const char *logfile);

#if defined(RELEASE)
#define LOGPRINT(txt) \
  do                  \
  {                   \
  } while(0)
#else
// define this to something to get logging
//#define LOGPRINT(txt) OutputDebugStringW(txt)
#define LOGPRINT(txt) \
  do                  \
  {                   \
  } while(0)
#endif

void CheckHook()
{
  ShimData *data = NULL;

  HANDLE datahandle = OpenFileMappingA(FILE_MAP_READ, FALSE, GLOBAL_HOOK_DATA_NAME);

  if(datahandle == NULL)
  {
    LOGPRINT(L"renderdocshim: can't open global data\n");
    return;
  }

  data = (ShimData *)MapViewOfFile(datahandle, FILE_MAP_READ, 0, 0, sizeof(ShimData));

  if(data == NULL)
  {
    CloseHandle(datahandle);
    LOGPRINT(L"renderdocshim: can't map global data\n");
    return;
  }

  if(data->pathmatchstring[0] == 0 || data->pathmatchstring[1] == 0 ||
     data->pathmatchstring[2] == 0 || data->pathmatchstring[3] == 0)
  {
    LOGPRINT(L"renderdocshim: invalid pathmatchstring: '");
    LOGPRINT(data->pathmatchstring);
    LOGPRINT(L"'\n");

    UnmapViewOfFile(data);
    CloseHandle(datahandle);
    return;
  }

  // no new[], need to use VirtualAlloc
  const int exepathLen = 1024;
  wchar_t *exepath = (wchar_t *)VirtualAlloc(NULL, exepathLen * sizeof(wchar_t),
                                             MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);

  if(exepath)
  {
    // no memset :).
    for(int i = 0; i < exepathLen; i++)
      exepath[i] = 0;

    GetModuleFileNameW(NULL, exepath, exepathLen - 1);

    // no str*cmp functions
    int find = FindStringOrdinal(FIND_FROMSTART, exepath, -1, data->pathmatchstring, -1, TRUE);

    if(find >= 0)
    {
      LOGPRINT(L"renderdocshim: Hooking into '");
      LOGPRINT(exepath);
      LOGPRINT(L"', based on '");
      LOGPRINT(data->pathmatchstring);
      LOGPRINT(L"'\n");

      HMODULE mod = LoadLibraryW(data->rdocpath);

      if(mod)
      {
        pINTERNAL_SetCaptureOptions setopts =
            (pINTERNAL_SetCaptureOptions)GetProcAddress(mod, "INTERNAL_SetCaptureOptions");
        pINTERNAL_SetLogFile setlogfile =
            (pINTERNAL_SetLogFile)GetProcAddress(mod, "INTERNAL_SetLogFile");
        pRENDERDOC_SetDebugLogFile setdebuglog =
            (pRENDERDOC_SetDebugLogFile)GetProcAddress(mod, "RENDERDOC_SetDebugLogFile");

        if(setopts)
          setopts((const CaptureOptions *)data->opts);

        if(setlogfile && data->capfile[0])
          setlogfile(data->capfile);

        if(setdebuglog && data->debuglog[0])
          setdebuglog(data->debuglog);
      }
    }
    else
    {
      LOGPRINT(L"renderdocshim: NOT Hooking into '");
      LOGPRINT(exepath);
      LOGPRINT(L"', based on '");
      LOGPRINT(data->pathmatchstring);
      LOGPRINT(L"'\n");
    }

    VirtualFree(exepath, 0, MEM_RELEASE);
  }
  else
  {
    LOGPRINT(L"renderdocshim: Failed to allocate exepath\n");
  }

  UnmapViewOfFile(data);
  CloseHandle(datahandle);
}

DWORD CheckHookThread(LPVOID param)
{
  CheckHook();

  // this makes sure that we remove the reference to the shim dll and unload from
  // the target process. That minimises the impact of having the dll inserted into
  // every process
  FreeLibraryAndExitThread((HMODULE)param, 0);
  return 0;
}

BOOL APIENTRY dll_entry(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
  if(ul_reason_for_call == DLL_PROCESS_ATTACH)
  {
    DisableThreadLibraryCalls(hModule);

    // create a thread so that we can perform more complex actions (DllMain must be minimal
    // in size, even this is a bit dodgy).
    CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&CheckHookThread, (LPVOID)hModule, 0, NULL);
  }

  return TRUE;
}


text:
@interface PodsDummy_Pods_StickFlowLayoutDemo : NSObject
@end
@implementation PodsDummy_Pods_StickFlowLayoutDemo
@end


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

<title>NUnit - ConfigEditor</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-US">
<meta name="norton-safeweb-site-verification" content="tb6xj01p4hgo5x-8wscsmq633y11-e6nhk-bnb5d987bseanyp6p0uew-pec8j963qlzj32k5x9h3r2q7wh-vmy8bbhek5lnpp5w4p8hocouuq39e09jrkihdtaeknua" />
<link rel="stylesheet" type="text/css" href="nunit.css">
<link rel="shortcut icon" href="favicon.ico">

    NUnit
    Documentation

Configuration Editor

The Configuration Editor is displayed using the Project | Configuration | Edit… menu item and
supports the following operations:

Remove

Remove the selected configuration. If it was
the active config, then the next one in the list
is made active.

Rename

Rename the selected configuration.

Add…

Add a new configuration. The Add
Configuration dialog allows specifying an
existing configuration to use as a template.

Make Active

Makes the selected configuration active.

Close

Exits the configuration editor

NUnit 2.6.1

Getting Started

Writing Tests

Running Tests

Console Runner

Gui Runner

Command-Line

Main Menu

Context Menu

Settings Dialog

Addins Dialog

Test Properties

Configuration Editor

PNUnit Runner

NUnit Agent

Project Editor

Runtime Selection

Assembly Isolation

Configuration Files

Multiple Assemblies

Visual Studio Support

Extensibility

Release Notes

Samples

License

NUnit Test Adapter

License

  Copyright © 2012 Charlie Poole. All Rights Reserved.


text:
package tpe.nested.nonstaticmember;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.util.Random;

import de.smits_net.games.framework.board.Board;
import de.smits_net.games.framework.image.AnimatedImage;
import de.smits_net.games.framework.image.ImagePack;
import de.smits_net.games.framework.image.StripedImage;
import de.smits_net.games.framework.sprite.AnimatedSprite;
import de.smits_net.games.framework.sprite.Direction;
import de.smits_net.games.framework.sprite.Sprite.BoundaryPolicy;

/**
 * Spielfeld.
 */
public class GameBoard extends Board {

    /** Alien, das durch das Bild läuft. */
    private Alien alien;

    /**
     * Erzeugt ein neues Board.
     */
    public GameBoard() {
        // neues Spielfeld anlegen
        super(10, new Dimension(800, 300), Color.BLACK);

        // Alien initialisieren
        alien = new Alien(new Point(800, 50 + new Random().nextInt(100)));

        // Alien soll auf Maus-Klicks reagieren
//        addMouseListener(alien);
    }

    /**
     * Spielfeld neu zeichnen. Wird vom Framework aufgerufen.
     */
    @Override
    public void drawGame(Graphics g) {
        // Alien zeichnen
        alien.draw(g, this);
    }

    /**
     * Game-Over-Text anzeigen. Wird vom Framework aufgerufen.
     */
    @Override
    public void drawGameOver(Graphics g) {
        centerText(g, "Das Spiel ist aus!");
    }

    /**
     * Spielsituation updaten. Wird vom Framework aufgerufen.
     */
    @Override
    public boolean updateGame() {
        alien.move();
        return alien.isVisible();
    }

/**
 *
 * Ein Allien.
 *
 */
    class Alien extends AnimatedSprite {

        /** Geschwindigkeit des Alien X-Richtung. */
        private static final int ALIEN_SPEED = 2;

        /**
         * Neues Alien anlegen.
         *
         *  board das Spielfeld
         * @param startPoint Start-Position
         */
        Alien(Point startPoint) {
            super(GameBoard.this, startPoint, BoundaryPolicy.JUMP_BACK,
                    new AnimatedImage(50, // very odd
                            new ImagePack("assets", "ship01",
                                    "ship02", "ship03")));
            velocity.setVelocity(Direction.WEST, ALIEN_SPEED);

            addMouseListener(alien);
        }

        /**
         * Alien explodieren lassen.
         */
        public void explode() {
            setActive(false);
            setImages(new AnimatedImage(20,
                    new StripedImage("assets/explosion_1.png", 43)));
            setInvisibleAfterFrames(70);
        }

        /**
         * Klick auf das Alien lässt es explodieren.
         */
        @Override
        public void mousePressed() {
            explode();
        }
    }

}


text:
import contextlib
import os
import subprocess

from .tester import Tester
from .util import run_cmd, log

class GoTester(Tester):
    PRODUCER = True
    CONSUMER = True
    FLIGHT_SERVER = True
    FLIGHT_CLIENT = True

    # FIXME(sbinet): revisit for Go modules
    HOME = os.getenv('HOME', '~')
    GOPATH = os.getenv('GOPATH', os.path.join(HOME, 'go'))
    GOBIN = os.environ.get('GOBIN', os.path.join(GOPATH, 'bin'))

    GO_INTEGRATION_EXE = os.path.join(GOBIN, 'arrow-json-integration-test')
    STREAM_TO_FILE = os.path.join(GOBIN, 'arrow-stream-to-file')
    FILE_TO_STREAM = os.path.join(GOBIN, 'arrow-file-to-stream')

    FLIGHT_SERVER_CMD = [
        os.path.join(GOBIN, 'arrow-flight-integration-server')]
    FLIGHT_CLIENT_CMD = [
        os.path.join(GOBIN, 'arrow-flight-integration-client'),
        '-host', 'localhost']

    name = 'Go'

    def _run(self, arrow_path=None, json_path=None, command='VALIDATE'):
        cmd = [self.GO_INTEGRATION_EXE]

        if arrow_path is not None:
            cmd.extend(['-arrow', arrow_path])

        if json_path is not None:
            cmd.extend(['-json', json_path])

        cmd.extend(['-mode', command])

        if self.debug:
            log(' '.join(cmd))

        run_cmd(cmd)

    def validate(self, json_path, arrow_path, quirks=None):
        return self._run(arrow_path, json_path, 'VALIDATE')

    def json_to_file(self, json_path, arrow_path):
        return self._run(arrow_path, json_path, 'JSON_TO_ARROW')

    def stream_to_file(self, stream_path, file_path):
        cmd = [self.STREAM_TO_FILE, '<', stream_path, '>', file_path]
        self.run_shell_command(cmd)

    def file_to_stream(self, file_path, stream_path):
        cmd = [self.FILE_TO_STREAM, file_path, '>', stream_path]
        self.run_shell_command(cmd)

    @contextlib.contextmanager
    def flight_server(self, scenario_name=None):
        cmd = self.FLIGHT_SERVER_CMD + ['-port=0']
        if scenario_name:
            cmd = cmd + ['-scenario', scenario_name]
        if self.debug:
            log(' '.join(cmd))
        server = subprocess.Popen(cmd,
                                  stdout=subprocess.PIPE,
                                  stderr=subprocess.PIPE)

        try:
            output = server.stdout.readline().decode()
            if not output.startswith("Server listening on localhost:"):
                server.kill()
                out, err = server.communicate()
                raise RuntimeError(
                    "Flight-Go server did not start properly, "
                    "stdout: \n{}\n\nstderr:\n{}\n"
                    .format(output + out.decode(), err.decode())
                )
            port = int(output.split(":")[1])
            yield port
        finally:
            server.kill()
            server.wait(5)

    def flight_request(self, port, json_path=None, scenario_name=None):
        cmd = self.FLIGHT_CLIENT_CMD + [
            '-port=' + str(port),
        ]
        if json_path:
            cmd.extend(('-path', json_path))
        elif scenario_name:
            cmd.extend(('-scenario', scenario_name))
        else:
            raise TypeError("Must provide one of json_path or scenario_name")

        if self.debug:
            log(' '.join(cmd))
        run_cmd(cmd)


text:
package de.alpharogroup.user.service;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;

import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.torpedoquery.jpa.Torpedo;

import de.alpharogroup.collections.list.ListExtensions;
import de.alpharogroup.db.service.jpa.AbstractBusinessService;
import de.alpharogroup.random.RandomExtensions;
import de.alpharogroup.user.entities.UserTokens;
import de.alpharogroup.user.repositories.UserTokensDao;
import de.alpharogroup.user.service.api.UserTokensService;

@Transactional
@Service("userTokensService")
public class UserTokensBusinessService
	extends
		AbstractBusinessService<UserTokens, Integer, UserTokensDao>
	implements
		UserTokensService
{

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;

	@Override
	public UserTokens find(String username)
	{
		return ListExtensions.getFirst(findAll(username));
	}

	@Override
	public List<UserTokens> findAll(String username)
	{
		List<UserTokens> userTokens = null;
		final UserTokens from = Torpedo.from(UserTokens.class);
		Torpedo.where(from.getUsername()).eq(username);
		final org.torpedoquery.jpa.Query<UserTokens> select = Torpedo.select(from);
		userTokens = select.list(getDao().getEntityManager());
		return userTokens;
	}

	@Override
	public String getAutheticationToken(String username)
	{
		final UserTokens token = find(username);
		if (token != null)
		{
			return token.getToken();
		}
		return null;
	}

	@Override
	public boolean isValid(String token)
	{
		List<UserTokens> userTokens = null;
		final UserTokens from = Torpedo.from(UserTokens.class);
		Torpedo.where(from.getToken()).eq(token);
		final org.torpedoquery.jpa.Query<UserTokens> select = Torpedo.select(from);
		userTokens = select.list(getDao().getEntityManager());
		final boolean valid = CollectionUtils.isNotEmpty(userTokens);
		return valid;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String newAuthenticationToken(String username)
	{
		UserTokens userTokens = find(username);
		if (userTokens == null)
		{
			userTokens = merge(newUserTokens(username));
		}
		// check if expired
		final Date now = Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant());
		if (userTokens.getExpiry().before(now))
		{
			// expires in one year
			final Date expiry = Date.from(
				LocalDateTime.now().plusMonths(12).atZone(ZoneId.systemDefault()).toInstant());
			// create a token
			final String token = RandomExtensions.randomToken();
			userTokens.setExpiry(expiry);
			userTokens.setToken(token);
			userTokens = merge(userTokens);
		}
		return userTokens.getToken();
	}

	/**
	 * New user tokens.
	 *
	 * @param username
	 *            the username
	 * @return the user tokens
	 */
	private UserTokens newUserTokens(String username)
	{
		UserTokens userTokens;
		// expires in one year
		final Date expiry = Date
			.from(LocalDateTime.now().plusMonths(12).atZone(ZoneId.systemDefault()).toInstant());
		// create a token
		final String token = RandomExtensions.randomToken();
		userTokens = UserTokens.builder().expiry(expiry).username(username).token(token).build();
		return userTokens;
	}

	@Autowired
	public void setUserTokensDao(UserTokensDao userTokensDao)
	{
		setDao(userTokensDao);
	}

}


text:
package sun.jvm.hotspot.runtime;

import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.utilities.*;

public class MonitorInfo {
  private OopHandle owner;
  private BasicLock lock;
  private OopHandle ownerKlass;
  private boolean eliminated;
  private boolean ownerIsScalarReplaced;

  public MonitorInfo(OopHandle owner, BasicLock lock, boolean eliminated, boolean ownerIsScalarReplaced) {
    if (!ownerIsScalarReplaced) {
      this.owner = owner;
      this.ownerKlass = null;
    } else {
      Assert.that(eliminated, "monitor should be eliminated for scalar replaced object");
      this.owner = null;
      this.ownerKlass = owner;
    }
    this.eliminated = eliminated;
    this.ownerIsScalarReplaced = ownerIsScalarReplaced;
  }

  public OopHandle owner() {
   Assert.that(!ownerIsScalarReplaced, "should not be called for scalar replaced object");
   return owner;
  }

  public OopHandle ownerKlass() {
   Assert.that(ownerIsScalarReplaced, "should not be called for not scalar replaced object");
   return ownerKlass;
  }

  public BasicLock lock()  { return lock; }
  public boolean eliminated() { return eliminated; }
  public boolean ownerIsScalarReplaced() { return ownerIsScalarReplaced; }
}


text:
"""Add ``conf`` column in ``dag_run`` table

Revision ID: 40e67319e3a9
Revises: 2e541a1dcfed
Create Date: 2015-10-29 08:36:31.726728

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = '40e67319e3a9'
down_revision = '2e541a1dcfed'
branch_labels = None
depends_on = None
airflow_version = '1.6.0'

def upgrade():
    op.add_column('dag_run', sa.Column('conf', sa.PickleType(), nullable=True))

def downgrade():
    op.drop_column('dag_run', 'conf')


text:
require 'test_helper'

class NotifyTest < ActionMailer::TestCase
  test "welcome" do
    mail = Notify.welcome
    assert_equal "Welcome", mail.subject
    assert_equal ["to@example.org"], mail.to
    assert_equal ["from@example.com"], mail.from
    assert_match "Hi", mail.body.encoded
  end

end


text:
package astava.java.parser;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.stream.Collectors;

import static astava.java.DomFactory.ret;

public class MutableClassDomBuilder implements ClassDomBuilder {
    private int modifier;
    private String name;
    private String superName;
    private Hashtable<String, FieldDomBuilder> fieldBuilders = new Hashtable<>();
    private Hashtable<String, MethodDomBuilder> methodBuilders = new Hashtable<>();
    private ArrayList<String> interfaces = new ArrayList<>();
    //private ArrayList<FieldDomBuilder> fieldBuilders = new ArrayList<>();
    //private ArrayList<MethodDomBuilder> methodBuilders = new ArrayList<>();

    public void setModifier(int modifier) {
        this.modifier = modifier;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public List<FieldDomBuilder> getFields() {
        return fieldBuilders.values().stream().collect(Collectors.toList());
    }

    @Override
    public List<MethodDomBuilder> getMethods() {
        return methodBuilders.values().stream().collect(Collectors.toList());
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setSuperName(String superName) {
        this.superName = superName;
    }

    @Override
    public String getSuperName() {
        return superName;
    }

    public void addField(FieldDomBuilder fieldBuilder) {
        fieldBuilders.put(fieldBuilder.getName(), fieldBuilder);
    }

    public void addMethod(MethodDomBuilder methodBuilder) {
        methodBuilders.put(methodBuilder.getName(), methodBuilder);
    }

    @Override
    public ClassDeclaration build(ClassResolver classResolver) {
        List<FieldDeclaration> fieldDeclarations = getFields().stream().map(x -> x.declare(classResolver)).collect(Collectors.toList());
        List<MethodDeclaration> methodDeclarations = getMethods().stream().map(x -> x.declare(classResolver)).collect(Collectors.toList());

        /*// Add default constructor if necessary
        boolean hasConstructors = methodDeclarations.stream().anyMatch(x -> x.getName().equals("<init>"));
        if(!hasConstructors) {
            methodDeclarations.add(new MethodDeclaration() {
                @Override
                public int getModifier() {
                    return Modifier.PUBLIC;
                }

                @Override
                public String getName() {
                    return "<init>";
                }

                @Override
                public List<ParameterInfo> getParameterTypes() {
                    return Arrays.asList();
                }

                @Override
                public String getReturnTypeName() {
                    return Descriptor.VOID;
                }ghm

                @Override
                public MethodDom build(ClassDeclaration classDeclaration) {
                    return methodDeclaration(Modifier.PUBLIC, "<init>", Arrays.asList(), Descriptor.VOID, block(Arrays.asList(
                        invokeSpecial(Descriptor.get("java/lang/Object"), "<init>", Descriptor.getMethodDescriptor(Arrays.asList(), Descriptor.VOID), self(), Arrays.asList()),
                        ret()
                    )));
                }
            });
        }*/

        return new ClassDeclaration() {
            @Override
            public List<FieldDeclaration> getFields() {
                return fieldDeclarations;
            }

            @Override
            public List<MethodDeclaration> getMethods() {
                return methodDeclarations;
            }

            @Override
            public int getModifiers() {
                return modifier;
            }

            @Override
            public String getName() {
                return name;
            }

            @Override
            public String getSuperName() {
                return superName;
            }

            @Override
            public List<String> getInterfaces() {
                return interfaces;
            }

            @Override
            public boolean isInterface() {
                return false;
            }
        };

        /*List<FieldDom> fields = fieldDeclarations.stream().map(x -> x.build(cd)).collect(Collectors.toList());
        List<MethodDom> methods = methodDeclarations.stream().map(x -> x.build(cd)).collect(Collectors.toList());

        return new ClassDom() {
            @Override
            public int getModifier() {
                return modifier;
            }

            @Override
            public String getName() {
                return name;
            }

            @Override
            public String getSuperName() {
                return superName;
            }

            @Override
            public List<FieldDom> getFields() {
                return fields;
            }

            @Override
            public List<MethodDom> getMethods() {
                return methods;
            }
        };*/
    }

    @Override
    public String toString() {
        return "fields=" + getFields().stream().map(x -> x.getName()).collect(Collectors.toList());
    }

    public void addInterface(String typeName) {
        interfaces.add(typeName);
    }
}


text:
package com.nagopy.android.disablemanager2;

import android.os.Build;
import android.util.Log;

import com.android.uiautomator.core.Configurator;
import com.android.uiautomator.core.UiDevice;
import com.android.uiautomator.core.UiObject;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static junit.framework.Assert.fail;

/**
 * uiautomatorのテスト用ユーティリティクラス.
 */
public class TestUtils {

    /**
     * {@link #sleep()}のデフォルト停止時間.
     */
    private static final long WAIT_MS = 251;

    public static final String PACKAGE_NAME = "com.nagopy.android.disablemanager2";
    public static final String TAG = "nagopy_uiautomator";

    /**
     * コンストラクタ.
     */
    private TestUtils() {
    }

    /**
     * 標準出力.
     */
    private static void out(Object obj) {
        System.out.println(obj == null ? "null" : obj.toString());
    }

    /**
     * 標準エラー.
     */
    private static void err(Throwable t) {
        System.err.println(t.getMessage());
    }

    /**
     * デバッグログ出力.
     */
    public static void debugLog(Object obj) {
        Log.d(TAG, obj == null ? "null" : obj.toString());
    }

    /**
     * INFOログ出力+標準出力.
     */
    public static void infoLog(Object obj) {
        Log.i(TAG, obj == null ? "null" : obj.toString());
        out(obj);
    }

    /**
     * 警告ログ出力+標準出力.
     */
    public static void warningLog(Object obj) {
        Log.w(TAG, obj == null ? "null" : obj.toString());
        out(obj);
    }

    /**
     * エラーログ出力+エラー出力.
     */
    public static void errorLog(Throwable t) {
        Log.e(TAG, t.getMessage());
        err(t);
    }

    /**
     * スレッドを一時停止する.
     */
    public static void sleep() {
        sleep(WAIT_MS);
    }

    /**
     * スレッドを一時停止する.
     *
     * @param time 停止時間(ミリ秒)
     */
    public static void sleep(long time) {
        try {
            Thread.sleep(time);
        } catch (InterruptedException e) {
            // ignore
        }
    }

    /**
     * 対象アプリが表示されているかを確認する.
     *
     * @param packageName パッケージ名
     * @return 指定されたパッケージのなんらかの要素が存在すればtrue
     */
    public static boolean isTargetApp(String packageName) {
        return new UiObject(new UiSelectorBuilder().packageName(packageName).build()).exists();
    }

    /**
     * スクリーンショットを撮る.

     * API17未満の場合は何もしない。
     *
     * @param uiDevice  {@link com.android.uiautomator.testrunner.UiAutomatorTestCase#getUiDevice()}
     * @param outputDir 出力ディレクトリ
     * @param fileName  出力ファイル名
     */
    public static void takeScreenshot(UiDevice uiDevice, String outputDir, String fileName) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
            // API17未満は機能自体がないためここで終了
            return;
        }

        TestUtils.sleep(); // ちょっとWaitしてちゃんとSSに映るようにする

        File ss = new File(outputDir, fileName);
        if (!uiDevice.takeScreenshot(ss)) {
            fail("スクリーンショットの保存に失敗 path=" + ss.getAbsolutePath());
        }
    }

    /**
     * タイムアウト時間の設定等を行う.

     * API18未満の場合は何もしない。
     */
    public static void initConfigure() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
            Configurator configurator = Configurator.getInstance();
            configurator.setWaitForSelectorTimeout(WAIT_MS);
        }
    }

    /**
     * 対象アプリが表示されなくなるまでバックキーを押し続ける.
     *
     * @param uiDevice    {@link com.android.uiautomator.testrunner.UiAutomatorTestCase#getUiDevice()}
     * @param packageName 対象アプリのパッケージ名
     */
    public static void finishApp(UiDevice uiDevice, String packageName) {
        while (TestUtils.isTargetApp(packageName)) {
            uiDevice.pressBack();
        }
    }

    private static final List<String> ignoreAppPrefixList;

    static {
        List<String> tmpIgnoreAppList = new ArrayList<>();
        tmpIgnoreAppList.add("com.google.android.gms"); // 開発者サービス
        tmpIgnoreAppList.add("jp.co.nttdocomo");
        tmpIgnoreAppList.add("com.nttdocomo");
        tmpIgnoreAppList.add("com.sonyericsson");
        tmpIgnoreAppList.add("com.sonymobile");
        ignoreAppPrefixList = Collections.unmodifiableList(tmpIgnoreAppList);
    }

    public static boolean isIgnorePackage(String packageName) {
        for (String ignorePrefix : ignoreAppPrefixList) {
            if (packageName.startsWith(ignorePrefix)) {
                return true;
            }
        }
        return false;
    }
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _angularCakephp = require('../angular-cakephp');

var _lodash = require('lodash');

var _lodash2 = _interopRequireDefault(_lodash);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var MESSAGE_DELETE_ERROR_NO_ID = 'Can not delete record with no ID';
var MESSAGE_VIEW_ERROR_NO_ID = 'Can not view record with no ID';

/**
 * Class ActiveRecord
 */

var ActiveRecord = function () {

    /**
     * @constructor
     * @param  {Object} data  = {}
     * @param  {Class Instance} model = null
     * @param  {Boolean} map_data = true
     */
    function ActiveRecord() {
        var data = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
        var model = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
        var map_data = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];

        _classCallCheck(this, ActiveRecord);

        this.model = !_lodash2.default.isNull(model) ? model : _angularCakephp.BaseModel;
        this.mapData = !_lodash2.default.isNull(map_data) ? map_data : true;

        // map data
        if (this.mapData) {
            for (var prop in data) {
                this[prop] = data[prop];
            }
        }
    }

    /**
     * mapData
     * Whether or not to atomatically map provided data to class properties
     */

    _createClass(ActiveRecord, [{
        key: 'getClassName',

        /**
         * getClassName
         */
        value: function getClassName() {
            // get Active Record class name from Class.constructor.name if it's not 'Function', otherwise  get from Class.name
            return this.constructor.name !== 'Function' ? this.constructor.name : !_lodash2.default.isUndefined(this.name) ? this.name : null;
        }

        //-----------------------
        // methods
        //-----------------------

        /**
         * view
         * @param  {Object} config = {}
         * @return {Promise}
         */

    }, {
        key: 'view',
        value: function view() {
            var config = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

            // view (no id)
            if (!_lodash2.default.has(this, 'id') || _lodash2.default.isUndefined(this.id)) {
                throw new Error(MESSAGE_VIEW_ERROR_NO_ID);
            }

            // edit
            return this.model.view(this.constructor, this.id, config);
        }

        /**
         * save
         * runs RestApi save or edit depending on whether anid is set
         *
         * @param  {Object} config = {}
         * @return {Promise}
         */

    }, {
        key: 'save',
        value: function save() {
            var config = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

            // add (no id)
            if (!_lodash2.default.has(this, 'id') || _lodash2.default.isUndefined(this.id)) {
                return this.model.add(this.constructor, this, config);
            }

            // edit
            return this.model.edit(this.constructor, this.id, this, config);
        }

        /**
         * delete
         *
         * @param  {Object} config = {}
         * @return {Promise}
         */

    }, {
        key: 'delete',
        value: function _delete() {
            var config = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

            // no id
            if (!_lodash2.default.has(this, 'id') || _lodash2.default.isUndefined(this.id)) {
                throw new Error(MESSAGE_DELETE_ERROR_NO_ID);
            }

            // delete
            return this.model.delete(this.constructor, this.id, config);
        }
    }, {
        key: 'clone',
        value: function clone() {
            return new this.constructor(this, this.model, this.mapData);
        }
    }, {
        key: 'mapData',
        get: function get() {
            return this._map_data;
        },
        set: function set(value) {
            this._map_data = value;
        }

        /**
         * model
         */

    }, {
        key: 'model',
        get: function get() {
            return this._model;
        },
        set: function set(value) {
            this._model = value;
        }
    }]);

    return ActiveRecord;
}();

// constants

exports.default = ActiveRecord;
ActiveRecord.MESSAGE_DELETE_ERROR_NO_ID = MESSAGE_DELETE_ERROR_NO_ID;
ActiveRecord.MESSAGE_VIEW_ERROR_NO_ID = MESSAGE_VIEW_ERROR_NO_ID;


text:
<?php

$ftype = (true) ? "min." : "";
$paramIndex = 1;
$code = "";
while(isset($_REQUEST[$paramIndex]))
{
    if(strtolower($_REQUEST[$paramIndex])=="style.min.css")
        $code .= file_get_contents("./templates/style.".$ftype."css");
    else if(strtolower($_REQUEST[$paramIndex])=="chatv23/style.min.css")
        $code .= file_get_contents("./templates/overlays/chatv23/style.".$ftype."css");
    else if(strtolower($_REQUEST[$paramIndex])=="jsglobal.min.js")
    {
        $code .= file_get_contents("./templates/jscriptv23/jsglobal.".$ftype."js");
        $code .= file_get_contents("./templates/jscriptv23/icons.".$ftype."js");
    }
    else if(strtolower($_REQUEST[$paramIndex])=="jsbox.min.js")
    {
        $code .= file_get_contents("./templates/jscriptv23/jsbox.".$ftype."js");
        $code .= file_get_contents("./templates/jscriptv23/jsboxv2.".$ftype."js");
    }
    else if(strtolower($_REQUEST[$paramIndex])=="jstrack.min.js")
        $code .= file_get_contents("./templates/jscriptv23/jstrack.".$ftype."js");
    else if(strtolower($_REQUEST[$paramIndex])=="jsextern.min.js")
        $code .= file_get_contents("./templates/overlays/chatv23/jsextern.".$ftype."js");

    $paramIndex++;
}
if($_REQUEST["t"]=="css")
    header("Content-Type: text/css");
else
    header("Content-Type: application/javascript");

$expires = 60*60*24;
header("Pragma: public");
header("Cache-Control: maxage=".$expires);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
exit($code);
?>


text:
import * as expect from 'expect'
import { Toolbox } from '../core/toolbox'
import loggerExtension from './logger-extension'

const toolbox = new Toolbox()
loggerExtension(toolbox)

const { logger } = toolbox

test('info', () => {
  expect(typeof logger.info).toBe('function')
})

test('warn', () => {
  expect(typeof logger.warn).toBe('function')
})

test('success', () => {
  expect(typeof logger.success).toBe('function')
})

test('error', () => {
  expect(typeof logger.error).toBe('function')
})

test('newline', () => {
  expect(typeof logger.newline).toBe('function')
})

test('table', () => {
  expect(typeof logger.table).toBe('function')
})

test('spin', () => {
  expect(typeof logger.spin).toBe('function')
})

test('colors', () => {
  expect(typeof logger.colors.highlight).toBe('function')
  expect(typeof logger.colors.info).toBe('function')
  expect(typeof logger.colors.warning).toBe('function')
  expect(typeof logger.colors.success).toBe('function')
  expect(typeof logger.colors.error).toBe('function')
  expect(typeof logger.colors.line).toBe('function')
  expect(typeof logger.colors.muted).toBe('function')
})


text:
export LC_ALL=C.UTF-8

set -o errexit; source ./ci/test/00_setup_env.sh
set -o errexit; source ./ci/lint/04_install.sh
set -o errexit; source ./ci/lint/06_script.sh


text: Viper.js - Tag/Event Loader library


text:
package org.kuali.rice.krad.uif.util;

import java.util.List;
import java.util.Map;

import org.kuali.rice.core.api.util.type.KualiDecimal;
import org.kuali.rice.kim.api.identity.Person;

/**
 * Mock person implementation.
 */
public class MockPerson implements Person {

    private static final long serialVersionUID = 5330488987382249417L;

    private final String id;

    public MockPerson() {
        id = null;
    }

    MockPerson(String id) {
        this.id = id;
    }

    @Override
    public void refresh() {}

    @Override
    public String getPrincipalId() {
        return id;
    }

    @Override
    public String getPrincipalName() {
        return id;
    }

    @Override
    public String getEntityId() {
        return id;
    }

    @Override
    public String getEntityTypeCode() {
        return null;
    }

    @Override
    public String getFirstName() {
        return "Test";
    }

    @Override
    public String getFirstNameUnmasked() {
        return "Test";
    }

    @Override
    public String getMiddleName() {
        return "User";
    }

    @Override
    public String getMiddleNameUnmasked() {
        return "User";
    }

    @Override
    public String getLastName() {
        return id;
    }

    @Override
    public String getLastNameUnmasked() {
        return id;
    }

    @Override
    public String getName() {
        return "Test User " + id;
    }

    @Override
    public String getNameUnmasked() {
        return "Test User " + id;
    }

    @Override
    public String getEmailAddress() {
        return null;
    }

    @Override
    public String getEmailAddressUnmasked() {
        return null;
    }

    @Override
    public String getAddressLine1() {
        return null;
    }

    @Override
    public String getAddressLine1Unmasked() {
        return null;
    }

    @Override
    public String getAddressLine2() {
        return null;
    }

    @Override
    public String getAddressLine2Unmasked() {
        return null;
    }

    @Override
    public String getAddressLine3() {
        return null;
    }

    @Override
    public String getAddressLine3Unmasked() {
        return null;
    }

    @Override
    public String getAddressCity() {
        return null;
    }

    @Override
    public String getAddressCityUnmasked() {
        return null;
    }

    @Override
    public String getAddressStateProvinceCode() {
        return null;
    }

    @Override
    public String getAddressStateProvinceCodeUnmasked() {
        return null;
    }

    @Override
    public String getAddressPostalCode() {
        return null;
    }

    @Override
    public String getAddressPostalCodeUnmasked() {
        return null;
    }

    @Override
    public String getAddressCountryCode() {
        return null;
    }

    @Override
    public String getAddressCountryCodeUnmasked() {
        return null;
    }

    @Override
    public String getPhoneNumber() {
        return null;
    }

    @Override
    public String getPhoneNumberUnmasked() {
        return null;
    }

    @Override
    public String getCampusCode() {
        return null;
    }

    @Override
    public Map<String, String> getExternalIdentifiers() {
        return null;
    }

    @Override
    public boolean hasAffiliationOfType(String affiliationTypeCode) {
        return false;
    }

    @Override
    public List<String> getCampusCodesForAffiliationOfType(String affiliationTypeCode) {
        return null;
    }

    @Override
    public String getEmployeeStatusCode() {
        return null;
    }

    @Override
    public String getEmployeeTypeCode() {
        return null;
    }

    @Override
    public KualiDecimal getBaseSalaryAmount() {
        return null;
    }

    @Override
    public String getExternalId(String externalIdentifierTypeCode) {
        return null;
    }

    @Override
    public String getPrimaryDepartmentCode() {
        return null;
    }

    @Override
    public String getEmployeeId() {
        return null;
    }

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

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2015 mgm technology partners GmbH

    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.

-->
<configuration>
	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
		<encoder>
			<pattern>%date{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{35} - %msg%n</pattern>
		</encoder>
	</appender>

	<root level="DEBUG">
		<appender-ref ref="console" />
	</root>
</configuration>


text:
<?php

namespace PHPExiftool\Driver\Tag\MXF;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class SDKVersion extends AbstractTag
{

    protected $Id = '060e2b34.0101.0102.03010201.05000000';

    protected $Name = 'SDKVersion';

    protected $FullName = 'MXF::Main';

    protected $GroupName = 'MXF';

    protected $g0 = 'MXF';

    protected $g1 = 'MXF';

    protected $g2 = 'Video';

    protected $Type = '?';

    protected $Writable = false;

    protected $Description = 'SDK Version';
}


text:
class Adddetailtousers < ActiveRecord::Migration
  def change
  	add_column :users, :profile_photo, :string
  	add_column :users, :cover_photo, :string
  end
end


text:
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ui.components;

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.SystemInfoRt;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.ComponentUtil;
import com.intellij.ui.mac.foundation.ID;
import com.intellij.util.NotNullProducer;
import com.intellij.util.ui.UIUtil;
import com.sun.jna.Callback;
import com.sun.jna.Pointer;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.awt.*;
import java.awt.event.AWTEventListener;
import java.awt.event.MouseEvent;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;

import static com.intellij.ui.mac.foundation.Foundation.*;

class MacScrollBarUI extends DefaultScrollBarUI {
  private static final List<Reference<MacScrollBarUI>> UI = new ArrayList<>();

  MacScrollBarUI(int thickness, int thicknessMax, int thicknessMin) {
    super(thickness, thicknessMax, thicknessMin);
  }

  MacScrollBarUI() {
    super(14, 14, 11);
  }

  @Override
  protected ScrollBarAnimationBehavior createBaseAnimationBehavior() {
    return new MacScrollBarAnimationBehavior(
      new Computable<JScrollBar>() {
        @Override
        public JScrollBar compute() {
          return myScrollBar;
        }
      },
      myTrack.animator,
      myThumb.animator);
  }

  @Override
  boolean isAbsolutePositioning(MouseEvent event) {
    return Behavior.JumpToSpot == Behavior.CURRENT.get();
  }

  @Override
  boolean isTrackClickable() {
    return isOpaque(myScrollBar) || (myAnimationBehavior.getTrackFrame() > 0 && myAnimationBehavior.getThumbFrame() > 0);
  }

  @Override
  boolean isTrackExpandable() {
    return !isOpaque(myScrollBar);
  }

  @Override
  void paintTrack(Graphics2D g, JComponent c) {
    if (myAnimationBehavior.getTrackFrame() > 0 && myAnimationBehavior.getThumbFrame() > 0 || isOpaque(c)) super.paintTrack(g, c);
  }

  @Override
  void paintThumb(Graphics2D g, JComponent c) {
    if (isOpaque(c)) {
      paint(myThumb, g, c, true);
    }
    else if (myAnimationBehavior.getThumbFrame() > 0) {
      paint(myThumb, g, c, false);
    }
  }

  @Override
  public void installUI(JComponent c) {
    super.installUI(c);
    updateStyle(Style.CURRENT.get());
    processReferences(this, null, null);
    AWTEventListener listener = MOVEMENT_LISTENER.getAndSet(null); // add only one movement listener
    if (listener != null) Toolkit.getDefaultToolkit().addAWTEventListener(listener, AWTEvent.MOUSE_MOTION_EVENT_MASK);
  }

  @Override
  public void uninstallUI(JComponent c) {
    processReferences(null, this, null);
    super.uninstallUI(c);
  }

  /**
   * The movement listener that is intended to do not hide shown thumb while mouse is moving.
   */
  private static final AtomicReference<AWTEventListener> MOVEMENT_LISTENER = new AtomicReference<>(new AWTEventListener() {
    @Override
    public void eventDispatched(AWTEvent event) {
      if (event != null && MouseEvent.MOUSE_MOVED == event.getID()) {
        Object source = event.getSource();
        if (source instanceof Component) {
          JScrollPane pane = ComponentUtil.getParentOfType((Class<? extends JScrollPane>)JScrollPane.class, (Component)source);
          if (pane != null) {
            pauseThumbAnimation(pane.getHorizontalScrollBar());
            pauseThumbAnimation(pane.getVerticalScrollBar());
          }
        }
      }
    }

    /**
     * Pauses animation of the thumb if it is shown.
     *
     * @param bar the scroll bar with custom UI
     */
    private void pauseThumbAnimation(JScrollBar bar) {
      Object object = bar == null ? null : bar.getUI();
      if (object instanceof MacScrollBarUI) {
        MacScrollBarUI ui = (MacScrollBarUI)object;
        if (0 < ui.myAnimationBehavior.getThumbFrame()) ui.myAnimationBehavior.onThumbMove();
      }
    }
  });

  /**
   * Processes references in the static list of references synchronously.
   * This method removes all cleared references and the reference specified to remove,
   * collects objects from other references into the specified list and
   * adds the reference specified to add.
   *
   * @param toAdd    the object to add to the static list of references (ignored if {@code null})
   * @param toRemove the object to remove from the static list of references (ignored if {@code null})
   * @param list     the list to collect all available objects (ignored if {@code null})
   */
  private static void processReferences(MacScrollBarUI toAdd, MacScrollBarUI toRemove, List<? super MacScrollBarUI> list) {
    synchronized (UI) {
      Iterator<Reference<MacScrollBarUI>> iterator = UI.iterator();
      while (iterator.hasNext()) {
        Reference<MacScrollBarUI> reference = iterator.next();
        MacScrollBarUI ui = reference.get();
        if (ui == null || ui == toRemove) {
          iterator.remove();
        }
        else if (list != null) {
          list.add(ui);
        }
      }
      if (toAdd != null) {
        UI.add(new WeakReference<>(toAdd));
      }
    }
  }

  private void updateStyle(Style style) {
    if (myScrollBar != null) {
      myScrollBar.setOpaque(style != Style.Overlay);
      myScrollBar.revalidate();
      myScrollBar.repaint();
      myAnimationBehavior.onThumbMove();
    }
  }

  private static ID createDelegate(String name, Pointer pointer, Callback callback) {
    ID delegateClass = allocateObjcClassPair(getObjcClass("NSObject"), name);
    if (!ID.NIL.equals(delegateClass)) {
      if (!addMethod(delegateClass, pointer, callback, "v@")) {
        throw new RuntimeException("Cannot add observer method");
      }
      registerObjcClassPair(delegateClass);
    }
    return invoke(name, "new");
  }

  private static <T> T callMac(NotNullProducer<? extends T> producer) {
    if (SystemInfo.isMac) {
      NSAutoreleasePool pool = new NSAutoreleasePool();
      try {
        return producer.produce();
      }
      catch (Throwable throwable) {
        Logger.getInstance(MacScrollBarUI.class).warn(throwable);
      }
      finally {
        pool.drain();
      }
    }
    return null;
  }

  private enum Behavior {
    NextPage, JumpToSpot;

    private static final Native<Behavior> CURRENT = new Native<>() {
      @NotNull
      @Override
      public Behavior produce() {
        ID defaults = invoke("NSUserDefaults", "standardUserDefaults");
        invoke(defaults, "synchronize");
        ID behavior = invoke(defaults, "boolForKey:", nsString("AppleScrollerPagingBehavior"));
        Behavior value = 1 == behavior.intValue() ? JumpToSpot : NextPage;
        Logger.getInstance(MacScrollBarUI.class).debug("scroll bar behavior ", value, " from ", behavior);
        return value;
      }

      @Override
      public String toString() {
        return "scroll bar behavior";
      }

      @Override
      ID initialize() {
        return invoke(invoke("NSDistributedNotificationCenter", "defaultCenter"),
                      "addObserver:selector:name:object:",
                      createDelegate("JBScrollBarBehaviorObserver", createSelector("handleBehaviorChanged:"), this),
                      createSelector("handleBehaviorChanged:"),
                      nsString("AppleNoRedisplayAppearancePreferenceChanged"),
                      ID.NIL,
                      2 // NSNotificationSuspensionBehaviorCoalesce
        );
      }
    };
  }

  private enum Style {
    Legacy, Overlay;

    private static final Native<Style> CURRENT = new Native<>() {
      @Override
      public void run() {
        Style oldStyle = get();
        if (SystemInfoRt.isMac && !Registry.is("ide.mac.disableMacScrollbars", false)) {
          super.run();
        }
        Style newStyle = get();
        if (newStyle != oldStyle) {
          List<MacScrollBarUI> list = new ArrayList<>();
          processReferences(null, null, list);
          for (MacScrollBarUI ui : list) {
            ui.updateStyle(newStyle);
          }
        }
      }

      @NotNull
      @Override
      public Style produce() {
        ID style = invoke(getObjcClass("NSScroller"), "preferredScrollerStyle");
        Style value = 1 == style.intValue() ? Overlay : Legacy;
        Logger.getInstance(MacScrollBarUI.class).debug("scroll bar style ", value, " from ", style);
        return value;
      }

      @Override
      public String toString() {
        return "scroll bar style";
      }

      @Override
      ID initialize() {
        return invoke(invoke("NSNotificationCenter", "defaultCenter"),
                      "addObserver:selector:name:object:",
                      createDelegate("JBScrollBarStyleObserver", createSelector("handleScrollerStyleChanged:"), this),
                      createSelector("handleScrollerStyleChanged:"),
                      nsString("NSPreferredScrollerStyleDidChangeNotification"),
                      ID.NIL
        );
      }
    };
  }

  private static abstract class Native<T> implements Callback, Runnable, NotNullProducer<T> {
    private T myValue;

    Native() {
      Logger.getInstance(MacScrollBarUI.class).debug("initialize ", this);
      callMac(() -> initialize());
      UIUtil.invokeLaterIfNeeded(this);
    }

    abstract ID initialize();

    T get() {
      return myValue;
    }

    @SuppressWarnings("UnusedDeclaration")
    public void callback(ID self, Pointer selector, ID event) {
      Logger.getInstance(MacScrollBarUI.class).debug("update ", this);
      UIUtil.invokeLaterIfNeeded(this);
    }

    @Override
    public void run() {
      myValue = callMac(this);
    }
  }
}


text:
CC_BASE_PREFIX=/tmp/

# If you use arm, you may need more fine-tuning:
# arm hardfloat v7
#TRIPLE=arm-linux-musleabihf
#GCC_BOOTSTRAP_CONFFLAGS="--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16"
#GCC_CONFFLAGS="--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16"

# arm softfp
#TRIPLE=arm-linux-musleabi
#GCC_BOOTSTRAP_CONFFLAGS="--with-arch=armv7-a --with-float=softfp"
#GCC_CONFFLAGS="--with-arch=armv7-a --with-float=softfp"

GCC_BUILTIN_PREREQS=yes
MAKEFLAGS=-j8

# Enable this to build the bootstrap gcc (thrown away) without optimization, to reduce build time
GCC_STAGE1_NOOPT=1


text:
<?php
/**
 * Created with IntelliJ IDEA by Nick Chervyakov.
 * User: Nikolay Chervyakov
 * Date: 01.02.2016
 * Time: 15:48
 */

namespace PaymentBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Range;

/**
 * Class PaymentSelectionFormType
 * @package PaymentBundle\Form\Type
 */
class PaymentSelectionFormType extends AbstractType
{
    /**
     * @var array
     */
    protected $variants;

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $choices = [];
        foreach ($this->variants as $variant => $coins) {
            $choices["Pay $${variant} for $coins minutes chat with"] = $variant;
        }

        $choices['payment_selection.custom'] = 'custom';

        $builder->add('amount', 'choice', [
            'choices' => $choices,
            'choices_as_values' => true,
            'expanded' => true,
            'label' => 'payment_selection.amount'
        ]);

        $builder->add('custom', 'number', [
            'constraints' => [
                new Range([
                    'min' => 5,
                    'max' => 1000,
                    'minMessage' => 'payment_selection.min_error',
                    'maxMessage' => 'payment_selection.max_error',
                ])
            ],
            'error_bubbling' => true,
            'disabled' => true,
            'label' => 'payment_selection.custom'
        ]);

        $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) {
            $form = $event->getForm();
            $data = $event->getData();

            if ($data === null) {
                $data = [];
            }

            if ($data['amount'] === 'custom') {
                $custom = $form->get('custom')->getConfig();
                $options = $custom->getOptions();

                $newOptions = $options;
                $newOptions['disabled'] = false;
                $newOptions['constraints'][] = new NotBlank();

                $form->add('custom', $custom->getType()->getName(), $newOptions);
            }
        });
    }

    public function configureOptions(OptionsResolver $resolver)
    {
    }

    public function getName()
    {
        return 'payment_selection';
    }

    public function setVariants($variants)
    {
        if (!is_array($variants)) {
            $variants = [];
        }

        $this->variants = $variants;
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `HuffmanDecoderError` enum in crate `tokio_http2`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, HuffmanDecoderError">

    <title>tokio_http2::hpack::huffman::HuffmanDecoderError - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../../../main.css">

    <link rel="shortcut icon" href="https://lambdastackio.github.io/static/images/favicon.ico">

tokio_http2::<wbr>hpack::<wbr>huffman

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options…"
                       type="search">

        </form>

Enum tokio_http2::<wbr>hpack::<wbr>huffman::<wbr>HuffmanDecoderError

                       [−]

               [src]

pub enum HuffmanDecoderError {
    PaddingTooLarge,
    InvalidPadding,
    EOSInString,
}

Represents the error variants that the HuffmanDecoder can return.

Variants

PaddingTooLarge

Any padding strictly larger than 7 bits MUST be interpreted as an error

InvalidPadding

Any padding that does not correspond to the most significant bits of
EOS MUST be interpreted as an error.

EOSInString

If EOS is ever found in the string, it causes an error.

Trait Implementations

impl PartialEq for HuffmanDecoderError

[src]

fn eq(&self, __arg_0: &HuffmanDecoderError) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl Copy for HuffmanDecoderError

[src]

impl Clone for HuffmanDecoderError

[src]

fn clone(&self) -> HuffmanDecoderError

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Debug for HuffmanDecoderError

[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

Help

Keyboard Shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

+

Collapse/expand all sections

Search Tricks

                    Prefix searches with a type followed by a colon (e.g.
                    fn:) to restrict the search to a given type.

                    Accepted types are: fn, mod,
                    struct, enum,
                    trait, type, macro,
                    and const.

                    Search functions by type signature (e.g.
                    vec -> usize or * -> vec)


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Plotting EEG sensors on the scalp — MNE 0.21.2 documentation</title>
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/bootstrap_divs.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/gallery.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/gallery-binder.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/gallery-dataframe.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/gallery-rendered-html.css" />

    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />

    <link rel="canonical" href="https://mne.tools/stable/index.html" />

    <link rel="stylesheet" href="../../_static/style.css " type="text/css" />
    <link rel="stylesheet" href="../../_static/font-awesome.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/font-source-code-pro.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/font-source-sans-pro.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/flag-icon.css" type="text/css" />

<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">

        </button>

        0.21.2

Install

Overview

Tutorials

Examples

Glossary

API

              More

 GitHub

 Get help

 Contribute

 Cite MNE

              <button type="button" class="btn btn-primary btn-sm navbar-btn dropdown-toggle" id="dLabelMore" data-toggle="dropdown" style="margin-left: 10px">
              v0.21.2

            </button>

Development

v0.21 (stable)

v0.20

v0.19

v0.18

v0.17

v0.16

v0.15

v0.14

v0.13

v0.12

v0.11

<form class="navbar-form navbar-right" action="../../search.html" method="get">

  <input type="text" name="q" class="form-control" placeholder="Search" />

  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>

Note

Click here
to download the full example code

Plotting EEG sensors on the scalp¶

In this example, digitized EEG sensor locations are shown on the scalp.

Out:

Opening raw data file /home/circleci/mne_data/MNE-sample-data/MEG/sample/sample_audvis_raw.fif...
    Read a total of 3 projection items:
        PCA-v1 (1 x 102)  idle
        PCA-v2 (1 x 102)  idle
        PCA-v3 (1 x 102)  idle
    Range : 25800 ... 192599 =     42.956 ...   320.670 secs
Ready.
Using outer_skin.surf for head surface.

# Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)

import mne
from mne.viz import plot_alignment, set_3d_view

print(__doc__)

data_path = mne.datasets.sample.data_path()
subjects_dir = data_path + '/subjects'
trans = mne.read_trans(data_path + '/MEG/sample/sample_audvis_raw-trans.fif')
raw = mne.io.read_raw_fif(data_path + '/MEG/sample/sample_audvis_raw.fif')
fig = plot_alignment(raw.info, trans, subject='sample', dig=False,
                     eeg=['original', 'projected'], meg=[],
                     coord_frame='head', subjects_dir=subjects_dir)
set_3d_view(figure=fig, azimuth=135, elevation=80)

Total running time of the script: ( 0 minutes  16.635 seconds)

Estimated memory usage:  44 MB

Download Python source code: plot_eeg_on_scalp.py

Download Jupyter notebook: plot_eeg_on_scalp.ipynb

Gallery generated by Sphinx-Gallery

© Copyright 2012-2020, MNE Developers. Last updated on 2020-03-27.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProvaPrestadorServico.Models
{
    public class Prestador
    {
        public Guid Id { get; set; }
        public string Nome { get; set; }
        public string ServicoPrestado { get; set; }
        public string Telefone { get; set; }
        public Endereco Endereco { get; set; }
    }
}


text:
package com.example.spotifystreamer.model;

/**
 * Created by bill on 19/07/2015.
 */
public class TestStreamerContract {
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <TITLE>Adobe Software Technology Lab: dialog_result_t Struct Reference</TITLE>
    <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/>
    <LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/>
    <LINK REL="alternate" TITLE="stlab.adobe.com RSS" HREF="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1" TYPE="application/rss+xml"/>

Documentation

        Overview

        Building ASL

        Documentation

        Library Wiki Docs

        Indices

        Browse Perforce

More Info

        Release Notes

        Wiki

        Site Search

        License

        Success Stories

        Contributors

Media

        Download

        Perforce Depots

Support

        ASL SourceForge Home

        Mailing Lists

        Discussion Forums

        Report Bugs

        Suggest Features

        Contribute to ASL

RSS

        Short-text news

        Full-text news

        File releases

Other Adobe Projects

        Open @ Adobe

        Adobe Open Source

        Adobe Labs

        Adobe Media Gallery

        C++ Benchmarks

Other Resources

        Boost

        RIAForge

        SGI STL

adobe

dialog_result_t

Public Member Functions |
Public Attributes

dialog_result_t Struct Reference

[Modal Dialog Interface Kit]

#include <modal_dialog_interface.hpp>

List of all members.

Public Member Functions

dialog_result_t & 	operator= (const dialog_result_t &x)

Public Attributes

dictionary_t 	command_m

dictionary_t 	display_state_m

dictionary_t 	record_m

name_t 	terminating_action_m

Detailed Description

This is the struct returned by the handle_dialog API.

Definition at line 82 of file modal_dialog_interface.hpp.

Member Function Documentation

          dialog_result_t& operator=
          (
          const dialog_result_t &
           x )

Definition at line 84 of file modal_dialog_interface.hpp.

Member Data Documentation

          dictionary_t command_m

Contains the complete parameter set necessary to execute the function of which this dialog is intended to collect the parameters. While using handle_dialog it is assumed that there exists in the Adam model an output cell called result that will be fetched and whose value will be stuffed into this dictionary. Note the implication there is that the result cell itself is a dictionary of values.

Definition at line 128 of file modal_dialog_interface.hpp.

          dictionary_t display_state_m

Retained information as it pertains to the visual layout of the view (window location, size, etc.) and also as it pertains to the basic model of the view (what tab(s) are currently selected, what the state of other basic sheet cells are, etc.)

Definition at line 117 of file modal_dialog_interface.hpp.

          dictionary_t record_m

The set and touched record pair that need to be stored in order to script the dialog to re-execute the command that is being returned (also in this struct). Note that this record information stores the "intention" of the user, and may vary greatly from the actual values needed by the command in order to execute. This information is more "accurate" than the parameters needed for this instance of the execution because the input values may vary for a command from instance to instance, but retaining the intention of the user assures that they get what they want out of the command based on the parameters they explicitly set. Note that this information can be round-tripped over multiple instantiations of the handle_dialog API, resulting in a new instance of the dialog having the same intent with which the previous instance left off (aka previous values are retained).

Definition at line 109 of file modal_dialog_interface.hpp.

          name_t terminating_action_m

The name of the action that was used to terminate (close) the dialog. See the Action Callback section of this documentation for more information on how this value is set at runtime.

Definition at line 135 of file modal_dialog_interface.hpp.

Company |

Online Privacy Policy |

Terms of Use |

Contact Us |

Accessibility |

Report Piracy |

Permissions & Trademarks |

Product License Agreements |

Send Feedback

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google


text:
import os
import sys
from fontTools.ttLib import TTFont

def main(argv):
    for path in argv:
        if not os.path.exists(path):
            sys.stderr.write("[fix-fstype.py] ERROR: " + path + " is not a valid path to a font file")
            sys.exit(1)
        else:
            font = TTFont(path)
            font['OS/2'].fsType = 0
            font.save(path)
            print(path + " - successful fstype fix")

if __name__ == '__main__':
  main(sys.argv[1:])


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// Copied from https://github.com/aspnet/AspNetCore/tree/master/src/Http/Headers/src

using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Globalization;

#pragma warning disable IDE0018 // Inline declaration
#pragma warning disable IDE0032 // Use auto property
#pragma warning disable IDE0044 // Make field readonly

namespace Azure.Core.Http.Multipart
{
    internal abstract class HttpHeaderParser<T>
    {
        private bool _supportsMultipleValues;

        protected HttpHeaderParser(bool supportsMultipleValues)
        {
            _supportsMultipleValues = supportsMultipleValues;
        }

        public bool SupportsMultipleValues
        {
            get { return _supportsMultipleValues; }
        }

        // If a parser supports multiple values, a call to ParseValue/TryParseValue should return a value for 'index'
        // pointing to the next non-whitespace character after a delimiter. E.g. if called with a start index of 0
        // for string "value , second_value", then after the call completes, 'index' must point to 's', i.e. the first
        // non-whitespace after the separator ','.
        public abstract bool TryParseValue(StringSegment value, ref int index, out T parsedValue);

        public T ParseValue(StringSegment value, ref int index)
        {
            // Index may be value.Length (e.g. both 0). This may be allowed for some headers (e.g. Accept but not
            // allowed by others (e.g. Content-Length). The parser has to decide if this is valid or not.
            Contract.Requires((value == null) || ((index >= 0) && (index <= value.Length)));

            // If a parser returns 'null', it means there was no value, but that's valid (e.g. "Accept: "). The caller
            // can ignore the value.
            T result;
            if (!TryParseValue(value, ref index, out result))
            {
                throw new FormatException(string.Format(CultureInfo.InvariantCulture,
                    "The header contains invalid values at index {0}: '{1}'", index, value.Value ?? "<null>"));
            }
            return result;
        }

        public virtual bool TryParseValues(IList<string> values, out IList<T> parsedValues)
        {
            return TryParseValues(values, strict: false, parsedValues: out parsedValues);
        }

        public virtual bool TryParseStrictValues(IList<string> values, out IList<T> parsedValues)
        {
            return TryParseValues(values, strict: true, parsedValues: out parsedValues);
        }

        protected virtual bool TryParseValues(IList<string> values, bool strict, out IList<T> parsedValues)
        {
            Contract.Assert(_supportsMultipleValues);
            // If a parser returns an empty list, it means there was no value, but that's valid (e.g. "Accept: "). The caller
            // can ignore the value.
            parsedValues = null;
            List<T> results = null;
            if (values == null)
            {
                return false;
            }
            for (var i = 0; i < values.Count; i++)
            {
                var value = values[i];
                int index = 0;

                while (!string.IsNullOrEmpty(value) && index < value.Length)
                {
                    T output;
                    if (TryParseValue(value, ref index, out output))
                    {
                        // The entry may not contain an actual value, like " , "
                        if (output != null)
                        {
                            if (results == null)
                            {
                                results = new List<T>();    // Allocate it only when used
                            }
                            results.Add(output);
                        }
                    }
                    else if (strict)
                    {
                        return false;
                    }
                    else
                    {
                        // Skip the invalid values and keep trying.
                        index++;
                    }
                }
            }
            if (results != null)
            {
                parsedValues = results;
                return true;
            }
            return false;
        }

        public virtual IList<T> ParseValues(IList<string> values)
        {
            return ParseValues(values, strict: false);
        }

        public virtual IList<T> ParseStrictValues(IList<string> values)
        {
            return ParseValues(values, strict: true);
        }

        protected virtual IList<T> ParseValues(IList<string> values, bool strict)
        {
            Contract.Assert(_supportsMultipleValues);
            // If a parser returns an empty list, it means there was no value, but that's valid (e.g. "Accept: "). The caller
            // can ignore the value.
            var parsedValues = new List<T>();
            if (values == null)
            {
                return parsedValues;
            }
            foreach (var value in values)
            {
                int index = 0;

                while (!string.IsNullOrEmpty(value) && index < value.Length)
                {
                    T output;
                    if (TryParseValue(value, ref index, out output))
                    {
                        // The entry may not contain an actual value, like " , "
                        if (output != null)
                        {
                            parsedValues.Add(output);
                        }
                    }
                    else if (strict)
                    {
                        throw new FormatException(string.Format(CultureInfo.InvariantCulture,
                            "The header contains invalid values at index {0}: '{1}'", index, value));
                    }
                    else
                    {
                        // Skip the invalid values and keep trying.
                        index++;
                    }
                }
            }
            return parsedValues;
        }

        // If ValueType is a custom header value type (e.g. NameValueHeaderValue) it implements ToString() correctly.
        // However for existing types like int, byte[], DateTimeOffset we can't override ToString(). Therefore the
        // parser provides a ToString() virtual method that can be overridden by derived types to correctly serialize
        // values (e.g. byte[] to Base64 encoded string).
        // The default implementation is to just call ToString() on the value itself which is the right thing to do
        // for most headers (custom types, string, etc.).
        public virtual string ToString(object value)
        {
            Contract.Requires(value != null);

            return value.ToString();
        }
    }
}


text:
class Utils
  # Take a list of items (ie, course ids) and breaks it into chunks of 50.
  # The Wikipedia liststudents API takes a maximum of 50 course ids per request.
  def self.chunk_requests(items, chunk_size=50)
    blocks = items.each_slice(chunk_size).to_a
    results = []
    blocks.each do |b|
      info = yield b
      results.push(*info)
    end
    results
  end

  def self.parse_json(data)
    begin
      data = JSON.parse data
    rescue JSON::ParserError => e
      Rails.logger.error "Caught #{e}"
    end
    data
  end

  def self.run_on_all(model, method, array)
    array = [array] if array.is_a? model
    model.transaction do
      (array || model.current).each(&method)
    end
  end
end


text: require('../internals/define-well-known-symbol')('match');


text:
{# -*- coding: utf-8 -*-

  This file is part of Invenio.
  Copyright (C) 2015-2020 CERN.

  Invenio is free software; you can redistribute it and/or modify it
  under the terms of the MIT License; see LICENSE file for more details.
#}
{%- block navbar_search %}
<form class="navbar-form navbar-left" action="{{url_for('invenio_search_ui.search')}}" role="search">

      <input type="text" class="form-control" name="q" placeholder="{{_('Search')}}">

        <button type="submit" class="btn btn-default"></button>

</form>
{%- endblock navbar_search %}


text:
package org.onosproject.event;

import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;

/**
 * Basis for components which need to export listener mechanism.
 */
@Component(componentAbstract = true)
public abstract class AbstractListenerManager<E extends Event, L extends EventListener<E>>
    implements ListenerService<E, L> {

    protected final ListenerRegistry<E, L> listenerRegistry = new ListenerRegistry<>();

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected EventDeliveryService eventDispatcher;

    @Override
    public void addListener(L listener) {
        listenerRegistry.addListener(listener);
    }

    @Override
    public void removeListener(L listener) {
        listenerRegistry.removeListener(listener);
    }

    /**
     * Safely posts the specified event to the local event dispatcher.
     * If there is no event dispatcher or if the event is null, this method
     * is a noop.
     *
     * @param event event to be posted; may be null
     */
    protected void post(E event) {
        if (event != null && eventDispatcher != null) {
            eventDispatcher.post(event);
        }
    }

}


text:
'use strict';

var ReactDefaultInjection = require('./ReactDefaultInjection');
var ReactServerRendering = require('./ReactServerRendering');
var ReactVersion = require('./ReactVersion');

ReactDefaultInjection.inject();

var ReactDOMServer = {
  renderToString: ReactServerRendering.renderToString,
  renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
  version: ReactVersion
};

module.exports = ReactDOMServer;


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>Native query in Hibernate</title>
    <meta name="description" content="" />

    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="shortcut icon" href="https://celsogg.github.io/blog/favicon.ico">

    <link rel="stylesheet" type="text/css" href="//celsogg.github.io/blog/themes/casper/assets/css/screen.css?v=1486606250282" />
    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:300,700,700italic,300italic|Open+Sans:700,400" />

    <link rel="canonical" href="https://celsogg.github.io/blog/2017/02/08/Native-query-in-Hibernate.html" />
    <meta name="referrer" content="origin" />

    <meta property="og:type" content="website" />
    <meta property="og:title" content="Native query in Hibernate" />
    <meta property="og:description" content="String query = "select * from TABLE where COLUMN = '" + someStringParam + "'"; Session session = HibernateSessionFactory.getSession(); Query queryResult = session.createSQLQuery(query);	// queryResult.list() Statement Stmt = null; Connection connection = null; try {     HibernateSessionFactory.beginTransaction();     connection = HibernateSessionF" />
    <meta property="og:url" content="https://celsogg.github.io/blog/2017/02/08/Native-query-in-Hibernate.html" />
    <meta property="article:tag" content="java" />
    <meta property="article:tag" content=" hibernate" />
    <meta property="article:tag" content=" query" />

    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Native query in Hibernate" />
    <meta name="twitter:description" content="String query = "select * from TABLE where COLUMN = '" + someStringParam + "'"; Session session = HibernateSessionFactory.getSession(); Query queryResult = session.createSQLQuery(query);	// queryResult.list() Statement Stmt = null; Connection connection = null; try {     HibernateSessionFactory.beginTransaction();     connection = HibernateSessionF" />
    <meta name="twitter:url" content="https://celsogg.github.io/blog/2017/02/08/Native-query-in-Hibernate.html" />

    <meta name="generator" content="HubPress" />
    <link rel="alternate" type="application/rss+xml" title="" href="https://celsogg.github.io/blog/rss/" />

Native query in Hibernate

                <time class="post-date" datetime="2017-02-08">08 February 2017</time>  on java,  hibernate,  query

String query = "select * from TABLE where COLUMN = '" + someStringParam + "'";
Session session = HibernateSessionFactory.getSession();
Query queryResult = session.createSQLQuery(query);	// queryResult.list()

Statement Stmt = null;
Connection connection = null;
try {
    HibernateSessionFactory.beginTransaction();
    connection = HibernateSessionFactory.getSession().connection();
    Stmt = connection.createStatement();
    ResultSet rSet = Stmt.executeQuery("some update query");

    if (rSet.next()) {
    	System.out.println(rSet.getString("COLUMN_NAME"));
    }

    HibernateSessionFactory.getSession().flush();
    HibernateSessionFactory.commitTransaction();

} catch (Exception e) {
    e.printStackTrace();
} finally {
    try {
           HibernateSessionFactory.closeSession();
    } catch (PersistenceDataException e) {
            e.printStackTrace();
    }
}

                celsogg's Picture

celsogg

Read more posts by this author.

Share this post

                    Twitter

                    Facebook

                    Google+

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

 © 2017

Proudly published with HubPress