text:
package org.ethereum.net.peerdiscovery;

import org.ethereum.manager.WorldManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.ThreadPoolExecutor;

public class PeerDiscoveryMonitorThread implements Runnable {
    private final static Logger logger = LoggerFactory.getLogger("peerdiscovery");

    private ThreadPoolExecutor executor;
    private int seconds;
    private volatile boolean run = true;

	public PeerDiscoveryMonitorThread(ThreadPoolExecutor executor, int delay) {
		this.executor = executor;
		this.seconds = delay;
	}

    public void shutdown() {
		this.run = false;
    }

    @Override
    public void run() {
        while(run) {
            logger.trace(
                    String.format("[monitor] [%d/%d] Active: %d, Completed: %d, Task: %d, isShutdown: %s, isTerminated: %s, peersDiscovered: %d ",
                            this.executor.getPoolSize(),
                            this.executor.getCorePoolSize(),
                            this.executor.getActiveCount(),
                            this.executor.getCompletedTaskCount(),
                            this.executor.getTaskCount(),
                            this.executor.isShutdown(),
                            this.executor.isTerminated(),
                            WorldManager.getInstance().getPeers().size()));
            try {
                Thread.sleep(seconds*1000);
            } catch (InterruptedException e) {
            	logger.error("Thread interrupted", e);
            }
        }
    }
}


text:
IGr-Skeleton
============

Base classes and files to serve as a skeleton for learning OpenGL projects.

redpajama_set_name: RedPajamaGithub


text:
function oiKeyPress
% Define optical image window key press callbacks
%
% Syntax:
%   oiKeyPress
%
% Description:
%    This routine is set as the call back for the optical image key press
%    interpretation the key mappings are defined as:
%       ctl-D -- Delete current optical image
%       ctl-N -- Edit optical image name
%       ctl-R -- Refresh OI window
%
%    This routine is not called from the command line.
%
% Inputs:
%    None.
%
% Outputs:
%    None.
%
% Optional key/value pairs:
%    None.
%

% History:
%    xx/xx/05       Copyright ImagEval Consultants, LLC, 2005.
%    03/19/18  jnm  Formatting
%    07/01/19  JNM  Commented out duplicate case 8 (Ctrl+H) vs bkspc/del

% Read the current key press from the buffer. A control key is empty on
% first entry. But a ctrl-Value gets read properly on second entry.
key = double(get(gcf, 'CurrentCharacter'));

if isempty(key), return; end

handles = guihandles;
eventData = [];
hObject = handles.figure1;

switch key
    case {8 127} % Backspace and Delete
    case 3  % ctrl-C
    case 4  % ctrl-D
       oiWindow('oiDelete', hObject, eventData, handles);
    case 5  % ctrl-E
    case 6  % ctrl-F
    case 7  % ctrl-G
    % case 8  % ctrl-H
    case 9  % ctrl-I
    case 10  % ctrl-J
    case 11  % ctrl-K
    case 12  % ctrl-L
    case 13  % ctrl-M
    case 14 % ctrl-N
        oiWindow('menuEditName_Callback', hObject, eventData, handles)
    case 15 % ctrl-O
    case 16 % ctrl-P
    case 17 % ctrl-Q
    case 18 % ctrl-R
        oiWindow('oiRefresh', hObject, eventData, handles)
    case 19 % ctrl-S
    case 20 % ctrl-T
    case 21 % ctrl-U
    case 22 % ctrl-V
    case 23 % ctrl-W
    case 24 % ctrl-X
    case 25 % ctrl-Y
    case 26 % ctrl-Z
    case 97 % alt-A

    otherwise
        return;
end

return;


text:
// Copyright 2008 The Apache Software Foundation
//
// 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.

package org.apache.tapestry5.services;

import org.apache.tapestry5.ioc.AnnotationProvider;

/**
 * Defines a context for editing a bean via {@link org.apache.tapestry5.corelib.components.BeanEditor}.
 * This value is made available at render time via the {@link org.apache.tapestry5.annotations.Environmental} annotation.
 */
public interface BeanEditContext extends AnnotationProvider
{
    /**
     * @return The class of the bean under edit.
     */
    Class<?> getBeanClass();
}


text:
function tv_api_append(_args) {
	var win = Ti.UI.createWindow({
		title:_args.title
	});
	// create table view with empty data set and then append
	var tableview = Titanium.UI.createTableView();

	// append to row
	tableview.appendRow({hasChild:true,title:'Row 1 as Dictionary',header:'Header'});
	tableview.appendRow({hasChild:true,title:'Row 2 as Dictionary'});
	tableview.appendRow({hasChild:true,title:'Row 3 as Dictionary'});
	tableview.appendRow({hasChild:true,title:'Row 4 as Dictionary',footer:'Footer'});

	// now append with object
	tableview.appendRow(Ti.UI.createTableViewRow({hasChild:true,title:'Row 1 as API'}));
	tableview.appendRow(Ti.UI.createTableViewRow({hasDetail:true,title:'Row 2 as API'}));
	tableview.appendRow(Ti.UI.createTableViewRow({hasCheck:true,title:'Row 3 as API'}));
	tableview.appendRow(Ti.UI.createTableViewRow({title:'Row 4 as API'}));

	// create table view event listener
	tableview.addEventListener('click', function(e)
	{
		// event data
		var index = e.index;
		var section = e.section;
		var row = e.row;
		var rowdata = e.rowData;
		Titanium.UI.createAlertDialog({title:'Table View',message:'row ' + row + ' index ' + index + ' section ' + section  + ' row data ' + rowdata}).show();
	});

	// add table view to the window
	win.add(tableview);
	return win;
};

module.exports = tv_api_append;


text:
var Blast  = require('../index.js')();

