text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace SysUt14Gr03.Models
{
    [Table("Statuser")]
    public class Status
    {
        [Key]
        public int Status_id { get; set; }
        public string Navn { get; set; }

        public virtual List<Oppgave> Oppgaver { get; set; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
title:  "»Zapečaćena knjiga«?"
date:   31/12/2018
---

### Svedočanstvo (Otkrivenje 1,1-3)

»Mnogi se povode za mišlju da je Otkrivenje zapečaćena knjiga i zato ne žele da posvete vreme proučavanju njenih tajni. Oni smatraju da treba gledati na slavu spasenja i da tajne otkrivene Jovanu na ostrvu Patmos zaslužuju manju pažnju od toga.

Međutim, Bog ne gleda tako na tu knjigu. On izjavljuje: 'Svjedočim svakome koji čuje riječi proroštva knjige ove: ako ko dometne ovome, Bog će nametnuti na njega zla napisana u knjizi ovoj; i ako ko oduzme od riječi knjige proroštva ovoga, Bog će oduzeti njegov dijel od knjige života, i od grada svetoga, i od onoga što je napisano u knjizi ovoj. Govori onaj koji svjedoči ovo: da, doći ću skoro!' (Otkrivenje 22,18-20).

Knjiga Otkrivenje javlja svetu šta je bilo, šta jeste i šta će biti. Napisana je za nauk nama na koje kraj sveta dođe. Nju treba proučavati sa strahopoštovanjem. U prednosti smo što znamo ono što je za naše poučenje. A da li se zaista odnosimo prema Božjoj reči s poštovanjem kao što  dolikuje, i sa zahvalnošću kakva je ugodna Bogu? 'Sve je pismo od Boga dano i korisno za učenje, za karanje, za popravljanje, za poučavanje u pravdi, da bude savršen čovjek Božij, za svako dobro djelo pripravljen' (2. Timotiju 3,16-17).

Gospod je svom sluzi Jovanu lično otkrio tajne knjige Otkrivenje, i Njegova namera je da one budu otvorene da bi svako mogao da ih proučava. U toj knjizi opisani su prizori koji su sada već deo prošlosti, ali i neki od večnog interesa koji se upravo odvijaju oko nas. Ostala njena proročanstva neće se u potpunosti ispuniti sve do pred kraj vremena, kad se bude odigrao poslednji veliki sukob između sila tame i Kneza neba.«1

**Odgovorite**

`1.	U savremenom svetu u kom živimo, šta vi lično možete učiniti da biste knjigu Otkrivenje proučavali i objavljivali na neki inovativan način?`

`2.	Na koji način bivamo blagosloveni kad slušamo i čitamo reči proroštva?`

`3.	Ako smo posavetovani u vezi s važnošću proučavanja knjige Otkrivenje, zašto se ta knjiga danas tako malo razume?`

*Daun Forde Marfi, Virsdejl, Florida, SAD*

____
1  Ellen G. White, The Review and Herald, August 21, 1987.


text:
<?php
namespace OhDM;

use OhDM\Exception\ConfigException;

class Config
{
    /**
     * @var \MongoClient|null
     */
    public $mongo = null;

    /**
     * @var string
     */
    public $dbName = 'test';

    /**
     * @var Config|null
     */
    protected static $instance = null;

    /**
     * Protected constructor.
     * @param \MongoClient $db
     * @param string $dbName
     */
    protected function __construct(\MongoClient $mongo, $dbName)
    {
        $this->mongo = $mongo;
        $this->dbName = $dbName;
    }

    /**
     * Initialise the configuration
     * @param \MongoClient $db
     * @param string $dbName
     * @return boolean
     */
    public static function init(\MongoClient $mongo, $dbName)
    {
        static::$instance = new self($mongo, $dbName);

        return true;
    }

    /**
     * Destroy the configuration
     * @return void
     */
    public static function destroyInstance()
    {
        if (static::$instance instanceof Config && static::$instance->mongo instanceof \MongoClient) {
            static::$instance->mongo->close();
        }
        static::$instance = null;

        return true;
    }

    /**
     * Get the instance of Config
     * @throws \Exception if init is not called first
     * @return \OhDM\Config
     */
    public static function getInstance()
    {
        if (!static::$instance instanceof Config) {
            throw new ConfigException('Call ::init prior to get instance.');
        }

        return static::$instance;
    }
}


text:
from pybluetooth import HCIThread
from pybluetooth.address import *

from scapy.layers.bluetooth import *

try:
    from unittest.mock import MagicMock
except ImportError:
    from mock import MagicMock

def _create_patched_hci_thread():
    h = HCIThread(MagicMock())
    h.sent_packets = []

    def send_cmd(scapy_packet, *args, **kwargs):
        h.sent_packets.append(scapy_packet)
    h.send_cmd = send_cmd
    return h

def test_hci_thread_cmd_le_create_connection():
    h = _create_patched_hci_thread()
    a = Address("c9:ea:a5:b8:c8:1", AddressType.random)
    h.cmd_le_create_connection(a)
    p = h.sent_packets[0]
    assert p.getlayer(HCI_Cmd_LE_Create_Connection)
    assert p.patype == 0x01  # Random
    assert p.paddr == "c9:ea:a5:b8:c8:01"


text:
from typing import TypeVar

from scitwi.search.search_query import SearchQuery

StrOrQuery = TypeVar('StrOrQuery', str, SearchQuery)


text:
static NSString * const kTestServiceName = @"tnt.keychain.test";

#pragma mark - Helper Types

@interface TNTNonSerializable : NSObject
@property( nonatomic, readwrite, strong )NSNumber *n;
@end

@implementation TNTNonSerializable
@end

#pragma mark - NitroKeychainTests Interface

@interface NitroKeychainTests : XCTestCase
@end

#pragma mark - NitroKeychainTests Implementation

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnonnull"

@implementation NitroKeychainTests

#pragma mark - Test Lifecycle

-( void )tearDown
{
    [TNTKeychain delete: kTestServiceName];
}

#pragma mark - save Tests

-( void )test_save_saves_data
{
    BOOL saved = [TNTKeychain save: kTestServiceName data: @"Hello World"];
    XCTAssertTrue( saved );

    saved = [TNTKeychain save: kTestServiceName data: @{ @"Hello": @"World" }];
    XCTAssertTrue( saved );

    saved = [TNTKeychain save: kTestServiceName data: @[ @"Hello", @"World" ]];
    XCTAssertTrue( saved );

    saved = [TNTKeychain save: kTestServiceName data: @100];
    XCTAssertTrue( saved );
}

-( void )test_save_updates_data_if_keychainItemId_already_exists
{
    [TNTKeychain save: kTestServiceName data: @"Hello World"];
    BOOL saved = [TNTKeychain save: kTestServiceName data: @"Olá Mundo"];
    XCTAssertTrue( saved );
    XCTAssertEqualObjects( @"Olá Mundo", [TNTKeychain load: kTestServiceName] );

    [TNTKeychain save: kTestServiceName data: @{ @"Hello": @"World" }];
    saved = [TNTKeychain save: kTestServiceName data: @{ @"Olá": @"Mundo" }];
    XCTAssertTrue( saved );
    XCTAssertEqualObjects( @{ @"Olá": @"Mundo" }, [TNTKeychain load: kTestServiceName] );

    [TNTKeychain save: kTestServiceName data: @[ @"Hello", @"World" ]];
    saved = [TNTKeychain save: kTestServiceName data: @[ @"Olá", @"Mundo" ]];
    XCTAssertTrue( saved );
    NSArray *expected = @[ @"Olá", @"Mundo" ];
    XCTAssertEqualObjects( expected, [TNTKeychain load: kTestServiceName] );

    [TNTKeychain save: kTestServiceName data: @100];
    saved = [TNTKeychain save: kTestServiceName data: @500];
    XCTAssertTrue( saved );
    XCTAssertEqualObjects( @500, [TNTKeychain load: kTestServiceName] );
}

-( void )test_save_does_not_throw_on_invalid_keychain_item_ids
{
    XCTAssertNoThrow( [TNTKeychain save: nil data: @100] );
    XCTAssertNoThrow( [TNTKeychain save: @"" data: @500] );
}

-( void )test_save_returns_NO_on_invalid_keychain_item_ids
{
    XCTAssertFalse( [TNTKeychain save: nil data: @100] );
    XCTAssertFalse( [TNTKeychain save: @"" data: @500] );
}

-( void )test_save_does_not_throw_on_nil_data
{
    XCTAssertNoThrow( [TNTKeychain save: kTestServiceName data: nil] );
}

-( void )test_save_returns_NO_on_nil_data
{
    XCTAssertFalse( [TNTKeychain save: kTestServiceName data: nil] );
}

-( void )test_save_does_not_throw_on_invalid_data
{
    TNTNonSerializable *temp = [TNTNonSerializable new];
    temp.n = @99;
    XCTAssertNoThrow( [TNTKeychain save: kTestServiceName data: temp] );
}

-( void )test_save_returns_NO_on_invalid_data
{
    TNTNonSerializable *temp = [TNTNonSerializable new];
    temp.n = @99;
    XCTAssertFalse( [TNTKeychain save: kTestServiceName data: temp] );
}

#pragma mark - load Tests

-( void )test_load_loads_data
{
    [TNTKeychain save: kTestServiceName data: @"Hello World"];
    NSString *string = [TNTKeychain load: kTestServiceName];
    XCTAssertEqualObjects( @"Hello World", string );

    [TNTKeychain save: kTestServiceName data: @{ @"Hello": @"World" }];
    NSDictionary *dict = [TNTKeychain load: kTestServiceName];
    XCTAssertEqualObjects( @{ @"Hello": @"World" }, dict );

    [TNTKeychain save: kTestServiceName data: @[ @"Hello", @"World" ]];
    NSArray *array = [TNTKeychain load: kTestServiceName];
    NSArray *expected = @[ @"Hello", @"World" ];
    XCTAssertEqualObjects( expected, array );

    [TNTKeychain save: kTestServiceName data: @100];
    NSNumber *number = [TNTKeychain load: kTestServiceName];
    XCTAssertEqualObjects( @100, number );
}

-( void )test_load_does_not_throw_on_inexistent_keychain_item
{
    XCTAssertNoThrow( [TNTKeychain load: @"   "] );
    XCTAssertNoThrow( [TNTKeychain load: kTestServiceName] );
}

-( void )test_load_does_not_throw_on_invalid_keychain_item_ids
{
    XCTAssertNoThrow( [TNTKeychain load: nil] );
    XCTAssertNoThrow( [TNTKeychain load: @""] );
}

-( void )test_load_returns_nil_on_inexistent_keychain_item
{
    XCTAssertNil( [TNTKeychain load: @"   "] );
    XCTAssertNil( [TNTKeychain load: kTestServiceName] );
}

-( void )test_load_returns_nil_on_invalid_keychain_item_ids
{
    XCTAssertNil( [TNTKeychain load: nil] );
    XCTAssertNil( [TNTKeychain load: @""] );
}

#pragma mark - delete Tests

-( void )test_delete_deletes_data
{
    [TNTKeychain save: kTestServiceName data: @"Hello World"];
    [TNTKeychain delete: kTestServiceName];
    NSString *string = [TNTKeychain load: kTestServiceName];
    XCTAssertNil( string );

    [TNTKeychain save: kTestServiceName data: @{ @"Hello": @"World" }];
    [TNTKeychain delete: kTestServiceName];
    NSDictionary *dict = [TNTKeychain load: kTestServiceName];
    XCTAssertNil( dict );

    [TNTKeychain save: kTestServiceName data: @[ @"Hello", @"World" ]];
    [TNTKeychain delete: kTestServiceName];
    NSArray *array = [TNTKeychain load: kTestServiceName];
    XCTAssertNil( array );

    [TNTKeychain save: kTestServiceName data: @100];
    [TNTKeychain delete: kTestServiceName];
    NSNumber *number = [TNTKeychain load: kTestServiceName];
    XCTAssertNil( number );
}

-( void )test_delete_does_nothing_on_inexistent_keychain_item
{
    XCTAssertNoThrow( [TNTKeychain delete: @"   "] );
    XCTAssertNoThrow( [TNTKeychain delete: kTestServiceName] );
}

-( void )test_delete_does_nothing_on_invalid_keychain_item_ids
{
    XCTAssertNoThrow( [TNTKeychain delete: nil] );
    XCTAssertNoThrow( [TNTKeychain delete: @""] );
}

@end

#pragma clang diagnostic pop


text:
function featurePolicyFeaturesListing(platformSpecific, outputFunc) {
  // List of all policy-controlled platform-specific features. Please update
  // this list when adding a new policy-controlled platform-specific interface.
  // This enables us to keep the churn on the platform-specific expectations
  // files to a bare minimum to make updates in the common (platform-neutral)
  // case as simple as possible.
  var platformSpecificFeatures = new Set([
    'bluetooth',
  ]);

  function filterPlatformSpecificFeature(featureName) {
    return platformSpecificFeatures.has(featureName) == platformSpecific;
  }

  for (const feature of document.featurePolicy.features()
           .filter(filterPlatformSpecificFeature)
           .sort()) {
    outputFunc(feature);
  }
}


text:
<?php

class F5_Form_Helpers_States extends F5_Db_Table_Abstract
{
    protected $_name = 'default_states';
    protected $_primary = 'state_id';

    protected $_referenceMap = array(
        'Countries' => array(
            'columns'        => array('country_id'),
            'refTableClass'  => 'F5_Form_Helpers_Countries',
            'refColumns'     => array('country_id'),
            'onDelete'       => self::CASCADE,
            'onUpdate'       => self::RESTRICT
        )
    );

    public $states = array();

    public function getStates($where = null, $order_by = null)
    {
        $countries = $this->fetchAll(
                            $this->select()
                                 ->order(array($order_by ? $order_by : 'state_code'))
                                 ->where($where ? $where : 1)
        );

        if($countries) {
            foreach ($countries->toArray() as $key => $country) {
				$this->countries[$country['country_code']] = $country['country_name'];
			}
        }

        return $this;
    }
}

?>


text:
/**
 * @file main.cpp Entry point for the application.
 */

#include <fstream>
#include <iostream>

#include "ReturnValue.h"

#include "context/maple/Driver.h"
#include "platform/Platform.h"
#include "run/FieldBenchmarks.h"
#include "run/Interpolation.h"
#include "runprofile/factory/CommandLine.h"
#include "runprofile/RunProfile.h"
#include "runprofile/util.h"
#include "util/MultiIndexMap.h"
#include "util/Timer.h"

#define LOG_MODULE ::logging::LogModuleEnum::MAIN
#include "util/log.h"

void showVersion(std::ostream& os) {
  os << "  Version "
     << Platform::getMajorVersion() << "."
     << Platform::getMinorVersion() << "."
     << Platform::getBugFixVersion()
     << " built "  << Platform::getBuildTime()
     << " Revision " << Platform::getCommitHash()
     << " Committed on " << Platform::getCommitDateTime() << std::endl;
  os << "    Compiled with " << Platform::getCompilerName()
     << " version " << Platform::getCompilerVersion() << std::endl;
  os << "  Report bugs, suggestions or comments to "
     << Platform::getSite() << std::endl
     << std::endl;
}

typedef enum {
  FILE_OPEN = 0,
  FILE_EXISTS = 1,
  FILE_OPEN_ERROR = 2
} OpenFileStatus;

OpenFileStatus openFileForWritting(
  std::ofstream* stream, const std::string& filename, bool newFile = true) {
  if (newFile) {
    // Try to open the file
    std::ofstream ofile(filename.c_str(), std::ios::in);
    if (!ofile.fail()) {
      return FILE_EXISTS;
    }
    ofile.close();
  }
  stream->open(filename.c_str(), std::ios::out);
  if (stream->fail()) {
    // LERR_ << "Error opening file '" << filename << "' for writing.";
    return FILE_OPEN_ERROR;
  }
  return FILE_OPEN;
}

int runMachineInfo(
    const runprofile::RunProfile& /* profile */,
    util::MultiIndexMap* /* mmap */) {

  return 1;
}

int runBenchmark(
    const runprofile::RunProfile& /* profile */, util::MultiIndexMap* mmap) {

  run::FieldBenchmarks fb;

  LAPP1_ << "Measuring speed of Field operations: ";
  fb.run(&((*mmap)["benchmark"]["field"]));

  return 0;
}

int runInterpolation(
    const runprofile::RunProfile& profile, util::MultiIndexMap* mmap) {

  boost::shared_ptr<runprofile::InterpProfile const> iprof
      = profile.getInterpProfile();

  if (!iprof) {
    LERR_ << "No interpolation profile is defined.";
    return ReturnValue::DID_NOT_RUN;
  }

  util::MultiIndexMap& m = *mmap;

  LAPP1_ << "Parsing input file '" << profile.getInputFileName() << "' ...";

  // Parse maple input file into context
  boost::shared_ptr<context::InterpContext> ctxtPtr(
      new context::InterpContext());
  maple::Driver parseDriver;
  //parseDriver.setDebugScanner(true);
  //parseDriver.setDebugParser(true);

  boost::timer tm;
  if (!parseDriver.parse_file(profile.getInputFileName(), ctxtPtr)) {
    LERR_ << "Could not parse input file: " << profile.getInputFileName();
    return ReturnValue::PARSE_ERROR;
  }
  m["input"]["parsetime"] = tm.elapsed();

  LAPP1_ << "Done parsing. Got " << ctxtPtr->getNumberOfStatements()
         << " statements to execute.";

  m["input"]["problem"]["numberofstatements"] = ctxtPtr->getNumberOfStatements();

  LAPP1_ << "Total nVars "
         << ctxtPtr->getNumberOfVariables()
         << " variables to interpolate.";

  int nVars = ctxtPtr->getNumberOfVariables();
  m["input"]["problem"]["variable"]["total"] = nVars ;
  std::ostringstream varsStr;
  for (int i = 0; i < nVars; ++i) {
    const std::string varName = ctxtPtr->getVarName(i);
    m["input"]["problem"]["variable"]["list"] += varName;
    if (i) {
      varsStr << ",";
    }
    varsStr << varName;
  }
  LAPP1_ << "Variables " << varsStr.str();

  run::Interpolation interp(iprof);

  interp.run(ctxtPtr, &(m["interpolation"]));

  return 0;
}

ReturnValue saveData(
    const util::MultiIndexMap& storage,
    const std::string& filename,
    bool shouldOverwrite) {

  // Try to open file now before computation starts
  std::ofstream ofile;
  OpenFileStatus status = openFileForWritting(&ofile,
      filename, !shouldOverwrite);

  switch(status) {
    case FILE_OPEN: // ok
      break;
    case FILE_EXISTS:
      LERR_ << "File '" << filename << "' already exist. "
               "Will not overwrite unless -w option is used.";
      return ReturnValue::FILE_ALREADY_EXISTS;
    case FILE_OPEN_ERROR:
      LERR_ << "Error opening file '" << filename
            << "' for writing.";
      return ReturnValue::OUT_FILE_OPEN_ERROR;
    default:
      LERR_ << "Unknown status opening file '" << filename
            << "' for writing.";
      return ReturnValue::UNKNOWN;
  }

  LAPP1_ << "Writing out result into file";
  ofile << storage;  // write out all results to file
  ofile.close();
  LAPP_ << "Done.";

  return ReturnValue::SUCCESS;
}

int main(int argc, char* argv[]) {
  // Initialize default logging.
  // The sink can be reconfigured later depending on command line arguments.
  boost::shared_ptr<logging::sink_t> log_sink = logging::init();

  std::cout << Platform::getApplicationName()
            << " - " << Platform::getApplicationDescription();
  std::cout << " Version " << Platform::getVersionStr()
            << " Commit " << Platform::getCommitHash()
            << std::endl << std::endl;

  ReturnValue status = ReturnValue::UNKNOWN;

  // Parse command line arguments
  try {
    std::unique_ptr<runprofile::RunProfile> profile
        = runprofile::factory::CommandLine::getRunProfile(argc,argv);

    // Set logging level for each module
    std::vector<
      std::pair<logging::LogModuleEnum, logging::LogLevelEnum>
    > moduleLogLevels;
    for (int i = 0; i < logging::LogModuleEnum::NUM_ENUMS; i++) {
      moduleLogLevels.push_back(std::make_pair(
        logging::LogModuleEnum(i),
        profile->getLogLevel(logging::LogModuleEnum(i))
      ));
    }
    logging::setModuleLogLevels(log_sink, moduleLogLevels);
    logging::setLogTags(log_sink, profile->getLogTags());

    LAPP1_ << "Run profile:" << std::endl << *profile;

    LAPP2_ << "Committed  on: " << Platform::getCommitDateTime();
    //LAPP2_ << "Compiled   on: " << Platform::getCompileDate() << " "
    //       << Platform::getCompileTime();
    LAPP2_ << "Compiled with: " << Platform::getCompilerName()<< " "
           << Platform::getCompilerVersion();
    LAPP2_ << "        flags: " << Platform::getCompilerFlags();
    //LAPP2_ << " Report bugs : " << Platform::getBugReportName() << " "
    //       << Platform::getBugReportEmail();
    LAPP2_ << " Project site: " << Platform::getSite();

    util::MultiIndexMap m;

    m << *profile;

    m["tool"]["name"] = Platform::getApplicationName();
    m["tool"]["description"] = Platform::getApplicationDescription();
    m["tool"]["version"]["major"] = Platform::getMajorVersion();
    m["tool"]["version"]["minor"] = Platform::getMinorVersion();
    m["tool"]["version"]["subminor"] = Platform::getBugFixVersion();
    m["tool"]["version"]["subminor"] = Platform::getBugFixVersion();
    m["tool"]["build"]["commit_hash"] = Platform::getCommitHash();
    m["tool"]["build"]["date"] = Platform::getCompileDate();
    m["tool"]["build"]["compiler"]["name"] = Platform::getCompilerName();
    m["tool"]["build"]["compiler"]["version"] = Platform::getCompilerVersion();
    m["tool"]["build"]["compiler"]["flags"] = Platform::getCompilerFlags();
    m["tool"]["site"] = Platform::getSite();
    m["tool"]["license"] = Platform::getLicenseInfo();

    m["execution"]["start"] = util::getCurrentTimeString();
    switch (profile->getAction().getId()) {
      case runprofile::ActionEnum::HELP:
        std::cerr << profile->getOptionDescription() << std::endl;
        status = ReturnValue::DID_NOT_RUN;
        break;
      case runprofile::ActionEnum::VERSION:
        showVersion(std::cerr);
        status = ReturnValue::SUCCESS;
        break;
      case runprofile::ActionEnum::BENCHMARK:
        status = (0 != runBenchmark(*profile, &m))
            ? ReturnValue::UNKNOWN : ReturnValue::SUCCESS;
        break;
      case runprofile::ActionEnum::MACHINE_INFO:
        status = (0 != runMachineInfo(*profile, &m))
            ? ReturnValue::UNKNOWN : ReturnValue::SUCCESS;
        break;
      case runprofile::ActionEnum::INTERPOLATE:
        status = (0 != runInterpolation(*profile, &m))
            ? ReturnValue::UNKNOWN : ReturnValue::SUCCESS;
        break;
      default:
        throw std::logic_error("Unknown/unimplemented action");
    }

    m["execution"]["status"] = status.toString();
    m["execution"]["end"] = util::getCurrentTimeString();

    if (profile->getOutputFileName().size() > 0) {
      saveData(m, profile->getOutputFileName(), profile->isOverwrite());
    }

  } catch (const std::exception& e) {
    LERR_ << e.what() << std::endl;
    status = ReturnValue::BAD_CMD_LINE_OPTION;
  }
  // catch (...) { } // comment out to core dump on unexpected exceptions

  return status.getId();
}


text:
echo 'Currently executing project installation.'
echo 'Setting npm global folder to home.'
mkdir ~/.npm_global
npm config set prefix '~/.npm_global'
export PATH=~/.npm_global/bin:$PATH
source ~/.profile
cd /xrgrpc/
echo 'Fixing npm synced folder Vagrant issues, remove if not Vagrant.'
mkdir -p ~/testxrclient/node_modules/
ln -s ~/testxrclient/node_modules/ node_modules
echo 'Installing project dependencies from npm.'
npm install
node node_modules/.bin/mocha tests/index.js
echo 'Finished execution.'


text:
package pipeline

import (
	"fmt"
	"strings"
	"yabs/common/format"
	"yabs/common/format/minidump"
	"regexp"
)

// Pipeline stage
type Stage interface {
	//Process the report
	//If return true then pipeline stop
	Process(report *minidump.Report, info *format.Info) bool
}

type SignatureAndSource struct {
	Stage
}

type MinidumpStackUnfolding struct {
	Stage
}

func (m *SignatureAndSource) Process(report *minidump.Report, info *format.Info) bool {
	if len(report.CrashingThread.Frames) > 0 {
		frame := &report.CrashingThread.Frames[0]
		signature := frame.Function
		source := fmt.Sprintf("%s:%d", frame.File,
			frame.Line)
		report.Signature = signature
		report.Source = source
	}

	return false
}

func (m *MinidumpStackUnfolding) Process(report *minidump.Report, info *format.Info) bool {
	frames := report.CrashingThread.Frames
	if len(report.CrashingThread.Frames) == 0 {
		// go to next stage
		return false
	}

	iqoption := regexp.MustCompile("iq\\s*option")
	for _, frame := range frames {
		module := strings.ToLower(frame.Module)
		if iqoption.MatchString(module) {
			report.Signature = frame.Function
			report.Source = fmt.Sprintf("%s:%d", frame.File,
				frame.Line)
			return true
		}
	}

	return true
}


text:
#include <aws/amplifybackend/model/CreateBackendAuthVerificationMessageConfig.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace AmplifyBackend
{
namespace Model
{

CreateBackendAuthVerificationMessageConfig::CreateBackendAuthVerificationMessageConfig() :
    m_deliveryMethod(DeliveryMethod::NOT_SET),
    m_deliveryMethodHasBeenSet(false),
    m_emailSettingsHasBeenSet(false),
    m_smsSettingsHasBeenSet(false)
{
}

CreateBackendAuthVerificationMessageConfig::CreateBackendAuthVerificationMessageConfig(JsonView jsonValue) :
    m_deliveryMethod(DeliveryMethod::NOT_SET),
    m_deliveryMethodHasBeenSet(false),
    m_emailSettingsHasBeenSet(false),
    m_smsSettingsHasBeenSet(false)
{
  *this = jsonValue;
}

CreateBackendAuthVerificationMessageConfig& CreateBackendAuthVerificationMessageConfig::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("deliveryMethod"))
  {
    m_deliveryMethod = DeliveryMethodMapper::GetDeliveryMethodForName(jsonValue.GetString("deliveryMethod"));

    m_deliveryMethodHasBeenSet = true;
  }

  if(jsonValue.ValueExists("emailSettings"))
  {
    m_emailSettings = jsonValue.GetObject("emailSettings");

    m_emailSettingsHasBeenSet = true;
  }

  if(jsonValue.ValueExists("smsSettings"))
  {
    m_smsSettings = jsonValue.GetObject("smsSettings");

    m_smsSettingsHasBeenSet = true;
  }

  return *this;
}

JsonValue CreateBackendAuthVerificationMessageConfig::Jsonize() const
{
  JsonValue payload;

  if(m_deliveryMethodHasBeenSet)
  {
   payload.WithString("deliveryMethod", DeliveryMethodMapper::GetNameForDeliveryMethod(m_deliveryMethod));
  }

  if(m_emailSettingsHasBeenSet)
  {
   payload.WithObject("emailSettings", m_emailSettings.Jsonize());

  }

  if(m_smsSettingsHasBeenSet)
  {
   payload.WithObject("smsSettings", m_smsSettings.Jsonize());

  }

  return payload;
}

} // namespace Model
} // namespace AmplifyBackend
} // namespace Aws


