text:
/*----------------------------------------------------------------------------------
        This file contains ESP32 and ESP32S2 Depricated ADC APIs and functions
-----------------------------------------------------------------------------------*/

#include "sdkconfig.h"
#include "esp_types.h"
#include "esp_log.h"
#include "esp_intr_alloc.h"
#include "driver/rtc_io.h"
#include "hal/adc_hal.h"
#include "hal/adc_ll.h"
#include "hal/adc_types.h"
#include "hal/adc_hal_conf.h"
#ifdef CONFIG_PM_ENABLE
#include "esp_pm.h"
#endif
#include "freertos/FreeRTOS.h"

#include "driver/adc_i2s_legacy.h"
#include "driver/adc_types_legacy.h"

static __attribute__((unused)) const char *ADC_TAG = "ADC";

#define ADC_CHECK_RET(fun_ret) ({                  \
    if (fun_ret != ESP_OK) {                                \
        ESP_LOGE(ADC_TAG,"%s:%d\n",__FUNCTION__,__LINE__);  \
        return ESP_FAIL;                                    \
    }                                                       \
})

#define ADC_CHECK(a, str, ret_val) ({                                               \
    if (!(a)) {                                                                     \
        ESP_LOGE(ADC_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str);                \
        return (ret_val);                                                           \
    }                                                                               \
})

#define ADC_CHANNEL_CHECK(periph, channel) ADC_CHECK(channel < SOC_ADC_CHANNEL_NUM(periph), "ADC"#periph" channel error", ESP_ERR_INVALID_ARG)
#define ADC_GET_IO_NUM(periph, channel) (adc_channel_io_map[periph][channel])

extern portMUX_TYPE rtc_spinlock; //TODO: Will be placed in the appropriate position after the rtc module is finished.
#define ADC_ENTER_CRITICAL()  portENTER_CRITICAL(&rtc_spinlock)
#define ADC_EXIT_CRITICAL()  portEXIT_CRITICAL(&rtc_spinlock)

#ifdef CONFIG_PM_ENABLE
esp_pm_lock_handle_t adc_digi_arbiter_lock = NULL;
#endif  //CONFIG_PM_ENABLE

#if CONFIG_IDF_TARGET_ESP32
/*---------------------------------------------------------------
        ESP32 Depricated ADC APIs and functions
---------------------------------------------------------------*/
#define DIG_ADC_OUTPUT_FORMAT_DEFUALT (ADC_DIGI_FORMAT_12BIT)
#define DIG_ADC_ATTEN_DEFUALT         (ADC_ATTEN_DB_11)
#define DIG_ADC_BIT_WIDTH_DEFUALT     (3)   //3 for ADC_WIDTH_BIT_12

/**
 * @brief ADC digital controller (DMA mode) conversion rules setting.
 */
typedef struct {
    union {
        struct {
            uint8_t atten:     2;   /*!< ADC sampling voltage attenuation configuration. Modification of attenuation affects the range of measurements.
                                         0: measurement range 0 - 800mV,
                                         1: measurement range 0 - 1100mV,
                                         2: measurement range 0 - 1350mV,
                                         3: measurement range 0 - 2600mV. */
            uint8_t bit_width: 2;   /*!< ADC resolution.
-                                         0: 9 bit;
-                                         1: 10 bit;
-                                         2: 11 bit;
-                                         3: 12 bit. */
            int8_t channel:   4;   /*!< ADC channel index. */
        };
        uint8_t val;                /*!<Raw data value */
    };
} adc_digi_pattern_table_t;

/**
 * @brief ADC digital controller (DMA mode) output data format option.
 */
typedef enum {
    ADC_DIGI_FORMAT_12BIT,  /*!<ADC to DMA data format,                [15:12]-channel, [11: 0]-12 bits ADC data (`adc_digi_output_data_t`). Note: For single convert mode. */
    ADC_DIGI_FORMAT_11BIT,  /*!<ADC to DMA data format, [15]-adc unit, [14:11]-channel, [10: 0]-11 bits ADC data (`adc_digi_output_data_t`). Note: For multi or alter convert mode. */
    ADC_DIGI_FORMAT_MAX,
} adc_digi_format_t;

/**
  * Explanation of the relationship between `conv_limit_num`, `dma_eof_num` and the number of DMA outputs:
  *
  *     +---------------------+--------+--------+--------+
  *     | conv_mode           | single |  both  |  alter |
  *     +---------------------+--------+--------+--------+
  *     | trigger meas times  |    1   |    1   |    1   |
  *     +---------------------+--------+--------+--------+
  *     | conv_limit_num      |   +1   |   +1   |   +1   |
  *     | dma_eof_num         |   +1   |   +2   |   +1   |
  *     | dma output (byte)   |   +2   |   +4   |   +2   |
  *     +---------------------+--------+--------+--------+
  */
typedef struct {
    uint32_t adc1_pattern_len;               /*!<Pattern table length for digital controller. Range: 0 ~ 16 (0: Don't change the pattern table setting).
                                                 The pattern table that defines the conversion rules for each SAR ADC. Each table has 16 items, in which channel selection,
                                                 resolution and attenuation are stored. When the conversion is started, the controller reads conversion rules from the
                                                 pattern table one by one. For each controller the scan sequence has at most 16 different rules before repeating itself. */
    uint32_t adc2_pattern_len;               /*!<Refer to ``adc1_pattern_len`` */
    adc_digi_pattern_table_t *adc1_pattern;  /*!<Pointer to pattern table for digital controller. The table size defined by `adc1_pattern_len`. */
    adc_digi_pattern_table_t *adc2_pattern;  /*!<Refer to `adc1_pattern` */
    adc_digi_convert_mode_t conv_mode;       /*!<ADC conversion mode for digital controller. See ``adc_digi_convert_mode_t``. */
    adc_digi_format_t format;                /*!<ADC output data format for digital controller. See ``adc_digi_format_t``. */
} adc_digi_config_t;

/**
 * Set adc output 16-bit-data format from digital controller.
 *
 * @param data_sel 1: [15] unit, [14:11] channel, [10:0] data, 11-bit-width at most. Only work under `ADC_LL_DIGI_CONV_BOTH_UNIT` or `ADC_LL_DIGI_CONV_ALTER_UNIT` mode.
 *                 0: [15:12] channel, [11:0] data, 12-bit-width at most. Only work under `ADC_LL_DIGI_CONV_ONLY_ADC1` or `ADC_LL_DIGI_CONV_ONLY_ADC2` mode
 * @note see `adc_ll_digi_pattern_table_t` for more detail of data bit width
 */
static inline void adc_ll_digi_set_output_format(bool data_sel)
{
    SYSCON.saradc_ctrl.data_sar_sel = data_sel;
}

static inline void adc_ll_digi_prepare_pattern_table(adc_unit_t adc_n, uint32_t pattern_index, adc_digi_pattern_table_t pattern)
{
    uint32_t tab;
    uint8_t index = pattern_index / 4;
    uint8_t offset = (pattern_index % 4) * 8;
    if (adc_n == ADC_UNIT_1) {
        tab = SYSCON.saradc_sar1_patt_tab[index];   // Read old register value
        tab &= (~(0xFF000000 >> offset));           // clear old data
        tab |= ((uint32_t)pattern.val << 24) >> offset; // Fill in the new data
        SYSCON.saradc_sar1_patt_tab[index] = tab;   // Write back
    } else { // adc_n == ADC_UNIT_2
        tab = SYSCON.saradc_sar2_patt_tab[index];   // Read old register value
        tab &= (~(0xFF000000 >> offset));           // clear old data
        tab |= ((uint32_t)pattern.val << 24) >> offset; // Fill in the new data
        SYSCON.saradc_sar2_patt_tab[index] = tab;   // Write back
    }
}

static void adc_digi_controller_reg_set(const adc_digi_config_t *cfg)
{
    /* On ESP32, only support ADC1 */
    switch (cfg->conv_mode) {
        case ADC_CONV_SINGLE_UNIT_1:
            adc_ll_digi_set_convert_mode(ADC_LL_DIGI_CONV_ONLY_ADC1);
            break;
        case ADC_CONV_SINGLE_UNIT_2:
            adc_ll_digi_set_convert_mode(ADC_LL_DIGI_CONV_ONLY_ADC2);
            break;
        case ADC_CONV_BOTH_UNIT:
            adc_ll_digi_set_convert_mode(ADC_LL_DIGI_CONV_BOTH_UNIT);
            break;
        case ADC_CONV_ALTER_UNIT:
            adc_ll_digi_set_convert_mode(ADC_LL_DIGI_CONV_ALTER_UNIT);
            break;
        default:
            abort();
    }

    if (cfg->conv_mode & ADC_CONV_SINGLE_UNIT_1) {
        adc_ll_set_controller(ADC_UNIT_1, ADC_LL_CTRL_DIG);
        if (cfg->adc1_pattern_len) {
            adc_ll_digi_clear_pattern_table(ADC_UNIT_1);
            adc_ll_digi_set_pattern_table_len(ADC_UNIT_1, cfg->adc1_pattern_len);
            for (uint32_t i = 0; i < cfg->adc1_pattern_len; i++) {
                adc_ll_digi_prepare_pattern_table(ADC_UNIT_1, i, cfg->adc1_pattern[i]);
            }
        }
    }
    if (cfg->conv_mode & ADC_CONV_SINGLE_UNIT_2) {
        adc_ll_set_controller(ADC_UNIT_2, ADC_LL_CTRL_DIG);
        if (cfg->adc2_pattern_len) {
            adc_ll_digi_clear_pattern_table(ADC_UNIT_2);
            adc_ll_digi_set_pattern_table_len(ADC_UNIT_2, cfg->adc2_pattern_len);
            for (uint32_t i = 0; i < cfg->adc2_pattern_len; i++) {
                adc_ll_digi_prepare_pattern_table(ADC_UNIT_2, i, cfg->adc2_pattern[i]);
            }
        }
    }
    adc_ll_digi_set_output_format(cfg->format);
    adc_ll_digi_convert_limit_enable(ADC_LL_DEFAULT_CONV_LIMIT_EN);
    adc_ll_digi_set_convert_limit_num(ADC_LL_DEFAULT_CONV_LIMIT_NUM);
    adc_ll_digi_set_data_source(ADC_I2S_DATA_SRC_ADC);
}

esp_err_t adc_set_i2s_data_source(adc_i2s_source_t src)
{
    ADC_CHECK((src == ADC_I2S_DATA_SRC_IO_SIG || src == ADC_I2S_DATA_SRC_ADC), "ADC i2s data source error", ESP_ERR_INVALID_ARG);
    ADC_ENTER_CRITICAL();
    adc_ll_digi_set_data_source(src);
    ADC_EXIT_CRITICAL();
    return ESP_OK;
}