suite('Date', function() {

	var date = new Date();

	bench('.create()', function() {
		Date.create();
	});

	bench('.isDate(var)', function() {
		Date.isDate(date);
	});
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <logbulk.version>0.1.0-dev</logbulk.version>
    <logbulk.tcp.version>0.1.0-dev</logbulk.tcp.version>
    <protobuf.version>2.6.1</protobuf.version>
    <lombok.version>1.16.14</lombok.version>
  </properties>
  <groupId>io.techcode.logbulk</groupId>
  <artifactId>logbulk-plugin-riemann</artifactId>
  <version>0.1.0-dev</version>

  <dependencies>
    <!-- RUN -->
    <dependency>
      <groupId>io.techcode.logbulk</groupId>
      <artifactId>logbulk</artifactId>
      <version>${logbulk.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.techcode.logbulk</groupId>
      <artifactId>logbulk-plugin-tcp</artifactId>
      <version>${logbulk.tcp.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>${protobuf.version}</version>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${lombok.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- TEST -->
    <dependency>
      <groupId>io.techcode.logbulk</groupId>
      <artifactId>logbulk-test</artifactId>
      <version>${logbulk.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <defaultGoal>clean package</defaultGoal>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19.1</version>
        <configuration>
          <argLine>
            -Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.SLF4JLogDelegateFactory
          </argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <minimizeJar>false</minimizeJar>
              <artifactSet>
                <includes>
                  <include>com.google.protobuf:protobuf-java</include>
                </includes>
              </artifactSet>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>


text:
//*****************************************************************************
//
// dma.h - Driver for the DMA Module.
//
//*****************************************************************************

#ifndef __MSP430WARE_DMA_H__
#define __MSP430WARE_DMA_H__

#include "inc/hw_memmap.h"

#if defined(__MSP430_HAS_DMAX_3__) || defined(__MSP430_HAS_DMAX_6__)

//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif

#include "inc/hw_regaccess.h"
//*****************************************************************************
//
//! \brief Used in the DMA_init() function as the param parameter.
//
//*****************************************************************************
typedef struct DMA_initParam
{
    //! Is the specified channel to initialize.
    //! \n Valid values are:
    //! - \b DMA_CHANNEL_0
    //! - \b DMA_CHANNEL_1
    //! - \b DMA_CHANNEL_2
    //! - \b DMA_CHANNEL_3
    //! - \b DMA_CHANNEL_4
    //! - \b DMA_CHANNEL_5
    //! - \b DMA_CHANNEL_6
    //! - \b DMA_CHANNEL_7
    uint8_t channelSelect;
    //! Is the transfer mode of the selected channel.
    //! \n Valid values are:
    //! - \b DMA_TRANSFER_SINGLE [Default]
    //! - \b DMA_TRANSFER_BLOCK
    //! - \b DMA_TRANSFER_BURSTBLOCK
    //! - \b DMA_TRANSFER_REPEATED_SINGLE
    //! - \b DMA_TRANSFER_REPEATED_BLOCK
    //! - \b DMA_TRANSFER_REPEATED_BURSTBLOCK
    uint16_t transferModeSelect;
    //! Is the amount of transfers to complete in a block transfer mode, as
    //! well as how many transfers to complete before the interrupt flag is
    //! set. Valid value is between 1-65535, if 0, no transfers will occur.
    uint16_t transferSize;
    //! Is the source that will trigger the start of each transfer, note that
    //! the sources are device specific.
    //! \n Valid values are:
    //! - \b DMA_TRIGGERSOURCE_0 [Default]
    //! - \b DMA_TRIGGERSOURCE_1
    //! - \b DMA_TRIGGERSOURCE_2
    //! - \b DMA_TRIGGERSOURCE_3
    //! - \b DMA_TRIGGERSOURCE_4
    //! - \b DMA_TRIGGERSOURCE_5
    //! - \b DMA_TRIGGERSOURCE_6
    //! - \b DMA_TRIGGERSOURCE_7
    //! - \b DMA_TRIGGERSOURCE_8
    //! - \b DMA_TRIGGERSOURCE_9
    //! - \b DMA_TRIGGERSOURCE_10
    //! - \b DMA_TRIGGERSOURCE_11
    //! - \b DMA_TRIGGERSOURCE_12
    //! - \b DMA_TRIGGERSOURCE_13
    //! - \b DMA_TRIGGERSOURCE_14
    //! - \b DMA_TRIGGERSOURCE_15
    //! - \b DMA_TRIGGERSOURCE_16
    //! - \b DMA_TRIGGERSOURCE_17
    //! - \b DMA_TRIGGERSOURCE_18
    //! - \b DMA_TRIGGERSOURCE_19
    //! - \b DMA_TRIGGERSOURCE_20
    //! - \b DMA_TRIGGERSOURCE_21
    //! - \b DMA_TRIGGERSOURCE_22
    //! - \b DMA_TRIGGERSOURCE_23
    //! - \b DMA_TRIGGERSOURCE_24
    //! - \b DMA_TRIGGERSOURCE_25
    //! - \b DMA_TRIGGERSOURCE_26
    //! - \b DMA_TRIGGERSOURCE_27
    //! - \b DMA_TRIGGERSOURCE_28
    //! - \b DMA_TRIGGERSOURCE_29
    //! - \b DMA_TRIGGERSOURCE_30
    //! - \b DMA_TRIGGERSOURCE_31
    uint8_t triggerSourceSelect;
    //! Is the specified size of transfers.
    //! \n Valid values are:
    //! - \b DMA_SIZE_SRCWORD_DSTWORD [Default]
    //! - \b DMA_SIZE_SRCBYTE_DSTWORD
    //! - \b DMA_SIZE_SRCWORD_DSTBYTE
    //! - \b DMA_SIZE_SRCBYTE_DSTBYTE
    uint8_t transferUnitSelect;
    //! Is the type of trigger that the trigger signal needs to be to start a
    //! transfer.
    //! \n Valid values are:
    //! - \b DMA_TRIGGER_RISINGEDGE [Default]
    //! - \b DMA_TRIGGER_HIGH
    uint8_t triggerTypeSelect;
} DMA_initParam;

//*****************************************************************************
//
// The following are values that can be passed to the triggerSourceSelect
// parameter for functions: DMA_init(); the param parameter for functions:
// DMA_init().
//
//*****************************************************************************
#define DMA_TRIGGERSOURCE_0                                              (0x00)
#define DMA_TRIGGERSOURCE_1                                              (0x01)
#define DMA_TRIGGERSOURCE_2                                              (0x02)
#define DMA_TRIGGERSOURCE_3                                              (0x03)
#define DMA_TRIGGERSOURCE_4                                              (0x04)
#define DMA_TRIGGERSOURCE_5                                              (0x05)
#define DMA_TRIGGERSOURCE_6                                              (0x06)
#define DMA_TRIGGERSOURCE_7                                              (0x07)
#define DMA_TRIGGERSOURCE_8                                              (0x08)
#define DMA_TRIGGERSOURCE_9                                              (0x09)
#define DMA_TRIGGERSOURCE_10                                             (0x0A)
#define DMA_TRIGGERSOURCE_11                                             (0x0B)
#define DMA_TRIGGERSOURCE_12                                             (0x0C)
#define DMA_TRIGGERSOURCE_13                                             (0x0D)
#define DMA_TRIGGERSOURCE_14                                             (0x0E)
#define DMA_TRIGGERSOURCE_15                                             (0x0F)
#define DMA_TRIGGERSOURCE_16                                             (0x10)
#define DMA_TRIGGERSOURCE_17                                             (0x11)
#define DMA_TRIGGERSOURCE_18                                             (0x12)
#define DMA_TRIGGERSOURCE_19                                             (0x13)
#define DMA_TRIGGERSOURCE_20                                             (0x14)
#define DMA_TRIGGERSOURCE_21                                             (0x15)
#define DMA_TRIGGERSOURCE_22                                             (0x16)
#define DMA_TRIGGERSOURCE_23                                             (0x17)
#define DMA_TRIGGERSOURCE_24                                             (0x18)
#define DMA_TRIGGERSOURCE_25                                             (0x19)
#define DMA_TRIGGERSOURCE_26                                             (0x1A)
#define DMA_TRIGGERSOURCE_27                                             (0x1B)
#define DMA_TRIGGERSOURCE_28                                             (0x1C)
#define DMA_TRIGGERSOURCE_29                                             (0x1D)
#define DMA_TRIGGERSOURCE_30                                             (0x1E)
#define DMA_TRIGGERSOURCE_31                                             (0x1F)

//*****************************************************************************
//
// The following are values that can be passed to the param parameter for
// functions: DMA_init(); the transferModeSelect parameter for functions:
// DMA_init().
//
//*****************************************************************************
#define DMA_TRANSFER_SINGLE                                           (DMADT_0)
#define DMA_TRANSFER_BLOCK                                            (DMADT_1)
#define DMA_TRANSFER_BURSTBLOCK                                       (DMADT_2)
#define DMA_TRANSFER_REPEATED_SINGLE                                  (DMADT_4)
#define DMA_TRANSFER_REPEATED_BLOCK                                   (DMADT_5)
#define DMA_TRANSFER_REPEATED_BURSTBLOCK                              (DMADT_6)

//*****************************************************************************
//
// The following are values that can be passed to the channelSelect parameter
// for functions: DMA_init(), DMA_setTransferSize(), DMA_getTransferSize(),
// DMA_setSrcAddress(), DMA_setDstAddress(), DMA_enableTransfers(),
// DMA_disableTransfers(), DMA_startTransfer(), DMA_enableInterrupt(),
// DMA_disableInterrupt(), DMA_getInterruptStatus(), DMA_clearInterrupt(),
// DMA_getNMIAbortStatus(), and DMA_clearNMIAbort(); the param parameter for
// functions: DMA_init().
//
//*****************************************************************************
#define DMA_CHANNEL_0                                                    (0x00)
#define DMA_CHANNEL_1                                                    (0x10)
#define DMA_CHANNEL_2                                                    (0x20)
#define DMA_CHANNEL_3                                                    (0x30)
#define DMA_CHANNEL_4                                                    (0x40)
#define DMA_CHANNEL_5                                                    (0x50)
#define DMA_CHANNEL_6                                                    (0x60)
#define DMA_CHANNEL_7                                                    (0x70)

//*****************************************************************************
//
// The following are values that can be passed to the triggerTypeSelect
// parameter for functions: DMA_init(); the param parameter for functions:
// DMA_init().
//
//*****************************************************************************
#define DMA_TRIGGER_RISINGEDGE                                    (!(DMALEVEL))
#define DMA_TRIGGER_HIGH                                             (DMALEVEL)

//*****************************************************************************
//
// The following are values that can be passed to the transferUnitSelect
// parameter for functions: DMA_init(); the param parameter for functions:
// DMA_init().
//
//*****************************************************************************
#define DMA_SIZE_SRCWORD_DSTWORD                   (!(DMASRCBYTE + DMADSTBYTE))
#define DMA_SIZE_SRCBYTE_DSTWORD                                   (DMASRCBYTE)
#define DMA_SIZE_SRCWORD_DSTBYTE                                   (DMADSTBYTE)
#define DMA_SIZE_SRCBYTE_DSTBYTE                      (DMASRCBYTE + DMADSTBYTE)

//*****************************************************************************
//
// The following are values that can be passed to the directionSelect parameter
// for functions: DMA_setSrcAddress(), and DMA_setDstAddress().
//
//*****************************************************************************
#define DMA_DIRECTION_UNCHANGED                                  (DMASRCINCR_0)
#define DMA_DIRECTION_DECREMENT                                  (DMASRCINCR_2)
#define DMA_DIRECTION_INCREMENT                                  (DMASRCINCR_3)

//*****************************************************************************
//
// The following are values that can be passed toThe following are values that
// can be returned by the DMA_getInterruptStatus() function.
//
//*****************************************************************************
#define DMA_INT_INACTIVE                                                  (0x0)
#define DMA_INT_ACTIVE                                                 (DMAIFG)

//*****************************************************************************
//
// The following are values that can be passed toThe following are values that
// can be returned by the DMA_getNMIAbortStatus() function.
//
//*****************************************************************************
#define DMA_NOTABORTED                                                    (0x0)
#define DMA_ABORTED                                                  (DMAABORT)

//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************

//*****************************************************************************
//
//! \brief Initializes the specified DMA channel.
//!
//! This function initializes the specified DMA channel. Upon successful
//! completion of initialization of the selected channel the control registers
//! will be cleared and the given variables will be set. Please note, if
//! transfers have been enabled with the enableTransfers() function, then a
//! call to disableTransfers() is necessary before re-initialization. Also
//! note, that the trigger sources are device dependent and can be found in the
//! device family data sheet. The amount of DMA channels available are also
//! device specific.
//!
//! \param param is the pointer to struct for initialization.
//!
//! \return STATUS_SUCCESS or STATUS_FAILURE of the initialization process.
//
//*****************************************************************************
extern void DMA_init(DMA_initParam *param);

//*****************************************************************************
//
//! \brief Sets the specified amount of transfers for the selected DMA channel.
//!
//! This function sets the specified amount of transfers for the selected DMA
//! channel without having to reinitialize the DMA channel.
//!
//! \param channelSelect is the specified channel to set source address
//!        direction for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//! \param transferSize is the amount of transfers to complete in a block
//!        transfer mode, as well as how many transfers to complete before the
//!        interrupt flag is set. Valid value is between 1-65535, if 0, no
//!        transfers will occur.
//!        \n Modified bits are \b DMAxSZ of \b DMAxSZ register.
//!
//! \return None
//
//*****************************************************************************
extern void DMA_setTransferSize(uint8_t channelSelect,
                                uint16_t transferSize);

//*****************************************************************************
//
//! \brief Gets the amount of transfers for the selected DMA channel.
//!
//! This function gets the amount of transfers for the selected DMA channel
//! without having to reinitialize the DMA channel.
//!
//! \param channelSelect is the specified channel to set source address
//!        direction for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//!
//! \return the amount of transfers
//
//*****************************************************************************
extern uint16_t DMA_getTransferSize(uint8_t channelSelect);

//*****************************************************************************
//
//! \brief Sets source address and the direction that the source address will
//! move after a transfer.
//!
//! This function sets the source address and the direction that the source
//! address will move after a transfer is complete. It may be incremented,
//! decremented or unchanged.
//!
//! \param channelSelect is the specified channel to set source address
//!        direction for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//! \param srcAddress is the address of where the data will be transferred
//!        from.
//!        \n Modified bits are \b DMAxSA of \b DMAxSA register.
//! \param directionSelect is the specified direction of the source address
//!        after a transfer.
//!        Valid values are:
//!        - \b DMA_DIRECTION_UNCHANGED
//!        - \b DMA_DIRECTION_DECREMENT
//!        - \b DMA_DIRECTION_INCREMENT
//!        \n Modified bits are \b DMASRCINCR of \b DMAxCTL register.
//!
//! \return None
//
//*****************************************************************************
extern void DMA_setSrcAddress(uint8_t channelSelect,
                              uint32_t srcAddress,
                              uint16_t directionSelect);

//*****************************************************************************
//
//! \brief Sets the destination address and the direction that the destination
//! address will move after a transfer.
//!
//! This function sets the destination address and the direction that the
//! destination address will move after a transfer is complete. It may be
//! incremented, decremented, or unchanged.
//!
//! \param channelSelect is the specified channel to set the destination
//!        address direction for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//! \param dstAddress is the address of where the data will be transferred to.
//!        \n Modified bits are \b DMAxDA of \b DMAxDA register.
//! \param directionSelect is the specified direction of the destination
//!        address after a transfer.
//!        Valid values are:
//!        - \b DMA_DIRECTION_UNCHANGED
//!        - \b DMA_DIRECTION_DECREMENT
//!        - \b DMA_DIRECTION_INCREMENT
//!        \n Modified bits are \b DMADSTINCR of \b DMAxCTL register.
//!
//! \return None
//
//*****************************************************************************
extern void DMA_setDstAddress(uint8_t channelSelect,
                              uint32_t dstAddress,
                              uint16_t directionSelect);

//*****************************************************************************
//
//! \brief Enables transfers to be triggered.
//!
//! This function enables transfers upon appropriate trigger of the selected
//! trigger source for the selected channel.
//!
//! \param channelSelect is the specified channel to enable transfer for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//!
//! \return None
//
//*****************************************************************************
extern void DMA_enableTransfers(uint8_t channelSelect);

//*****************************************************************************
//
//! \brief Disables transfers from being triggered.
//!
//! This function disables transfer from being triggered for the selected
//! channel. This function should be called before any re-initialization of the
//! selected DMA channel.
//!
//! \param channelSelect is the specified channel to disable transfers for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//!
//! \return None
//
//*****************************************************************************
extern void DMA_disableTransfers(uint8_t channelSelect);

//*****************************************************************************
//
//! \brief Starts a transfer if using the default trigger source selected in
//! initialization.
//!
//! This functions triggers a transfer of data from source to destination if
//! the trigger source chosen from initialization is the DMA_TRIGGERSOURCE_0.
//! Please note, this function needs to be called for each (repeated-)single
//! transfer, and when transferAmount of transfers have been complete in
//! (repeated-)block transfers.
//!
//! \param channelSelect is the specified channel to start transfers for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//!
//! \return None
//
//*****************************************************************************
extern void DMA_startTransfer(uint8_t channelSelect);

//*****************************************************************************
//
//! \brief Enables the DMA interrupt for the selected channel.
//!
//! Enables the DMA interrupt source.  Only the sources that are enabled can be
//! reflected to the processor interrupt; disabled sources have no effect on
//! the processor. Does not clear interrupt flags.
//!
//! \param channelSelect is the specified channel to enable the interrupt for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//!
//! \return None
//
//*****************************************************************************
extern void DMA_enableInterrupt(uint8_t channelSelect);

//*****************************************************************************
//
//! \brief Disables the DMA interrupt for the selected channel.
//!
//! Disables the DMA interrupt source. Only the sources that are enabled can be
//! reflected to the processor interrupt; disabled sources have no effect on
//! the processor.
//!
//! \param channelSelect is the specified channel to disable the interrupt for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//!
//! \return None
//
//*****************************************************************************
extern void DMA_disableInterrupt(uint8_t channelSelect);

//*****************************************************************************
//
//! \brief Returns the status of the interrupt flag for the selected channel.
//!
//! Returns the status of the interrupt flag for the selected channel.
//!
//! \param channelSelect is the specified channel to return the interrupt flag
//!        status from.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//!
//! \return One of the following:
//!         - \b DMA_INT_INACTIVE
//!         - \b DMA_INT_ACTIVE
//!         \n indicating the status of the current interrupt flag
//
//*****************************************************************************
extern uint16_t DMA_getInterruptStatus(uint8_t channelSelect);

//*****************************************************************************
//
//! \brief Clears the interrupt flag for the selected channel.
//!
//! This function clears the DMA interrupt flag is cleared, so that it no
//! longer asserts.
//!
//! \param channelSelect is the specified channel to clear the interrupt flag
//!        for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//!
//! \return None
//
//*****************************************************************************
extern void DMA_clearInterrupt(uint8_t channelSelect);

//*****************************************************************************
//
//! \brief Returns the status of the NMIAbort for the selected channel.
//!
//! This function returns the status of the NMI Abort flag for the selected
//! channel. If this flag has been set, it is because a transfer on this
//! channel was aborted due to a interrupt from an NMI.
//!
//! \param channelSelect is the specified channel to return the status of the
//!        NMI Abort flag for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//!
//! \return One of the following:
//!         - \b DMA_NOTABORTED
//!         - \b DMA_ABORTED
//!         \n indicating the status of the NMIAbort for the selected channel
//
//*****************************************************************************
extern uint16_t DMA_getNMIAbortStatus(uint8_t channelSelect);

//*****************************************************************************
//
//! \brief Clears the status of the NMIAbort to proceed with transfers for the
//! selected channel.
//!
//! This function clears the status of the NMI Abort flag for the selected
//! channel to allow for transfers on the channel to continue.
//!
//! \param channelSelect is the specified channel to clear the NMI Abort flag
//!        for.
//!        Valid values are:
//!        - \b DMA_CHANNEL_0
//!        - \b DMA_CHANNEL_1
//!        - \b DMA_CHANNEL_2
//!        - \b DMA_CHANNEL_3
//!        - \b DMA_CHANNEL_4
//!        - \b DMA_CHANNEL_5
//!        - \b DMA_CHANNEL_6
//!        - \b DMA_CHANNEL_7
//!
//! \return None
//
//*****************************************************************************
extern void DMA_clearNMIAbort(uint8_t channelSelect);

//*****************************************************************************
//
//! \brief Disables the DMA from stopping the CPU during a Read-Modify-Write
//! Operation to start a transfer.
//!
//! This function allows the CPU to finish any read-modify-write operations it
//! may be in the middle of before transfers of and DMA channel stop the CPU.
//!
//!
//! \return None
//
//*****************************************************************************
extern void DMA_disableTransferDuringReadModifyWrite(void);

//*****************************************************************************
//
//! \brief Enables the DMA to stop the CPU during a Read-Modify-Write Operation
//! to start a transfer.
//!
//! This function allows the DMA to stop the CPU in the middle of a read-
//! modify-write operation to transfer data.
//!
//!
//! \return None
//
//*****************************************************************************
extern void DMA_enableTransferDuringReadModifyWrite(void);

//*****************************************************************************
//
//! \brief Enables Round Robin prioritization.
//!
//! This function enables Round Robin Prioritization of DMA channels. In the
//! case of Round Robin Prioritization, the last DMA channel to have
//! transferred data then has the last priority, which comes into play when
//! multiple DMA channels are ready to transfer at the same time.
//!
//!
//! \return None
//
//*****************************************************************************
extern void DMA_enableRoundRobinPriority(void);

//*****************************************************************************
//
//! \brief Disables Round Robin prioritization.
//!
//! This function disables Round Robin Prioritization, enabling static
//! prioritization of the DMA channels. In static prioritization, the DMA
//! channels are prioritized with the lowest DMA channel index having the
//! highest priority (i.e. DMA Channel 0 has the highest priority).
//!
//!
//! \return None
//
//*****************************************************************************
extern void DMA_disableRoundRobinPriority(void);

//*****************************************************************************
//
//! \brief Enables a NMI to interrupt a DMA transfer.
//!
//! This function allow NMI's to interrupting any DMA transfer currently in
//! progress and stops any future transfers to begin before the NMI is done
//! processing.
//!
//!
//! \return None
//
//*****************************************************************************
extern void DMA_enableNMIAbort(void);

//*****************************************************************************
//
//! \brief Disables any NMI from interrupting a DMA transfer.
//!
//! This function disables NMI's from interrupting any DMA transfer currently
//! in progress.
//!
//!
//! \return None
//
//*****************************************************************************
extern void DMA_disableNMIAbort(void);

//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif

#endif
#endif // __MSP430WARE_DMA_H__


text:
'use strict';

exports.register = (server, options, next) => {
  server.ext({
    type: 'onPreHandler',
    method: (request, reply) => {
      request.models = server.plugins['hapi-sequelize'].db.sequelize.models;
      reply.continue();
    }
  });

  next();
};

exports.register.attributes = {
  name: 'database-request-extension',
  version: '1.0'
};


text:
// Copyright 2016 Google Inc. All Rights Reserved.
//
// 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.

namespace GoogleCloudExtension.Analytics.Events
{
    /// <summary>
    /// Event sent when a .publishsettings file is created.
    /// </summary>
    internal static class SavePublishSettingsEvent
    {
        private const string SavePublishSettingsEventName = "savePublishSettings";

        public static AnalyticsEvent Create()
        {
            return new AnalyticsEvent(SavePublishSettingsEventName);
        }
    }
}


text:
struct status {
    uint32_t done;
    uint32_t _pad1;
    uint32_t returncode;
    uint32_t _pad2;
} __attribute__((packed));

volatile struct status *epiphany_status = (struct status *) 0x8f200000;
volatile char *epiphany_results = (char *) 0x8f300000;

int main(int argc, char *argv[])
{
    epiphany_status->returncode = SKIP;
    epiphany_status->done = 1;

    return SKIP;
}


text:
class JwtController < ApplicationController
  skip_before_action :authenticate_user!
  skip_before_action :verify_authenticity_token
  before_action :authenticate_project_or_user

  SERVICES = {
    Auth::ContainerRegistryAuthenticationService::AUDIENCE => Auth::ContainerRegistryAuthenticationService
  }.freeze

  def auth
    service = SERVICES[params[:service]]
    return head :not_found unless service

    result = service.new(@authentication_result.project, @authentication_result.actor, auth_params)
      .execute(authentication_abilities: @authentication_result.authentication_abilities)

    render json: result, status: result[:http_status]
  end

  private

  def authenticate_project_or_user
    @authentication_result = Gitlab::Auth::Result.new(nil, nil, :none, Gitlab::Auth.read_authentication_abilities)

    authenticate_with_http_basic do |login, password|
      @authentication_result = Gitlab::Auth.find_for_git_client(login, password, project: nil, ip: request.ip)

      if @authentication_result.failed? ||
          (@authentication_result.actor.present? && !@authentication_result.actor.is_a?(User))
        render_unauthorized
      end
    end
  rescue Gitlab::Auth::MissingPersonalTokenError
    render_missing_personal_token
  end

  def render_missing_personal_token
    render json: {
      errors: [
        { code: 'UNAUTHORIZED',
          message: "HTTP Basic: Access denied\n" \
                   "You must use a personal access token with 'api' scope for Git over HTTP.\n" \
                   "You can generate one at #{profile_personal_access_tokens_url}" }
      ]
    }, status: 401
  end

  def render_unauthorized
    render json: {
      errors: [
        { code: 'UNAUTHORIZED',
          message: 'HTTP Basic: Access denied' }
      ]
    }, status: 401
  end

  def auth_params
    params.permit(:service, :scope, :account, :client_id)
  end
end


text:
// <copyright file="ScoreboardTests.cs" company="GameFifteen2Team">
// The MIT License (MIT)
// Copyright(c) 2015 Team "Game-Fifteen-2"
// </copyright>
// <summary>
// ScoreboardTests class.
// </summary>
// <author>GameFifteen2Team</author>

namespace Tests_GameFifteen.Logic.Tests_Scoreboards
{
    using System;
    using System.Linq;

    using GameFifteen.Logic.Common;
    using GameFifteen.Logic.Scoreboards;

    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// Covers tests for Scoreboard.
    /// </summary>
    [TestClass]
    public class ScoreboardTests
    {
        /// <summary>
        /// The method tests if exception is thrown when not positive intender is provided as moves count.
        /// </summary>
        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException),
          "Parameter must be a positive integer")]
        public void ExpectScoreboardAddMethodToThrowsWhenNonePositiveIntegerForMovesIsProvided()
        {
            var scoreboard = new Scoreboard();
            var moves = -1;
            var playerName = "Test Player";

            scoreboard.Add(moves, playerName);
        }

        /// <summary>
        /// The method tests if exception is thrown when 0 is provided as moves count.
        /// </summary>
        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException),
         "Parameter must be a positive integer")]
        public void ExpectScoreboardAddMethodToThrowsWhenZeroIntegerForMovesIsProvided()
        {
            var scoreboard = new Scoreboard();
            var moves = 0;
            var playerName = "Test Player";

            scoreboard.Add(moves, playerName);
        }

        /// <summary>
        /// The method tests if exception is thrown when null value is provided as player name.
        /// </summary>
        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException),
          "Argument name cannot be null!")]
        public void ExpectScoreboardAddMethodToThrowsWhenNullIsProvidedForPlayerNameParameter()
        {
            var scoreboard = new Scoreboard();
            var moves = 5;
            string playerName = null;

            scoreboard.Add(moves, playerName);
        }

        /// <summary>
        /// The method tests if exception is thrown when null value is provided as player name and non positive integer for moves.
        /// </summary>
        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException),
         "Parameter must be a positive integer")]
        public void ExpectScoreboardAddMethodToThrowsWhenNullIsProvidedForPlayerNameAndNonPositiveIntegerForMoves()
        {
            var scoreboard = new Scoreboard();
            var moves = -5;
            string playerName = null;

            scoreboard.Add(moves, playerName);
        }

        /// <summary>
        /// The method test if Scoreboard.Add method adds new score.
        /// </summary>
        [TestMethod]
        public void ExpectScoreboardAddMethodToAddScoreToTopsScores()
        {
            var moves = 5;
            var playerName = "Test Player";
            var scoreboard = new Scoreboard();
            scoreboard.Add(moves, playerName);
            var topScore = scoreboard.GetTopScores()[0];

            Assert.IsInstanceOfType(topScore, typeof(Score));
        }

        /// <summary>
        /// The method test if Scoreboard.IsInTopScores method returns true when it is top score.
        /// </summary>
        [TestMethod]
        public void ExpectScoreboardIsInTopScoresMethodToToreturnTrueWhenLessThanMaxCountOfScoresAreInTopScores()
        {
            var scoreboard = new Scoreboard();
            var moves = 5;
            var expecterIsInTopScore = scoreboard.IsInTopScores(moves);

            Assert.IsTrue(expecterIsInTopScore);
        }

        /// <summary>
        /// The method test if Scoreboard.IsInTopScores method returns false when it is not top score.
        /// </summary>
        [TestMethod]
        public void ExpectScoreboardIsInTopScoresMethodToToreturnFalseWhenIsOutOfTopScores()
        {
            var scoreboard = new Scoreboard();
            var playerName = "Test Player";
            var maxCountTopScores = Constants.ScoreboardMaxCount;

            for (int moves = 1; moves <= maxCountTopScores; moves++)
            {
                scoreboard.Add(moves, playerName);
            }

            var expecterIsInTopScore = scoreboard.IsInTopScores(maxCountTopScores + 1);

            Assert.IsFalse(expecterIsInTopScore);
        }

        /// <summary>
        /// The method test if Scoreboard.IsInTopScores method returns true when it is top score.
        /// </summary>
        [TestMethod]
        public void ExpectScoreboardIsInTopScoresMethodToToreturnTrueWhenTopScorProvided()
        {
            var scoreboard = new Scoreboard();
            var playerName = "Test Player";
            var maxCountTopScores = Constants.ScoreboardMaxCount;

            for (int moves = 1; moves <= maxCountTopScores; moves++)
            {
                scoreboard.Add(moves, playerName);
            }

            var expecterIsInTopScore = scoreboard.IsInTopScores(maxCountTopScores - 1);

            Assert.IsTrue(expecterIsInTopScore);
        }

        /// <summary>
        /// The method test if Scoreboard.Add method NOT to adds new score when it is not top score.
        /// </summary>
        [TestMethod]
        public void ExpectScoreboardAddMethodNotToAddScoreToTopsScoresWhenIsNotInTopScores()
        {
            var scoreboard = new Scoreboard();
            var playerName = "Test Player";
            var maxCountTopScores = Constants.ScoreboardMaxCount;

            for (int moves = 1; moves <= maxCountTopScores; moves++)
            {
                scoreboard.Add(moves, playerName);
            }

            scoreboard.Add(maxCountTopScores + 1, playerName);

            var actualCountOfScoresOutOfTop = scoreboard.GetTopScores()
                .Where(s => s.Moves == maxCountTopScores + 1)
                .Count();

            var expectedCountOfScoresOutOfTop = 0;

            Assert.AreEqual(expectedCountOfScoresOutOfTop, actualCountOfScoresOutOfTop);
        }

        /// <summary>
        /// The method test if Scoreboard.ToString returns correct value withe no top scores.
        /// </summary>
        [TestMethod]
        public void ExpectScoreboardToStringReturnsConstanstScoreoardIsEmptyString()
        {
            var scoreboard = new Scoreboard();
            var actualToString = scoreboard.ToString();
            var expectedToString = Constants.ScoreboardIsEmpty
                 + Environment.NewLine;

            Assert.AreEqual(expectedToString, actualToString);
        }

        /// <summary>
        /// The method test if Scoreboard.ToString returns correct value withe there are top scores.
        /// </summary>
        [TestMethod]
        public void ExpectScoreboardToStringReturnsCorrectScoreboardString()
        {
            var scoreboard = new Scoreboard();
            var moves = 5;
            var playerName = "Test Player";
            scoreboard.Add(moves, playerName);

            var actualToString = scoreboard.ToString();
            var expectedToString = Constants.Scoreboard +
                                   Environment.NewLine +
                                   string.Format(Constants.ScoreboardFormat, 1, playerName, moves) +
                                   Environment.NewLine;

            Assert.AreEqual(expectedToString, actualToString);
        }
    }
}