text:
class CCritSec
{
public:
	CCritSec();
	virtual ~CCritSec();
public:
    void Lock(void);
    void Unlock(void);
protected:
    CRITICAL_SECTION m_CritSec;
};

#endif


text:
package com.docker.atsea.repositories;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.docker.atsea.model.Order;

@Repository
@Transactional
public interface OrderRepository extends JpaRepository<Order, Long> {

}


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

<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:05 +0000">

<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css">
<link rel="start" href="../../../../overview-summary.html">

<title>PhpDriver (Doctrine)</title>

Doctrine

Overview

Namespace

Class

Tree

Deprecated

Index

Frames
No frames

Summary: Field | Method | Constr
Detail: Field | Method | Constr

Doctrine\ORM\Mapping\Driver\PhpDriver

/Doctrine/ORM/Mapping/Driver/PhpDriver.php at line 46

Class PhpDriver

Class:PhpDriver - Superclass: AbstractFileDriver
AbstractFileDriver
   ⌊ PhpDriver

public  class PhpDriver
extends AbstractFileDriver

The PhpDriver includes php files which just populate ClassMetadataInfo
instances with plain php code

License:

http://www.opensource.org/licenses/lgpl-license.php LGPL

See Also:

www.doctrine-project.org

Since:

2.0

Version:

$Revision$

Author		Benjamin:

Eberlei <kontakt@beberlei.de>

Author		Guilherme:

Blanco <guilhermeblanco@hotmail.com>

Author:

Jonathan H. Wage <jonwage@gmail.com>

Roman Borschel <roman@code-factory.org>

Todo:

Rename: PHPDriver

Field Summary

protected  mixed

$_fileExtension

{@inheritdoc}

protected  mixed

$_metadata

Fields inherited from Doctrine\ORM\Mapping\Driver\AbstractFileDriver

_fileExtension, _paths

Method Summary

 void

loadMetadataForClass(mixed className, mixed metadata)

{@inheritdoc}

Methods inherited from Doctrine\ORM\Mapping\Driver\AbstractFileDriver

addPaths, getAllClassNames, getElement, getFileExtension, getPaths, isTransient, setFileExtension

Field Detail

/Doctrine/ORM/Mapping/Driver/PhpDriver.php at line 51

_fileExtension

protected  mixed $_fileExtension = '.php'

/Doctrine/ORM/Mapping/Driver/PhpDriver.php at line 52

_metadata

protected  mixed $_metadata

Method Detail

/Doctrine/ORM/Mapping/Driver/PhpDriver.php at line 57

loadMetadataForClass

public  void loadMetadataForClass(mixed className, mixed metadata)

Doctrine

Overview

Namespace

Class

Tree

Deprecated

Index

Frames
No frames

Summary: Field | Method | Constr
Detail: Field | Method | Constr

This document was generated by PHPDoctor: The PHP Documentation Creator


text:
WebIS-2014-spring course notes and wiki.

## Resources ##

### CSS/HTML/PHP ###
* CSS and HTML
 * http://www.w3schools.com/html/
 * http://www.webreference.com/html/rendering/
 * http://www.hotdesign.com/seybold/everything.html (Required Reading)
 * http://www.sitepoint.com/books/css2/ (Recommended Reading)
* PHP introduction
 * http://www.w3schools.com/php/
* Eclipse.
  * http://www.ibm.com/developerworks/library/os-ecov/
* Git
  * http://git-scm.com/book/