extern esp_err_t adc_common_gpio_init(adc_unit_t adc_unit, adc_channel_t channel);
esp_err_t adc_i2s_mode_init(adc_unit_t adc_unit, adc_channel_t channel)
{
    if (adc_unit == ADC_UNIT_1) {
        ADC_CHANNEL_CHECK(ADC_UNIT_1, channel);
    } else if (adc_unit == ADC_UNIT_2) {
        //ADC2 does not support DMA mode
        ADC_CHECK(false, "ADC2 not support DMA for now.", ESP_ERR_INVALID_ARG);
        ADC_CHANNEL_CHECK(ADC_UNIT_2, channel);
    }

    adc_digi_pattern_table_t adc1_pattern[1];
    adc_digi_pattern_table_t adc2_pattern[1];
    adc_digi_config_t dig_cfg = {
        .format = DIG_ADC_OUTPUT_FORMAT_DEFUALT,
        .conv_mode = ADC_CONV_SINGLE_UNIT_1,
    };

    if (adc_unit == ADC_UNIT_1) {
        adc1_pattern[0].atten = DIG_ADC_ATTEN_DEFUALT;
        adc1_pattern[0].bit_width = DIG_ADC_BIT_WIDTH_DEFUALT;
        adc1_pattern[0].channel = channel;
        dig_cfg.adc1_pattern_len = 1;
        dig_cfg.adc1_pattern = adc1_pattern;
    } else if (adc_unit == ADC_UNIT_2) {
        adc2_pattern[0].atten = DIG_ADC_ATTEN_DEFUALT;
        adc2_pattern[0].bit_width = DIG_ADC_BIT_WIDTH_DEFUALT;
        adc2_pattern[0].channel = channel;
        dig_cfg.adc2_pattern_len = 1;
        dig_cfg.adc2_pattern = adc2_pattern;
    }
    adc_common_gpio_init(adc_unit, channel);
    ADC_ENTER_CRITICAL();
    adc_ll_digi_set_fsm_time(ADC_HAL_FSM_RSTB_WAIT_DEFAULT, ADC_HAL_FSM_START_WAIT_DEFAULT,
                             ADC_HAL_FSM_STANDBY_WAIT_DEFAULT);
    adc_ll_set_sample_cycle(ADC_HAL_SAMPLE_CYCLE_DEFAULT);
    adc_hal_pwdet_set_cct(ADC_HAL_PWDET_CCT_DEFAULT);
    adc_ll_digi_output_invert(ADC_UNIT_1, ADC_HAL_DIGI_DATA_INVERT_DEFAULT(ADC_UNIT_1));
    adc_ll_digi_output_invert(ADC_UNIT_2, ADC_HAL_DIGI_DATA_INVERT_DEFAULT(ADC_UNIT_2));
    adc_ll_digi_set_clk_div(ADC_HAL_DIGI_SAR_CLK_DIV_DEFAULT);
    adc_digi_controller_reg_set(&dig_cfg);
    ADC_EXIT_CRITICAL();

    return ESP_OK;
}

#endif  //#if CONFIG_IDF_TARGET_ESP32


text:
const { serialize, unserialize } = require('./serialization');

describe('Serialization', () => {
    it('should keep the value of the serialized entry', () => {
        const entry = 'entry';
        const unserializedEntry = unserialize(serialize(entry));
        expect(unserializedEntry).toEqual(entry);
    });

    it('should keep the type of the serialized entry', () => {
        const entry = false;
        expect(typeof entry).toEqual('boolean');

        const serializedEntry = serialize(entry);
        expect(typeof serializedEntry).toEqual('string');

        const unseriazedEntry = unserialize(serializedEntry);
        expect(typeof unseriazedEntry).toEqual('boolean');
    });

    it('should keep `null` intact', () => {
        const entry = null;
        const unserializedEntry = unserialize(serialize(entry));
        expect(unserializedEntry).toEqual(entry);
    });
});

redpajama_set_name: RedPajamaGithub


text:
import subprocess
from .base_strategy import BaseStrategy
from utils.say import say

import spotipy

class PlayMusic(BaseStrategy):
    def __init__(self):
        self.type = "s/w"
        self.artist = None
        self.sp = spotipy.Spotify()
        self.sp.trace = False

    def describe(self):
        return "Would you like to listen to some music?"

    def find_artist(self, name):
        results = self.sp.search(q='artist:' + name, type='artist')
        items = results['artists']['items']

        if len(items) > 0:
            self.artist = items[0]
            say("Curating the best from %s..." % self.artist['name'])
            return True

        return False

    def start_spotify(self):
        running = int(subprocess.check_output([
            'osascript',
            '-e', 'tell application "System Events"',
            '-e', 'count (every process whose name is "Spotify")',
            '-e', 'end tell'
        ]).strip())

        if not running:
            subprocess.call([
                'osascript',
                '-e',
                'tell application "Spotify" to activate'
            ])

    def get_top_tracks(self):
        tracks = self.sp.artist_top_tracks(self.artist["uri"])['tracks']
        if len(tracks) > 0:
            say("Here's what I think are their best works.")
            count = 0

            playlist = {}

            for track in tracks:
                print("[%d] Song: %s Album: %s" % (count + 1, track['name'], track['album']['name']))
                say("%s from the album %s" % (track['name'], track['album']['name']))
                count += 1

                playlist[str(count)] = (self.artist['name'], track['name'], track['album']['name'], track['uri'])

            say("Please type the index of the song you would like to hear")
            choice = raw_input("reply: ")

            say("Playing %s from the album %s." % (playlist[choice][1], playlist[choice][2]))

            subprocess.call([
                'osascript',
                '-e',
                'tell app "Spotify" to play track "%s"' % playlist[choice][3]
            ])
        else:
            say("Sorry, Although I know %s but I can't find any songs. Weird" % (self.artist['name']))

    def perform(self):
        self.start_spotify()
        say("Please type the artist you want to hear: ")
        name = raw_input("reply: ")

        if not self.find_artist(name):
            say("That's weird. All this knowledge and still I couldn't find anything. I'll try to learn more.")
            say("My sincere apologies for that.")
            return

        self.get_top_tracks()

    def react(self):
        say("Okay, lets find some awesome music just for you...")


text:
#ifndef ALITRDQAGUICLUSTERSSTACK_H
#define ALITRDQAGUICLUSTERSSTACK_H

/* $Id: AliTRDqaGuiClustersStack.h 23387 2008-01-17 17:25:16Z cblume $ */

#include "TGFrame.h"

class TH1D;
class TString;
class TGLabel;
class TGComboBox;
class TGTextButton;
class TRootEmbeddedCanvas;

class AliTRDqaGuiClustersStack : public TGCompositeFrame {

 public:

  AliTRDqaGuiClustersStack();
  AliTRDqaGuiClustersStack(TGWindow *parent);
  ~AliTRDqaGuiClustersStack() {}

  void SetQAFile(const char *filename);
  void SetSM(Int_t idxSM);
  void SetStack(Int_t idxStack);
  void SetView(Int_t idxView);

  // void Play();  // *SLOT*
  void PreviusStack() {if (fIdxStack > 0) SetStack(fIdxStack-1);}   // *SLOT*
  void NextStack()    {if (fIdxStack < fgknStack-1) SetStack(fIdxStack+1);}   // *SLOT*

  void PreviusSM() {if (fIdxSM > 0) SetSM(fIdxSM-1);}      // *SLOT*
  void NextSM()    {if (fIdxSM < fgknSM-1) SetSM(fIdxSM+1);}   // *SLOT*

  void SelectStack(Int_t idx) {SetStack(idx);} // *SLOT*
  void SelectSM(Int_t idx) {SetSM(idx);}       // *SLOT*
  void SelectView(Int_t idx) {SetView(idx);}   // *SLOT*

 protected:

  static const Int_t fgknSM;     // number of Super Modules
  static const Int_t fgknStack;  // number of stacks
  static const Int_t fgknCh;     // number of chambers per stack

  Int_t fIdxSM;      // active super module
  Int_t fIdxStack;   // active stack
  Int_t fView;       // data type

  //char fFileName[256];      // file with histograms
  const Char_t *fFileName;    // file with histograms

  TRootEmbeddedCanvas *fCanvasList[6];   // canvases
  TH1D *fHistList[6];                    // and histos

  //
  TGCompositeFrame *fGPanel;   // panel with buttons
  TGCompositeFrame *fGCanvas;  // and with canvases

  // steering panel
  // TGLabel      *fGLabel;
  TGComboBox   *fGSelectSM;        // select super module
  TGComboBox   *fGSelectStack;     // select stack
  TGComboBox   *fGSelectView;      // select data type

  TGTextButton *fGPrevSM;       // button
  TGTextButton *fGPrevStack;    // button
  TGTextButton *fGNextSM;       // buton
  TGTextButton *fGNextStack;    // button
  TGTextButton *fGPlay;         // inactive button

  void CreateHistAmplitude();
  void CreateHistTimeCharge();
  void CreateHistTimeMPV();

 private:
  AliTRDqaGuiClustersStack& operator = (const AliTRDqaGuiClustersStack& /*g*/) { return *this; };
  AliTRDqaGuiClustersStack(const AliTRDqaGuiClustersStack &);
  ClassDef(AliTRDqaGuiClustersStack,2) //
};

#endif


text:
const template = require('./about.html'),
      vue = require('vue');

module.exports = vue.extend({
  template: template
});


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.09.07 at 08:01:35 PM IST
//

package com.mozu.qbintegration.model.qbmodel.allgen;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element ref="{}ColTitle" maxOccurs="unbounded"/>
 *         <element ref="{}ColType"/>
 *       </sequence>
 *       <attribute name="colID" use="required" type="{}INTTYPE" />
 *       <attribute name="dataType" use="required">
 *         <simpleType>
 *           <restriction base="{}STRTYPE">
 *             <enumeration value="AMTTYPE"/>
 *             <enumeration value="BOOLTYPE"/>
 *             <enumeration value="DATETIMETYPE"/>
 *             <enumeration value="DATETYPE"/>
 *             <enumeration value="ENUMTYPE"/>
 *             <enumeration value="GUIDTYPE"/>
 *             <enumeration value="IDTYPE"/>
 *             <enumeration value="INTTYPE"/>
 *             <enumeration value="PERCENTTYPE"/>
 *             <enumeration value="PRICETYPE"/>
 *             <enumeration value="QUANTYPE"/>
 *             <enumeration value="STRTYPE"/>
 *             <enumeration value="TIMEINTERVALTYPE"/>
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "colTitle",
    "colType"
})
@XmlRootElement(name = "ColDesc")
public class ColDesc {

    @XmlElement(name = "ColTitle", required = true)
    protected List<ColTitle> colTitle;
    @XmlElement(name = "ColType", required = true)
    protected String colType;
    @XmlAttribute(name = "colID", required = true)
    protected BigInteger colID;
    @XmlAttribute(name = "dataType", required = true)
    protected String dataType;

    /**
     * Gets the value of the colTitle property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the colTitle property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getColTitle().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link ColTitle }
     *
     *
     */
    public List<ColTitle> getColTitle() {
        if (colTitle == null) {
            colTitle = new ArrayList<ColTitle>();
        }
        return this.colTitle;
    }

    /**
     * Gets the value of the colType property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getColType() {
        return colType;
    }

    /**
     * Sets the value of the colType property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setColType(String value) {
        this.colType = value;
    }

    /**
     * Gets the value of the colID property.
     *
     * @return
     *     possible object is
     *     {@link BigInteger }
     *
     */
    public BigInteger getColID() {
        return colID;
    }

    /**
     * Sets the value of the colID property.
     *
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *
     */
    public void setColID(BigInteger value) {
        this.colID = value;
    }