text:
module Facts
  module Linux
    module Networking
      class Mtu
        FACT_NAME = 'networking.mtu'

        def call_the_resolver
          fact_value = Facter::Resolvers::Linux::Networking.resolve(:mtu)

          Facter::ResolvedFact.new(FACT_NAME, fact_value)
        end
      end
    end
  end
end


text:
package com.igormaznitsa.jhexed.extapp.lookup;

public final class EmptyLookup implements Lookup {

  public EmptyLookup(){

  }

  @Override
  public <T> T lookup(final Class<T> type, final Object ... args) {
    return null;
  }

}


text:
namespace v8 {
namespace internal {

class Assembler;
class ByteArray;
class BytecodeArray;

// HandlerTable is a byte array containing entries for exception handlers in
// the code object it is associated with. The tables come in two flavors:
// 1) Based on ranges: Used for unoptimized code. Stored in a {ByteArray} that
//    is attached to each {BytecodeArray}. Contains one entry per exception
//    handler and a range representing the try-block covered by that handler.
//    Layout looks as follows:
//      [ range-start , range-end , handler-offset , handler-data ]
// 2) Based on return addresses: Used for turbofanned code. Stored directly in
//    the instruction stream of the {Code} object. Contains one entry per
//    call-site that could throw an exception. Layout looks as follows:
//      [ return-address-offset , handler-offset ]
class V8_EXPORT_PRIVATE HandlerTable {
 public:
  // Conservative prediction whether a given handler will locally catch an
  // exception or cause a re-throw to outside the code boundary. Since this is
  // undecidable it is merely an approximation (e.g. useful for debugger).
  enum CatchPrediction {
    UNCAUGHT,     // The handler will (likely) rethrow the exception.
    CAUGHT,       // The exception will be caught by the handler.
    PROMISE,      // The exception will be caught and cause a promise rejection.
    DESUGARING,   // The exception will be caught, but both the exception and
                  // the catching are part of a desugaring and should therefore
                  // not be visible to the user (we won't notify the debugger of
                  // such exceptions).
    ASYNC_AWAIT,  // The exception will be caught and cause a promise rejection
                  // in the desugaring of an async function, so special
                  // async/await handling in the debugger can take place.
    UNCAUGHT_ASYNC_AWAIT,  // The exception will be caught and cause a promise
                           // rejection in the desugaring of an async REPL
                           // script. The corresponding message object needs to
                           // be kept alive on the Isolate though.
  };