### Test Driven Development/Design ###
* "Test Driven Development: By Example," by Kent Beck, 2002. http://www.amazon.com/dp/0321146530
* http://www.agiledata.org/essays/tdd.html
* PHPUnit http://phpunit.de/
* Configure PHPUnit for Eclipse (http://pkp.sfu.ca/wiki/index.php/Configure_Eclipse_for_PHPUnit)

## Lectures ##

### Week 1
* Introduciton to class and syllabus.
* Overview of the Web Stack.
* Download and uncompress class software.

### Week 2
* Setting up the system.
* HTML, UTF-8, TDD, Github, and the development envronment (eclipse).
* Project overview.
* Agile
 * http://www.agilealliance.org/the-alliance/the-agile-manifesto/the-twelve-principles-of-agile-software/
 * http://guide.agilealliance.org/
 * http://www.ambysoft.com/essays/agileLifecycle.html
 * http://www.indicthreads.com/1439/quick-introduction-to-agile-software-development/


text:
;;; runtime/device/keyboard.asm
;;;
;;; The keyboard.
;;;
;;; Copyright 2014 Jesse Haber-Kucharsky
;;; Released under the terms of the Apache License Version 2.0.

  .#once

  .section "data"

keyboard:

@device_id1: .dat 0x7406
@device_id2: .dat 0x30cf

@manufacturer_1: .dat 0
@manufacturer_2: .dat 0

@version: .dat 1

@index: .reserve 1

  ;; keyboard_get_key
  ;;
  ;; Get the key currently stored in the keyboard buffer.
  ;;
  ;; OUT:
  ;;   A - The code of the key currently in the buffer, or 0 if the buffer
  ;;       is empty.
keyboard_get_key:
  SET   A, 1
  HWI   [keyboard@index]
  SET   A, C
  SET   PC, POP


text:
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals,
* QuantConnect Visual Studio Plugin
*/

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace QuantConnect.QCStudioPlugin.Forms
{
    public partial class ChooseFiles : Form
    {
        public ChooseFiles()
        {
            InitializeComponent();
        }
    }
}


text:
from game_color_graph import GraphColorMC, GraphColorSA
from game_kqueens import KQueensMC, KQueensSA
from game_magic_square import MagicSquareMC, MagicSquareSA

class Factory():
    """
    Permits to build a game dynamically,
    corresponding to a certain local search type
    """

    __LIST_GAMES = {
        "mc": {
            "K-Queens": KQueensMC,
            "Graph Coloring": GraphColorMC,
            "Magic Square": MagicSquareMC
        },
        "sa": {
            "K-Queens": KQueensSA,
            "Graph Coloring": GraphColorSA,
            "Magic Square": MagicSquareSA
        }
    }

    def list_games(cls):
        list_mc = Factory.__LIST_GAMES["mc"]
        list_sa = Factory.__LIST_GAMES["sa"]

        # Keep only games which have both MC and SA implementation
        return list(set(list_mc.keys()) & set(list_sa.keys()))

    def build(cls, game_type, local_search_type):
        """
        Unique class method. Create a game corresponding
        to game_type and local_search_type
        """

        assert(local_search_type in Factory.__LIST_GAMES)

        games = Factory.__LIST_GAMES[local_search_type]

        assert(game_type in games)

        return games[game_type]()

    build = classmethod(build)
    list_games = classmethod(list_games)


text:
from translator.hot.syntax.hot_resource import HotResource

# Name used to dynamically load appropriate map class.
TARGET_CLASS_NAME = 'ToscaNfvCommonAffinityRule'

class ToscaNfvCommonAffinityRule(HotResource):
    """Translate common TOSCA policy type tosca.policies.nfv.AffinityRule."""

    GROUP_SUFFIX = '_group'

    def __init__(self, policy, csar_dir=None, hot_template_parameters=None):
        self.own_resource_name = policy.name + self.GROUP_SUFFIX
        super(ToscaNfvCommonAffinityRule, self).__init__(
            policy,
            name=self.own_resource_name,
            type='OS::Nova::ServerGroup',
            csar_dir=csar_dir)
        self.policy = policy
        self.hot_template_parameters = hot_template_parameters

    def handle_properties(self, resources):
        policy_props = self.policy.properties
        rule = 'anti-affinity' if self.is_anti else 'affinity'

        # NOTE: In ETSI-NFV SOL001, nfvi_node/zone/zone_group/nfvi_pop
        # is specified as 'scope'.
        # This code only supports nfvi_node as 'scope'and no conversion
        # for other'scope'.
        scope = policy_props.get('scope', None)
        if scope != 'nfvi_node':
            self.name = None
            self.type = None
            return

        # NOTE: In ETSI-NFV SOL001,
        # - tosca.nodes.nfv.Vdu.Compute
        # - tosca.nodes.nfv.VnfVirtualLink
        # - tosca.groups.nfv.PlacementGroup
        # is specified as'targets'.
        # This code only supports tosca.nodes.nfv.Vdu.Compute as 'targets'
        # and no conversion for other 'targets'.
        is_exists_server = False
        for resource in resources:
            if self.policy.type in self.toscatype and \
                    resource.name in self.policy.targets and \
                    resource.type == 'OS::Nova::Server':
                self.properties['name'] = self.name
                self.properties['policies'] = [rule]
                if not resource.properties.get('scheduler_hints'):
                    resource.properties['scheduler_hints'] = {}
                resource.properties['scheduler_hints'].update(
                    {'group': '{ get_resource: %s }' % (self.name)}
                )
                is_exists_server = True

        if is_exists_server is False:
            self.name = None
            self.type = None


text:
Date: Tue, 05 Nov 1996 21:10:35 GMT
Server: NCSA/1.5
Content-type: text/html
Last-modified: Sat, 02 Nov 1996 01:01:43 GMT
Content-length: 2506

<title> List of Publications </title>

<!WA0>

Mechanisms for Cooperative Shared Memory,

David A. Wood,
Satish Chandra,
Babak Falsafi,
Mark D. Hill,
James R. Larus,
Alvin R. Lebeck,
James C. Lewis,
Shubhendu S. Mukherjee,
Subbarao Palacharla,
Steven K. Reinhardt
(ACM/IEEE International Symposium on Computer Architecture (ISCA), May 1993).

<!WA1>

Kernel Support for the Wisconsin Wind Tunnel,

Steven K. Reinhardt, Babak Falsafi, David A. Wood
(Usenix Symposium on Microkernels
and Other Kernel Architectures, September 1993).

<!WA2>

Cost/Performance of a Parallel Computer Simulator,

Babak Falsafi and David A. Wood
(SCS PADS, July 1994).

<!WA3>

Fine-grain Access Control for Distributed Shared Memory,

Ioannis Schoinas, Babak Falsafi, Alvin R. Lebeck,
Steven K. Reinhardt, James R. Larus, David A. Wood
(The Sixth International Conference on Architectural Support for Programming
Languages and Operating Systems (ASPLOS VI), Oct. 1994).

<!WA4>

Application-Specific Protocols for User-Level Shared Memory,

Babak Falsafi, Alvin R. Lebeck, Steven K. Reinhardt, Ioannis Schoinas,
Mark D. Hill James R. Larus, Anne Rogers, David A. Wood
(Supercomputing '94, Nov. 1994).

<!WA5>

Coherent Network Interfaces for Fine-Grain Communication,

Shubhendu S. Mukherjee, Babak Falsafi, Mark D. Hill, David A. Wood
(ACM/IEEE International Symposium on Computer Architecture (ISCA), May 1996).

<!WA6>

When does Dedicated Protocol Processing Make Sense?

Babak Falsafi and David A. Wood
(Technical Report 1302, Computer Sciences Department, University of Wisconsin-Madison, February 1996).

<!WA7>

Scheduling Communication on an SMP Node Parallel Machine

Babak Falsafi and David A. Wood
(IEEE International Symposium on High Performance Computer Architecture (HPCA), February 1997).


text:
namespace System.Windows.Forms {

    using System;

    /// <include file='doc\ICurrencyManagerProvider.uex' path='docs/doc[@for="ICurrencyManagerProvider"]/*' />
    /// <devdoc>
    /// </devdoc>
    [SRDescription(SR.ICurrencyManagerProviderDescr)]
    public interface ICurrencyManagerProvider {

        /// <include file='doc\ICurrencyManagerProvider.uex' path='docs/doc[@for="ICurrencyManagerProvider.CurrencyManager"]/*' />
        /// <devdoc>
        ///     Return the main currency manager for this data source.
        /// </devdoc>
        CurrencyManager CurrencyManager { get; }

        /// <include file='doc\ICurrencyManagerProvider.uex' path='docs/doc[@for="ICurrencyManagerProvider.GetRelatedCurrencyManager"]/*' />
        /// <devdoc>
        ///     Return a related currency manager for specified data member on this data source.
        ///     If data member is null or empty, this method returns the data source's main currency
        ///     manager (ie. this method returns the same value as the CurrencyManager property).
        /// </devdoc>
        CurrencyManager GetRelatedCurrencyManager(string dataMember);
    }

}


text:
#include "tensorflow/core/profiler/internal/advisor/tfprof_advisor.h"

#include "tensorflow/core/lib/io/path.h"
#include "tensorflow/core/lib/strings/str_util.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/test.h"

namespace tensorflow {
namespace tfprof {

class TFProfAdvisorTest : public ::testing::Test {
 protected:
  TFProfAdvisorTest() {
    stats_.reset(new TFStats(std::unique_ptr<GraphDef>(new GraphDef()), nullptr,
                             nullptr, nullptr));

    stats_->AddNodeForTest(
        0, CreateNode("n1", "Conv2D", {{"data_format", "NHWC"}}, 0, 10, 2));
    stats_->AddNodeForTest(0, CreateNode("n2", "Conv2D", {}, 0, 20, 2));
    stats_->BuildAllViews();
    advisor_.reset(new Advisor(stats_.get()));
  }

  std::unique_ptr<TFGraphNode> CreateNode(const string& name,
                                          const string& type,
                                          std::map<string, string> attrs,
                                          int64 step, int64 start_miros,
                                          int64 end_rel_micros) {
    node_defs_.push_back(std::unique_ptr<NodeDef>(new NodeDef()));
    NodeDef* def = node_defs_.back().get();

    def->set_name(name);
    def->set_op(type);
    for (const auto& attr : attrs) {
      (*def->mutable_attr())[attr.first].set_s(attr.second);
    }
    std::unique_ptr<TFGraphNode> node(new TFGraphNode(def, -1, nullptr));

    NodeExecStats node_stat;
    node_stat.set_all_start_micros(start_miros);
    node_stat.set_op_end_rel_micros(end_rel_micros);
    node->AddStepStat(step, "/job:localhost/replica:0/task:0/device:GPU:0",
                      node_stat);
    node->AddStepStat(step,
                      "/job:localhost/replica:0/task:0/device:GPU:0:stream:all",
                      node_stat);
    node->AddStepStat(step,
                      "/job:localhost/replica:0/task:0/device:GPU:0:stream:0",
                      node_stat);
    return node;
  }

  std::unique_ptr<TFStats> stats_;
  std::unique_ptr<Advisor> advisor_;
  std::vector<std::unique_ptr<NodeDef>> node_defs_;
};

TEST_F(TFProfAdvisorTest, Basics) {
  AdvisorOptionsProto options = Advisor::DefaultOptions();
  AdviceProto advice = advisor_->Advise(options);
  EXPECT_TRUE(advice.checkers().find(kCheckers[0]) != advice.checkers().end());
  EXPECT_TRUE(advice.checkers().find(kCheckers[1]) != advice.checkers().end());
  EXPECT_TRUE(advice.checkers().find(kCheckers[2]) != advice.checkers().end());
}

TEST_F(TFProfAdvisorTest, OperationChecker) {
  AdvisorOptionsProto options;
  (*options.mutable_checkers())[kCheckers[1]];
  AdviceProto advice = advisor_->Advise(options);
  EXPECT_EQ(advice.checkers().at(kCheckers[1]).reports_size(), 1);
  EXPECT_TRUE(str_util::StrContains(
      advice.checkers().at(kCheckers[1]).reports(0), "NCHW"));
}

TEST_F(TFProfAdvisorTest, UtilizationChecker) {
  AdvisorOptionsProto options;
  (*options.mutable_checkers())[kCheckers[0]];
  AdviceProto advice = advisor_->Advise(options);
  EXPECT_EQ(advice.checkers().at(kCheckers[0]).reports_size(), 1);
  EXPECT_TRUE(str_util::StrContains(
      advice.checkers().at(kCheckers[0]).reports(0), "low utilization"));
}

TEST_F(TFProfAdvisorTest, ExpensiveOperationChecker) {
  AdvisorOptionsProto options;
  (*options.mutable_checkers())[kCheckers[2]];
  AdviceProto advice = advisor_->Advise(options);
  EXPECT_TRUE(
      str_util::StrContains(advice.checkers().at(kCheckers[2]).reports(0),
                            "top 1 operation type: Conv2D"));
}

}  // namespace tfprof
}  // namespace tensorflow


text:
package uk.ac.imperial.doc.gpa.probes;

import uk.ac.imperial.doc.gpa.fsm.NFAState;

public interface IProbe
{
	public String getName ();

	public void setName (String name);

	public void setStartingState (NFAState state);

    public NFAState getStartingState ();
}


text:
class Footer extends React.Component{
	constructor(props){
		super(props);
	}

	render(){
		return (

©drip blog system {new Date().getFullYear()}

			);
	}
}

export default Footer;


text:
package com.dsp.servlet;

import java.util.List;

class DspEnd extends DspToken implements Output
{
	static final String NAME = "end";

	protected DspDo doTag;

	DspEnd(String eat, List<DspArg> args)
	{
		super(eat, args);
	} // DspEnd()

	public int doJava(DspCompile comp, StringBuilder buf, int level) throws DspParseException
	{
		return doTag.doEnd(comp, buf, level);
	} // doJava()

	@Override
	public void postParse(DspCompile comp, List<Token> tokens, int index) throws DspParseException
	{
		super.postParse(comp, tokens, index);
		if (getClass() == DspEnd.class)
		{
			if (args != null && (args.size() > 1 || args.get(0).getExpr() != null))
					throw new DspParseException("Expressions not allowed in 'end'", getTokenIndex(), comp);
			for (--index; index >= 0; index--)
			{
				try {
					DspDo doTag = (DspDo)tokens.get(index);
					if (doTag.setEnd(this))
					{
						this.doTag = doTag;
						break;
					}
				} catch (ClassCastException e) {
				}
			}
			if (doTag == null) throw new DspParseException("End with no matching 'do', 'if', or 'while'", getTokenIndex(), comp);
		}
	} // postParse()

	public String toString()
	{
		return toString(NAME);
	} // toString()

} // DspEnd


text:
//
//  NSDictionaryHeader.h
//  MACProject
//
//  Created by MacKun on 16/8/12.
//  Copyright © 2016年 com.mackun. All rights reserved.
//

#ifndef NSDictionaryHeader_h
#define NSDictionaryHeader_h

#import "NSDictionary+JKBlock.h"
#import "NSDictionary+JKSafeAccess.h"
#import "NSDictionary+MAC.h"
#import "NSDictionary+JKMerge.h"

#endif /* NSDictionaryHeader_h */


text:
System.register(['angular2/core', 'angular2/http', 'angular2/common', 'angular2/router', '../../shared/components/control-messages.component', '../../shared/services/validationService', '../../posts/postService'], function(exports_1, context_1) {
    "use strict";
    var __moduleName = context_1 && context_1.id;
    var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var __metadata = (this && this.__metadata) || function (k, v) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
    };
    var core_1, http_1, common_1, router_1, control_messages_component_1, validationService_1, postService_1;
    var CreatePostComponent;
    return {
        setters:[
            function (core_1_1) {
                core_1 = core_1_1;
            },
            function (http_1_1) {
                http_1 = http_1_1;
            },
            function (common_1_1) {
                common_1 = common_1_1;
            },
            function (router_1_1) {
                router_1 = router_1_1;
            },
            function (control_messages_component_1_1) {
                control_messages_component_1 = control_messages_component_1_1;
            },
            function (validationService_1_1) {
                validationService_1 = validationService_1_1;
            },
            function (postService_1_1) {
                postService_1 = postService_1_1;
            }],
        execute: function() {
            CreatePostComponent = (function () {
                function CreatePostComponent(fb, _http, _postService, _router) {
                    this.fb = fb;
                    this._http = _http;
                    this._postService = _postService;
                    this._router = _router;
                    this.postFormProcess = false;
                    this.postForm = this.fb.group({
                        'title': ['dumytitile', common_1.Validators.compose([common_1.Validators.required])],
                        'price': ['20', common_1.Validators.compose([common_1.Validators.required])],
                        'category': ['mobile', common_1.Validators.compose([common_1.Validators.required])],
                        'description': ['Checkout this description', common_1.Validators.compose([common_1.Validators.required])],
                        'name': ['mynmae', common_1.Validators.compose([common_1.Validators.required])],
                        'phone': ['03343853136', common_1.Validators.compose([common_1.Validators.required])],
                        'images': [''],
                        'state': ['sindh', common_1.Validators.compose([common_1.Validators.required])],
                        'city': ['karachi', common_1.Validators.compose([common_1.Validators.required])]
                    });
                }
                CreatePostComponent.prototype.createPost = function (postForm) {
                    var _this = this;
                    this.upload(function (images) {
                        var postData = {
                            title: postForm.title,
                            price: postForm.price,
                            category: postForm.category,
                            description: postForm.description,
                            name: postForm.name,
                            phone: postForm.phone,
                            images: images,
                            state: postForm.state,
                            city: postForm.city
                        };
                        _this.postFormProcess = true;
                        //JSON.stringify(postData)
                        _this._postService.createPost(postData)
                            .subscribe(function (data) { return _this.postingResponse = JSON.stringify(data); }, function (error) { return console.log(error); }, function () {
                            _this.postFormProcess = false;
                            console.log(_this.postingResponse);
                            _this._router.navigate(['Posts']);
                        });
                    });
                };
                CreatePostComponent.prototype.upload = function (cb) {
                    this.makeFileRequest("http://localhost:3000/post/upload", [], this.filesToUpload)
                        .then(function (result) {
                        var img = [];
                        Object.keys(result).forEach(function (key) {
                            var res = result[key].path.split("client");
                            img.push({ path: res[1] });
                            //console.debug("Input File name: " + result[key].name + " type:" + result[key].size + " size:" + result[key].size);
                        });
                        cb(img);
                    }, function (error) {
                        console.debug(error);
                    });
                };
                CreatePostComponent.prototype.fileChangeEvent = function (fileInput) {
                    this.filesToUpload = fileInput.target.files;
                };
                CreatePostComponent.prototype.makeFileRequest = function (url, params, files) {
                    return new Promise(function (resolve, reject) {
                        var formData = new FormData();
                        var xhr = new XMLHttpRequest();
                        for (var i = 0; i < files.length; i++) {
                            formData.append("uploads", files[i], files[i].name);
                        }
                        xhr.onreadystatechange = function () {
                            if (xhr.readyState == 4) {
                                if (xhr.status == 200) {
                                    resolve(JSON.parse(xhr.response));
                                }
                                else {
                                    reject(xhr.response);
                                }
                            }
                        };
                        xhr.open("POST", url, true);
                        xhr.send(formData);
                    });
                };
                CreatePostComponent = __decorate([
                    core_1.Component({
                        templateUrl: 'app/posts/templates/create.html',
                        directives: [common_1.FORM_DIRECTIVES, control_messages_component_1.ControlMessages],
                        providers: [postService_1.PostService, validationService_1.ValidationService]
                    }),
                    __metadata('design:paramtypes', [common_1.FormBuilder, http_1.Http, postService_1.PostService, router_1.Router])
                ], CreatePostComponent);
                return CreatePostComponent;
            }());
            exports_1("CreatePostComponent", CreatePostComponent);
        }
    }
});

//# sourceMappingURL=createPost.component.js.map


text:
FROM debian:jessie

RUN apt-get update && \
    apt-get install  -y --no-install-recommends \
    ca-certificates \
    file \
    curl \
    git \
    openssh-client \
    gcc \
    g++ \
    libc6-dev \
    pkg-config \
    libdbus-1-dev && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/bin/strip /usr/bin/cross-strip

# Install jq

RUN JQ_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/jq-latest" \
    && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/jq $JQ_URL \
    && chmod +x /usr/bin/jq \
    && jq --version

# Setup Rust

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

ENV PATH=/root/.cargo/bin:$PATH

VOLUME /work

WORKDIR /work


text:
list(APPEND WebCore_INCLUDE_DIRECTORIES
    "${WEBCORE_DIR}/platform/graphics/texmap"
)
list(APPEND WebCore_SOURCES
    platform/graphics/texmap/BitmapTexture.cpp
    platform/graphics/texmap/BitmapTexturePool.cpp
    platform/graphics/texmap/TextureMapper.cpp
    platform/graphics/texmap/TextureMapperAnimation.cpp
    platform/graphics/texmap/TextureMapperBackingStore.cpp
    platform/graphics/texmap/TextureMapperFPSCounter.cpp
    platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp
    platform/graphics/texmap/TextureMapperLayer.cpp
    platform/graphics/texmap/TextureMapperTile.cpp
)

if (USE_TEXTURE_MAPPER_GL)
    list(APPEND WebCore_SOURCES
        platform/graphics/texmap/BitmapTextureGL.cpp
        platform/graphics/texmap/ClipStack.cpp
        platform/graphics/texmap/TextureMapperContextAttributes.cpp
        platform/graphics/texmap/TextureMapperGL.cpp
        platform/graphics/texmap/TextureMapperShaderProgram.cpp
    )
endif ()

if (USE_COORDINATED_GRAPHICS)
    list(APPEND WebCore_INCLUDE_DIRECTORIES
        "${WEBCORE_DIR}/page/scrolling/coordinatedgraphics"
        "${WEBCORE_DIR}/platform/graphics/texmap/coordinated"
    )
    list(APPEND WebCore_SOURCES
        page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
        page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp

        platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
        platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp

        platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
        platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
        platform/graphics/texmap/coordinated/Tile.cpp
        platform/graphics/texmap/coordinated/TiledBackingStore.cpp
    )

    # FIXME: Move this into Nicosia.cmake once the component is set for long-term use.
    list(APPEND WebCore_INCLUDE_DIRECTORIES
        "${WEBCORE_DIR}/platform/graphics/nicosia"
    )
    list(APPEND WebCore_SOURCES
        platform/graphics/nicosia/NicosiaBuffer.cpp
    )
else ()
    list(APPEND WebCore_SOURCES
        platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
        platform/graphics/texmap/TextureMapperTiledBackingStore.cpp
    )
endif ()


text:
package htmlctrl

var validators = make(map[string]Validator)

// RegisterValidator associates a name with the validator function so that it may be referenced in a struct tag.
func RegisterValidator(name string, fn Validator) {
	validators[name] = fn
}

// Validator is used to validate changes made via html objects. The Valid function is given the requested new value
// and should return true only when it is an acceptable value. If it returns false then the change is reverted
type Validator interface {
	Validate(interface{}) bool
}

// ValidatorFunc describes an abitrary function that implements the Validator interface.
type ValidatorFunc func(interface{}) bool

// Validate implements the Validator interface
func (v ValidatorFunc) Validate(i interface{}) bool {
	return v(i)
}

// ValidateBool is a function that validates bool types.
type ValidateBool func(bool) bool

// Validate implements the Validator interface but type asserts that the argument is a bool.
func (v ValidateBool) Validate(i interface{}) bool {
	return v(i.(bool))
}

// ValidateInt is a function that validates int types.
type ValidateInt func(int) bool

// Validate implements the Validator interface but type asserts that the argument is an int.
func (v ValidateInt) Validate(i interface{}) bool {
	return v(i.(int))
}

// ValidateFloat64 is a function that validates float64 types.
type ValidateFloat64 func(float64) bool

// Validate implements the Validator interface but type asserts that the argument is an float.
func (v ValidateFloat64) Validate(i interface{}) bool {
	return v(i.(float64))
}

// ValidateString is a function that validates string types.
type ValidateString func(string) bool

// Validate implements the Validator interface but type asserts that the argument is an string.
func (v ValidateString) Validate(i interface{}) bool {
	return v(i.(string))
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1">
  <model>
    <listOfCompartments>
      <compartment id="c" constant="false"/>
    </listOfCompartments>
    <listOfSpecies>
      <species id="s" compartment="c" boundaryCondition="false" hasOnlySubstanceUnits="false" constant="false"/>
    </listOfSpecies>
    <listOfParameters>
      <parameter id="y" constant="false"/>
      <parameter id="q" constant="true"/>
      <parameter id="z" constant="false"/>
      <parameter id="p" constant="false"/>
    </listOfParameters>
    <listOfConstraints>
      <constraint>
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <neq/>
            <apply>
              <gt/>
              <cn type="integer"> 3 </cn>
              <cn type="integer"> 6 </cn>
            </apply>
            <true/>
          </apply>
        </math>
      </constraint>
    </listOfConstraints>
  </model>
</sbml>


text:
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">

    <title>RMC Equipment List Tests</title>

    <script src="../../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
    <script src="../../bower_components/web-component-tester/browser.js"></script>

    <!-- Import the element to test -->
    <link rel="import" href="../../app/src/elements/rmc-equipment-list.html">
  </head>
  <body>
    <test-fixture id="RMCEquipmentList">
      <template>
        <rmc-equipment-list></rmc-equipment-list>
      </template>
    </test-fixture>
    <test-fixture id="RMCEquipmentListEditable">
      <template>
        <rmc-equipment-list editable></rmc-equipment-list>
      </template>
    </test-fixture>

    <script>
      suite('rmc-equipment-list tests', function() {
        let rmcEquipmentList;

        let equipmentListGetAjax;
        let request;
        let server;
        let responseHeaders = {
          json: {'Content-Type': 'application/json'},
        };

        /**
         * Mirror <iron-ajax> data to persisted attribute in <app-indexeddb-mirror>
         */
        function mirrorData() {
          // set persistedEquipment to ajax response
          rmcEquipmentList.persistedEquipment = request.response;
        }

        setup(function() {
          rmcEquipmentList = fixture('RMCEquipmentList');

          server = sinon.fakeServer.create();
          server.respondWith(
            'GET',
            'api/get/equipment-list', [
              200,
              responseHeaders.json,
              '[{"count":"1", "force":"100", "name":"Machine 1"}]',
            ]
          );
        });

        teardown(function() {
          server.restore();
        });

        suite('contians elements', function() {
          test('it should have a form to add a machine', function() {
            rmcEquipmentList.shadowRoot.querySelector('#machineForm');
          });
        });

        suite('when loading equipment list', function() {
          setup(function() {
            // get fresh instance of iron-ajax before every test
            equipmentListGetAjax = rmcEquipmentList.shadowRoot.querySelector('#equipmentListGetAjax');
          });

          test('has sane defaults that love you', function() {
            request = equipmentListGetAjax.generateRequest();
            server.respond();

            expect(request.response).to.be.ok;
            expect(request.response).to.be.an('Array');
            expect(request.status).to.be.equal(200);
          });

          test('has the correct xhr method', function() {
            request = equipmentListGetAjax.generateRequest();
            server.respond();

            expect(request.xhr.method).to.be.equal('GET');
          });

          test('item lengths should be equalled', function(done) {
            request = equipmentListGetAjax.generateRequest();
            server.respond();
            mirrorData();

            flush(function() {
              let tableRows = rmcEquipmentList.shadowRoot.querySelectorAll('.table > tbody > tr');
              assert.equal(tableRows.length, 1);
              done();
            });
          });

          test('gets item count', function(done) {
            request = equipmentListGetAjax.generateRequest();
            server.respond();
            mirrorData();

            flush(function() {
              let count = rmcEquipmentList.shadowRoot.querySelector('.table > tbody > tr > th');
              assert.equal(count.textContent, '1');
              done();
            });
          });

          test('gets item force', function(done) {
            request = equipmentListGetAjax.generateRequest();
            server.respond();
            mirrorData();

            flush(function() {
              let force = rmcEquipmentList.shadowRoot.querySelector('.table > tbody > tr > td:nth-child(2)');
              assert.equal(force.textContent, '100 Ton');
              done();
            });
          });

          test('gets item name', function(done) {
            request = equipmentListGetAjax.generateRequest();
            server.respond();
            mirrorData();

            flush(function() {
              let name = rmcEquipmentList.shadowRoot.querySelector('.table > tbody > tr > td:nth-child(3)');
              assert.equal(name.textContent, 'Machine 1');
              done();
            });
          });
        });

        suite('when editable', function() {
          let rmcEquipmentListEditable;

          setup(function() {
            rmcEquipmentListEditable = fixture('RMCEquipmentListEditable');
          });

          suite('defines properties', function() {
            test('defines the "editable" property', function() {
              assert.equal(rmcEquipmentListEditable.hasAttribute('editable'), true);
            });
          });

          suite('contians elements', function() {
            test('it should have a form to add a machine', function(done) {
              flush(function() {
                let el = rmcEquipmentListEditable.shadowRoot.querySelector('#equipmentListAddMachineForm');
                assert.equal(el.id, 'equipmentListAddMachineForm');
                done();
              });
            });

            test('it should have an iron-ajax element to delete a machine', function(done) {
              flush(function() {
                let el = rmcEquipmentListEditable.shadowRoot.querySelector('#deleteEquipmentListAjax');
                assert.equal(el.id, 'deleteEquipmentListAjax');
                done();
              });
            });
          });
        });
      });
    </script>
  </body>
</html>


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

namespace BrockAllen.OAuth2
{
    class AuthorizationRedirect
    {
        public string AuthorizationUrl { get; set; }
        public string State { get; set; }
    }
}


text:
class PropertyTypesController < ApplicationController
  before_action :set_property_type, only: [:show, :edit, :update, :destroy]

  # GET /property_types
  # GET /property_types.json
  def index
    @property_types = PropertyType.all
  end

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

  # GET /property_types/new
  def new
    @property_type = PropertyType.new
  end

  # GET /property_types/1/edit
  def edit
  end

  # POST /property_types
  # POST /property_types.json
  def create
    @property_type = PropertyType.new(property_type_params)

    respond_to do |format|
      if @property_type.save
        format.html { redirect_to @property_type, notice: t('property.successfully_created') }
        format.json { render action: 'show', status: :created, location: @property_type }
      else
        format.html { render action: 'new' }
        format.json { render json: @property_type.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /property_types/1
  # PATCH/PUT /property_types/1.json
  def update
    respond_to do |format|
      if @property_type.update(property_type_params)
        format.html { redirect_to @property_type, notice: t('property.successfully_updated') }
        format.json { head :no_content }
      else
        format.html { render action: 'edit' }
        format.json { render json: @property_type.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /property_types/1
  # DELETE /property_types/1.json
  def destroy
    @property_type.destroy
    respond_to do |format|
      format.html { redirect_to property_types_url }
      format.json { head :no_content }
    end
  end

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

    # Never trust parameters from the scary internet, only allow the white list through.
    def property_type_params
      ps = params.require(:property_type).permit(:name)
      ps[:full_name] && ps[:full_name].squish!
      ps
    end
end


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

<title>Changing rule style cssText</title>

FAIL (script not run or produced an error)


text:
using System;
using System.Drawing;
using mshtml;
using OpenLiveWriter.Api;
using OpenLiveWriter.ApplicationFramework;
using OpenLiveWriter.Extensibility.ImageEditing;
using OpenLiveWriter.HtmlEditor;

namespace OpenLiveWriter.PostEditor.PostHtmlEditing
{
	internal delegate void ApplyDecoratorCallback();
	internal class ImageDecoratorEditorContextImpl : ImageDecoratorEditorContext
	{
		ApplyDecoratorCallback _applyDecoratorCallback;
		IProperties _settings;
		ImagePropertiesInfo _imageProperties;
		IUndoUnitFactory _undoHost;
		public ImageDecoratorEditorContextImpl(IProperties settings, ApplyDecoratorCallback applyDecoratorCallback, ImagePropertiesInfo imageProperties, IUndoUnitFactory undoHost, CommandManager commandManager)
		{
			_applyDecoratorCallback = applyDecoratorCallback;
			_settings = settings;
			_imageProperties = imageProperties;
			_undoHost = undoHost;
		    _commandManager = commandManager;
		}
		public void ApplyDecorator()
		{
			_applyDecoratorCallback();
		}

		public IProperties Settings
		{
			get { return _settings; }
		}

		public Size SourceImageSize
		{
			get { return ImageInfo.ImageSourceSize; }
		}

		public Uri SourceImageUri
		{
			get
			{
				return ImageInfo.ImageSourceUri;
			}
		}

		private ImagePropertiesInfo ImageInfo
		{
			get
			{
				return _imageProperties;
			}
		}

		public IHTMLElement ImgElement
		{
			get { return ImageInfo.ImgElement; }
		}

	    public float? EnforcedAspectRatio
	    {
            get { return _imageProperties.EnforcedAspectRatio; }
	    }

	    public RotateFlipType ImageRotation
		{
			get
			{
				return ImageInfo.ImageRotation;
			}
			set
			{
				ImageInfo.ImageRotation = value;
			}
		}

		public IImageDecoratorUndoUnit CreateUndoUnit()
		{
			return new ImageDecoratorUndoUnitAdapter(_undoHost.CreateUndoUnit());
		}

		internal class ImageDecoratorUndoUnitAdapter : IUndoUnit, IImageDecoratorUndoUnit
		{
			private IUndoUnit _undo;
			public ImageDecoratorUndoUnitAdapter(IUndoUnit undo)
			{
				_undo = undo;
			}

			public void Commit()
			{
				_undo.Commit();
			}

			public void Dispose()
			{
				_undo.Dispose();
			}
		}

	    private CommandManager _commandManager;
	    public CommandManager CommandManager
	    {
	        get
	        {
	            return _commandManager;
	        }
	    }
	}
}


text:
Game *Game::instance = 0;

Game *Game::Instance() {
    if (instance == 0) {
        instance = new Game();
    }

    return instance;
}

bool Game::init(const char *title, int xPos, int yPos, int height, int width, bool fullscreen) {
    if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
        return false;
    }

    this->height = height;
    this->width = width;

    std::cout << "SDL init success\n";

    int flags = SDL_WINDOW_SHOWN;
    if (fullscreen) {
        flags = SDL_WINDOW_FULLSCREEN;
    }

    window = SDL_CreateWindow(title, xPos, yPos, width, height, flags);

    if (window == 0) {
        std::cout << "windows creation unsuccessful" << std::endl;
        return false;
    }

    renderer = SDL_CreateRenderer(window, -1, 0);

    if (renderer == 0) {
        std::cout << "renderer creation unsuccessful" << std::endl;
        return false;
    }

    SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);

    GameObjectFactory::Instance()->registerType("AnimatedGraphic", new AnimatedGraphicCreator());
    GameObjectFactory::Instance()->registerType("MenuButton", new MenuButtonCreator());
    GameObjectFactory::Instance()->registerType("Player", new PlayerCreator());
    InputHandler::Instance()->initialiseJoysticks();

    running = true;

    TextureManager::Instance()->load("assets/animate-alpha.png", "rider", renderer);
    TextureManager::Instance()->load("assets/animate-alpha.png", "animate", renderer);

    gameStateMachine = new GameStateMachine();
    gameStateMachine->changeState(new MainMenuState());

    return true;
}

void Game::handleEvents() {
    auto input = InputHandler::Instance();

    input->update();

    if (input->isKeyDown(SDL_SCANCODE_RETURN)) {
        gameStateMachine->changeState(new PlayState());
    }
}

void Game::render() {
    SDL_RenderClear(renderer);

    gameStateMachine->render();

    SDL_RenderPresent(renderer);
}

void Game::update() {
    gameStateMachine->update();
}

void Game::clean() {
    std::cout << "cleaning game" << std::endl;

    running = false;
    InputHandler::Instance()->clean();

    SDL_DestroyWindow(window);
    SDL_DestroyRenderer(renderer);
    SDL_Quit();
}

void Game::setCurrentLevel(int currentLevel) {
    this->currentLevel = currentLevel;

    gameStateMachine->changeState(new BetweenLevelState());
    levelComplete = false;
}


text:
import json
import time
import unittest
import uuid

from kubernetes.client import api_client
from kubernetes.client.apis import core_v1_api
from kubernetes.e2e_test import base

def short_uuid():
    id = str(uuid.uuid4())
    return id[-12:]

class TestClient(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        cls.config = base.get_e2e_configuration()

    def test_pod_apis(self):
        client = api_client.ApiClient(config=self.config)
        api = core_v1_api.CoreV1Api(client)

        name = 'busybox-test-' + short_uuid()
        pod_manifest = {
            'apiVersion': 'v1',
            'kind': 'Pod',
            'metadata': {
                'name': name
            },
            'spec': {
                'containers': [{
                    'image': 'busybox',
                    'name': 'sleep',
                    "args": [
                        "/bin/sh",
                        "-c",
                        "while true;do date;sleep 5; done"
                    ]
                }]
            }
        }

        resp = api.create_namespaced_pod(body=pod_manifest,
                                         namespace='default')
        self.assertEqual(name, resp.metadata.name)
        self.assertTrue(resp.status.phase)

        while True:
            resp = api.read_namespaced_pod(name=name,
                                           namespace='default')
            self.assertEqual(name, resp.metadata.name)
            self.assertTrue(resp.status.phase)
            if resp.status.phase != 'Pending':
                break
            time.sleep(1)

        exec_command = ['/bin/sh',
                        '-c',
                        'for i in $(seq 1 3); do date; done']
        resp = api.connect_get_namespaced_pod_exec(name, 'default',
                                                   command=exec_command,
                                                   stderr=False, stdin=False,
                                                   stdout=True, tty=False)
        print('EXEC response : %s' % resp)
        self.assertEqual(3, len(resp.splitlines()))

        exec_command = 'uptime'
        resp = api.connect_post_namespaced_pod_exec(name, 'default',
                                                    command=exec_command,
                                                    stderr=False, stdin=False,
                                                    stdout=True, tty=False)
        print('EXEC response : %s' % resp)
        self.assertEqual(1, len(resp.splitlines()))

        resp = api.connect_post_namespaced_pod_exec(name, 'default',
                                                    command='/bin/sh',
                                                    stderr=True, stdin=True,
                                                    stdout=True, tty=False,
                                                    _preload_content=False)
        resp.write_stdin("echo test string 1\n")
        line = resp.readline_stdout(timeout=5)
        self.assertFalse(resp.peek_stderr())
        self.assertEqual("test string 1", line)
        resp.write_stdin("echo test string 2 >&2\n")
        line = resp.readline_stderr(timeout=5)
        self.assertFalse(resp.peek_stdout())
        self.assertEqual("test string 2", line)
        resp.write_stdin("exit\n")
        resp.update(timeout=5)
        line = resp.read_channel(api_client.ws_client.ERROR_CHANNEL)
        status = json.loads(line)
        self.assertEqual(status['status'], 'Success')
        resp.update(timeout=5)
        self.assertFalse(resp.is_open())

        number_of_pods = len(api.list_pod_for_all_namespaces().items)
        self.assertTrue(number_of_pods > 0)

        resp = api.delete_namespaced_pod(name=name, body={},
                                         namespace='default')

    def test_service_apis(self):
        client = api_client.ApiClient(config=self.config)
        api = core_v1_api.CoreV1Api(client)

        name = 'frontend-' + short_uuid()
        service_manifest = {'apiVersion': 'v1',
                            'kind': 'Service',
                            'metadata': {'labels': {'name': name},
                                         'name': name,
                                         'resourceversion': 'v1'},
                            'spec': {'ports': [{'name': 'port',
                                                'port': 80,
                                                'protocol': 'TCP',
                                                'targetPort': 80}],
                                     'selector': {'name': name}}}

        resp = api.create_namespaced_service(body=service_manifest,
                                             namespace='default')
        self.assertEqual(name, resp.metadata.name)
        self.assertTrue(resp.status)

        resp = api.read_namespaced_service(name=name,
                                           namespace='default')
        self.assertEqual(name, resp.metadata.name)
        self.assertTrue(resp.status)

        service_manifest['spec']['ports'] = [{'name': 'new',
                                              'port': 8080,
                                              'protocol': 'TCP',
                                              'targetPort': 8080}]
        resp = api.patch_namespaced_service(body=service_manifest,
                                            name=name,
                                            namespace='default')
        self.assertEqual(2, len(resp.spec.ports))
        self.assertTrue(resp.status)

        resp = api.delete_namespaced_service(name=name,
                                             namespace='default')

    def test_replication_controller_apis(self):
        client = api_client.ApiClient(config=self.config)
        api = core_v1_api.CoreV1Api(client)

        name = 'frontend-' + short_uuid()
        rc_manifest = {
            'apiVersion': 'v1',
            'kind': 'ReplicationController',
            'metadata': {'labels': {'name': name},
                         'name': name},
            'spec': {'replicas': 2,
                     'selector': {'name': name},
                     'template': {'metadata': {
                         'labels': {'name': name}},
                         'spec': {'containers': [{
                             'image': 'nginx',
                             'name': 'nginx',
                             'ports': [{'containerPort': 80,
                                        'protocol': 'TCP'}]}]}}}}

        resp = api.create_namespaced_replication_controller(
            body=rc_manifest, namespace='default')
        self.assertEqual(name, resp.metadata.name)
        self.assertEqual(2, resp.spec.replicas)

        resp = api.read_namespaced_replication_controller(
            name=name, namespace='default')
        self.assertEqual(name, resp.metadata.name)
        self.assertEqual(2, resp.spec.replicas)

        resp = api.delete_namespaced_replication_controller(
            name=name, body={}, namespace='default')

    def test_configmap_apis(self):
        client = api_client.ApiClient(config=self.config)
        api = core_v1_api.CoreV1Api(client)

        name = 'test-configmap-' + short_uuid()
        test_configmap = {
            "kind": "ConfigMap",
            "apiVersion": "v1",
            "metadata": {
                "name": name,
            },
            "data": {
                "config.json": "{\"command\":\"/usr/bin/mysqld_safe\"}",
                "frontend.cnf": "[mysqld]\nbind-address = 10.0.0.3\nport = 3306\n"
            }
        }

        resp = api.create_namespaced_config_map(
            body=test_configmap, namespace='default'
        )
        self.assertEqual(name, resp.metadata.name)

        resp = api.read_namespaced_config_map(
            name=name, namespace='default')
        self.assertEqual(name, resp.metadata.name)

        test_configmap['data']['config.json'] = "{}"
        resp = api.patch_namespaced_config_map(
            name=name, namespace='default', body=test_configmap)

        resp = api.delete_namespaced_config_map(
            name=name, body={}, namespace='default')

        resp = api.list_namespaced_config_map('default', pretty=True)
        self.assertEqual([], resp.items)

    def test_node_apis(self):
        client = api_client.ApiClient(config=self.config)
        api = core_v1_api.CoreV1Api(client)

        for item in api.list_node().items:
            node = api.read_node(name=item.metadata.name)
            self.assertTrue(len(node.metadata.labels) > 0)
            self.assertTrue(isinstance(node.metadata.labels, dict))


text:
import { debounce } from '../../utils/debounce/debounce.util';

/**
 * Debounce decorator
 *
 *  class MyClass {
 *    debounceable(10)
 *    myFn() { ... }
 *  }
 */
export function debounceable(duration: number, immediate?: boolean) {
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
  return (_: any, key: string, descriptor: any): any => {
    return {
      configurable: true,
      enumerable: descriptor.enumerable,
      get: function getter() {
        Object.defineProperty(this, key, {
          configurable: true,
          enumerable: descriptor.enumerable,
          value: debounce(descriptor.value, duration, immediate)
        });

        // eslint-disable-next-line security/detect-object-injection
        return this[key];
      }
    };
  };
}


text:
require 'rails_helper'
require 'sidekiq/testing'

Sidekiq::Testing.inline!

describe SendUpgradeReceiptEmailWorker do
  describe "perform" do
    it { expect(SendUpgradeReceiptEmailWorker).to respond_to(:perform_async) }
  end
end


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;

namespace Rippy
{
    public class AppSettings<T> where T : new()
    {
        private const string DEFAULT_FILENAME = "settings.json";

        public void Save(string fileName = DEFAULT_FILENAME)
        {
            File.WriteAllText(fileName, (new JavaScriptSerializer()).Serialize(this));
        }

        public static void Save(T pSettings, string fileName = DEFAULT_FILENAME)
        {
            File.WriteAllText(fileName, (new JavaScriptSerializer()).Serialize(pSettings));
        }

        public static T Load(string fileName = DEFAULT_FILENAME)
        {
            T t = new T();
            if (File.Exists(fileName))
                t = (new JavaScriptSerializer()).Deserialize<T>(File.ReadAllText(fileName));
            return t;
        }
    }
}


text:
YUI.add('dataschema-xml', function (Y, NAME) {

/**
Provides a DataSchema implementation which can be used to work with XML data.

@module dataschema
@submodule dataschema-xml
**/

/**
Provides a DataSchema implementation which can be used to work with XML data.

See the `apply` method for usage.

@class DataSchema.XML
@extends DataSchema.Base
@static
**/
var Lang = Y.Lang,

    okNodeType = {
        1 : true,
        9 : true,
        11: true
    },

    SchemaXML;

SchemaXML = {

    ////////////////////////////////////////////////////////////////////////////
    //
    // DataSchema.XML static methods
    //
    ////////////////////////////////////////////////////////////////////////////
    /**
    Applies a schema to an XML data tree, returning a normalized object with
    results in the `results` property. Additional information can be parsed out
    of the XML for inclusion in the `meta` property of the response object.  If
    an error is encountered during processing, an `error` property will be
    added.

    Field data in the nodes captured by the XPath in _schema.resultListLocator_
    is extracted with the field identifiers described in _schema.resultFields_.
    Field identifiers are objects with the following properties:

      * `key`    : <strong>(required)</strong> The desired property name to use
            store the retrieved value in the result object.  If `locator` is
            not specified, `key` is also used as the XPath locator (String)
      * `locator`: The XPath locator to the node or attribute within each
            result node found by _schema.resultListLocator_ containing the
            desired field data (String)
      * `parser` : A function or the name of a function on `Y.Parsers` used
            to convert the input value into a normalized type.  Parser
            functions are passed the value as input and are expected to
            return a value.
      * `schema` : Used to retrieve nested field data into an array for
            assignment as the result field value.  This object follows the same
            conventions as _schema_.

    If no value parsing or nested parsing is needed, you can use XPath locators
    (strings) instead of field identifiers (objects) -- see example below.

    `response.results` will contain an array of objects with key:value pairs.
    The keys are the field identifier `key`s, and the values are the data
    values extracted from the nodes or attributes found by the field `locator`
    (or `key` fallback).

    To extract additional information from the XML, include an array of
    XPath locators in _schema.metaFields_.  The collected values will be
    stored in `response.meta` with the XPath locator as keys.

    @example
        var schema = {
                resultListLocator: '//produce/item',
                resultFields: [
                    {
                        locator: 'name',
                        key: 'name'
                    },
                    {
                        locator: 'color',
                        key: 'color',
                        parser: function (val) { return val.toUpperCase(); }
                    }
                ]
            };

        // Assumes data like
        // <inventory>
        //   <produce>
        //     <item><name>Banana</name><color>yellow</color></item>
        //     <item><name>Orange</name><color>orange</color></item>
        //     <item><name>Eggplant</name><color>purple</color></item>
        //   </produce>
        // </inventory>

        var response = Y.DataSchema.JSON.apply(schema, data);

        // response.results[0] is { name: "Banana", color: "YELLOW" }

    @method apply
    @param {Object} schema Schema to apply.  Supported configuration
        properties are:
      @param {String} [schema.resultListLocator] XPath locator for the
          XML nodes that contain the data to flatten into `response.results`
      @param {Array} [schema.resultFields] Field identifiers to
          locate/assign values in the response records. See above for
          details.
      @param {Array} [schema.metaFields] XPath locators to extract extra
          non-record related information from the XML data
    @param {XMLDoc} data XML data to parse
    @return {Object} An Object with properties `results` and `meta`
    @static
    **/
    apply: function(schema, data) {
        var xmldoc = data, // unnecessary variables
            data_out = { results: [], meta: {} };

        if (xmldoc && okNodeType[xmldoc.nodeType] && schema) {
            // Parse results data
            data_out = SchemaXML._parseResults(schema, xmldoc, data_out);

            // Parse meta data
            data_out = SchemaXML._parseMeta(schema.metaFields, xmldoc, data_out);
        } else {
            Y.log("XML data could not be schema-parsed: " + Y.dump(data) + " " + Y.dump(data), "error", "dataschema-xml");
            data_out.error = new Error("XML schema parse failure");
        }

        return data_out;
    },

    /**
     * Get an XPath-specified value for a given field from an XML node or document.
     *
     * @method _getLocationValue
     * @param field {String | Object} Field definition.
     * @param context {Object} XML node or document to search within.
     * @return {Object} Data value or null.
     * @static
     * @protected
     */
    _getLocationValue: function(field, context) {
        var locator = field.locator || field.key || field,
            xmldoc = context.ownerDocument || context,
            result, res, value = null;

        try {
            result = SchemaXML._getXPathResult(locator, context, xmldoc);
            while ((res = result.iterateNext())) {
                value = res.textContent || res.value || res.text || res.innerHTML || null;
            }

            // FIXME: Why defer to a method that is mixed into this object?
            // DSchema.Base is mixed into DSchema.XML (et al), so
            // DSchema.XML.parse(...) will work.  This supports the use case
            // where DSchema.Base.parse is changed, and that change is then
            // seen by all DSchema.* implementations, but does not support the
            // case where redefining DSchema.XML.parse changes behavior. In
            // fact, DSchema.XML.parse is never even called.
            return Y.DataSchema.Base.parse.call(this, value, field);
        } catch (e) {
            Y.log('SchemaXML._getLocationValue failed: ' + e.message);
        }

        return null;
    },

    /**
     * Fetches the XPath-specified result for a given location in an XML node
     * or document.
     *
     * @method _getXPathResult
     * @param locator {String} The XPath location.
     * @param context {Object} XML node or document to search within.
     * @param xmldoc {Object} XML document to resolve namespace.
     * @return {Object} Data collection or null.
     * @static
     * @protected
     */
    _getXPathResult: function(locator, context, xmldoc) {
        // Standards mode
        if (! Lang.isUndefined(xmldoc.evaluate)) {
            return xmldoc.evaluate(locator, context, xmldoc.createNSResolver(context.ownerDocument ? context.ownerDocument.documentElement : context.documentElement), 0, null);
        }
        // IE mode
        else {
            var values=[], locatorArray = locator.split(/\b\/\b/), i=0, l=locatorArray.length, location, subloc, m, isNth;

            // XPath is supported
            try {
                // this fixes the IE 5.5+ issue where childnode selectors begin at 0 instead of 1
                xmldoc.setProperty("SelectionLanguage", "XPath");
                values = context.selectNodes(locator);
            }
            // Fallback for DOM nodes and fragments
            catch (e) {
                // Iterate over each locator piece
                for (; i<l && context; i++) {
                    location = locatorArray[i];

                    // grab nth child []
                    if ((location.indexOf("[") > -1) && (location.indexOf("]") > -1)) {
                        subloc = location.slice(location.indexOf("[")+1, location.indexOf("]"));
                        //XPath is 1-based while DOM is 0-based
                        subloc--;
                        context = context.children[subloc];
                        isNth = true;
                    }
                    // grab attribute value @
                    else if (location.indexOf("@") > -1) {
                        subloc = location.substr(location.indexOf("@"));
                        context = subloc ? context.getAttribute(subloc.replace('@', '')) : context;
                    }
                    // grab that last instance of tagName
                    else if (-1 < location.indexOf("//")) {
                        subloc = context.getElementsByTagName(location.substr(2));
                        context = subloc.length ? subloc[subloc.length - 1] : null;
                    }
                    // find the last matching location in children
                    else if (l != i + 1) {
                        for (m=context.childNodes.length-1; 0 <= m; m-=1) {
                            if (location === context.childNodes[m].tagName) {
                                context = context.childNodes[m];
                                m = -1;
                            }
                        }
                    }
                }

                if (context) {
                    // attribute
                    if (Lang.isString(context)) {
                        values[0] = {value: context};
                    }
                    // nth child
                    else if (isNth) {
                        values[0] = {value: context.innerHTML};
                    }
                    // all children
                    else {
                        values = Y.Array(context.childNodes, 0, true);
                    }
                }
            }

            // returning a mock-standard object for IE
            return {
                index: 0,

                iterateNext: function() {
                    if (this.index >= this.values.length) {return undefined;}
                    var result = this.values[this.index];
                    this.index += 1;
                    return result;
                },

                values: values
            };
        }
    },

    /**
     * Schema-parsed result field.
     *
     * @method _parseField
     * @param field {String | Object} Required. Field definition.
     * @param result {Object} Required. Schema parsed data object.
     * @param context {Object} Required. XML node or document to search within.
     * @static
     * @protected
     */
    _parseField: function(field, result, context) {
        var key = field.key || field,
            parsed;

        if (field.schema) {
            parsed = { results: [], meta: {} };
            parsed = SchemaXML._parseResults(field.schema, context, parsed);

            result[key] = parsed.results;
        } else {
            result[key] = SchemaXML._getLocationValue(field, context);
        }
    },

    /**
     * Parses results data according to schema
     *
     * @method _parseMeta
     * @param xmldoc_in {Object} XML document parse.
     * @param data_out {Object} In-progress schema-parsed data to update.
     * @return {Object} Schema-parsed data.
     * @static
     * @protected
     */
    _parseMeta: function(metaFields, xmldoc_in, data_out) {
        if(Lang.isObject(metaFields)) {
            var key,
                xmldoc = xmldoc_in.ownerDocument || xmldoc_in;

            for(key in metaFields) {
                if (metaFields.hasOwnProperty(key)) {
                    data_out.meta[key] = SchemaXML._getLocationValue(metaFields[key], xmldoc);
                }
            }
        }
        return data_out;
    },

    /**
     * Schema-parsed result to add to results list.
     *
     * @method _parseResult
     * @param fields {Array} Required. A collection of field definition.
     * @param context {Object} Required. XML node or document to search within.
     * @return {Object} Schema-parsed data.
     * @static
     * @protected
     */
    _parseResult: function(fields, context) {
        var result = {}, j;

        // Find each field value
        for (j=fields.length-1; 0 <= j; j--) {
            SchemaXML._parseField(fields[j], result, context);
        }

        return result;
    },

    /**
     * Schema-parsed list of results from full data
     *
     * @method _parseResults
     * @param schema {Object} Schema to parse against.
     * @param context {Object} XML node or document to parse.
     * @param data_out {Object} In-progress schema-parsed data to update.
     * @return {Object} Schema-parsed data.
     * @static
     * @protected
     */
    _parseResults: function(schema, context, data_out) {
        if (schema.resultListLocator && Lang.isArray(schema.resultFields)) {
            var xmldoc = context.ownerDocument || context,
                fields = schema.resultFields,
                results = [],
                node, nodeList, i=0;

            if (schema.resultListLocator.match(/^[:\-\w]+$/)) {
                nodeList = context.getElementsByTagName(schema.resultListLocator);

                // loop through each result node
                for (i = nodeList.length - 1; i >= 0; --i) {
                    results[i] = SchemaXML._parseResult(fields, nodeList[i]);
                }
            } else {
                nodeList = SchemaXML._getXPathResult(schema.resultListLocator, context, xmldoc);

                // loop through the nodelist
                while ((node = nodeList.iterateNext())) {
                    results[i] = SchemaXML._parseResult(fields, node);
                    i += 1;
                }
            }

            if (results.length) {
                data_out.results = results;
            } else {
                data_out.error = new Error("XML schema result nodes retrieval failure");
            }
        }
        return data_out;
    }
};

Y.DataSchema.XML = Y.mix(SchemaXML, Y.DataSchema.Base);

}, '3.7.2', {"requires": ["dataschema-base"]});


text:
package cz.muni.physics.pdr.backend.manager;

import java.io.Serializable;
import java.util.Collection;
import java.util.function.Predicate;

/**
 * @author Michal Krajčovič
 * @version 1.0
 * @since 14/04/16
 */
public interface GenericEntityManager<T, ID extends Serializable> {
    /**
     * Method for storing entity
     * @param entity entity to be stored
     */
    void insert(T entity);

    /**
     * Method for removing entity
     * @param entity entity to be removed
     */
    void delete(T entity);

    /**
     * This method returns all available entities
     * @return all available entities
     */
    Collection<T> getAll();

    /**
     * This method is for getting first entity that matches given predicate
     * @param predicate predicate to match entity
     * @return first entity that matches predicate
     */
    T searchFor(Predicate<T> predicate);

    /**
     * This method is for retrieving all entities that match given predicate
     * @param predicate predicate to match entity
     * @return all entities that match predicate
     */
    Collection<T> searchForAll(Predicate<T> predicate);

    /**
     * This method retrieves entity by its ID
     * @param id id for identifying entity
     * @return found entity by its id
     */
    T getById(ID id);
}