    /**
     * Gets the value of the dataType property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDataType() {
        return dataType;
    }

    /**
     * Sets the value of the dataType property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDataType(String value) {
        this.dataType = value;
    }

}


text:
FOUNDATION_EXPORT double EHItemsViewVersionNumber;
FOUNDATION_EXPORT const unsigned char EHItemsViewVersionString[];


text:
<?php

namespace Thytanium\Chameleon\Handlers;

/**
 * Interface HandlerInterface
 * @package Thytanium\Chameleon\Handlers
 */
interface HandlerInterface
{
    /**
     * Handle handler
     *
     * @return mixed
     */
    public function handle();

    /**
     * Mime type
     *
     * @return string
     */
    public function mime();

    /**
     * File extension
     *
     * @return string
     */
    public function ext();

    /**
     * Filename
     *
     * @param $title
     * @param $default
     * @return string
     */
    public function filename($title, $default = '');
}


text:
<!DOCTYPE HTML>
<html>
	<head>
		<title>Hello World HTML5 version</title>
		<script src="cocos2d.js"></script>
	</head>
	<body style="padding:0px;margin:0px;background-color:white">
		<canvas id="gameCanvas" width="500" height="500">
		Your browser does not support the canvas tag
		</canvas>
	</body>
</html>


text:
package elastic

import (
	"context"
	"fmt"
	"net/http"
	"net/url"
	"strings"

	"github.com/olivere/elastic/v7/uritemplates"
)

// IndexService adds or updates a typed JSON document in a specified index,
// making it searchable.
//
// See https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-index_.html
// for details.
type IndexService struct {
	client *Client

	pretty     *bool       // pretty format the returned JSON response
	human      *bool       // return human readable values for statistics
	errorTrace *bool       // include the stack trace of returned errors
	filterPath []string    // list of filters used to reduce the response
	headers    http.Header // custom request-level HTTP headers

	id                  string
	index               string
	typ                 string
	parent              string
	routing             string
	timeout             string
	timestamp           string
	ttl                 string
	version             interface{}
	opType              string
	versionType         string
	refresh             string
	waitForActiveShards string
	pipeline            string
	ifSeqNo             *int64
	ifPrimaryTerm       *int64
	bodyJson            interface{}
	bodyString          string
}

// NewIndexService creates a new IndexService.
func NewIndexService(client *Client) *IndexService {
	return &IndexService{
		client: client,
		typ:    "_doc",
	}
}

// Pretty tells Elasticsearch whether to return a formatted JSON response.
func (s *IndexService) Pretty(pretty bool) *IndexService {
	s.pretty = &pretty
	return s
}

// Human specifies whether human readable values should be returned in
// the JSON response, e.g. "7.5mb".
func (s *IndexService) Human(human bool) *IndexService {
	s.human = &human
	return s
}

// ErrorTrace specifies whether to include the stack trace of returned errors.
func (s *IndexService) ErrorTrace(errorTrace bool) *IndexService {
	s.errorTrace = &errorTrace
	return s
}

// FilterPath specifies a list of filters used to reduce the response.
func (s *IndexService) FilterPath(filterPath ...string) *IndexService {
	s.filterPath = filterPath
	return s
}

// Header adds a header to the request.
func (s *IndexService) Header(name string, value string) *IndexService {
	if s.headers == nil {
		s.headers = http.Header{}
	}
	s.headers.Add(name, value)
	return s
}

// Headers specifies the headers of the request.
func (s *IndexService) Headers(headers http.Header) *IndexService {
	s.headers = headers
	return s
}

// Id is the document ID.
func (s *IndexService) Id(id string) *IndexService {
	s.id = id
	return s
}

// Index is the name of the index.
func (s *IndexService) Index(index string) *IndexService {
	s.index = index
	return s
}

// Type is the type of the document.
//
// Deprecated: Types are in the process of being removed.
func (s *IndexService) Type(typ string) *IndexService {
	s.typ = typ
	return s
}

// WaitForActiveShards sets the number of shard copies that must be active
// before proceeding with the index operation. Defaults to 1, meaning the
// primary shard only. Set to `all` for all shard copies, otherwise set to
// any non-negative value less than or equal to the total number of copies
// for the shard (number of replicas + 1).
func (s *IndexService) WaitForActiveShards(waitForActiveShards string) *IndexService {
	s.waitForActiveShards = waitForActiveShards
	return s
}

// Pipeline specifies the pipeline id to preprocess incoming documents with.
func (s *IndexService) Pipeline(pipeline string) *IndexService {
	s.pipeline = pipeline
	return s
}

// Refresh the index after performing the operation.
//
// See https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-refresh.html
// for details.
func (s *IndexService) Refresh(refresh string) *IndexService {
	s.refresh = refresh
	return s
}

// Ttl is an expiration time for the document.
func (s *IndexService) Ttl(ttl string) *IndexService {
	s.ttl = ttl
	return s
}

// TTL is an expiration time for the document (alias for Ttl).
func (s *IndexService) TTL(ttl string) *IndexService {
	s.ttl = ttl
	return s
}

// Version is an explicit version number for concurrency control.
func (s *IndexService) Version(version interface{}) *IndexService {
	s.version = version
	return s
}

// OpType is an explicit operation type, i.e. "create" or "index" (default).
func (s *IndexService) OpType(opType string) *IndexService {
	s.opType = opType
	return s
}

// Parent is the ID of the parent document.
func (s *IndexService) Parent(parent string) *IndexService {
	s.parent = parent
	return s
}

// Routing is a specific routing value.
func (s *IndexService) Routing(routing string) *IndexService {
	s.routing = routing
	return s
}

// Timeout is an explicit operation timeout.
func (s *IndexService) Timeout(timeout string) *IndexService {
	s.timeout = timeout
	return s
}

// Timestamp is an explicit timestamp for the document.
func (s *IndexService) Timestamp(timestamp string) *IndexService {
	s.timestamp = timestamp
	return s
}

// VersionType is a specific version type.
func (s *IndexService) VersionType(versionType string) *IndexService {
	s.versionType = versionType
	return s
}

// IfSeqNo indicates to only perform the index operation if the last
// operation that has changed the document has the specified sequence number.
func (s *IndexService) IfSeqNo(seqNo int64) *IndexService {
	s.ifSeqNo = &seqNo
	return s
}

// IfPrimaryTerm indicates to only perform the index operation if the
// last operation that has changed the document has the specified primary term.
func (s *IndexService) IfPrimaryTerm(primaryTerm int64) *IndexService {
	s.ifPrimaryTerm = &primaryTerm
	return s
}

// BodyJson is the document as a serializable JSON interface.
func (s *IndexService) BodyJson(body interface{}) *IndexService {
	s.bodyJson = body
	return s
}

// BodyString is the document encoded as a string.
func (s *IndexService) BodyString(body string) *IndexService {
	s.bodyString = body
	return s
}

// buildURL builds the URL for the operation.
func (s *IndexService) buildURL() (string, string, url.Values, error) {
	var err error
	var method, path string

	if s.id != "" {
		// Create document with manual id
		method = "PUT"
		path, err = uritemplates.Expand("/{index}/{type}/{id}", map[string]string{
			"id":    s.id,
			"index": s.index,
			"type":  s.typ,
		})
	} else {
		// Automatic ID generation
		// See https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-index_.html#index-creation
		method = "POST"
		path, err = uritemplates.Expand("/{index}/{type}/", map[string]string{
			"index": s.index,
			"type":  s.typ,
		})
	}
	if err != nil {
		return "", "", url.Values{}, err
	}

	// Add query string parameters
	params := url.Values{}
	if v := s.pretty; v != nil {
		params.Set("pretty", fmt.Sprint(*v))
	}
	if v := s.human; v != nil {
		params.Set("human", fmt.Sprint(*v))
	}
	if v := s.errorTrace; v != nil {
		params.Set("error_trace", fmt.Sprint(*v))
	}
	if len(s.filterPath) > 0 {
		params.Set("filter_path", strings.Join(s.filterPath, ","))
	}
	if s.waitForActiveShards != "" {
		params.Set("wait_for_active_shards", s.waitForActiveShards)
	}
	if s.refresh != "" {
		params.Set("refresh", s.refresh)
	}
	if s.opType != "" {
		params.Set("op_type", s.opType)
	}
	if s.parent != "" {
		params.Set("parent", s.parent)
	}
	if s.pipeline != "" {
		params.Set("pipeline", s.pipeline)
	}
	if s.routing != "" {
		params.Set("routing", s.routing)
	}
	if s.timeout != "" {
		params.Set("timeout", s.timeout)
	}
	if s.timestamp != "" {
		params.Set("timestamp", s.timestamp)
	}
	if s.ttl != "" {
		params.Set("ttl", s.ttl)
	}
	if s.version != nil {
		params.Set("version", fmt.Sprintf("%v", s.version))
	}
	if s.versionType != "" {
		params.Set("version_type", s.versionType)
	}
	if v := s.ifSeqNo; v != nil {
		params.Set("if_seq_no", fmt.Sprintf("%d", *v))
	}
	if v := s.ifPrimaryTerm; v != nil {
		params.Set("if_primary_term", fmt.Sprintf("%d", *v))
	}
	return method, path, params, nil
}

// Validate checks if the operation is valid.
func (s *IndexService) Validate() error {
	var invalid []string
	if s.index == "" {
		invalid = append(invalid, "Index")
	}
	if s.typ == "" {
		invalid = append(invalid, "Type")
	}
	if s.bodyString == "" && s.bodyJson == nil {
		invalid = append(invalid, "BodyJson")
	}
	if len(invalid) > 0 {
		return fmt.Errorf("missing required fields: %v", invalid)
	}
	return nil
}

// Do executes the operation.
func (s *IndexService) Do(ctx context.Context) (*IndexResponse, error) {
	// Check pre-conditions
	if err := s.Validate(); err != nil {
		return nil, err
	}

	// Get URL for request
	method, path, params, err := s.buildURL()
	if err != nil {
		return nil, err
	}

	// Setup HTTP request body
	var body interface{}
	if s.bodyJson != nil {
		body = s.bodyJson
	} else {
		body = s.bodyString
	}

	// Get HTTP response
	res, err := s.client.PerformRequest(ctx, PerformRequestOptions{
		Method:  method,
		Path:    path,
		Params:  params,
		Body:    body,
		Headers: s.headers,
	})
	if err != nil {
		return nil, err
	}

	// Return operation response
	ret := new(IndexResponse)
	if err := s.client.decoder.Decode(res.Body, ret); err != nil {
		return nil, err
	}
	return ret, nil
}

// IndexResponse is the result of indexing a document in Elasticsearch.
type IndexResponse struct {
	Index         string      `json:"_index,omitempty"`
	Type          string      `json:"_type,omitempty"`
	Id            string      `json:"_id,omitempty"`
	Version       int64       `json:"_version,omitempty"`
	Result        string      `json:"result,omitempty"`
	Shards        *ShardsInfo `json:"_shards,omitempty"`
	SeqNo         int64       `json:"_seq_no,omitempty"`
	PrimaryTerm   int64       `json:"_primary_term,omitempty"`
	Status        int         `json:"status,omitempty"`
	ForcedRefresh bool        `json:"forced_refresh,omitempty"`
}


text: package elastic5


text:
package net.bunselmeyer.middleware.util;

import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;

public class Optionals {