  enum EncodingMode { kRangeBasedEncoding, kReturnAddressBasedEncoding };

  // Constructors for the various encodings.
  explicit HandlerTable(Code code);
  explicit HandlerTable(ByteArray byte_array);
  explicit HandlerTable(BytecodeArray bytecode_array);
  HandlerTable(Address handler_table, int handler_table_size,
               EncodingMode encoding_mode);

  // Getters for handler table based on ranges.
  int GetRangeStart(int index) const;
  int GetRangeEnd(int index) const;
  int GetRangeHandler(int index) const;
  int GetRangeData(int index) const;

  // Setters for handler table based on ranges.
  void SetRangeStart(int index, int value);
  void SetRangeEnd(int index, int value);
  void SetRangeHandler(int index, int offset, CatchPrediction pred);
  void SetRangeData(int index, int value);

  // Returns the required length of the underlying byte array.
  static int LengthForRange(int entries);

  // Emitters for handler table based on return addresses.
  static int EmitReturnTableStart(Assembler* masm);
  static void EmitReturnEntry(Assembler* masm, int offset, int handler);

  // Lookup handler in a table based on ranges. The {pc_offset} is an offset to
  // the start of the potentially throwing instruction (using return addresses
  // for this value would be invalid).
  int LookupRange(int pc_offset, int* data, CatchPrediction* prediction);