    @SuppressWarnings("OptionalUsedAsFieldOrParameterType")
    public static <T, U> void ifPresent(Optional<T> opt1, Optional<U> opt2, BiConsumer<T, U> consumer) {
        opt1.ifPresent((t) -> {
            opt2.ifPresent((u) -> {
                consumer.accept(t, u);
            });
        });

    }

    @SuppressWarnings("OptionalUsedAsFieldOrParameterType")
    public static <T, U, R> Optional<R> map(Optional<T> opt1, Optional<U> opt2, BiFunction<T, U, R> consumer) {
        return opt1
            .map((t) ->
                opt2.map((u) ->
                    consumer.apply(t, u)))
            .orElseGet(Optional::empty);

    }

}


text:
<?php

/**
 * SfsAdminBundle - Symfony2 project
 *
 * @author Ramine AGOUNE <ramine.agoune@solidlynx.com>
 */

namespace Sfs\AdminBundle\Exporter;

use Symfony\Component\HttpFoundation\StreamedResponse;

class JsonWriter extends WriterAbstract
{
	/**
	 * Returns a streamed Response with the json content of the exported entity
	 *
	 * @return StreamedResponse $response
	 */
	public function export() {
		$em = $this->em;
		$entityClass =  $this->entityClass;
		$listFields =  $this->listFields;

		$response = new StreamedResponse(function() use($em, $entityClass, $listFields) {
			// Get all objects in db
			$repository = $em->getRepository($entityClass);
			$results = $repository->createQueryBuilder('o')->getQuery()->getArrayResult();

			$handle = fopen('php://output', 'r+');

			fwrite($handle, json_encode($results));

			fclose($handle);
		});

		return $response;
	}
}


text:
<?php

namespace Think\Upload\Driver\Oss\Model;

use Think\Upload\Driver\Oss\Core\OssException;

/**
 * Class WebsiteConfig
 * @package OSS\Model
 * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketWebsite.html
 */
class WebsiteConfig implements XmlConfig
{
    /**
     * WebsiteConfig constructor.
     * @param  string $indexDocument
     * @param  string $errorDocument
     */
    public function __construct($indexDocument = "", $errorDocument = "")
    {
        $this->indexDocument = $indexDocument;
        $this->errorDocument = $errorDocument;
    }

    /**
     * @param string $strXml
     * @return null
     */
    public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);
        if (isset($xml->IndexDocument) && isset($xml->IndexDocument->Suffix)) {
            $this->indexDocument = strval($xml->IndexDocument->Suffix);
        }
        if (isset($xml->ErrorDocument) && isset($xml->ErrorDocument->Key)) {
            $this->errorDocument = strval($xml->ErrorDocument->Key);
        }
    }

    /**
     * 把WebsiteConfig序列化成xml
     *
     * @return string
     * @throws OssException
     */
    public function serializeToXml()
    {
        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><WebsiteConfiguration></WebsiteConfiguration>');
        $index_document_part = $xml->addChild('IndexDocument');
        $error_document_part = $xml->addChild('ErrorDocument');
        $index_document_part->addChild('Suffix', $this->indexDocument);
        $error_document_part->addChild('Key', $this->errorDocument);
        return $xml->asXML();
    }

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

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

    private $indexDocument = "";
    private $errorDocument = "";
}


text:
package sys

import (
	"encoding/binary"
	"unsafe"
)

func GetEndian() binary.ByteOrder {
	var i int32 = 0x1
	v := (*[4]byte)(unsafe.Pointer(&i))
	if v[0] == 0 {
		return binary.BigEndian
	} else {
		return binary.LittleEndian
	}
}


text:
const chai = require('chai');
const chaiHttp = require('chai-http');
const cheerio = require('cheerio');
const nock = require('nock');

const constants = require('../../app/lib/constants');
const getSampleResponse = require('../resources/getSampleResponse');
const iExpect = require('../lib/expectations');
const postcodesIOURL = require('../lib/constants').postcodesIOURL;
const server = require('../../server');
const nockRequests = require('../lib/nockRequests');
const queryBuilder = require('../../app/lib/queryBuilder');
const postcodeCoordinates = require('../resources/postcode-coordinates');

const expect = chai.expect;
const queryTypes = constants.queryTypes;

chai.use(chaiHttp);

const siteRoot = constants.siteRoot;
const resultsRoute = `${siteRoot}/results`;

function expectStandardMetadata($) {
  const canonicalUrl = `https://127.0.0.1${siteRoot}/`;
  expect($('link[rel="canonical"]').attr('href')).to.equal(canonicalUrl);
  expect($('meta[property="og:description"]').attr('content')).to.equal(constants.app.description);
  expect($('meta[property="og:image"]').attr('content')).to.equal(`${canonicalUrl}images/opengraph-image.png`);
  expect($('meta[property="og:image:alt"]').attr('content')).to.equal('nhs.uk');
  expect($('meta[property="og:image:height"]').attr('content')).to.equal('630');
  expect($('meta[property="og:image:width"]').attr('content')).to.equal('1200');
  expect($('meta[property="og:locale"]').attr('content')).to.equal(constants.app.locale);
  expect($('meta[property="og:site_name"]').attr('content')).to.equal(constants.app.siteName);
  expect($('meta[property="og:title"]').attr('content')).to.equal(`${constants.app.title} - NHS`);
  expect($('meta[property="og:type"]').attr('content')).to.equal('website');
  expect($('meta[property="og:url"]').attr('content')).to.equal(`https://127.0.0.1${siteRoot}/`);
  expect($('meta[property="twitter:card"]').attr('content')).to.equal('summary_large_image');
  expect($('meta[property="twitter:creator"]').attr('content')).to.equal('@nhsuk');
  expect($('meta[property="twitter:site"]').attr('content')).to.equal('@nhsuk');
}

describe('Metadata', () => {
  const location = 'Midsomer';

  afterEach('clean nock', () => {
    nock.cleanAll();
  });

  describe('the search page', () => {
    it('should include the standard properties', async () => {
      const res = await chai.request(server).get(siteRoot);
      iExpect.htmlWith200Status(res);
      const $ = cheerio.load(res.text);

      expectStandardMetadata($);
    });
  });

  describe('the results page, when displaying results', () => {
    it('should include the standard properties', async () => {
      const searchOrigin = postcodeCoordinates.LS1;
      const body = queryBuilder(searchOrigin, { queryType: queryTypes.nearby });
      await nockRequests.serviceSearch(body, 200, 'organisations/LS1-as.json');

      const res = await chai.request(server)
        .get(resultsRoute)
        .query({
          latitude: searchOrigin.latitude,
          location,
          longitude: searchOrigin.longitude,
        });
      iExpect.htmlWith200Status(res);
      const $ = cheerio.load(res.text);

      expectStandardMetadata($);
    });
  });

  describe('the results page, when there are no results', () => {
    it('should include the standard properties', async () => {
      const multiPlaceResponse = getSampleResponse('postcodesio-responses/multiplePlaceResult.json');
      const multiPlaceTerm = 'multiresult';

      nock(postcodesIOURL)
        .get(`/places?limit=100&q=${multiPlaceTerm}`)
        .times(1)
        .reply(200, multiPlaceResponse);

      const res = await chai.request(server)
        .get(resultsRoute)
        .query({ location: multiPlaceTerm });

      iExpect.htmlWith200Status(res);
      const $ = cheerio.load(res.text);

      expectStandardMetadata($);
    });
  });
});


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

  <title>Description of manageStack</title>
  <meta name="keywords" content="manageStack">
  <meta name="description" content="Valid modes:">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 © 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../../../../../m2html.css">

Home >  .. > SMASHtoolbox > +SMASH > +General > @DataStack > private > manageStack.m

manageStack

PURPOSE

Valid modes:

SYNOPSIS

function varargout=manageStack(mode,varargin)

DESCRIPTION

 Valid modes:
    manageStack('push',name,value);

    value=manageStack('pop',name);

    list=manageStack('probe',name);

    manageStack('delete',name,...);

CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

SOURCE CODE

0001 % Valid modes:
0002 %    manageStack('push',name,value);
0003 %
0004 %    value=manageStack('pop',name);
0005 %
0006 %    list=manageStack('probe',name);
0007 %
0008 %    manageStack('delete',name,...);
0009 %
0010 function varargout=manageStack(mode,varargin)
0011
0012 mlock
0013 persistent StackMemory
0014 if isempty(StackMemory)
0015     StackMemory=struct();
0016 end
0017
0018 if strcmp(mode,'push')
0019     name=varargin{1};
0020     value=varargin{2};
0021     if ~isfield(StackMemory,name)
0022         StackMemory.(name)={};
0023     end
0024     StackMemory.(name){end+1}=value;
0025     return
0026 end
0027
0028 switch mode
0029     case 'pop'
0030         name=varargin{1};
0031         msg=sprintf('ERROR: stack "%s" not defined',name);
0032         assert(isfield(StackMemory,name),msg);
0033         if isempty(StackMemory.(name))
0034             varargout{1}=[];
0035         else
0036             varargout{1}=StackMemory.(name){end};
0037         end
0038         StackMemory.(name)=StackMemory.(name)(1:end-1);
0039     case 'probe'
0040         if nargin == 1
0041             varargout{1}=fieldnames(StackMemory);
0042         else
0043         name=varargin{1};
0044         msg=sprintf('ERROR: stack "%s" not defined',name);
0045         assert(isfield(StackMemory,name),msg);
0046             varargout{1}=numel(StackMemory.(name));
0047         end
0048     case 'delete'
0049         if nargin == 1
0050             StackMemory=struct();
0051         else
0052         name=varargin{1};
0053         msg=sprintf('ERROR: stack "%s" not defined',name);
0054         assert(isfield(StackMemory,name),msg);
0055             StackMemory=rmfield(StackMemory,name);
0056         end
0057 end
0058
0059 end

<address>Generated on Tue 10-Nov-2020 17:53:50 by m2html © 2005</address>


text:
layout: post
date: 2004-12-30
time: "09:00:00"
author: "Greg Wilson"
title: Python Software Foundation Grant
category: ["Python Software Foundation"]
---

Greg Wilson has been awared a grant from the Python Software Foundation to revamp his course on "Software Engineering for Scientists and Engineers", and put it under an open license, so that it can be used at other institutions.  W00t!


text:
import unittest
import os
from tests import ExploitVerification
from framework import Query
import bblogger

import logging

logging = logging.getLogger("testbb")

def main():

    suite = unittest.TestSuite()
    loader = unittest.TestLoader()

    for exploit in Query().exploits:
        suite.addTest(ExploitVerification(exploit))

    testRunner = unittest.runner.TextTestRunner()
    testRunner.run(suite)

if __name__ == "__main__":
    main()


text:
package com.nicolas.coding.login.auth;

import java.security.GeneralSecurityException;

/**
 * Using an interface to allow us to inject different signature
 * implementations.
 */
interface Signer {
    /**
     * @param data Preimage to sign, represented as sequence of arbitrary bytes
     * @return Signature as sequence of bytes.
     * @throws GeneralSecurityException
     */
    byte[] sign(byte[] data) throws GeneralSecurityException;
}


text:
package com.xing.xnote;

import android.app.Activity;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.VideoView;

public class SitemActivity extends Activity implements OnClickListener{

	private Button delete,back;
	private ImageView image;
	private VideoView video;
	private TextView  tv;
	private XnoteDbHelper dbHelper;
	private SQLiteDatabase db;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.item);
		initView();
		dbHelper=new XnoteDbHelper(this);
		db=dbHelper.getWritableDatabase();
		if(getIntent().getStringExtra(XnoteDbHelper.PATH).equals("null")){

			image.setVisibility(View.GONE);
		}
		else{
			image.setVisibility(View.VISIBLE);
		}
		if(getIntent().getStringExtra(XnoteDbHelper.VIDEO).equals("null")){

			video.setVisibility(View.GONE);
		}
		else{
			video.setVisibility(View.VISIBLE);
		}
		tv.setText(getIntent().getStringExtra(XnoteDbHelper.CONTENT));
		Bitmap bitmap=BitmapFactory.decodeFile(getIntent().getStringExtra(XnoteDbHelper.PATH));
		image.setImageBitmap(bitmap);
		video.setVideoURI(Uri.parse(getIntent().getStringExtra(XnoteDbHelper.VIDEO)));
		video.start();
	}

	private void initView(){

		delete=(Button)findViewById(R.id.but_delete);
		back=(Button)findViewById(R.id.but_back);
		image=(ImageView)findViewById(R.id.item_image);
		video=(VideoView)findViewById(R.id.item_video);
		tv=(TextView)findViewById(R.id.item_tv);
		delete.setOnClickListener(this);
		back.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {

		switch (v.getId()) {
		case R.id.but_delete:
			delete();
			finish();
			break;

		case R.id.but_back:
			finish();
			break;
		}
	}
	public void delete(){

		db.delete(XnoteDbHelper.TABLE_NAME, XnoteDbHelper.ID+"="+getIntent().getIntExtra(XnoteDbHelper.ID, 0), null);
	}
}


text:
using System;

namespace WindowsPhoneUWP.UpgradeHelpers
{

  public abstract class UriMapperBaseHelper
  {
    public abstract Uri MapUri(Uri uri);
  }
}


text:
namespace CRFPP {
  struct Node;

  struct Path {
    Node   *rnode;
    Node   *lnode;
    int    *fvector;
    double  cost;

    Path(): rnode(0), lnode(0), fvector(0), cost(0.0) {}

    // for CRF
    void calcExpectation(double *expected, double, size_t) const;
    void add(Node *_lnode, Node *_rnode) ;

    void clear() {
      rnode = lnode = 0;
      fvector = 0;
      cost = 0.0;
    }
  };

  typedef std::vector<Path*>::const_iterator const_Path_iterator;
}
#endif


text:
О комплексе

«Планетоград» это дома повышенного комфорта высотой 4-5 этажей с яркими
          фасадами, французскими балконами и витражным остеклением лоджий.

Закрытая территория, дворы без авто, продуманное разделение транспортных
          потоков. Микрорайон возводится на Пулковских высотах в Московском районе.

«Планетоград» это дома повышенного комфорта высотой 4-5 этажей с яркими
          фасадами, французскими балконами и витражным остеклением лоджий.

          {{> elements/buttonKnowBuild}}


text:
//
// Copyright (c) 2008-2011, Kenneth Bell
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//

using System;
using System.Collections.Generic;
using System.IO;

namespace DiscUtils.SquashFs
{
    internal sealed class BuilderDirectory : BuilderNode
    {
        private readonly List<Entry> _children;
        private readonly Dictionary<string, Entry> _index;
        private DirectoryInode _inode;

        public BuilderDirectory()
        {
            _children = new List<Entry>();
            _index = new Dictionary<string, Entry>();
        }

        public override Inode Inode
        {
            get { return _inode; }
        }

        public void AddChild(string name, BuilderNode node)
        {
            if (name.Contains(@"\\"))
            {
                throw new ArgumentException("Single level of path must be provided", nameof(name));
            }

            if (_index.ContainsKey(name))
            {
                throw new IOException("The directory entry '" + name + "' already exists");
            }

            Entry newEntry = new Entry { Name = name, Node = node };
            _children.Add(newEntry);
            _index.Add(name, newEntry);
        }

        public BuilderNode GetChild(string name)
        {
            Entry result;
            if (_index.TryGetValue(name, out result))
            {
                return result.Node;
            }

            return null;
        }

        public override void Reset()
        {
            foreach (Entry entry in _children)
            {
                entry.Node.Reset();
            }

            _inode = new DirectoryInode();
        }

        public override void Write(BuilderContext context)
        {
            if (_written)
            {
                return;
            }

            _children.Sort();

            foreach (Entry entry in _children)
            {
                entry.Node.Write(context);
            }

            WriteDirectory(context);

            WriteInode(context);

            _written = true;
        }

        private void WriteDirectory(BuilderContext context)
        {
            MetadataRef startPos = context.DirectoryWriter.Position;

            int currentChild = 0;
            int numDirs = 0;
            while (currentChild < _children.Count)
            {
                long thisBlock = _children[currentChild].Node.InodeRef.Block;
                int firstInode = _children[currentChild].Node.InodeNumber;

                int count = 1;
                while (currentChild + count < _children.Count
                       && _children[currentChild + count].Node.InodeRef.Block == thisBlock
                       && _children[currentChild + count].Node.InodeNumber - firstInode < 0x7FFF)
                {
                    ++count;
                }

                DirectoryHeader hdr = new DirectoryHeader
                {
                    Count = count - 1,
                    InodeNumber = firstInode,
                    StartBlock = (int)thisBlock
                };

                hdr.WriteTo(context.IoBuffer, 0);
                context.DirectoryWriter.Write(context.IoBuffer, 0, hdr.Size);

                for (int i = 0; i < count; ++i)
                {
                    Entry child = _children[currentChild + i];
                    DirectoryRecord record = new DirectoryRecord
                    {
                        Offset = (ushort)child.Node.InodeRef.Offset,
                        InodeNumber = (short)(child.Node.InodeNumber - firstInode),
                        Type = child.Node.Inode.Type,
                        Name = child.Name
                    };

                    record.WriteTo(context.IoBuffer, 0);
                    context.DirectoryWriter.Write(context.IoBuffer, 0, record.Size);

                    if (child.Node.Inode.Type == InodeType.Directory
                        || child.Node.Inode.Type == InodeType.ExtendedDirectory)
                    {
                        ++numDirs;
                    }
                }

                currentChild += count;
            }

            long size = context.DirectoryWriter.DistanceFrom(startPos);
            if (size > uint.MaxValue)
            {
                throw new NotImplementedException("Writing large directories");
            }

            NumLinks = numDirs + 2; // +1 for self, +1 for parent

            _inode.StartBlock = (uint)startPos.Block;
            _inode.Offset = (ushort)startPos.Offset;
            _inode.FileSize = (uint)size + 3; // For some reason, always +3
        }

        private void WriteInode(BuilderContext context)
        {
            FillCommonInodeData(context);
            _inode.Type = InodeType.Directory;

            InodeRef = context.InodeWriter.Position;

            _inode.WriteTo(context.IoBuffer, 0);

            context.InodeWriter.Write(context.IoBuffer, 0, _inode.Size);
        }

        private class Entry : IComparable<Entry>
        {
            public string Name;
            public BuilderNode Node;

            public int CompareTo(Entry other)
            {
                return string.CompareOrdinal(Name, other.Name);
            }
        }
    }
}


text:
/** \brief FreeOSEK Os Conformance Test for the Event Mechanism, Test Sequence 2
 **
 ** \file FreeOSEK/Os/tst/ctest/src/ctest_em_02.c
 **/

/** \addtogroup FreeOSEK
 ** @{ */
/** \addtogroup FreeOSEK_Os
 ** @{ */
/** \addtogroup FreeOSEK_Os_CT Conformance Test
 ** @{ */
/** \addtogroup FreeOSEK_Os_CT_EM Event Mechanism
 ** @{ */
/** \addtogroup FreeOSEK_Os_CT_EM_02 Test Sequence 2
 ** @{ */

/*
 * Initials     Name
 * ---------------------------
 * MaCe         Mariano Cerdeiro
 */

/*
 * modification history (new versions first)
 * -----------------------------------------------------------
 * 20090417 v0.1.0 MaCe initial version based on old moduletest
 */

/*==================[inclusions]=============================================*/
#include "os.h"            /* include os header file */
#include "ctest_em_02.h"   /* include test header file */
#include "ctest.h"         /* include ctest header file */

/*==================[macros and definitions]=================================*/

/*==================[internal data declaration]==============================*/

/*==================[internal functions declaration]=========================*/

/*==================[internal data definition]===============================*/

/*==================[external data definition]===============================*/
const uint32f SequenceCounterOk = MAX_SEQUENCE;

/*==================[internal functions definition]==========================*/

/*==================[external functions definition]==========================*/
int main
(
   void
)
{
   /* start OS in AppMode 1 */
   StartOS(AppMode1);

   /* shall never return */
   while(1);

   return 0;
}

TASK(Task1)
{
   StatusType ret;
   EventMaskType EventMask;

   Sequence(3);
   /* \treq EM_20 nmf E1E2 se Call GetEvent() for waiting extended task
    *
    * \result Return current state of all event bits. Service returns E_OK
    */
   ret = GetEvent(Task2, &EventMask);
   ASSERT(EM_20, ret != E_OK);
   ASSERT(EM_20, EventMask != 0);

   Sequence(4);
   ret = SetEvent(Task1, Event1);
   ASSERT(OTHER, ret != E_OK);

   Sequence(5);
   /* \treq EM_18 nmf E1E2 se Call GetEvent() for running extended task
    *
    * \result Return current state of all event bits. Service returns E_OK
    */
   ret = GetEvent(Task1, &EventMask);
   ASSERT(EM_18, ret != E_OK);
   ASSERT(EM_18, EventMask != Event1);

   Sequence(6);
   /* \treq EM_26 nmf E1E2 se Call WaitEvent() for extended task. At least one
    * of the event waited for is already set
    *
    * \result No preemption of running task. Service returns E_OK
    */
   ret = WaitEvent(Event1);
   ASSERT(EM_26, ret != E_OK);

   Sequence(7);
   /* \treq EM_14 nmf E1E2 se Call ClearEvent() for extended task
    *
    * \result Requested events are cleared. Service returns E_OK
    */
   ret = ClearEvent(Event1);
   ASSERT(EM_14, ret != E_OK);

   Sequence(8);
   ret = GetEvent(Task1, &EventMask);
   ASSERT(OTHER, ret != E_OK);
   ASSERT(OTHER, EventMask != 0);

   Sequence(9);
   ret = SetEvent(Task2, Event2);
   ASSERT(OTHER, ret != E_OK);

#if (CT_SCHEDULING_Task1 == CT_NON_PREEMPTIVE)
   /* force scheduling */
   Schedule();
#endif /* #if (CT_SCHEDULING_TASK1 == CT_NON_PREEMPTIVE) */

   Sequence(11);

   /* evaluate conformance tests */
   ConfTestEvaluation();

   /* finish the conformance test */
   ConfTestFinish();
}