  // Lookup handler in a table based on return addresses.
  int LookupReturn(int pc_offset);

  // Returns the number of entries in the table.
  int NumberOfRangeEntries() const;
  int NumberOfReturnEntries() const;

#ifdef ENABLE_DISASSEMBLER
  void HandlerTableRangePrint(std::ostream& os);   // NOLINT
  void HandlerTableReturnPrint(std::ostream& os);  // NOLINT
#endif

 private:
  // Getters for handler table based on ranges.
  CatchPrediction GetRangePrediction(int index) const;

  // Gets entry size based on mode.
  static int EntrySizeFromMode(EncodingMode mode);

  // Getters for handler table based on return addresses.
  int GetReturnOffset(int index) const;
  int GetReturnHandler(int index) const;

  // Number of entries in the loaded handler table.
  int number_of_entries_;

#ifdef DEBUG
  // The encoding mode of the table. Mostly useful for debugging to check that
  // used accessors and constructors fit together.
  EncodingMode mode_;
#endif

  // Direct pointer into the encoded data. This pointer points into objects on
  // the GC heap (either {ByteArray} or {Code}) and hence would become stale
  // during a collection. Hence we disallow any allocation.
  Address raw_encoded_data_;
  DISALLOW_HEAP_ALLOCATION(no_gc_)

  // Layout description for handler table based on ranges.
  static const int kRangeStartIndex = 0;
  static const int kRangeEndIndex = 1;
  static const int kRangeHandlerIndex = 2;
  static const int kRangeDataIndex = 3;
  static const int kRangeEntrySize = 4;

  // Layout description for handler table based on return addresses.
  static const int kReturnOffsetIndex = 0;
  static const int kReturnHandlerIndex = 1;
  static const int kReturnEntrySize = 2;

  // Encoding of the {handler} field.
  using HandlerPredictionField = base::BitField<CatchPrediction, 0, 3>;
  using HandlerOffsetField = base::BitField<int, 3, 29>;
};

}  // namespace internal
}  // namespace v8

#endif  // V8_CODEGEN_HANDLER_TABLE_H_


text:
package de.jonathansautter.autooff;

import android.annotation.TargetApi;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;

import com.astuetz.PagerSlidingTabStrip;
import com.github.orangegangsters.lollipin.lib.managers.AppLock;
import com.github.orangegangsters.lollipin.lib.managers.LockManager;

public class MainActivity extends AppCompatActivity {

    private static final int REQUEST_CODE = 1;
    static boolean main_active = false;
    private SharedPreferences settingsprefs;
    public static PageAdapter pageAdapter;

    @Override
    public void onStart() {
        super.onStart();
        main_active = true;
    }

    @Override
    public void onStop() {
        super.onStop();
        main_active = false;
    }

    @SuppressWarnings("unchecked")
    @Override
    protected void onResume() {
        super.onResume();
        LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
        //Log.d("AutoOff", "should lock: "+lockManager.getAppLock().shouldLockSceen(MainActivity.this));

        // pin protection
        if (lockManager.getAppLock().isPasscodeSet() && lockManager.getAppLock().shouldLockSceen(MainActivity.this)) {
            Intent intent = new Intent(MainActivity.this, CustomPinActivity.class);
            intent.putExtra(AppLock.EXTRA_TYPE, AppLock.UNLOCK_PIN);
            startActivity(intent);
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this));
        if (getResources().getBoolean(R.bool.portrait_only)) {
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        }
        setContentView(R.layout.activity_main);

        setTitle(R.string.app_name);

        settingsprefs = getSharedPreferences("settings", 0);

        if (!settingsprefs.getBoolean("disclaimerAgreed", false)) {
            AlertDialog.Builder builder1 = new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
            builder1.setTitle(getString(R.string.welcome));

            SpannableString s = new SpannableString(getString(R.string.roothint));
            Linkify.addLinks(s, Linkify.ALL);

            builder1.setMessage(s);
            builder1.setCancelable(false);

            builder1.setPositiveButton(getString(R.string.imrooted), new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                    AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this, R.style.AppCompatAlertDialogStyle);
                    builder.setTitle(getString(R.string.disclaimer));
                    builder.setMessage(getString(R.string.disclaimertext));
                    builder.setCancelable(false);

                    builder.setPositiveButton(getString(R.string.agree), new DialogInterface.OnClickListener() {

                        public void onClick(DialogInterface dialog, int which) {
                            settingsprefs.edit().putBoolean("disclaimerAgreed", true).apply();
                            dialog.dismiss();
                            sysoverlaypermission();
                        }
                    });

                    builder.setNegativeButton(getString(R.string.disagree), new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            MainActivity.this.finish();
                            dialog.dismiss();
                        }
                    });

                    AlertDialog alert = builder.create();
                    alert.show();
                }
            });

            builder1.setNegativeButton(getString(R.string.exit), new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                    MainActivity.this.finish();
                }
            });

            AlertDialog alert1 = builder1.create();
            alert1.show();
            ((TextView) alert1.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
        } else {
            sysoverlaypermission();
        }

        if (getSupportActionBar() != null) {
            getSupportActionBar().setElevation(0);
        }

        // Initialize the ViewPager and set an adapter
        ViewPager pager = (ViewPager) findViewById(R.id.viewpager);
        pageAdapter = new PageAdapter(getSupportFragmentManager(), MainActivity.this);
        PagerSlidingTabStrip tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
        final int pageMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4, getResources()
                .getDisplayMetrics());
        int lastUsedTab = settingsprefs.getInt("lastUsedTab", 0);
        if (pager != null) {
            pager.setOffscreenPageLimit(2);
            pager.setAdapter(pageAdapter);

            // Bind the tabs to the ViewPager
            if (tabs != null) {
                tabs.setViewPager(pager);
                pager.setPageMargin(pageMargin);
                pager.setCurrentItem(lastUsedTab);

                tabs.setOnTabReselectedListener(new PagerSlidingTabStrip.OnTabReselectedListener() {
                    @Override
                    public void onTabReselected(int position) {

                    }
                });
            }
        }

        if (getIntent().getBooleanExtra("shutdownerror", false)) {
            // show message: sorry unable to shutdown your device! root access granted? try busybox!?
            AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this, R.style.AppCompatAlertDialogStyle);
            builder.setTitle(getString(R.string.weresorry));
            builder.setMessage(getString(R.string.unabletoshutdown));
            builder.setCancelable(false);

            builder.setPositiveButton(getString(R.string.exit), new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                    MainActivity.this.finish();
                }
            });

            AlertDialog alert = builder.create();
            alert.show();
        }
    }

    public void sysoverlaypermission() {
        if (settingsprefs.getBoolean("firstLaunch", true)) {
            settingsprefs.edit().putBoolean("firstLaunch", false).apply();
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                if (!android.provider.Settings.canDrawOverlays(getApplicationContext())) {
                    AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
                    builder.setTitle(R.string.enableshutdowncountdown);
                    builder.setMessage(R.string.shutdowncountdowndesc);
                    builder.setCancelable(false);

                    builder.setPositiveButton(R.string.enable, new DialogInterface.OnClickListener() {

                        public void onClick(DialogInterface dialog, int which) {
                            checkDrawOverlayPermission();
                            dialog.dismiss();
                        }
                    });

                    builder.setNegativeButton(R.string.nothanks, new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            settingsprefs.edit().putBoolean("sysOverlay", false).apply();
                            dialog.dismiss();
                        }
                    });

                    AlertDialog alert = builder.create();
                    alert.show();
                } else {
                    settingsprefs.edit().putBoolean("sysOverlay", true).apply();
                }
            }
        } else if (settingsprefs.getBoolean("sysOverlay", false)) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                if (!android.provider.Settings.canDrawOverlays(getApplicationContext())) {
                    AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
                    builder.setTitle(R.string.enableshutdowncountdown);
                    builder.setMessage(getString(R.string.reenablecountdowndesc));
                    builder.setCancelable(false);

                    builder.setPositiveButton(R.string.enable, new DialogInterface.OnClickListener() {

                        public void onClick(DialogInterface dialog, int which) {
                            checkDrawOverlayPermission();
                            dialog.dismiss();
                        }
                    });

                    builder.setNegativeButton(R.string.nothanks, new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            settingsprefs.edit().putBoolean("sysOverlay", false).apply();
                            dialog.dismiss();
                        }
                    });

                    AlertDialog alert = builder.create();
                    alert.show();
                } else {
                    settingsprefs.edit().putBoolean("sysOverlay", true).apply();
                }
            }
        }
    }

    @TargetApi(Build.VERSION_CODES.M)
    public void checkDrawOverlayPermission() {
        try {
            if (!android.provider.Settings.canDrawOverlays(getApplicationContext())) {
                Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
                        Uri.parse("package:" + getPackageName()));
                startActivityForResult(intent, REQUEST_CODE);
            } else {
                manualOverlayPermissionInstructions();
            }
        } catch (Exception e) {
            manualOverlayPermissionInstructions();
        }
    }

    private void manualOverlayPermissionInstructions() {
        AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
        builder.setTitle("Permission needed");
        builder.setMessage("To use the Shutdown Countdown Dialog, please enable the \"Draw over other apps permission for AutoOff\"\n\n" +
                        "1. Go to the Device Settings.\n" +
                        "2. Tap \"Apps\"\n" +
                        "3. On the top right, tap the gear icon.\n" +
                        "4. Under Advanced, chose \"Draw over other apps\"\n" +
                        "5. Find AutoOff in the list and tap it.\n" +
                        "6. Toggle \"Permit drawing over other apps\" to ON.");
        builder.setCancelable(false);

        builder.setPositiveButton(R.string.done, new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });

        builder.setNegativeButton(R.string.nothanks, new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int which) {
                settingsprefs.edit().putBoolean("sysOverlay", false).apply();
                dialog.dismiss();
            }
        });

        AlertDialog alert = builder.create();
        alert.show();
    }

    @TargetApi(Build.VERSION_CODES.M)
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == REQUEST_CODE) {
            if (android.provider.Settings.canDrawOverlays(this)) {
                // continue here - permission was granted
                settingsprefs.edit().putBoolean("sysOverlay", true).apply();
            } else {
                settingsprefs.edit().putBoolean("sysOverlay", false).apply();
            }
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        int id = item.getItemId();

        switch (id) {
            case R.id.settings:
                Intent intent = new Intent(MainActivity.this, Settings_Activity.class);
                startActivity(intent);
                return true;
            case R.id.about:
                Intent intent2 = new Intent(MainActivity.this, About.class);
                startActivity(intent2);
                return true;
        }
        return super.onOptionsItemSelected(item);
    }
}


text:
from muntjac.demo.sampler.APIResource import APIResource
from muntjac.demo.sampler.Feature import Feature, Version
from muntjac.ui.native_select import NativeSelect

class NativeSelection(Feature):

    def getSinceVersion(self):
        return Version.OLD

    def getName(self):
        return 'Native select'

    def getDescription(self):
        return ('A NativeSelect is a a simple drop-down list for selecting '
            'one item. It is called native because it uses the look '
            'and feel from the browser in use.
'
            'The ComboBox component is a much more versatile variant, but '
            'without the native look and feel.
'
            'From a usability standpoint, you might also want to consider '
            'using a ListSelect in single-select-mode, so that the user '
            'can see all options right away.')

    def getRelatedAPI(self):
        return [APIResource(NativeSelect)]

    def getRelatedFeatures(self):

        from muntjac.demo.sampler.features.selects.ComboBoxPlain import ComboBoxPlain
        from muntjac.demo.sampler.FeatureSet import Selects
        from muntjac.demo.sampler.features.selects.ListSelectSingle import ListSelectSingle

        return [ComboBoxPlain, ListSelectSingle, Selects]

    def getRelatedResources(self):
        # TODO Auto-generated method stub
        return None


text:
{% load i18n %}

	{% if references %}

		{% for reference in references %}

			{% include 'references/fragments/item.html' %}

{% endfor %}

	{% else %}
		{% trans "No references" %}
	{% endif %}
	{% include 'references/fragments/form_reference.html' %}


text:
import jwtDecode from 'jwt-decode'
import api from '@/utils/api'
import { parseCookies, setCookie, destroyCookie } from 'nookies'
import type { Credentials } from '@/types/Login'

const GRID_KEY = 'grid'

export function getToken() {
  const parsedCookies = parseCookies()
  return parsedCookies?.[GRID_KEY]
}

export function logout() {
  destroyCookie(null, GRID_KEY, { path: '/' })
  // TODO: Add private routes
  if (typeof window !== 'undefined') window.location = '/login'
}

export function decodeToken() {
  const token = getToken()
  if (!token) return null
  return jwtDecode(token)
}

export async function login({
  email,
  password,
}: {
  email: string
  password: string
}) {
  try {
    const token: Credentials = await api
      .post('login', { json: { email, password } })
      .json()
    setCookie(null, GRID_KEY, token.access_token, {
      maxAge: 30 * 24 * 60 * 60 * 5,
      path: '/',
    })
    return 'ok'
  } catch (err) {
    throw err
  }
}


text:
package org.smpp.pdu;

import org.smpp.Data;

/**
 * @author Logica Mobile Networks SMPP Open Source Team
 * @version $Revision: 1.1 $
 */
public class BindTransmitter extends BindRequest {
	public BindTransmitter() {
		super(Data.BIND_TRANSMITTER);
	}

	protected Response createResponse() {
		return new BindTransmitterResp();
	}

	public boolean isTransmitter() {
		return true;
	}

	public boolean isReceiver() {
		return false;
	}
}
/*
 * $Log: not supported by cvs2svn $
 */


text:
/*
Deployment script for Haikus

This code was generated by a tool.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
*/

GO
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;

SET NUMERIC_ROUNDABORT OFF;

GO
:setvar DatabaseName "Haikus"
:setvar DefaultFilePrefix "Haikus"
:setvar DefaultDataPath "C:\Program Files\Microsoft SQL Server\MSSQL11.SQLSERVER\MSSQL\DATA\"
:setvar DefaultLogPath "C:\Program Files\Microsoft SQL Server\MSSQL11.SQLSERVER\MSSQL\DATA\"

GO
:on error exit
GO
/*
Detect SQLCMD mode and disable script execution if SQLCMD mode is not supported.
To re-enable the script after enabling SQLCMD mode, execute the following:
SET NOEXEC OFF;
*/
:setvar __IsSqlCmdEnabled "True"
GO
IF N'$(__IsSqlCmdEnabled)' NOT LIKE N'True'
    BEGIN
        PRINT N'SQLCMD mode must be enabled to successfully execute this script.';
        SET NOEXEC ON;
    END

GO
IF EXISTS (SELECT 1
           FROM   [master].[dbo].[sysdatabases]
           WHERE  [name] = N'$(DatabaseName)')
    BEGIN
        ALTER DATABASE [$(DatabaseName)]
            SET ANSI_NULLS ON,
                ANSI_PADDING ON,
                ANSI_WARNINGS ON,
                ARITHABORT ON,
                CONCAT_NULL_YIELDS_NULL ON,
                QUOTED_IDENTIFIER ON,
                ANSI_NULL_DEFAULT ON,
                CURSOR_DEFAULT LOCAL
            WITH ROLLBACK IMMEDIATE;
    END

GO
IF EXISTS (SELECT 1
           FROM   [master].[dbo].[sysdatabases]
           WHERE  [name] = N'$(DatabaseName)')
    BEGIN
        ALTER DATABASE [$(DatabaseName)]
            SET PAGE_VERIFY NONE
            WITH ROLLBACK IMMEDIATE;
    END

GO
USE [$(DatabaseName)];

GO
PRINT N'Rename refactoring operation with key c21846b2-d828-45e8-9cd0-cc5e19b417d1 is skipped, element [dbo].[FK_Rating_Haikus] (SqlForeignKeyConstraint) will not be renamed to [FK_Haikus_Users]';

GO
PRINT N'Rename refactoring operation with key 131af19f-a1b8-4eca-9697-ca1f1507f30a is skipped, element [dbo].[Haikus].[IsDeleted] (SqlSimpleColumn) will not be renamed to Date';

GO
PRINT N'Rename refactoring operation with key 5fc07b31-641d-4c7d-8518-a64c4a998649, 1c08e22f-452b-4338-aee4-0c2e93621f58 is skipped, element [dbo].[Haikus].[IscCmplaint] (SqlSimpleColumn) will not be renamed to IsComplaint';

GO
PRINT N'Rename refactoring operation with key 9bbf5d50-6178-4b91-a6d5-8c2ccf3eeb32, b8f7e1bc-ece3-48af-a2b6-6139a6086865 is skipped, element [dbo].[Haikus].[Rating] (SqlSimpleColumn) will not be renamed to RatingValue';

GO
PRINT N'Rename refactoring operation with key 0240748d-afeb-483c-9aa2-8f2dd4c7590c is skipped, element [dbo].[Users].[ActualRating] (SqlSimpleColumn) will not be renamed to RatingValue';

GO
PRINT N'Rename refactoring operation with key 24b3b2de-56ff-4fba-ac8c-0d732b8643fa is skipped, element [dbo].[Users].[RatingCount] (SqlSimpleColumn) will not be renamed to RatersCount';

GO
PRINT N'Creating [dbo].[ComplaintForHaikus]...';

GO
CREATE TABLE [dbo].[ComplaintForHaikus] (
    [Id]      INT      IDENTITY (1, 1) NOT NULL,
    [HaikuId] BIGINT   NOT NULL,
    [Date]    DATETIME NOT NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);

GO
PRINT N'Creating [dbo].[Haikus]...';