TASK(Task2)
{
   StatusType ret;
   EventMaskType EventMask;

   Sequence(0);
   ret = ActivateTask(Task1);
   ASSERT(OTHER, ret != E_OK);

   Sequence(1);
   /* \treq EM_19 nmf E1E2 se Call GetEvent() from ready extended
    *
    * \result Return current state of all vent bits. Service returns E_OK
    */
   ret = GetEvent(Task1, &EventMask);
   ASSERT(EM_19, ret != E_OK);
   ASSERT(EM_19, EventMask != 0);

   Sequence(2);
   /* \treq EM_25 nmf E1E2 se Call WaitEvent() from ready extended task.
    * None of the events waited for is set
    *
    * \result Running task becomes waiting and ready task with highest priority
    * is executed. Service returns E_OS_OK
    */
   ret = WaitEvent(Event2);
   ASSERT(EM_25, ret != E_OK);

   Sequence(10);
   TerminateTask();
}

/** @} doxygen end group definition */
/** @} doxygen end group definition */
/** @} doxygen end group definition */
/** @} doxygen end group definition */
/** @} doxygen end group definition */
/*==================[end of file]============================================*/


text:
from distutils.core import setup

setup(
    name='Schedaddle',
    version='0.1.0',
    author='David Davis',
    author_email='davisd@davisd.com',
    packages=['schedaddle',],
    url='http://www.davisd.com/projects/python-schedaddle',
    data_files=[('.',['LICENSE'])],
    license='LICENSE',
    description='Schedaddle is a python package for getting dates and times on'\
    ' scheduled intervals',
    long_description=open('README').read(),
)


text:
package agentclient

import (
	"io"
	"net"
	"sync"
	"sync/atomic"

	"google.golang.org/grpc"
	"k8s.io/klog"
	"sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client"
)

// AgentClient runs on the node network side. It connects to proxy server and establishes
// a stream connection from which it sends and receives network traffic.
type AgentClient struct {
	nextConnID  int64
	connContext map[int64]*connContext

	stream *RedialableAgentClient
	stopCh <-chan struct{}
}

func newAgentClient(address, agentID string, cs *ClientSet, opts ...grpc.DialOption) (*AgentClient, error) {
	stream, err := NewRedialableAgentClient(address, agentID, cs, opts...)
	if err != nil {
		return nil, err
	}
	return newAgentClientWithRedialableAgentClient(stream), nil
}

func newAgentClientWithRedialableAgentClient(rac *RedialableAgentClient) *AgentClient {
	return &AgentClient{
		connContext: make(map[int64]*connContext),
		stream:      rac,
		stopCh:      rac.stopCh,
	}
}

// Close closes the underlying stream.
func (c *AgentClient) Close() {
	if c.stream == nil {
		klog.Warning("Unexpected empty AgentClient.stream")
		return
	}
	c.stream.Close()
}

// connContext tracks a connection from agent to node network.
type connContext struct {
	conn      net.Conn
	cleanFunc func()
	dataCh    chan []byte
	cleanOnce sync.Once
}

func (c *connContext) cleanup() {
	c.cleanOnce.Do(c.cleanFunc)
}

// Connect connnects to proxy server to establish a gRPC stream,
// on which the proxied traffic is multiplexed through the stream
// and piped to the local connection. It register itself as a
// backend from proxy server, so proxy server will route traffic
// to this agent.
//
// The caller needs to call Serve to start serving proxy requests
// coming from proxy server.

// Serve starts to serve proxied requests from proxy server over the
// gRPC stream. Successful Connect is required before Serve. The
// The requests include things like opening a connection to a server,
// streaming data and close the connection.
func (a *AgentClient) Serve() {
	klog.Infof("Start serving for serverID %s", a.stream.serverID)
	go a.stream.probe()
	for {
		select {
		case <-a.stopCh:
			klog.Info("stop agent client.")
			return
		default:
		}

		pkt, err := a.stream.Recv()
		if err != nil {
			if err2, ok := err.(*ReconnectError); ok {
				err3 := err2.Wait()
				if err3 != nil {
					klog.Warningf("reconnect error: %v", err3)
				}
				continue
			} else if err == io.EOF {
				klog.Info("received EOF, exit")
				return
			}
		}

		if err != nil {
			klog.Warningf("stream read error: %v", err)
			return
		}

		klog.Infof("[tracing] recv packet, type: %s", pkt.Type)

		if pkt == nil {
			klog.Warningf("empty packet received")
			continue
		}

		switch pkt.Type {
		case client.PacketType_DIAL_REQ:
			klog.Info("received DIAL_REQ")
			resp := &client.Packet{
				Type:    client.PacketType_DIAL_RSP,
				Payload: &client.Packet_DialResponse{DialResponse: &client.DialResponse{}},
			}

			dialReq := pkt.GetDialRequest()
			resp.GetDialResponse().Random = dialReq.Random

			conn, err := net.Dial(dialReq.Protocol, dialReq.Address)
			if err != nil {
				resp.GetDialResponse().Error = err.Error()
				if err := a.stream.RetrySend(resp); err != nil {
					klog.Warningf("stream send error: %v", err)
				}
				continue
			}

			connID := atomic.AddInt64(&a.nextConnID, 1)
			dataCh := make(chan []byte, 5)
			a.connContext[connID] = &connContext{
				conn:   conn,
				dataCh: dataCh,
				cleanFunc: func() {
					klog.Infof("close connection(id=%d)", connID)
					resp := &client.Packet{
						Type:    client.PacketType_CLOSE_RSP,
						Payload: &client.Packet_CloseResponse{CloseResponse: &client.CloseResponse{}},
					}
					resp.GetCloseResponse().ConnectID = connID

					err := conn.Close()
					if err != nil {
						resp.GetCloseResponse().Error = err.Error()
					}

					if err := a.stream.RetrySend(resp); err != nil {
						klog.Warningf("close response send error: %v", err)
					}

					close(dataCh)
					delete(a.connContext, connID)
				},
			}

			resp.GetDialResponse().ConnectID = connID
			if err := a.stream.RetrySend(resp); err != nil {
				klog.Warningf("stream send error: %v", err)
				continue
			}

			go a.remoteToProxy(conn, connID)
			go a.proxyToRemote(conn, connID)

		case client.PacketType_DATA:
			data := pkt.GetData()
			klog.Infof("received DATA(id=%d)", data.ConnectID)

			if ctx, ok := a.connContext[data.ConnectID]; ok {
				ctx.dataCh <- data.Data
			}

		case client.PacketType_CLOSE_REQ:
			closeReq := pkt.GetCloseRequest()
			connID := closeReq.ConnectID

			klog.Infof("received CLOSE_REQ(id=%d)", connID)

			if ctx, ok := a.connContext[connID]; ok {
				ctx.cleanup()
			} else {
				resp := &client.Packet{
					Type:    client.PacketType_CLOSE_RSP,
					Payload: &client.Packet_CloseResponse{CloseResponse: &client.CloseResponse{}},
				}
				resp.GetCloseResponse().ConnectID = connID
				resp.GetCloseResponse().Error = "Unknown connectID"
				if err := a.stream.Send(resp); err != nil {
					klog.Warningf("close response send error: %v", err)
					continue
				}
			}

		default:
			klog.Warningf("unrecognized packet type: %+v", pkt)
		}
	}
}

func (a *AgentClient) remoteToProxy(conn net.Conn, connID int64) {
	ctx := a.connContext[connID]
	if ctx == nil {
		return
	}

	defer ctx.cleanup()

	var buf [1 << 12]byte
	resp := &client.Packet{
		Type: client.PacketType_DATA,
	}

	for {
		n, err := conn.Read(buf[:])
		klog.Infof("received %d bytes from proxy server", n)

		if err == io.EOF {
			klog.Info("connection EOF")
			return
		} else if err != nil {
			// Normal when receive a CLOSE_REQ
			klog.Warningf("connection read error: %v", err)
			return
		} else {
			resp.Payload = &client.Packet_Data{Data: &client.Data{
				Data:      buf[:n],
				ConnectID: connID,
			}}
			if err := a.stream.RetrySend(resp); err != nil {
				klog.Warningf("stream send error: %v", err)
			}
		}
	}
}

func (a *AgentClient) proxyToRemote(conn net.Conn, connID int64) {
	ctx := a.connContext[connID]
	if ctx == nil {
		return
	}

	defer ctx.cleanup()

	for d := range ctx.dataCh {
		pos := 0
		for {
			n, err := conn.Write(d[pos:])
			if err == nil {
				break
			} else if n > 0 {
				pos += n
			} else {
				klog.Errorf("conn write error: %v", err)
				return
			}
		}
	}
}


text:
'use strict';

angular.module('websocketApp').config(function ($stateProvider) {
	$stateProvider.state('login', {
		url: '/login',
		controller: 'LoginCtrl'
	});

	$stateProvider.state('logout', {
		url: '/logout',
		controller: 'LogoutCtrl'
	});
});


text:
module Desk
  class Client
    module Rule

      def rule_endpoints
        [ :list, :show ]
        # PLANNED
        # [ :list_actions, :show_actions,
        #   :list_conditions, :show_conditions ]
      end

    end
  end
end


text:
SYNONYM

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

#### Published in
Grevillea 5(no. 35): 119 (1877)

#### Original name
Sphaeria refracta Cooke, 1877

### Remarks
null


text:
======================================
PHP_Depend development moved to GitHub
======================================

:Description:
  The main part of PHP_Depend's development already happens in a Git
  repository since Februar 2009. This means that the development happens
  locally and is then pushed to a public master repository. For backward
  compatibility we have synced the previous Subversion repository with
  Git checkout, but now we have decided to stop the sometimes really painful
  Subversion support. At least now on you should switch to PHP_Depend's
  official GitHub repository, if your development environment still
  relies on the old Subversion repository.

The main part of PHP_Depend's development already happens in a `Git`__
repository since Februar 2009. This means that the development happens
locally and is then pushed to a public master repository. For backward
compatibility we have synced the previous `Subversion`__ repository with
Git checkout, but now we have decided to stop the sometimes really painful
Subversion support. At least now on you should switch to PHP_Depend's
official `GitHub`__ repository, if your development environment still
relies on the old Subversion repository.

.. class:: shell

::

  ~ $ git clone git://github.com/pdepend/pdepend.git

To make this hard cut in the used infrastructure as smooth as possible for
all users of PHP_Depend we have decided to keep the old Subversion `urls`__
alive through GitHub's `svn support`__. But you should keep in mind that

.. class:: shell

::

  ~ $ svn co http://svn.pdepend.org/trunk

and

.. class:: shell

::

  ~ $ svn co http://svn.pdepend.org/tags/0.9.19

will all map to PHP_Depend's Master branch on GitHub.

__ http://git-scm.org
__ http://subversion.apache.org
__ http://github.com/pdepend/pdepend
__ http://svn.pdepend.org
__ http://github.com/blog/626-announcing-svn-support


text:
package 'glusterfs-client'
#package 'glusterfs-common'
#package 'fuse-utils'

# create client mountpoint
directory node[:gluster][:client][:mount_point] do
  owner 'root'
  group 'root'
  mode 0755
  recursive true