GO
CREATE TABLE [dbo].[Haikus] (
    [Id]          BIGINT         IDENTITY (1, 1) NOT NULL,
    [Text]        NVARCHAR (MAX) NOT NULL,
    [UserId]      BIGINT         NOT NULL,
    [Date]        DATETIME       NOT NULL,
    [IsDeleted]   BIT            NOT NULL,
    [RatingValue] BIGINT         NOT NULL,
    [RatersCount] BIGINT         NOT NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);

GO
PRINT N'Creating [dbo].[Rating]...';

GO
CREATE TABLE [dbo].[Rating] (
    [Id]        BIGINT IDENTITY (1, 1) NOT NULL,
    [Value]     INT    NOT NULL,
    [HaikuId]   BIGINT NOT NULL,
    [UserId]    BIGINT NOT NULL,
    [IsDeleted] BIT    NOT NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);

GO
PRINT N'Creating [dbo].[SaltForUser]...';

GO
CREATE TABLE [dbo].[SaltForUser] (
    [Id]     INT            IDENTITY (1, 1) NOT NULL,
    [Salt]   NVARCHAR (500) NOT NULL,
    [UserId] BIGINT         NOT NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);

GO
PRINT N'Creating [dbo].[SaltForUser].[IX_SaltForUser_UserId]...';

GO
CREATE NONCLUSTERED INDEX [IX_SaltForUser_UserId]
    ON [dbo].[SaltForUser]([UserId] ASC);

GO
PRINT N'Creating [dbo].[Users]...';

GO
CREATE TABLE [dbo].[Users] (
    [Id]          BIGINT         IDENTITY (1, 1) NOT NULL,
    [Username]    NVARCHAR (50)  NOT NULL,
    [PublishCode] NVARCHAR (MAX) NOT NULL,
    [IsDeleted]   BIT            NOT NULL,
    [IsVIP]       BIT            NOT NULL,
    [RatingValue] BIGINT         NOT NULL,
    [RatersCount] BIGINT         NOT NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);

GO
PRINT N'Creating unnamed constraint on [dbo].[ComplaintForHaikus]...';

GO
ALTER TABLE [dbo].[ComplaintForHaikus]
    ADD DEFAULT GETDATE() FOR [Date];

GO
PRINT N'Creating unnamed constraint on [dbo].[Haikus]...';

GO
ALTER TABLE [dbo].[Haikus]
    ADD DEFAULT 0 FOR [IsDeleted];

GO
PRINT N'Creating unnamed constraint on [dbo].[Haikus]...';

GO
ALTER TABLE [dbo].[Haikus]
    ADD DEFAULT 0 FOR [RatingValue];

GO
PRINT N'Creating unnamed constraint on [dbo].[Haikus]...';

GO
ALTER TABLE [dbo].[Haikus]
    ADD DEFAULT 0 FOR [RatersCount];

GO
PRINT N'Creating unnamed constraint on [dbo].[Rating]...';

GO
ALTER TABLE [dbo].[Rating]
    ADD DEFAULT 0 FOR [IsDeleted];

GO
PRINT N'Creating unnamed constraint on [dbo].[Users]...';

GO
ALTER TABLE [dbo].[Users]
    ADD DEFAULT 0 FOR [IsDeleted];

GO
PRINT N'Creating unnamed constraint on [dbo].[Users]...';

GO
ALTER TABLE [dbo].[Users]
    ADD DEFAULT 0 FOR [IsVIP];

GO
PRINT N'Creating unnamed constraint on [dbo].[Users]...';

GO
ALTER TABLE [dbo].[Users]
    ADD DEFAULT 0 FOR [RatingValue];

GO
PRINT N'Creating unnamed constraint on [dbo].[Users]...';

GO
ALTER TABLE [dbo].[Users]
    ADD DEFAULT 0 FOR [RatersCount];

GO
PRINT N'Creating [dbo].[FK_Haikus_Users]...';

GO
ALTER TABLE [dbo].[Haikus] WITH NOCHECK
    ADD CONSTRAINT [FK_Haikus_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([Id]);

GO
PRINT N'Creating [dbo].[FK_Ratings_Haikus]...';

GO
ALTER TABLE [dbo].[Rating] WITH NOCHECK
    ADD CONSTRAINT [FK_Ratings_Haikus] FOREIGN KEY ([HaikuId]) REFERENCES [dbo].[Haikus] ([Id]);

GO
PRINT N'Creating [dbo].[FK_Ratings_Users]...';

GO
ALTER TABLE [dbo].[Rating] WITH NOCHECK
    ADD CONSTRAINT [FK_Ratings_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Haikus] ([Id]);

GO
PRINT N'Creating [dbo].[FK_SaltForUser_Users]...';

GO
ALTER TABLE [dbo].[SaltForUser] WITH NOCHECK
    ADD CONSTRAINT [FK_SaltForUser_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([Id]);

GO
-- Refactoring step to update target server with deployed transaction logs

IF OBJECT_ID(N'dbo.__RefactorLog') IS NULL
BEGIN
    CREATE TABLE [dbo].[__RefactorLog] (OperationKey UNIQUEIDENTIFIER NOT NULL PRIMARY KEY)
    EXEC sp_addextendedproperty N'microsoft_database_tools_support', N'refactoring log', N'schema', N'dbo', N'table', N'__RefactorLog'
END
GO
IF NOT EXISTS (SELECT OperationKey FROM [dbo].[__RefactorLog] WHERE OperationKey = 'c21846b2-d828-45e8-9cd0-cc5e19b417d1')
INSERT INTO [dbo].[__RefactorLog] (OperationKey) values ('c21846b2-d828-45e8-9cd0-cc5e19b417d1')
IF NOT EXISTS (SELECT OperationKey FROM [dbo].[__RefactorLog] WHERE OperationKey = '131af19f-a1b8-4eca-9697-ca1f1507f30a')
INSERT INTO [dbo].[__RefactorLog] (OperationKey) values ('131af19f-a1b8-4eca-9697-ca1f1507f30a')
IF NOT EXISTS (SELECT OperationKey FROM [dbo].[__RefactorLog] WHERE OperationKey = '5fc07b31-641d-4c7d-8518-a64c4a998649')
INSERT INTO [dbo].[__RefactorLog] (OperationKey) values ('5fc07b31-641d-4c7d-8518-a64c4a998649')
IF NOT EXISTS (SELECT OperationKey FROM [dbo].[__RefactorLog] WHERE OperationKey = '1c08e22f-452b-4338-aee4-0c2e93621f58')
INSERT INTO [dbo].[__RefactorLog] (OperationKey) values ('1c08e22f-452b-4338-aee4-0c2e93621f58')
IF NOT EXISTS (SELECT OperationKey FROM [dbo].[__RefactorLog] WHERE OperationKey = '9bbf5d50-6178-4b91-a6d5-8c2ccf3eeb32')
INSERT INTO [dbo].[__RefactorLog] (OperationKey) values ('9bbf5d50-6178-4b91-a6d5-8c2ccf3eeb32')
IF NOT EXISTS (SELECT OperationKey FROM [dbo].[__RefactorLog] WHERE OperationKey = '0240748d-afeb-483c-9aa2-8f2dd4c7590c')
INSERT INTO [dbo].[__RefactorLog] (OperationKey) values ('0240748d-afeb-483c-9aa2-8f2dd4c7590c')
IF NOT EXISTS (SELECT OperationKey FROM [dbo].[__RefactorLog] WHERE OperationKey = 'b8f7e1bc-ece3-48af-a2b6-6139a6086865')
INSERT INTO [dbo].[__RefactorLog] (OperationKey) values ('b8f7e1bc-ece3-48af-a2b6-6139a6086865')
IF NOT EXISTS (SELECT OperationKey FROM [dbo].[__RefactorLog] WHERE OperationKey = '24b3b2de-56ff-4fba-ac8c-0d732b8643fa')
INSERT INTO [dbo].[__RefactorLog] (OperationKey) values ('24b3b2de-56ff-4fba-ac8c-0d732b8643fa')

GO

GO
/*
Post-Deployment Script Template
--------------------------------------------------------------------------------------
 This file contains SQL statements that will be appended to the build script.
 Use SQLCMD syntax to include a file in the post-deployment script.
 Example:      :r .\myfile.sql
 Use SQLCMD syntax to reference a variable in the post-deployment script.
 Example:      :setvar TableName MyTable
               SELECT * FROM [$(TableName)]
--------------------------------------------------------------------------------------
*/

INSERT INTO [dbo].[Users] ([Username], [PublishCode]) VALUES ('FirstUser', 'some publish code');
DECLARE @UserId BIGINT = SCOPE_IDENTITY();
INSERT INTO [dbo].[Haikus] ([Text], [UserId]) VALUES ('some dummy dummy haiku 1', @UserId);
INSERT INTO [dbo].[Haikus] ([Text], [UserId]) VALUES ('some dummy dummy haiku 2', @UserId);
INSERT INTO [dbo].[Haikus] ([Text], [UserId]) VALUES ('some dummy dummy haiku 3', @UserId);
INSERT INTO [dbo].[Haikus] ([Text], [UserId]) VALUES ('some dummy dummy haiku 4', @UserId);
INSERT INTO [dbo].[Haikus] ([Text], [UserId]) VALUES ('some dummy dummy haiku 5', @UserId);
INSERT INTO [dbo].[Haikus] ([Text], [UserId]) VALUES ('some dummy dummy haiku 6', @UserId);

GO

GO
PRINT N'Checking existing data against newly created constraints';

GO
USE [$(DatabaseName)];

GO
ALTER TABLE [dbo].[Haikus] WITH CHECK CHECK CONSTRAINT [FK_Haikus_Users];

ALTER TABLE [dbo].[Rating] WITH CHECK CHECK CONSTRAINT [FK_Ratings_Haikus];

ALTER TABLE [dbo].[Rating] WITH CHECK CHECK CONSTRAINT [FK_Ratings_Users];

ALTER TABLE [dbo].[SaltForUser] WITH CHECK CHECK CONSTRAINT [FK_SaltForUser_Users];

GO
PRINT N'Update complete.';

GO


text:
{-# LANGUAGE RankNTypes #-}
------------------------------------------------------------------------------
-- | Types internal to the implementation of the Snap HTTP server.
module Snap.Internal.Http.Server.Types
  ( ServerConfig(..)
  , PerSessionData(..)
  , DataFinishedHook
  , EscapeSnapHook
  , ExceptionHook
  , ParseHook
  , NewRequestHook
  , UserHandlerFinishedHook

  -- * Handlers
  , SendFileHandler
  , ServerHandler
  , AcceptFunc(..)

  -- * Socket types
  , SocketConfig(..)
  ) where

------------------------------------------------------------------------------
import           Control.Exception                (SomeException)
import           Data.ByteString                  (ByteString)
import           Data.IORef                       (IORef)
import           Data.Word                        (Word64)
import           Network.Socket                   (Socket)
------------------------------------------------------------------------------
import           Data.ByteString.Builder          (Builder)
import           Data.ByteString.Builder.Internal (Buffer)
import           System.IO.Streams                (InputStream, OutputStream)
------------------------------------------------------------------------------
import           Snap.Core                        (Request, Response)

------------------------------------------------------------------------------
-- | The 'NewRequestHook' is called once processing for an HTTP request begins,
-- i.e. after the connection has been accepted and we know that there's data
-- available to read from the socket. The IORef passed to the hook initially
-- contains a bottom value that will throw an exception if evaluated.
type NewRequestHook hookState = PerSessionData -> IO hookState

-- | The 'ParseHook' is called after the HTTP Request has been parsed by the
-- server, but before the user handler starts running.
type ParseHook hookState = IORef hookState -> Request -> IO ()

-- | The 'UserHandlerFinishedHook' is called once the user handler has finished
-- running, but before the data for the HTTP response starts being sent to the
-- client.
type UserHandlerFinishedHook hookState =
    IORef hookState -> Request -> Response -> IO ()

-- | The 'DataFinishedHook' is called once the server has finished sending the
-- HTTP response to the client.
type DataFinishedHook hookState =
    IORef hookState -> Request -> Response -> IO ()

-- | The 'ExceptionHook' is called if an exception reaches the toplevel of the
-- server, i.e. if an exception leaks out of the user handler or if an
-- exception is raised during the sending of the HTTP response data.
type ExceptionHook hookState = IORef hookState -> SomeException -> IO ()

-- | The 'EscapeSnapHook' is called if the user handler escapes the HTTP
-- session, e.g. for websockets.
type EscapeSnapHook hookState = IORef hookState -> IO ()

                             ---------------------
                             -- data structures --
                             ---------------------
------------------------------------------------------------------------------
-- | Data and services that all HTTP response handlers share.
--
data ServerConfig hookState = ServerConfig
    { _logAccess             :: !(Request -> Response -> Word64 -> IO ())
    , _logError              :: !(Builder -> IO ())
    , _onNewRequest          :: !(NewRequestHook hookState)
    , _onParse               :: !(ParseHook hookState)
    , _onUserHandlerFinished :: !(UserHandlerFinishedHook hookState)
    , _onDataFinished        :: !(DataFinishedHook hookState)
    , _onException           :: !(ExceptionHook hookState)
    , _onEscape              :: !(EscapeSnapHook hookState)

      -- | will be overridden by a @Host@ header if it appears.
    , _localHostname         :: !ByteString
    , _defaultTimeout        :: {-# UNPACK #-} !Int
    , _isSecure              :: !Bool

      -- | Number of accept loops to spawn.
    , _numAcceptLoops        :: {-# UNPACK #-} !Int
    }

------------------------------------------------------------------------------
-- | All of the things a session needs to service a single HTTP request.
data PerSessionData = PerSessionData
    { -- | If the bool stored in this IORef becomes true, the server will close
      -- the connection after the current request is processed.
      _forceConnectionClose :: {-# UNPACK #-} !(IORef Bool)

      -- | An IO action to modify the current request timeout.
    , _twiddleTimeout       :: !((Int -> Int) -> IO ())

      -- | The value stored in this IORef is True if this request is the first
      -- on a new connection, and False if it is a subsequent keep-alive
      -- request.
    , _isNewConnection      :: !(IORef Bool)

      -- | The function called when we want to use @sendfile().@
    , _sendfileHandler      :: !SendFileHandler

      -- | The server's idea of its local address.
    , _localAddress         :: !ByteString

      -- | The listening port number.
    , _localPort            :: {-# UNPACK #-} !Int

      -- | The address of the remote user.
    , _remoteAddress        :: !ByteString

      -- | The remote user's port.
    , _remotePort           :: {-# UNPACK #-} !Int

      -- | The read end of the socket connection.
    , _readEnd              :: !(InputStream ByteString)

      -- | The write end of the socket connection.
    , _writeEnd             :: !(OutputStream ByteString)
    }

------------------------------------------------------------------------------
newtype AcceptFunc = AcceptFunc {
  runAcceptFunc :: (forall a . IO a -> IO a)         -- exception restore function
                    -> IO ( SendFileHandler          -- what to do on sendfile
                          , ByteString               -- local address
                          , Int                      -- local port
                          , ByteString               -- remote address
                          , Int                      -- remote port
                          , InputStream ByteString   -- socket read end
                          , OutputStream ByteString  -- socket write end
                          , IO ()                    -- cleanup action
                          )
  }

                             --------------------
                             -- function types --
                             --------------------
------------------------------------------------------------------------------
-- | This function, provided to the web server internals from the outside, is
-- responsible for producing a 'Response' once the server has parsed the
-- 'Request'.
--
type ServerHandler hookState =
        ServerConfig hookState     -- ^ global server config
     -> PerSessionData             -- ^ per-connection data
     -> Request                    -- ^ HTTP request object
     -> IO (Request, Response)

------------------------------------------------------------------------------
-- | A 'SendFileHandler' is called if the user handler requests that a file be
-- sent using @sendfile()@ on systems that support it (Linux, Mac OSX, and
-- FreeBSD).
type SendFileHandler =
       Buffer                   -- ^ builder buffer
    -> Builder                  -- ^ status line and headers
    -> FilePath                 -- ^ file to send
    -> Word64                   -- ^ start offset
    -> Word64                   -- ^ number of bytes
    -> IO ()

                        -------------------------------
                        -- types for server backends --
                        -------------------------------

------------------------------------------------------------------------------
-- | Either the server should start listening on the given interface \/ port
-- combination, or the server should start up with a 'Socket' that has already
-- had @bind()@ and @listen()@ called on it.
data SocketConfig = StartListening ByteString Int
                  | PreBound Socket


text:
from __future__ import (
    absolute_import,
    division,
    print_function,
    unicode_literals,
)

import sys
import unittest

_PY2 = sys.version_info[0] == 2

class GorillaTestCase(unittest.TestCase):

    if _PY2:
        assertCountEqual = unittest.TestCase.assertItemsEqual


text:
            error
            Diese Seite existiert nicht


text:
package com.family.web.util;

import java.io.Serializable;
import java.util.List;

import javax.servlet.http.HttpSession;

import com.family.service.bean.UserBean;
import com.family.web.controller.model.MemberModel;

public class UserSession implements Serializable {

	private static final long serialVersionUID = 1L;
	private static final String USER_SESSION = "UserSession";

	private List<UserBean> familyMembers;

	private MemberModel houseHeadInfo;

	public List<UserBean> getFamilyMembers() {
		return familyMembers;
	}

	public void setFamilyMembers(List<UserBean> familyMembers) {
		this.familyMembers = familyMembers;
	}

	public MemberModel getHouseHeadInfo() {
		return houseHeadInfo;
	}

	public void setHouseHeadInfo(MemberModel houseHeadInfo) {
		this.houseHeadInfo = houseHeadInfo;
	}

	/**
	 * get UserSession from HttpSession
	 */
	public static UserSession getUserSession(HttpSession session) {
		UserSession userSession = (UserSession) session.getAttribute(USER_SESSION);
		if (userSession == null) {
			return new UserSession();
		} else {
			return userSession;
		}
	}

	/**
	 * Store UserSession in HttpSession
	 */
	public static void storeUserSession(HttpSession session, HttpSession userSession) {
		session.setAttribute(USER_SESSION, userSession);
	}

	public static void storeHouseheadInfo(HttpSession session, MemberModel houseHeadInfo) {
		UserSession userSession = (UserSession) session.getAttribute(USER_SESSION);
		if (userSession == null) {
			userSession = new UserSession();
		}

		userSession.setHouseHeadInfo(houseHeadInfo);
		session.setAttribute(USER_SESSION, userSession);
	}

	public static MemberModel retrieveHouseheadInfo(HttpSession session) {
		UserSession userSession = (UserSession) session.getAttribute(USER_SESSION);
		MemberModel houseHead = null;

		if (userSession != null) {
			houseHead = userSession.getHouseHeadInfo();
		}

		return houseHead;
	}

}


text:
		<title>Counter</title>
		<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
		<link href="https://fonts.googleapis.com/css?family=Quicksand" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="./styles-2.css">
		<link rel="shortcut icon" href="images/favicon.ico" type="images/x-icon">

        	Need Help?

Intro to Web Programming

Intro to HTML

Intro to CSS

From Woof to JavaScript

Web Reference Guide

<form method="get" action="https://www.google.com/search" target="_blank"><input id="g-input" type="text" name="q"  placeholder="Search Google"></form>

Counter

In this project we'll make an interactive counter that can do simple addition and subtraction.

Click here to view fullscreen.

1. Create a new HTML document and give it a title.

2. Create an HTML element with an id of your choice, and with "0" inside it.

3. Create a button that says "Plus" or "+" on it.

4. Create a button that says "Minus" or "-" on it.

5. Using JavaScript, write code that gets the number from your HTML element, adds 1 to the number, then updates the page.

6. Make it so that this code runs when you click the "plus" button.

7. Now, write code that gets the number from your HTML element, subtracts 1 from the number, then updates the page.

8. Make it so that this new code runs when you click the "minus" button.

9. Add a text input box to the page, and give it an id.

10. Make it so that when you click "Plus" or "Minus", it adds or subtracts the number from the input box, instead of just 1.

11. Style your page with CSS -- make boxes with borders, style your fonts, etc.

12. Save and share your project!