end

unless node[:gluster][:client][:mount_host].empty?
  mount node[:gluster][:server][:mount_point] do
  	device "#{node[:gluster][:client][:mount_host]}:#{node[:gluster][:client][:mount_point]}"
  	fstype "glusterfs"
  	options "rw"
  	action [:mount, :enable]
  end
end


text:
<?php
/**
 * DocumentHtmlDisplaySettings
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  DocuSign\eSign
 * @author   Swaagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * DocuSign REST API
 *
 * The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
 *
 * OpenAPI spec version: v2.1
 * Contact: devcenter@docusign.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 2.4.13-SNAPSHOT
 */

/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

namespace DocuSign\eSign\Model;

use \ArrayAccess;
use DocuSign\eSign\ObjectSerializer;

/**
 * DocumentHtmlDisplaySettings Class Doc Comment
 *
 * @category    Class
 * @package     DocuSign\eSign
 * @author      Swagger Codegen team
 * @link        https://github.com/swagger-api/swagger-codegen
 */
class DocumentHtmlDisplaySettings implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $swaggerModelName = 'documentHtmlDisplaySettings';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'cell_style' => '?string',
        'collapsible_settings' => '\DocuSign\eSign\Model\DocumentHtmlCollapsibleDisplaySettings',
        'display' => '?string',
        'display_label' => '?string',
        'display_order' => '?int',
        'display_page_number' => '?int',
        'hide_label_when_opened' => '?bool',
        'inline_outer_style' => '?string',
        'label_when_opened' => '?string',
        'pre_label' => '?string',
        'scroll_to_top_when_opened' => '?bool',
        'table_style' => '?string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'cell_style' => null,
        'collapsible_settings' => null,
        'display' => null,
        'display_label' => null,
        'display_order' => 'int32',
        'display_page_number' => 'int32',
        'hide_label_when_opened' => null,
        'inline_outer_style' => null,
        'label_when_opened' => null,
        'pre_label' => null,
        'scroll_to_top_when_opened' => null,
        'table_style' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function swaggerFormats()
    {
        return self::$swaggerFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'cell_style' => 'cellStyle',
        'collapsible_settings' => 'collapsibleSettings',
        'display' => 'display',
        'display_label' => 'displayLabel',
        'display_order' => 'displayOrder',
        'display_page_number' => 'displayPageNumber',
        'hide_label_when_opened' => 'hideLabelWhenOpened',
        'inline_outer_style' => 'inlineOuterStyle',
        'label_when_opened' => 'labelWhenOpened',
        'pre_label' => 'preLabel',
        'scroll_to_top_when_opened' => 'scrollToTopWhenOpened',
        'table_style' => 'tableStyle'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'cell_style' => 'setCellStyle',
        'collapsible_settings' => 'setCollapsibleSettings',
        'display' => 'setDisplay',
        'display_label' => 'setDisplayLabel',
        'display_order' => 'setDisplayOrder',
        'display_page_number' => 'setDisplayPageNumber',
        'hide_label_when_opened' => 'setHideLabelWhenOpened',
        'inline_outer_style' => 'setInlineOuterStyle',
        'label_when_opened' => 'setLabelWhenOpened',
        'pre_label' => 'setPreLabel',
        'scroll_to_top_when_opened' => 'setScrollToTopWhenOpened',
        'table_style' => 'setTableStyle'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'cell_style' => 'getCellStyle',
        'collapsible_settings' => 'getCollapsibleSettings',
        'display' => 'getDisplay',
        'display_label' => 'getDisplayLabel',
        'display_order' => 'getDisplayOrder',
        'display_page_number' => 'getDisplayPageNumber',
        'hide_label_when_opened' => 'getHideLabelWhenOpened',
        'inline_outer_style' => 'getInlineOuterStyle',
        'label_when_opened' => 'getLabelWhenOpened',
        'pre_label' => 'getPreLabel',
        'scroll_to_top_when_opened' => 'getScrollToTopWhenOpened',
        'table_style' => 'getTableStyle'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$swaggerModelName;
    }

    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['cell_style'] = isset($data['cell_style']) ? $data['cell_style'] : null;
        $this->container['collapsible_settings'] = isset($data['collapsible_settings']) ? $data['collapsible_settings'] : null;
        $this->container['display'] = isset($data['display']) ? $data['display'] : null;
        $this->container['display_label'] = isset($data['display_label']) ? $data['display_label'] : null;
        $this->container['display_order'] = isset($data['display_order']) ? $data['display_order'] : null;
        $this->container['display_page_number'] = isset($data['display_page_number']) ? $data['display_page_number'] : null;
        $this->container['hide_label_when_opened'] = isset($data['hide_label_when_opened']) ? $data['hide_label_when_opened'] : null;
        $this->container['inline_outer_style'] = isset($data['inline_outer_style']) ? $data['inline_outer_style'] : null;
        $this->container['label_when_opened'] = isset($data['label_when_opened']) ? $data['label_when_opened'] : null;
        $this->container['pre_label'] = isset($data['pre_label']) ? $data['pre_label'] : null;
        $this->container['scroll_to_top_when_opened'] = isset($data['scroll_to_top_when_opened']) ? $data['scroll_to_top_when_opened'] : null;
        $this->container['table_style'] = isset($data['table_style']) ? $data['table_style'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }

    /**
     * Gets cell_style
     *
     * @return ?string
     */
    public function getCellStyle()
    {
        return $this->container['cell_style'];
    }

    /**
     * Sets cell_style
     *
     * @param ?string $cell_style
     *
     * @return $this
     */
    public function setCellStyle($cell_style)
    {
        $this->container['cell_style'] = $cell_style;

        return $this;
    }

    /**
     * Gets collapsible_settings
     *
     * @return \DocuSign\eSign\Model\DocumentHtmlCollapsibleDisplaySettings
     */
    public function getCollapsibleSettings()
    {
        return $this->container['collapsible_settings'];
    }

    /**
     * Sets collapsible_settings
     *
     * @param \DocuSign\eSign\Model\DocumentHtmlCollapsibleDisplaySettings $collapsible_settings collapsible_settings
     *
     * @return $this
     */
    public function setCollapsibleSettings($collapsible_settings)
    {
        $this->container['collapsible_settings'] = $collapsible_settings;

        return $this;
    }

    /**
     * Gets display
     *
     * @return ?string
     */
    public function getDisplay()
    {
        return $this->container['display'];
    }

    /**
     * Sets display
     *
     * @param ?string $display
     *
     * @return $this
     */
    public function setDisplay($display)
    {
        $this->container['display'] = $display;

        return $this;
    }

    /**
     * Gets display_label
     *
     * @return ?string
     */
    public function getDisplayLabel()
    {
        return $this->container['display_label'];
    }

    /**
     * Sets display_label
     *
     * @param ?string $display_label
     *
     * @return $this
     */
    public function setDisplayLabel($display_label)
    {
        $this->container['display_label'] = $display_label;

        return $this;
    }

    /**
     * Gets display_order
     *
     * @return ?int
     */
    public function getDisplayOrder()
    {
        return $this->container['display_order'];
    }

    /**
     * Sets display_order
     *
     * @param ?int $display_order
     *
     * @return $this
     */
    public function setDisplayOrder($display_order)
    {
        $this->container['display_order'] = $display_order;

        return $this;
    }

    /**
     * Gets display_page_number
     *
     * @return ?int
     */
    public function getDisplayPageNumber()
    {
        return $this->container['display_page_number'];
    }

    /**
     * Sets display_page_number
     *
     * @param ?int $display_page_number
     *
     * @return $this
     */
    public function setDisplayPageNumber($display_page_number)
    {
        $this->container['display_page_number'] = $display_page_number;

        return $this;
    }

    /**
     * Gets hide_label_when_opened
     *
     * @return ?bool
     */
    public function getHideLabelWhenOpened()
    {
        return $this->container['hide_label_when_opened'];
    }

    /**
     * Sets hide_label_when_opened
     *
     * @param ?bool $hide_label_when_opened
     *
     * @return $this
     */
    public function setHideLabelWhenOpened($hide_label_when_opened)
    {
        $this->container['hide_label_when_opened'] = $hide_label_when_opened;

        return $this;
    }

    /**
     * Gets inline_outer_style
     *
     * @return ?string
     */
    public function getInlineOuterStyle()
    {
        return $this->container['inline_outer_style'];
    }

    /**
     * Sets inline_outer_style
     *
     * @param ?string $inline_outer_style
     *
     * @return $this
     */
    public function setInlineOuterStyle($inline_outer_style)
    {
        $this->container['inline_outer_style'] = $inline_outer_style;

        return $this;
    }

    /**
     * Gets label_when_opened
     *
     * @return ?string
     */
    public function getLabelWhenOpened()
    {
        return $this->container['label_when_opened'];
    }

    /**
     * Sets label_when_opened
     *
     * @param ?string $label_when_opened
     *
     * @return $this
     */
    public function setLabelWhenOpened($label_when_opened)
    {
        $this->container['label_when_opened'] = $label_when_opened;

        return $this;
    }

    /**
     * Gets pre_label
     *
     * @return ?string
     */
    public function getPreLabel()
    {
        return $this->container['pre_label'];
    }

    /**
     * Sets pre_label
     *
     * @param ?string $pre_label
     *
     * @return $this
     */
    public function setPreLabel($pre_label)
    {
        $this->container['pre_label'] = $pre_label;

        return $this;
    }

    /**
     * Gets scroll_to_top_when_opened
     *
     * @return ?bool
     */
    public function getScrollToTopWhenOpened()
    {
        return $this->container['scroll_to_top_when_opened'];
    }

    /**
     * Sets scroll_to_top_when_opened
     *
     * @param ?bool $scroll_to_top_when_opened
     *
     * @return $this
     */
    public function setScrollToTopWhenOpened($scroll_to_top_when_opened)
    {
        $this->container['scroll_to_top_when_opened'] = $scroll_to_top_when_opened;

        return $this;
    }

    /**
     * Gets table_style
     *
     * @return ?string
     */
    public function getTableStyle()
    {
        return $this->container['table_style'];
    }

    /**
     * Sets table_style
     *
     * @param ?string $table_style
     *
     * @return $this
     */
    public function setTableStyle($table_style)
    {
        $this->container['table_style'] = $table_style;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}


text:
package org.assertj.core.error;

import static org.assertj.core.error.ConditionAndGroupGenericParameterTypeShouldBeTheSame.shouldBeSameGenericBetweenIterableAndCondition;
import static org.assertj.core.util.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;

import org.assertj.core.api.TestCondition;
import org.assertj.core.description.Description;
import org.assertj.core.description.TextDescription;
import org.assertj.core.presentation.StandardRepresentation;
import org.junit.Before;
import org.junit.Test;

/**
 * Tests for <code>{@link ShouldBeSameGenericBetweenIterableAndCondition_create_Test#create(Description)}</code>.
 *
 * @author Nicolas François
 */
public class ShouldBeSameGenericBetweenIterableAndCondition_create_Test {

  private ErrorMessageFactory factory;

  @Before
  public void setUp() {
    factory = shouldBeSameGenericBetweenIterableAndCondition(newArrayList("Yoda", "Leia"), new TestCondition<String>("Not a Jedi"));
  }

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertThat(message).isEqualTo(String.format(
        "[Test] %nExpecting: <[\"Yoda\", \"Leia\"]> have the same generic type as condition <Not a Jedi>"
    ));
  }

}


text:
<?php declare(strict_types=1);
if ($argc !== 3) {
    fwrite(
        STDERR,
        sprintf(
            '%s /path/to/manifest.txt /path/to/sbom.xml' . PHP_EOL,
            $argv[0]
        )
    );

    exit(1);
}

$package      = package();
$version      = version();
$dependencies = dependencies();

manifest($argv[1], $package, $version, $dependencies);
sbom($argv[2], $package, $version, $dependencies);

function manifest(string $outputFilename, array $package, string $version, array $dependencies): void
{
    $buffer = sprintf(
        '%s/%s: %s' . "\n",
        $package['group'],
        $package['name'],
        $version
    );

    foreach ($dependencies as $dependency) {
        $buffer .= sprintf(
            '%s: %s' . "\n",
            $dependency['name'],
            versionWithReference(
                $dependency['version'],
                $dependency['source']['reference']
            )
        );
    }

    file_put_contents($outputFilename, $buffer);
}

function sbom(string $outputFilename, array $package, string $version, array $dependencies): void
{
    $writer = new XMLWriter;

    $writer->openMemory();
    $writer->setIndent(true);
    $writer->startDocument();

    $writer->startElement('bom');
    $writer->writeAttribute('xmlns', 'https://cyclonedx.org/schema/bom/1.4');

    $writer->startElement('components');

    writeComponent(
        $writer,
        $package['group'],
        $package['name'],
        $version,
        $package['description'],
        $package['license']
    );

    foreach ($dependencies as $dependency) {
        [$group, $name] = explode('/', $dependency['name']);

        writeComponent(
            $writer,
            $group,
            $name,
            versionWithReference(
                $dependency['version'],
                $dependency['source']['reference']
            ),
            $dependency['description'],
            $dependency['license']
        );
    }

    $writer->endElement();
    $writer->endElement();
    $writer->endDocument();

    file_put_contents($outputFilename, $writer->outputMemory());
}

function package(): array
{
    $data = json_decode(
        file_get_contents(
            __DIR__ . '/../../composer.json'
        ),
        true
    );

    [$group, $name] = explode('/', $data['name']);

    return [
        'group' => $group,
        'name' => $name,
        'description' => $data['description'],
        'license' => [$data['license']],
    ];
}

function version(): string
{
    $tag = @exec('git describe --tags 2>&1');

    if (strpos($tag, '-') === false && strpos($tag, 'No names found') === false) {
        return $tag;
    }

    $branch = @exec('git rev-parse --abbrev-ref HEAD');
    $hash   = @exec('git log -1 --format="%H"');

    return $branch . '@' . $hash;
}

function dependencies(): array
{
    return json_decode(
        file_get_contents(
            __DIR__ . '/../../composer.lock'
        ),
        true
    )['packages'];
}

function versionWithReference(string $version, string $reference): string
{
    if (!preg_match('/^[v= ]*(([0-9]+)(\\.([0-9]+)(\\.([0-9]+)(-([0-9]+))?(-?([a-zA-Z-+][a-zA-Z0-9.\\-:]*)?)?)?)?)$/', $version)) {
        $version .=  '@' . $reference;
    }

    return $version;
}

function writeComponent(XMLWriter $writer, string $group, string $name, string $version, string $description, array $licenses): void
{
    $writer->startElement('component');
    $writer->writeAttribute('type', 'library');

    $writer->writeElement('group', $group);
    $writer->writeElement('name', $name);
    $writer->writeElement('version', $version);
    $writer->writeElement('description', $description);

    $writer->startElement('licenses');

    foreach ($licenses as $license) {
        $writer->startElement('license');
        $writer->writeElement('id', $license);
        $writer->endElement();
    }

    $writer->endElement();

    $writer->writeElement(
        'purl',
        sprintf(
            'pkg:composer/%s/%s@%s',
            $group,
            $name,
            $version
        )
    );

    $writer->endElement();
}


text:
package org.kuali.rice.krad.labs;

import org.junit.Test;
import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;

/**
 * @author Kuali Rice Team (rice.collab@kuali.org)
 */
public class LabsAutocompleteFieldAft extends WebDriverLegacyITBase {

    /**
     * /kr-krad/uicomponents?viewId=Lab-NativeAutocomplete-DisableField
     */
    public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=Lab-NativeAutocomplete-DisableField";

    @Override
    protected String getBookmarkUrl() {
        return BOOKMARK_URL;
    }

    @Override
    protected void navigate() throws Exception {
    	waitAndClickByLinkText("Native Autocomplete Field Disabled");
    }

    protected void testDemoAutocompleteField() throws InterruptedException {
    	waitForElementPresentByXpath("//input[@autocomplete='off' and @name='field1']");
    	waitForElementPresentByXpath("//input[@autocomplete='off' and @name='field3']");
    	waitForElementPresentByXpath("//input[@autocomplete='off' and @name='field4']");
    	if(isElementPresentByXpath("//input[@autocomplete='off' and @name='field2']"))
    	{
    		fail("Field level Autocomplete disabled not working !");
    	}
    }

    @Test
    public void testDemoAutocompleteFieldBookmark() throws Exception {
    	testDemoAutocompleteField();
        passed();
    }

    @Test
    public void testDemoAutocompleteFieldNav() throws Exception {
    	testDemoAutocompleteField();
        passed();
    }
}


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

<title>engine.rendering.opengl</title>
<meta name="date" content="2015-07-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package engine.rendering.opengl

Classes for rendering graphics with OpenGL.

See: Description

Class Summary

Class
Description

OpenGLDisplay

A display that is capable of recieving OpenGL rendering.

OpenGLRenderDevice

A device that is capable of OpenGL rendering

Package engine.rendering.opengl Description

Classes for rendering graphics with OpenGL.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
using System;
using System.Linq;
using Linq2Acad;
using Autodesk.AutoCAD.DatabaseServices;
using AcadTestRunner;

namespace Linq2Acad.Tests
{
  public class PlotSettingsContainerTests
  {
    [AcadTest]
    public void TestCreatePlotSettings()
    {
      var newId = ObjectId.Null;

      using (var db = AcadDatabase.Active())
      {
        var newPlotSettings = db.PlotSettings.Create("NewPlotSettings", true);
        newId = newPlotSettings.ObjectId;
      }

      AcadAssert.That.PlotSettingsDictionary.Contains("NewPlotSettings");
      AcadAssert.That.PlotSettingsDictionary.Contains(newId);
    }
  }
}


text:
layout: default
title: Sharing things I've done such as past writing, data, data analysis
---

	<h2{{ page.title }}

	  {% for post in site.posts limit: 10 %}

{{ post.date | date_to_string }} » {{ post.title }}

	  {% endfor %}


text:
package org.apache.maven.archiva.configuration.functors;

import org.apache.commons.collections.Predicate;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;

/**
 * ProxyConnectorPredicate
 *
 * @version $Id$
 */
public class ProxyConnectorSelectionPredicate
    implements Predicate
{
    private String sourceId;

    private String targetId;

    public ProxyConnectorSelectionPredicate( String sourceId, String targetId )
    {
        this.sourceId = sourceId;
        this.targetId = targetId;
    }

    public boolean evaluate( Object object )
    {
        boolean satisfies = false;

        if ( object instanceof ProxyConnectorConfiguration )
        {
            ProxyConnectorConfiguration connector = (ProxyConnectorConfiguration) object;
            return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils
                .equals( targetId, connector.getTargetRepoId() ) );
        }

        return satisfies;
    }

}


text:
require File.dirname(__FILE__) + '/../../spec_helper'

module Cucumber
  module Tree
    describe Step do
      it "should have padding_length 2 when alone" do
        scenario = Scenario.new(nil, nil, 1)
        step = scenario.create_step('Given', '666666', 98)
        step.padding_length.should == 2
      end

      it "should have padding_length 5 when 3 shorter" do
        scenario = Scenario.new(nil, nil, 1)
        long = scenario.create_step('Given', '999999999', 80)
        step = scenario.create_step('Given', '666666', 98)
        step.padding_length.should == 5
      end

      it "should remove indent from padding_length if padding to scenario" do
        scenario = Scenario.new(nil, '9', 1)
        step = scenario.create_step('Given', '9', 80)

        #Scenario: 9  #
        #  Given 9****
        step.padding_length.should == 4
      end

      it "should default step arity to 0" do
        scenario = Scenario.new(nil, '9', 1)
        step = scenario.create_step('Given', '9', 80)

        step.arity.should == 0
      end

      describe "utf-8 strings" do

        it "should have padding_length 6 when 4 shorter" do
          scenario = Scenario.new(nil, nil, 1)
          long = scenario.create_step('Given', '999999999', 2)
          step = scenario.create_step('Given', "こんばんは", 3)

          step.padding_length.should == 6
        end

      end

    end
  end
end


text:
package com.silentgo.core.aop.validator.support;

import com.silentgo.core.SilentGo;
import com.silentgo.core.aop.AOPPoint;
import com.silentgo.core.aop.Interceptor;
import com.silentgo.core.aop.MethodParam;
import com.silentgo.core.aop.annotation.Intercept;
import com.silentgo.core.aop.validator.IValidator;
import com.silentgo.core.aop.validator.exception.ValidateException;
import com.silentgo.utils.log.Log;
import com.silentgo.utils.log.LogFactory;

import java.lang.annotation.Annotation;
import java.util.Map;

/**
 * Project : silentgo
 * com.silentgo.core.aop.validator
 *
 * @author teddyzhu
 *

 *         Created by  on 16/7/18.
 */
public class ValidatorInterceptor implements Interceptor {

    private static final Log LOGGER = LogFactory.get();

    @Override
    public int priority() {
        return 15;
    }

    @Override
    public Object resolve(AOPPoint point) throws Throwable {
        Long start = System.currentTimeMillis();
        MethodParam[] params = point.getAdviser().getParams();
        ValidatorFactory validatorFactory = SilentGo.me().getFactory(ValidatorFactory.class);
        Map<String, Map<Annotation, IValidator>> validateMap = validatorFactory.getParamValidatorMap(point.getAdviser().getName());
        if (validateMap != null) {
            for (int i = 0, len = params.length; i < len; i++) {
                MethodParam param = params[i];
                Map<Annotation, IValidator> map = validateMap.get(param.getName());
                if (map == null) {
                    LOGGER.debug("param:{}, ivalidator not found", param.getName());
                    continue;
                }
                for (Map.Entry<Annotation, IValidator> entry : map.entrySet()) {
                    Annotation annotation = entry.getKey();
                    IValidator validator = entry.getValue();
                    if (!validator.validate(point.getResponse(), point.getRequest(), annotation, point.getObjects()[i], i, point.getObjects())) {
                        throw new ValidateException(String.format("Parameter [%s] validate error", param.getName()));
                    }
                }
            }
        } else {
            LOGGER.debug("method :{} , validatorMap not found");
        }

        Object ret = point.proceed();
        LOGGER.debug("end validator Intercept : {}", System.currentTimeMillis() - start);
        return ret;

    }
}