text:
// grab our packages
var gulp   = require('gulp'),
    jshint = require('gulp-jshint');
    sass = require('gulp-sass');
    sourcemaps = require('gulp-sourcemaps');
    concat = require('gulp-concat');
    autoprefixer = require('gulp-autoprefixer');
    minifyCSS = require('gulp-minify-css');
    rename = require('gulp-rename'); // to rename any file
    uglify = require('gulp-uglify');
    del = require('del');
    stylish = require('jshint-stylish');
    runSequence = require('run-sequence');
    coffee = require('gulp-coffee');
    gutil = require('gulp-util');
    http = require('http');
    ecstatic = require('ecstatic');
    deploy = require('gulp-gh-pages');
    bower = require('gulp-bower');

// Cleans the web dist folder
gulp.task('clean', function (cb) {
    del([
        'dist/**/*',
        'dist/js/libs/**/*.js',
        '!dist/fonts',
        '!dist/fonts/*.*',
        '!dist/images',
        '!dist/images/*.*',
        '!dist/index.html',
        '!dist/favicon.ico',
        '!dist/json'
    ], cb);
});

// Copy fonts task
gulp.task('copy-fonts', function() {
   gulp.src('source/fonts/**/*.{ttf,woff,eof,svg,eot,woff2,otf}')
   .pipe(gulp.dest('dist/fonts'));
});

// Compile coffeescript to JS
gulp.task('brew-coffee', function() {
  gulp.src('source/coffee/*.coffee')
    .pipe(coffee({bare: true}).on('error', gutil.log))
    .pipe(gulp.dest('source/js/app/'))
});

// configure the jshint task
gulp.task('jshint', function() {
  return gulp.src('source/js/**/*.js')
    .pipe(jshint())
    .pipe(jshint.reporter('jshint-stylish'));
});

gulp.task('build-css', function() {
  return gulp.src('source/scss/site.scss')
    .pipe(sourcemaps.init())  // Process the original sources
    .pipe(sass().on('error', sass.logError))
    .pipe(sourcemaps.write()) // Add the map to modified source.
    .pipe(autoprefixer({
        browsers: ['last 2 versions'],
        cascade: false
    }))
    .pipe(gulp.dest('dist/css'))
    .pipe(minifyCSS())
    .pipe(rename('site.min.css'))
    .pipe(gulp.dest('dist/css'))
    .on('error', sass.logError)
});

gulp.task('concat-js', function() {
    return gulp.src([
        'source/bower_components/bootstrap/dist/js/bootstrap.min.js',
    ])
    .pipe(sourcemaps.init())
      .pipe(concat('site.js'))
      .pipe(sourcemaps.write('./maps'))
    .pipe(gulp.dest('dist/js'));
});

// Shrinks all the js
gulp.task('shrink-js', function() {
    return gulp.src('source/js/*.js')
    // .pipe(uglify())
    .pipe(gulp.dest('dist/js'))
});

// Copy JS libraries over
gulp.task('copy-js', function() {
   gulp.src('source/js/libs/**/*.js').pipe(gulp.dest('dist/js/libs/'));
   gulp.src('source/js/*.js').pipe(gulp.dest('dist/js/'));
});

// Default build task
gulp.task('build-js', function(callback) {
  runSequence('copy-js', ['concat-js'], callback);
});

// configure which files to watch and what tasks to use on file changes
gulp.task('watch', function() {
  gulp.watch('source/coffee/**/*.js', ['brew-coffee']);
  gulp.watch('source/js/**/*.js', ['build-js']);
  gulp.watch('source/scss/**/*.scss', ['build-css']);
});

var options = {
    remoteUrl: "https://github.com/criticalcodex/dice.criticalcodex.com.git",
    branch: "gh-pages",
    push: true,
    force: true
};

gulp.task('bower', function() {
  return bower({ cmd: 'update'});
});

gulp.task('deploy', function () {
    return gulp.src('./dist/**/*')
        .pipe(deploy(options));
});

gulp.task('http', function(){
  http.createServer(
    ecstatic({ root: __dirname + '/dist' })
  ).listen(8080);
  console.log('Listening on :8080');

  gulp.watch('source/coffee/**/*.js', ['brew-coffee']);
  gulp.watch('source/js/**/*.js', ['build-js']);
  gulp.watch('source/scss/**/*.scss', ['build-css']);

});

// Default build task to build everything e
gulp.task('build', function(callback) {
  runSequence('copy-fonts', 'bower',
              ['build-css', 'build-js'],
              callback);
});


text:
package com.example.datacatalog;

// [START data_catalog_update_entry_group]
import com.google.cloud.datacatalog.v1.DataCatalogClient;
import com.google.cloud.datacatalog.v1.EntryGroup;
import com.google.cloud.datacatalog.v1.EntryGroupName;
import com.google.cloud.datacatalog.v1.UpdateEntryGroupRequest;
import com.google.protobuf.FieldMask;
import com.google.protobuf.util.FieldMaskUtil;
import java.io.IOException;

// Sample to update an entity group
public class UpdateEntryGroup {

  public static void main(String[] args) throws IOException {
    // TODO(developer): Replace these variables before running the sample.
    String projectId = "MY_PROJECT_ID";
    String location = "MY_LOCATION";
    String entryGroupId = "MY_ENTRY_GROUP_ID";
    String description = "MY_DESCRIPTION";
    EntryGroupName entryGroupName = EntryGroupName.of(projectId, location, entryGroupId);
    EntryGroup entryGroup =
        EntryGroup.newBuilder()
            .setName(entryGroupName.toString())
            .setDescription(description)
            .build();
    updateEntryGroup(entryGroup);
  }

  public static void updateEntryGroup(EntryGroup entryGroup) throws IOException {
    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests. After completing all of your requests, call
    // the "close" method on the client to safely clean up any remaining background resources.
    try (DataCatalogClient client = DataCatalogClient.create()) {
      FieldMask fieldMask = FieldMaskUtil.fromString("description");
      UpdateEntryGroupRequest request =
          UpdateEntryGroupRequest.newBuilder()
              .setEntryGroup(entryGroup)
              .setUpdateMask(fieldMask)
              .build();
      EntryGroup entryGroupUpdate = client.updateEntryGroup(request);
      System.out.println("Entry group updated successfully : " + entryGroupUpdate.getDescription());
    }
  }
}
// [END data_catalog_update_entry_group]

redpajama_set_name: RedPajamaGithub


text:
import React from 'react'
import { View, ListView, Text } from 'react-native'
import { connect } from 'react-redux'

// Styles
import styles from './Styles/SectionExampleStyle'

class ListviewSectionsExample extends React.Component {
  constructor (props) {
    super(props)

    /* ***********************************************************
    * STEP 1
    * This is an array of objects with the properties you desire
    * Usually this should come from Redux mapStateToProps
    *************************************************************/
    const dataObjects = {
      first: [
        {title: 'First Title', description: 'First Description'},
        {title: 'Second Title', description: 'Second Description'},
        {title: 'Third Title', description: 'Third Description'},
        {title: 'Fourth Title', description: 'Fourth Description'},
        {title: 'Fifth Title', description: 'Fifth Description'},
        {title: 'Sixth Title', description: 'Sixth Description'},
        {title: 'Seventh Title', description: 'Seventh Description'},
        {title: 'Eighth Title', description: 'Eighth Description'},
        {title: 'Ninth Title', description: 'Ninth Description'},
        {title: 'Tenth Title', description: 'Tenth Description'}
      ],
      second: [
        {title: 'Eleventh Title', description: 'Eleventh Description'},
        {title: '12th Title', description: '12th Description'},
        {title: '13th Title', description: '13th Description'},
        {title: '14th Title', description: '14th Description'},
        {title: '15th Title', description: '15th Description'},
        {title: '16th Title', description: '16th Description'},
        {title: '17th Title', description: '17th Description'},
        {title: '18th Title', description: '18th Description'},
        {title: '19th Title', description: '19th Description'},
        {title: '20th Title', description: '20th Description'},
        {title: 'BLACKJACK!', description: 'BLACKJACK! Description'}
      ]
    }
    /* ***********************************************************
    * STEP 2
    * Teach datasource how to detect if rows are different
    * Make this function fast!  Perhaps something like:
    *   (r1, r2) => r1.id !== r2.id}
    *   The same goes for sectionHeaderHasChanged
    *************************************************************/
    const rowHasChanged = (r1, r2) => r1 !== r2
    const sectionHeaderHasChanged = (s1, s2) => s1 !== s2

    // DataSource configured
    const ds = new ListView.DataSource({rowHasChanged, sectionHeaderHasChanged})

    // Datasource is always in state
    this.state = {
      dataSource: ds.cloneWithRowsAndSections(dataObjects)
    }
  }

  /* ***********************************************************
  * STEP 3
  * `_renderRow` function -How each cell/row should be rendered
  * It's our best practice to place a single component here:
  *
  * e.g.
    return <MyCustomCell title={rowData.title} description={rowData.description} />
  *************************************************************/
  _renderRow (rowData, sectionID) {
    // You can condition on sectionID (key as string), for different cells
    // in different sections
    return (
      <View style={styles.row}>
        <Text style={styles.boldLabel}>Section {sectionID} - {rowData.title}</Text>
        <Text style={styles.label}>{rowData.description}</Text>
      </View>
    )
  }

  /* ***********************************************************
  * STEP 4
  * If your datasource is driven by Redux, you'll need to
  * reset it when new data arrives.
  * DO NOT! place `cloneWithRowsAndSections` inside of render, since render
  * is called very often, and should remain fast!  Just replace
  * state's datasource on newProps.
  *
  * e.g.
    componentWillReceiveProps (newProps) {
      if (newProps.someData) {
        this.setState({
          dataSource: this.state.dataSource.cloneWithRowsAndSections(newProps.someData)
        })
      }
    }
  *************************************************************/

  // Used for friendly AlertMessage
  // returns true if the dataSource is empty
  _noRowData () {
    return this.state.dataSource.getRowCount() === 0
  }

  _renderHeader (data, sectionID) {
    switch (sectionID) {
      case 'first':
        return <Text style={styles.boldLabel}>First Section</Text>
      default:
        return <Text style={styles.boldLabel}>Second Section</Text>
    }
  }

  render () {
    return (
      <View style={styles.container}>
        <ListView
          renderSectionHeader={this._renderHeader}
          contentContainerStyle={styles.listContent}
          dataSource={this.state.dataSource}
          onLayout={this.onLayout}
          renderRow={this._renderRow}
          enableEmptySections
        />
      </View>
    )
  }
}

const mapStateToProps = (state) => {
  return {
    // ...redux state to props here
  }
}

const mapDispatchToProps = (dispatch) => {
  return {
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(ListviewSectionsExample)


text:
<?php

namespace Beanie\Command\ResponseParser;

use Beanie\Server\Server;

class JobResponseParser extends AbstractDataResponseParser
{
    /**
     * @inheritDoc
     */
    protected function extractData($responseLine, Server $server)
    {
        list(, $id, $dataLength) = explode(' ', $responseLine);

        return [
            'id' => $id,
            'data' => $server->readData($dataLength)
        ];
    }
}


text:
// Copyright (c) 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/webui/chromeos/diagnostics_dialog.h"

#include <string>

#include "ash/webui/diagnostics_ui/url_constants.h"
#include "base/strings/strcat.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"

namespace chromeos {
namespace {

std::string GetUrlForPage(DiagnosticsDialog::DiagnosticsPage page) {
  switch (page) {
    case DiagnosticsDialog::DiagnosticsPage::kDefault:
      return kChromeUIDiagnosticsAppUrl;
    case DiagnosticsDialog::DiagnosticsPage::kSystem:
      return base::StrCat({kChromeUIDiagnosticsAppUrl, "?system"});
    case DiagnosticsDialog::DiagnosticsPage::kConnectivity:
      return base::StrCat({kChromeUIDiagnosticsAppUrl, "?connectivity"});
    case DiagnosticsDialog::DiagnosticsPage::kInput:
      return base::StrCat({kChromeUIDiagnosticsAppUrl, "?input"});
  }
}

}  // namespace

// Scale factor for size of the diagnostics dialog, based on display size.
const float kDiagnosticsDialogScale = .8;

// static
void DiagnosticsDialog::ShowDialog(DiagnosticsDialog::DiagnosticsPage page,
                                   gfx::NativeWindow parent) {
  DiagnosticsDialog* dialog = new DiagnosticsDialog(page);
  dialog->ShowSystemDialog(parent);
}

DiagnosticsDialog::DiagnosticsDialog(DiagnosticsDialog::DiagnosticsPage page)
    : SystemWebDialogDelegate(GURL(GetUrlForPage(page)),
                              /*title=*/std::u16string()) {}

DiagnosticsDialog::~DiagnosticsDialog() = default;

const std::string& DiagnosticsDialog::Id() {
  return id_;
}

void DiagnosticsDialog::GetDialogSize(gfx::Size* size) const {
  const display::Display display =
      display::Screen::GetScreen()->GetPrimaryDisplay();

  gfx::Size display_size = display.size();

  display_size = gfx::Size(display_size.width() * kDiagnosticsDialogScale,
                           display_size.height() * kDiagnosticsDialogScale);

  *size = display_size;
}

}  // namespace chromeos


text:
import { describe, it } from 'mocha';
import { assert } from 'chai';
import request from 'supertest';
import app from '../../server.js';

describe('registration', () => {
  it('user can register', (done) => {
    request(app)
      .post('/auth/register')
      .send({ username: 'blah', password: 'blahhh' })
      .expect(201)
      .expect('Content-type', /json/)
      .end((err, res) => {
        assert.equal(true, res.body.registered);
        assert.equal('blah', res.body.username);
        done();
      });
  });
});


text:
<!DOCTYPE html>

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

	<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">

	<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css">

Atlas of Living Australia - demo

This is a landing page with links through to the components now installed on this server.

           This demo was installed using
           ansible scripts that are available
           here.

Occurrence store

          	The occurrence store should now be setup. This application consists of
          	3 web applications now running in Tomcat:

Occurrence search - Reskinnable front end UI

Explore your area  - Reskinnable front end UI

Web services

Apache SOLR

			There is also a command line tool now installed that can be started with the command "biocache".
			This tool can be used for loading data and running processes across the data.

Further information

          	As part of the installation the following tools are installed:

Apache Cassandra

            Cassandra can be accessed directly using the command-line tool cassandra-cli.

Collectory

          	The collectory is now setup and installed.	This is an application for editing metadata
          	for collections, institutions and data resources.

Collections browser

Datasets browser

Web services

Admin interface

Further information

          	As part of the installation the following tools are installed:

MySQL

            MySQL can be accessed directly using the command-line tool "mysql".

Sandbox

The sandbox can be used to quickly load a dataset into the occurrence store for visualisation.

            There is support for loading CSV data.

Front end UI

        © Atlas of Living Australia 2015

        - Machine setup up on {{ansible_date_time.date}}. Running
           {{ansible_distribution}}
           {{ansible_distribution_version}}


text:
[Join pattern](https://en.wikipedia.org/wiki/Join-pattern)
--------------

**Join-patterns** provide a way to write [concurrent](https://en.wikipedia.org/wiki/Concurrent_computing), [parallel](https://en.wikipedia.org/wiki/Parallel_algorithm) and [distributed](https://en.wikipedia.org/wiki/Distributed_programming) computer programs by [message passing](https://en.wikipedia.org/wiki/Message_passing). Compared to the use of [threads](https://en.wikipedia.org/wiki/Thread_(computing)) and locks, this is a high level programming model using communication constructs model to abstract the complexity of concurrent environment and to allow [scalability](https://en.wikipedia.org/wiki/Scalability). Its focus is on the execution of a [chord](https://en.wikipedia.org/wiki/Chord_(concurrency)) between messages atomically consumed from a group of channels.

Join-patterns can be used to easily encode related concurrency idioms like actors and active objects.

[Join Java](https://en.wikipedia.org/wiki/Join_Java) is a language based on the [Java programming language](https://en.wikipedia.org/wiki/Java_(programming_language)) allowing the use of the join calculus. It introduces three new language constructs: Join methods, Asynchronous methods, and ordering modifiers.

[**Barriers**](https://en.wikipedia.org/wiki/Barrier_(computer_science))
--------------

```csharp
class SymmetricBarrier {

	public readonly Synchronous.Channel Arrive;

	public SymmetricBarrier(int n) {
		// create j and init channels (elided)
		var pat = j.When(Arrive);
		for (int i = 1; i < n; i++)
			pat = pat.And(Arrive);
		pat.Do(() => { });
	}
}

```

[**Dining philosophers problem**](https://en.wikipedia.org/wiki/Dining_philosophers_problem)
--------------

```csharp
var j = Join.Create();
Synchronous.Channel[] hungry;
Asynchronous.Channel[] chopstick;
j.Init(out hungry, n);
j.Init(out chopstick, n);

for (int i = 0; i < n; i++) {
    var left = chopstick[i];
    var right = chopstick[(i+1) % n];
    j.When(hungry[i]).And(left).And(right).Do(() => {
    eat(); left(); right(); // replace chopsticks
    });
}
```

[**Mutual exclusion**](https://en.wikipedia.org/wiki/Mutual_exclusion)
--------------

```csharp
class Lock {
	public readonly Synchronous.Channel Acquire;
	public readonly Asynchronous.Channel Release;

    public Lock() {
        // create j and init channels (elided)
        j.When(Acquire).And(Release).Do(() => { });
        Release(); // initially free
    }
}
```

[**Producers/Consumers**](https://en.wikipedia.org/wiki/Producer-consumer_problem)
--------------

```csharp
class Buffer<T> {

	public readonly Asynchronous.Channel<T> Put;
	public readonly Synchronous<T>.Channel Get;

    public Buffer() {
        Join j = Join.Create(); // allocate a Join object
        j.Init(out Put);
        // bind its channels
        j.Init(out Get);
        j.When(Get).And(Put).Do // register chord
        (t => { return t; });
    }
}
```

[**Reader-writer locking**](https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock)
--------------

```csharp
class ReaderWriterLock {

	private readonly Asynchronous.Channel idle;
	private readonly Asynchronous.Channel<int> shared;
	public readonly Synchronous.Channel AcqR, AcqW,
	RelR, RelW;

	public ReaderWriterLock() {
		// create j and init channels (elided)
		j.When(AcqR).And(idle).Do(() => shared(1));
		j.When(AcqR).And(shared).Do(n => shared(n+1));
		j.When(RelR).And(shared).Do(n => {
			if (n == 1) idle(); else shared(n-1);
		});
		j.When(AcqW).And(idle).Do(() => { });
		j.When(RelW).Do(() => idle());
		idle(); // initially free
	}
}
```

[**Semaphores**](https://en.wikipedia.org/wiki/Semaphore_(programming))
--------------

```csharp
class Semaphore {

	public readonly Synchronous.Channel Acquire;
	public readonly Asynchronous.Channel Release;

    public Semaphore(int n) {
        // create j and init channels (elided)
        j.When(Acquire).And(Release).Do(() => { });
        for (; n > 0; n--)
			Release(); // initially n free
    }
}
```


text:
package at.alladin.rmbt.qos.testserver.plugin.rest;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicBoolean;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.restlet.Component;
import org.restlet.Server;
import org.restlet.data.Parameter;
import org.restlet.data.Protocol;
import org.restlet.util.Series;

import at.alladin.rmbt.qos.testserver.ServerPreferences;
import at.alladin.rmbt.qos.testserver.ServerPreferences.ServiceSetting;
import at.alladin.rmbt.qos.testserver.ServerPreferences.TestServerServiceEnum;
import at.alladin.rmbt.qos.testserver.TestServer;
import at.alladin.rmbt.qos.testserver.util.TestServerConsole;

/**
 *
 * @author lb
 *
 */
public class RestService extends ServiceSetting {
	public static final String PARAM_REST = "server.service.rest";
	public static final String PARAM_REST_PORT = "server.service.rest.port";
	public static final String PARAM_REST_SSL = "server.service.rest.ssl";
	public final static String QOS_KEY_FILE_ABSOLUTE = "src/at/alladin/rmbt/qos/testserver/" + TestServer.QOS_KEY_FILE;

	AtomicBoolean isRunning = new AtomicBoolean(false);

	int port = 0;

	boolean isSsl = false;

	final ServerPreferences serverPreferences;

	public RestService(Properties prop, ServerPreferences serverPreferences) {
		this(false, serverPreferences);
		setParam(prop);
	}

	public RestService(boolean isEnabled, ServerPreferences serverPreferences) {
		super("REST SERVICE", isEnabled);
		this.serverPreferences = serverPreferences;
	}

	@Override
	public void start() throws UnknownHostException {
		if (isEnabled) {
			final boolean isRunning = this.isRunning.getAndSet(true);
			if (!isRunning) {
				if (isEnabled && port <= 0) {
					this.isEnabled = false;
					TestServerConsole.log("Could not start RestService. Parameter missing: 'server.service.rest.port'", 1, TestServerServiceEnum.TEST_SERVER);
				}

			    Component component = new Component();

			    Server s = component.getServers().add(isSsl ? Protocol.HTTPS : Protocol.HTTP, InetAddress.getLocalHost().getHostAddress(), port);

			    if (isSsl) {
				    Series<Parameter> parameters = s.getContext().getParameters();
				    parameters.add("keystorePath", QOS_KEY_FILE_ABSOLUTE);
				    parameters.add("keystorePassword", TestServer.QOS_KEY_PASSWORD);
				    parameters.add("keyPassword", TestServer.QOS_KEY_PASSWORD);
				    parameters.add("keystoreType", TestServer.QOS_KEY_TYPE);
			    }

			    component.getDefaultHost().attach("", new RestletApplication());

			    try {
					component.start();
					TestServerConsole.log("[" + getName() + "] started: " + toString(), 1, TestServerServiceEnum.TEST_SERVER);
				} catch (Exception e) {
					TestServerConsole.error(getName(), e, 0, TestServerServiceEnum.TEST_SERVER);
				}
			}
		}
	}

	@Override
	public void stop() {
		if (isEnabled && isRunning.get()) {

			isRunning.set(false);
		}
	}

	@Override
	public void setParam(Properties properties) {
   		String param = properties.getProperty(PARAM_REST);
   		if (param!=null) {
   			setEnabled(Boolean.parseBoolean(param.trim()));
   		}

   		param = properties.getProperty(PARAM_REST_SSL);
   		if (param!=null) {
   			isSsl = Boolean.parseBoolean(param.trim());
   		}

   		param = properties.getProperty(PARAM_REST_PORT);
   		if (param!=null) {
   			port = Integer.parseInt(param);
   		}
	}

	@Override
	public String toString() {
		return "RestService [isRunning=" + isRunning + ", port=" + port
				+ ", isSsl=" + isSsl + "]";
	}

	/**
	 *
	 * @param json
	 * @param error
	 * @return
	 * @throws JSONException
	 */
	public static JSONObject addError(JSONObject json, String error) throws JSONException {
		JSONArray errorArray = json.optJSONArray("errors");
		if (errorArray == null) {
			errorArray = new JSONArray();
		}
		errorArray.put(error);
		json.put("errors", errorArray);
		return json;
	}
}


text:
package client

import (
	"fmt"
	"reflect"

	"github.com/ovn-org/libovsdb/cache"
	"github.com/ovn-org/libovsdb/mapper"
	"github.com/ovn-org/libovsdb/model"
	"github.com/ovn-org/libovsdb/ovsdb"
)

// Conditional is the interface used by the ConditionalAPI to match on cache objects
// and generate ovsdb conditions
type Conditional interface {
	// Generate returns a list of lists of conditions to be used in Operations
	// Each element in the (outer) list corresponds to an operation
	Generate() ([][]ovsdb.Condition, error)
	// matches returns true if a model matches the condition
	Matches(m model.Model) (bool, error)
	// returns the table that this condition is associated with
	Table() string
}

// equalityConditional uses the information available in a model to generate conditions
// The conditions are based on the equality of the first available index.
// The priority of indexes is: uuid, {schema index}
type equalityConditional struct {
	dbModel   model.DatabaseModel
	tableName string
	info      *mapper.Info
	singleOp  bool
}

func (c *equalityConditional) Matches(m model.Model) (bool, error) {
	info, err := c.dbModel.NewModelInfo(m)
	if err != nil {
		return false, err
	}
	return c.dbModel.Mapper.EqualFields(c.info, info)
}

func (c *equalityConditional) Table() string {
	return c.tableName
}

// Generate returns a condition based on the model and the field pointers
func (c *equalityConditional) Generate() ([][]ovsdb.Condition, error) {
	var result [][]ovsdb.Condition

	conds, err := c.dbModel.Mapper.NewEqualityCondition(c.info)
	if err != nil {
		return nil, err
	}
	if c.singleOp {
		result = append(result, conds)
	} else {
		for _, c := range conds {
			result = append(result, []ovsdb.Condition{c})
		}
	}
	return result, nil
}

// NewEqualityCondition creates a new equalityConditional
func newEqualityConditional(dbModel model.DatabaseModel, table string, all bool, model model.Model, fields ...interface{}) (Conditional, error) {
	info, err := dbModel.NewModelInfo(model)
	if err != nil {
		return nil, err
	}
	return &equalityConditional{
		dbModel:   dbModel,
		tableName: table,
		info:      info,
		singleOp:  all,
	}, nil
}

// explicitConditional generates conditions based on the provided Condition list
type explicitConditional struct {
	dbModel    model.DatabaseModel
	tableName  string
	info       *mapper.Info
	conditions []model.Condition
	singleOp   bool
}

func (c *explicitConditional) Matches(m model.Model) (bool, error) {
	return false, fmt.Errorf("cannot perform cache comparisons using explicit conditions")
}

func (c *explicitConditional) Table() string {
	return c.tableName
}

// Generate returns a condition based on the model and the field pointers
func (c *explicitConditional) Generate() ([][]ovsdb.Condition, error) {
	var result [][]ovsdb.Condition
	var conds []ovsdb.Condition

	for _, cond := range c.conditions {
		ovsdbCond, err := c.dbModel.Mapper.NewCondition(c.info, cond.Field, cond.Function, cond.Value)
		if err != nil {
			return nil, err
		}
		if c.singleOp {
			conds = append(conds, *ovsdbCond)
		} else {
			result = append(result, []ovsdb.Condition{*ovsdbCond})
		}

	}
	if c.singleOp {
		result = append(result, conds)
	}
	return result, nil
}

// newIndexCondition creates a new equalityConditional
func newExplicitConditional(dbModel model.DatabaseModel, table string, all bool, model model.Model, cond ...model.Condition) (Conditional, error) {
	info, err := dbModel.NewModelInfo(model)
	if err != nil {
		return nil, err
	}
	return &explicitConditional{
		dbModel:    dbModel,
		tableName:  table,
		info:       info,
		conditions: cond,
		singleOp:   all,
	}, nil
}

// predicateConditional is a Conditional that calls a provided function pointer
// to match on models.
type predicateConditional struct {
	tableName string
	predicate interface{}
	cache     *cache.TableCache
}

// matches returns the result of the execution of the predicate
// Type verifications are not performed
func (c *predicateConditional) Matches(model model.Model) (bool, error) {
	ret := reflect.ValueOf(c.predicate).Call([]reflect.Value{reflect.ValueOf(model)})
	return ret[0].Bool(), nil
}

func (c *predicateConditional) Table() string {
	return c.tableName
}

// generate returns a list of conditions that match, by _uuid equality, all the objects that
// match the predicate
func (c *predicateConditional) Generate() ([][]ovsdb.Condition, error) {
	allConditions := make([][]ovsdb.Condition, 0)
	tableCache := c.cache.Table(c.tableName)
	if tableCache == nil {
		return nil, ErrNotFound
	}
	for _, row := range tableCache.Rows() {
		match, err := c.Matches(row)
		if err != nil {
			return nil, err
		}
		if match {
			info, err := c.cache.DatabaseModel().NewModelInfo(row)
			if err != nil {
				return nil, err
			}
			elemCond, err := c.cache.Mapper().NewEqualityCondition(info)
			if err != nil {
				return nil, err
			}
			allConditions = append(allConditions, elemCond)
		}
	}
	return allConditions, nil
}

// newPredicateConditional creates a new predicateConditional
func newPredicateConditional(table string, cache *cache.TableCache, predicate interface{}) (Conditional, error) {
	return &predicateConditional{
		tableName: table,
		predicate: predicate,
		cache:     cache,
	}, nil
}

// errorConditional is a conditional that encapsulates an error
// It is used to delay the reporting of errors from conditional creation to API method call
type errorConditional struct {
	err error
}

func (e *errorConditional) Matches(model.Model) (bool, error) {
	return false, e.err
}

func (e *errorConditional) Table() string {
	return ""
}

func (e *errorConditional) Generate() ([][]ovsdb.Condition, error) {
	return nil, e.err
}

func newErrorConditional(err error) Conditional {
	return &errorConditional{
		err: fmt.Errorf("conditionerror: %s", err.Error()),
	}
}


text:
namespace MarginTrading.Backend.Core
{
    public class FplData
    {
        public decimal Fpl { get; set; }
        public decimal FplRate { get; set; }
        public decimal MarginRate { get; set; }
        public decimal MarginInit { get; set; }
        public decimal MarginMaintenance { get; set; }
        public decimal OpenPrice { get; set; }
        public decimal ClosePrice { get; set; }
        public decimal TotalFplSnapshot { get; set; }
        public decimal SwapsSnapshot { get; set; }
        public int AccountBaseAssetAccuracy { get; set; }

        public int CalculatedHash { get; set; }
        public int ActualHash { get; set; }
    }
}


text:
import test from 'tape'
import twoDimensional from '../../src/primitives/twoDimensional'

test('twoDimensional: define x and y properties', (t) => {
  t.plan(2)
  let twoD = Object.assign({}, twoDimensional(123, 987))
  t.equal(twoD.x, 123)
  t.equal(twoD.y, 987)
})


text:
package org.drools.semantics;

public interface NamedEntity {

    public String get__IndividualName();

    public void set__IndividualName( String n );

}


text:
package com.twilio.twiliochat.application;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.twilio.twiliochat.R;
import com.twilio.twiliochat.chat.listeners.InputOnClickListener;

public class AlertDialogHandler {
  public static void displayAlertWithMessage(String message, Context context) {
    AlertDialog.Builder builder =
        new AlertDialog.Builder(new ContextThemeWrapper(context, R.style.AlertDialogCustom));
    builder.setMessage(message).setCancelable(false).setPositiveButton("OK", null);

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

  public static void displayCancellableAlertWithHandler(String message, Context context,
                                                        DialogInterface.OnClickListener handler) {
    AlertDialog.Builder builder =
        new AlertDialog.Builder(new ContextThemeWrapper(context, R.style.AlertDialogCustom));
    builder.setMessage(message).setPositiveButton("OK", handler).setNegativeButton("Cancel", null);

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

  public static void displayInputDialog(String message, Context context,
                                        final InputOnClickListener handler) {
    LayoutInflater li = LayoutInflater.from(context);
    View promptsView = li.inflate(R.layout.input_dialog_view, null);

    AlertDialog.Builder builder =
        new AlertDialog.Builder(new ContextThemeWrapper(context, R.style.AlertDialogCustom));
    builder.setView(promptsView);

    final EditText userInput = (EditText) promptsView.findViewById(R.id.editTextUserInput);
    final TextView promptMessage = (TextView) promptsView.findViewById(R.id.textViewMessage);
    promptMessage.setText(message);

    builder.setCancelable(false).setPositiveButton("OK", new DialogInterface.OnClickListener() {
      @Override
      public void onClick(DialogInterface dialog, int which) {
        handler.onClick(userInput.getText().toString());
      }
    }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int id) {
        dialog.cancel();
      }
    });

    AlertDialog alertDialog = builder.create();

    alertDialog.show();
  }
}


text:
<?php

$lang['capture_page'] = "http://www.brankoconnect.com/site/signup";


text:
@interface DCHTTPRequestSerializer : AFHTTPRequestSerializer

@end


text:
package Google::Ads::AdWords::v201809::AdGroupCriterionOperation;
use strict;
use warnings;

__PACKAGE__->_set_element_form_qualified(1);

sub get_xmlns { 'https://adwords.google.com/api/adwords/cm/v201809' };

our $XML_ATTRIBUTE_CLASS;
undef $XML_ATTRIBUTE_CLASS;

sub __get_attr_class {
    return $XML_ATTRIBUTE_CLASS;
}

use base qw(Google::Ads::AdWords::v201809::Operation);
# Variety: sequence
use Class::Std::Fast::Storable constructor => 'none';
use base qw(Google::Ads::SOAP::Typelib::ComplexType);

{ # BLOCK to scope variables

my %operator_of :ATTR(:get<operator>);
my %Operation__Type_of :ATTR(:get<Operation__Type>);
my %operand_of :ATTR(:get<operand>);
my %exemptionRequests_of :ATTR(:get<exemptionRequests>);

__PACKAGE__->_factory(
    [ qw(        operator
        Operation__Type
        operand
        exemptionRequests

    ) ],
    {
        'operator' => \%operator_of,
        'Operation__Type' => \%Operation__Type_of,
        'operand' => \%operand_of,
        'exemptionRequests' => \%exemptionRequests_of,
    },
    {
        'operator' => 'Google::Ads::AdWords::v201809::Operator',
        'Operation__Type' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
        'operand' => 'Google::Ads::AdWords::v201809::AdGroupCriterion',
        'exemptionRequests' => 'Google::Ads::AdWords::v201809::ExemptionRequest',
    },
    {

        'operator' => 'operator',
        'Operation__Type' => 'Operation.Type',
        'operand' => 'operand',
        'exemptionRequests' => 'exemptionRequests',
    }
);

} # end BLOCK

1;

=pod

=head1 NAME

Google::Ads::AdWords::v201809::AdGroupCriterionOperation

=head1 DESCRIPTION

Perl data type class for the XML Schema defined complexType
AdGroupCriterionOperation from the namespace https://adwords.google.com/api/adwords/cm/v201809.

Operation (add, remove and set) on adgroup criteria. <p>If you try to ADD a criterion that already exists, it will be treated as a SET operation on the existing criterion.

=head2 PROPERTIES

The following properties may be accessed using get_PROPERTY / set_PROPERTY
methods:

=over

=item * operand

=item * exemptionRequests

=back

=head1 METHODS

=head2 new

Constructor. The following data structure may be passed to new():

=head1 AUTHOR

Generated by SOAP::WSDL

=cut


text:
namespace Google.Cloud.SecurityCenter.V1.Snippets
{
    // [START securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_sync]
    using Google.Cloud.SecurityCenter.V1;

    public sealed partial class GeneratedSecurityCenterClientSnippets
    {
        /// <summary>Snippet for GetNotificationConfig</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void GetNotificationConfigRequestObject()
        {
            // Create client
            SecurityCenterClient securityCenterClient = SecurityCenterClient.Create();
            // Initialize request argument(s)
            GetNotificationConfigRequest request = new GetNotificationConfigRequest
            {
                NotificationConfigName = NotificationConfigName.FromOrganizationNotificationConfig("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"),
            };
            // Make the request
            NotificationConfig response = securityCenterClient.GetNotificationConfig(request);
        }
    }
    // [END securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_sync]
}


text:
import { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import { Spell } from './spell';

@Injectable()
export class SpellService{
	constructor(private http: Http){
		let mappingFunction : (response: Response) => Spell[] = this.extractData.bind(this);
		this.spellObserv = this.http.get('/app/spells.json').share().map(mappingFunction);
	}

	processed : boolean = false;
	spells : Spell[] = [];
	classes: string[] = ["All"];
	levels: string[] = [
		"All",
		"Cantrip",
		"1st-level",
		"2nd-level",
		"3rd-level",
		"4th-level",
		"5th-level",
		"6th-level",
		"7th-level",
		"8th-level",
		"9th-level"
	];
	spellObserv: Observable<Spell[]>;

	getSpells(): Observable<Spell[]>{
		return this.spellObserv;
	}

	getClasses(): Observable<string[]>{
		let mappingFunction : (spells: Spell[]) => string[] = (spells: Spell[]) => {
			spells.forEach(this.addClasses.bind(this));

			return this.classes;
		};

		return this.getSpells().map(mappingFunction);
	}

	getLevels(): Promise<string[]>{
		return Promise.resolve(this.levels);
	}

	private extractData(resp: Response): Spell[]{
		if(this.processed){ return this.spells; }
		var data = resp.json();

		for(let jSpell of data){
			let spell: Spell = new Spell;
			spell.name = jSpell.name;
			spell.description = jSpell.desc;
			spell.range = jSpell.range;
			spell.components = jSpell.components;
			spell.material = jSpell.material;
			spell.ritual = jSpell.ritual === "yes";
			spell.duration = jSpell.duration;
			spell.concentration = jSpell.concentration.toUpperCase();
			spell.casting_time = jSpell.casting_time;
			spell.level = jSpell.level.trim();
			spell.school = jSpell.school;
			spell.classes = jSpell.class.split(',');

			for(var i = spell.classes.length-1; i >= 0; i--){
				spell.classes[i] = spell.classes[i].trim();
			}

			this.spells.push(spell);
		}

		this.processed = true;
		return this.spells;
	}

	private handleError(error: any): Promise<any>{
		  console.error('An error occurred', error); // for demo purposes only
		  return Promise.reject(error.message || error);
	}

	private addClasses(spell: Spell){
		for(var cls of spell.classes){
			if(this.classes.indexOf(cls.trim()) === -1){
				this.classes.push(cls.trim());
			}
		}
	}
}


text:
"""
    Kubernetes

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

    OpenAPI spec version: v1.6.1

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import os
import sys
import unittest

import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.extensions_v1beta1_deployment_list import ExtensionsV1beta1DeploymentList

class TestExtensionsV1beta1DeploymentList(unittest.TestCase):
    """ ExtensionsV1beta1DeploymentList unit test stubs """

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def testExtensionsV1beta1DeploymentList(self):
        """
        Test ExtensionsV1beta1DeploymentList
        """
        model = kubernetes.client.models.extensions_v1beta1_deployment_list.ExtensionsV1beta1DeploymentList()

if __name__ == '__main__':
    unittest.main()


text:
class ApplicationMailer < ActionMailer::Base
  default from: "noreply@mwahmed.com"
  layout 'mailer'
end


text:
$(document).ready(function() {
  $('#lessee-form').submit(function(e) {
    e.preventDefault();
    var form = $(this);
    var url = form.attr('action');
    proccessAction(url, form.serialize()).then(function(data) {
      form[0].reset();
    });
  });
  $('.btn-signin-type').click(function() {
  	var action = ($(this).find('input').val() == 'lessee') ? signinLesseeUrl : signinLessorUrl;
    if($(this).find('input').val() == 'lessee'){
      $('#social-media-login').show();
    } else {
      $('#social-media-login').hide();
    }
    $('#form-signin').attr('action', action);
  });

  $('.portfolio-box').click(function() {
  	catId = $(this).data('category-id');
  	var catName = $(this).data('category-name');
  	$('#category-modal').find('#category-modal-title').text(catName);
  	viewCategory(catId, 1);
  });
});

$(document).on('click', '.pagination a', function(e) {
	e.preventDefault();
	var page = $(this).data('ci-pagination-page');
	viewCategory(catId, page);
});

var catId;

function viewCategory(id, page) {
	$.post(categoryItemsUrl+'/'+id+'/'+page, {}, function(data) {
		if (data['result']) {
			$('#category-modal').find('.modal-body').html(data['view']);
		} else {
			$('#category-modal').find('.modal-body').html(data['message']);
		}
		$('#category-modal').modal('show');

	}, 'JSON');
}


text:
<!DOCTYPE html>

<title>How do I Soft Delete a site from Worksite Setup?</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="saka.sitesetup" name="description">
<meta content="delete course, remove course, remove site" name="search">
<link href="/library/skin/tool_base.css" media="screen" rel="stylesheet" type="text/css" charset="utf-8">
<link href="/library/skin/neo-default/tool.css" media="screen" rel="stylesheet" type="text/css" charset="utf-8">
<link href="/library/skin/neo-default/help.css" media="screen" rel="stylesheet" type="text/css" charset="utf-8">
<link href="/library/js/jquery/featherlight/0.4.0/featherlight.min.css" media="screen" rel="stylesheet" type="text/css" charset="utf-8">

How do I Soft Delete a site from Worksite Setup?

Soft Delete is the default deletion method, and can be done from either the Sites tool in the Administration Workspace, or the Worksite Setup tool for users with deletion permissions.

Go to Worksite Setup.

Select the Worksite Setup tool from the Tool Menu in your site.

Locate and select the site or sites you want to soft delete.

              Zoom

Find the site you want to delete be performing a search. For example:

Enter a search term, such as the site title.

Click Search.

Check the box next to the site or sites you would like to delete.

Click the Delete button.

              Zoom

Note: Make sure you do NOT click on th Hard Delete, as that option will permanently delete the site and all of its files and data.

Click Remove to confirm deletion.

              Zoom


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Message (Titan 1.0.0 API)</title>
<meta name="date" content="2015-09-19">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.thinkaurelius.titan.diskstorage.log

Interface Message

All Known Implementing Classes:

AbstractMessage, KCVSMessage

public interface Message

Messages which are added to and received from the Log.

Author:

Matthias Broecheler (me@matthiasb.com)

Method Summary

All Methods Instance Methods Abstract Methods

Modifier and Type
Method and Description

StaticBuffer
getContent()

Returns the content of the message

String
getSenderId()

Returns the unique identifier for the sender of the message

java.time.Instant
getTimestamp()

Returns the timestamp of this message in the specified time unit.

Method Detail

getSenderId

String getSenderId()

Returns the unique identifier for the sender of the message

Returns:

getTimestamp

java.time.Instant getTimestamp()

Returns the timestamp of this message in the specified time unit.
 This is the time when the message was added to the log.

Parameters:

unit -

Returns:

getContent

StaticBuffer getContent()

Returns the content of the message

Returns:

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2012–2015. All rights reserved.


text:
package org.apache.kafka.common.record;

import org.apache.kafka.common.KafkaException;

public class InvalidRecordException extends KafkaException {

    private static final long serialVersionUID = 1;

    public InvalidRecordException(String s) {
        super(s);
    }

}


text:
/* @flow */

import {
    CHECK,
    RECEIVE,
    REQUEST,
    RESET,
    RESET_RESPONSE,
    TOGGLE,
    UNCHECK,
} from './actions';

import type {
    CheckAction,
    ReceiveAction,
    RequestAction,
    ResetAction,
    ResetResponseAction,
    ResponseType,
    ToggleAction,
    UncheckAction,
} from './actions';

type Action =
    | CheckAction
    | ReceiveAction
    | RequestAction
    | ResetAction
    | ResetResponseAction
    | ToggleAction
    | UncheckAction;

export type BatchActionsState = {|
    +entities: Array<number>,
    +lastCheckedEntity: ?number,
    +requestInProgress: ?string,
    +response: ?ResponseType,
|};

const initial: BatchActionsState = {
    entities: [],
    lastCheckedEntity: null,
    requestInProgress: null,
    response: null,
};

function checkEntities(
    stateEntities: Array<number>,
    actionEntities: Array<number>,
) {
    // Union with duplicates removed
    return stateEntities.concat(
        actionEntities.filter((e) => stateEntities.indexOf(e) < 0),
    );
}

function toggleEntity(entities: Array<number>, entity: number) {
    // Remove entity if present
    if (entities.includes(entity)) {
        return entities.filter((e) => e !== entity);
    }
    // Add entity if not present
    else {
        return entities.concat([entity]);
    }
}

function uncheckEntities(
    stateEntities: Array<number>,
    actionEntities: Array<number>,
) {
    return stateEntities.filter((e) => actionEntities.indexOf(e) < 0);
}

export default function reducer(
    state: BatchActionsState = initial,
    action: Action,
): BatchActionsState {
    switch (action.type) {
        case CHECK:
            return {
                ...state,
                entities: checkEntities(state.entities, action.entities),
                lastCheckedEntity: action.lastCheckedEntity,
            };
        case RECEIVE:
            return {
                ...state,
                requestInProgress: null,
                response: action.response,
            };
        case REQUEST:
            return {
                ...state,
                requestInProgress: action.source,
            };
        case RESET:
            return {
                ...initial,
            };
        case RESET_RESPONSE:
            return {
                ...state,
                response: initial.response,
            };
        case TOGGLE:
            return {
                ...state,
                entities: toggleEntity(state.entities, action.entity),
                lastCheckedEntity: action.entity,
            };
        case UNCHECK:
            return {
                ...state,
                entities: uncheckEntities(state.entities, action.entities),
                lastCheckedEntity: action.lastCheckedEntity,
            };
        default:
            return state;
    }
}


text:
{% include css/base.css %}
{% include css/skeleton.css %}
{% include css/main.css %}
{% include css/bootstrap-image-gallery.min.css %}


text:
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:orientation="vertical">

    <include layout="@layout/realm_browser_toolbar"/>

    <ListView
        android:id="@+id/realm_browser_listView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</LinearLayout>


text:
package com.senseidb.extention.flexiblequery;

import org.apache.lucene.index.Term;

import java.io.IOException;

abstract public class DocsEnum {
  abstract public Term term();
  abstract public boolean next() throws IOException;
  abstract public boolean skipTo(int target) throws IOException;
  abstract public int doc();
  abstract public int freq();
  abstract public int position();
  abstract public long cost();
  abstract public String toString();
}


text:
To release a new version of canvas-datagrid, I've found that this order of steps works well:

1. Update the `CHANGELOG.md` file, with the new version number, date, and an overview of what's changed since the previous release. For example:

```
## 1.0.0 - 2025-06-01

### Added

- Big feature meriting 1.0.0 release (contributing-user-foo, #999)
```

2. Commit this file

3. Run `npm version patch` or `npm version <version-number>`, but usually `patch` will suffice. This will update the package.json and package-lock.json files, commit them, and tag the commit with the new version number.

4. Push the commits and tags

```
git push && git push --tags
```

5. Once you've pushed the tagged commit, the GitHub Actions CI pipeline will take care of releasing it to NPM. To see how that works, refer to `.github/workflows/release.yml````


text:
int main(){
    UDPCommunicator communicator = UDPCommunicator("", 4500);
    communicator.receieveLog = true;
    communicator.sendLog = true;
    while (true){
        communicator.receive();
    }
}


text:
package com.ibm.xsp.xflow.history;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.ibm.commons.util.StringUtil;
import com.ibm.xsp.xflow.IHistoryEntry;
import com.ibm.xsp.xflow.IWorkflowContext;
import com.ibm.xsp.xflow.WorkflowException;

/**
 * Define an abstract history entry.
 */
public abstract class AbstractHistoryEntry implements IHistoryEntry  {

	// Forced, to get the same result regardless of the locale
	public static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm z");
	public static String formatString(String s) {
		return StringUtil.format("{0} - {1}", dateFormat.format(new Date()), s);
	}

	public AbstractHistoryEntry(IWorkflowContext context) {
	}

	public final String getAsString() throws WorkflowException {
		return formatString(getString());
	}

	public abstract String getString() throws WorkflowException;
}


text:
<html>
<head>
    <script src="../OLLoader.js"></script>
    <script type="text/javascript">
    function test_basic(t) {
        t.plan(5);
        var format = new OpenLayers.Format.Text({extractStyles: true});
        var features = format.read(OpenLayers.Util.getElement("content").value);
        t.eq(features[0].style.externalGraphic, format.defaultStyle.externalGraphic, "style is set to defaults if no style props set in text file");
        var features = format.read(OpenLayers.Util.getElement("contentMarker").value);
        t.eq(features[0].style.externalGraphic, OpenLayers.Util.getImagesLocation() + "marker.png", "marker set correctly by default.");

        var features = format.read(OpenLayers.Util.getElement("content2").value);
        t.eq(features.length, 2, "two features read");
        t.eq(features[0].style.externalGraphic, "marker.png", "marker set correctly from data.");
        // t.eq(format.defaultStyle.externalGraphic, "../../img/marker.png", "defaultStyle externalGraphic not changed by pulling from data");

        var format = new OpenLayers.Format.Text({extractStyles: false});
        var features = format.read(OpenLayers.Util.getElement("content2").value);
        t.eq(features[0].style, null, "extractStyles: false results in null style property, even with style properties used");
    }
	function test_extra(t) {
        t.plan(1);
        var format = new OpenLayers.Format.Text();
        var features = format.read(OpenLayers.Util.getElement("content3").value);
        t.eq(features[0].attributes.whee, "chicken", "extra attributes are stored for later use");
	}
    </script>
</head>
<body>
<textarea id="content">
point
5,5
</textarea>
<textarea id="contentMarker">
point	iconSize
5,5	8,8
</textarea>
<textarea id="content2">
point	icon
5,5	marker.png
10,10	marker2.png
</textarea>
<textarea id="content3">
point	whee
5,5	chicken
</textarea>
</body>
</html>


text:
from setuptools import setup

setup(name='prostatscrapper',
      version='0.1',
      description='Package to download NFL stats',
      url='http://github.com/gpkort/statscraper',
      author='Greg Korthuis',
      author_email='gpkort@gmail.com',
      license='Apache 2.0 License',
      packages=['prostatscrapper'],
      zip_safe=False, install_requires=['requests', 'bs4', 'pandas'])


text:
//===---------- IncludeInserter.h - clang-tidy ----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H

#include "IncludeSorter.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/PPCallbacks.h"
#include <memory>
#include <string>

namespace clang {
namespace tidy {
namespace utils {

/// Produces fixes to insert specified includes to source files, if not
/// yet present.
///
/// ``IncludeInserter`` can be used in clang-tidy checks in the following way:
/// \code
/// #include "../utils/IncludeInserter.h"
/// #include "clang/Frontend/CompilerInstance.h"
///
/// class MyCheck : public ClangTidyCheck {
///  public:
///   void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
///                            Preprocessor *ModuleExpanderPP) override {
///     Inserter = std::make_unique<IncludeInserter>(
///         SM, getLangOpts(), utils::IncludeSorter::IS_Google);
///     PP->addPPCallbacks(Inserter->CreatePPCallbacks());
///   }
///
///   void registerMatchers(ast_matchers::MatchFinder* Finder) override { ... }
///
///   void check(
///       const ast_matchers::MatchFinder::MatchResult& Result) override {
///     ...
///     Inserter->CreateIncludeInsertion(
///         Result.SourceManager->getMainFileID(), "path/to/Header.h",
///         /*IsAngled=*/false);
///     ...
///   }
///
///  private:
///   std::unique_ptr<clang::tidy::utils::IncludeInserter> Inserter;
/// };
/// \endcode
class IncludeInserter {
public:
  IncludeInserter(const SourceManager &SourceMgr, const LangOptions &LangOpts,
                  IncludeSorter::IncludeStyle Style);
  ~IncludeInserter();

  /// Create ``PPCallbacks`` for registration with the compiler's preprocessor.
  std::unique_ptr<PPCallbacks> CreatePPCallbacks();

  /// Creates a \p Header inclusion directive fixit. Returns ``llvm::None`` on
  /// error or if inclusion directive already exists.
  llvm::Optional<FixItHint>
  CreateIncludeInsertion(FileID FileID, llvm::StringRef Header, bool IsAngled);

private:
  void AddInclude(StringRef FileName, bool IsAngled,
                  SourceLocation HashLocation, SourceLocation EndLocation);

  llvm::DenseMap<FileID, std::unique_ptr<IncludeSorter>> IncludeSorterByFile;
  llvm::DenseMap<FileID, std::set<std::string>> InsertedHeaders;
  const SourceManager &SourceMgr;
  const LangOptions &LangOpts;
  const IncludeSorter::IncludeStyle Style;
  friend class IncludeInserterCallback;
};

} // namespace utils
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H


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

<title>MessageType (java-taxii API)</title>
<meta name="date" content="2014-09-19">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.mitre.taxii.messages.xml10

Class MessageType

java.lang.Object

org.mitre.taxii.messages.xml10.MessageType

All Implemented Interfaces:

org.jvnet.jaxb2_commons.lang.Equals, org.jvnet.jaxb2_commons.lang.HashCode

Direct Known Subclasses:

RequestMessageType, ResponseMessageType

public abstract class MessageType
extends java.lang.Object
implements org.jvnet.jaxb2_commons.lang.Equals, org.jvnet.jaxb2_commons.lang.HashCode

The root of all TAXII messages. This is used to define header fields. This will never be instantiated directly but the TAXII Message Body types all extend this type.

Java class for MessageType complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="MessageType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="Extended_Headers" type="{http://taxii.mitre.org/messages/taxii_xml_binding-1}ExtendedHeadersType" minOccurs="0"/>
       </sequence>
       <attribute name="message_id" use="required" type="{http://taxii.mitre.org/messages/taxii_xml_binding-1}UnsignedIntegerType" />
     </restriction>
   </complexContent>
 </complexType>

Field Summary

Fields

Modifier and Type
Field and Description

protected ExtendedHeadersType
extendedHeaders

protected java.lang.String
messageId

Constructor Summary

Constructors

Constructor and Description

MessageType()

Default no-arg constructor

MessageType(ExtendedHeadersType extendedHeaders,
           java.lang.String messageId)

Fully-initialising value constructor

Method Summary

Methods

Modifier and Type
Method and Description

boolean
equals(java.lang.Object object)

boolean
equals(org.jvnet.jaxb2_commons.locator.ObjectLocator thisLocator,
      org.jvnet.jaxb2_commons.locator.ObjectLocator thatLocator,
      java.lang.Object object,
      org.jvnet.jaxb2_commons.lang.EqualsStrategy strategy)

ExtendedHeadersType
getExtendedHeaders()

Gets the value of the extendedHeaders property.

java.lang.String
getMessageId()

Gets the value of the messageId property.

int
hashCode()

int
hashCode(org.jvnet.jaxb2_commons.locator.ObjectLocator locator,
        org.jvnet.jaxb2_commons.lang.HashCodeStrategy strategy)

void
setExtendedHeaders(ExtendedHeadersType value)

Sets the value of the extendedHeaders property.

void
setMessageId(java.lang.String value)

Sets the value of the messageId property.

MessageType
withExtendedHeaders(ExtendedHeadersType value)

MessageType
withMessageId(java.lang.String value)

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

extendedHeaders

protected ExtendedHeadersType extendedHeaders

messageId

protected java.lang.String messageId

Constructor Detail

MessageType

public MessageType()

Default no-arg constructor

MessageType

public MessageType(ExtendedHeadersType extendedHeaders,
           java.lang.String messageId)

Fully-initialising value constructor

Method Detail

getExtendedHeaders

public ExtendedHeadersType getExtendedHeaders()

Gets the value of the extendedHeaders property.

Returns:

possible object is
     ExtendedHeadersType

setExtendedHeaders

public void setExtendedHeaders(ExtendedHeadersType value)

Sets the value of the extendedHeaders property.

Parameters:

value - allowed object is
     ExtendedHeadersType

getMessageId

public java.lang.String getMessageId()

Gets the value of the messageId property.

Returns:

possible object is
     String

setMessageId

public void setMessageId(java.lang.String value)

Sets the value of the messageId property.

Parameters:

value - allowed object is
     String

equals

public boolean equals(org.jvnet.jaxb2_commons.locator.ObjectLocator thisLocator,
             org.jvnet.jaxb2_commons.locator.ObjectLocator thatLocator,
             java.lang.Object object,
             org.jvnet.jaxb2_commons.lang.EqualsStrategy strategy)

Specified by:

equals in interface org.jvnet.jaxb2_commons.lang.Equals

equals

public boolean equals(java.lang.Object object)

Overrides:

equals in class java.lang.Object

hashCode

public int hashCode(org.jvnet.jaxb2_commons.locator.ObjectLocator locator,
           org.jvnet.jaxb2_commons.lang.HashCodeStrategy strategy)

Specified by:

hashCode in interface org.jvnet.jaxb2_commons.lang.HashCode

hashCode

public int hashCode()

Overrides:

hashCode in class java.lang.Object

withExtendedHeaders

public MessageType withExtendedHeaders(ExtendedHeadersType value)

withMessageId

public MessageType withMessageId(java.lang.String value)

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
/* hmme.c
 * Emit sequences from a model.
 *
 * Given an hmm, emit a number of sequences.
 *
 * Tue Nov 24 10:16:29 1992
 * radical alterations Wed Jul 28 12:12:57 1993: hmme
 *   used to be "hmm evaluation" and did some pretty
 *   useless stuff.
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>

#ifdef NEED_GETOPTH
#include <getopt.h>
#endif

#include "squid.h"
#include "states.h"
#include "externs.h"
#include "version.h"

#ifdef MEMDEBUG
#include "dbmalloc.h"
#endif

char Alphabet[MAXABET];		/* ACGT, for instance     */
int  Alphabet_size;		/* 4 or 20                */
int  Alphabet_type;		/* kDNA, kRNA, or kAmino  */

#define OPTIONS "bfhn:o:qr:s:B"

static char usage[] = "\
Usage: hmme [-options] <hmmfile>\n\
   where available options are:\n\
   -b            : emit single best (most probable) sequence\n\
   -f            : write in FASTA format, not SELEX\n\
   -h            : print short help and version info\n\
   -n <number>   : emit <number> sequences\n\
   -o <outfile>  : save sequences to outfile\n\
   -q            : quiet - suppress verbose banner\n\
   -r <rfile>    : read random model from <rfile>\n\
   -s <seed>     : set seed for random()\n\
\n\
   Experimental options:\n\
   -B            : like -b, but emit highest scoring sequence\n";

static char banner[] = "hmme -- sequence emission from a hidden Markov model";

int
main(int argc, char **argv)
{
  char   *hmmfile;              /* HMM file to open                */
  FILE   *hmmfp;                /* opened hmm file pointer         */
  struct hmm_struc *hmm;        /* the hidden Markov model         */
  int     idx;			/* counter over sequences          */
  char  **rseqs;		/* emitted sequences               */
  SQINFO *sqinfo;		/* array of info for rseqs         */
  char  **aseqs;                /* alignment of emitted sequences  */
  AINFO   ainfo;		/* info for aseqs                  */
  struct trace_s **tr;          /* tracebacks from emitted seqs    */
  float   score;                /* score of emitted sequence       */
  float   randomseq[MAXABET];	/* random sequence model, freqs    */
  char   *randomfile;

  int          optc;
  extern int   optind;
  extern char *optarg;

  int    emitnum;		/* option: number of sequences to emit */
  int    seed;
  char  *outfile;
  FILE  *ofp;
  int    do_best;
  int    do_rd_best;
  int    be_quiet;
  int    do_fasta;

  /***********************************************
   * Parse the command line
   ***********************************************/

  emitnum    = 10;
  seed       = (int) time ((time_t *) NULL);  /* default: "random" seed */
  outfile    = NULL;
  do_best    = FALSE;
  do_rd_best = FALSE;
  be_quiet   = FALSE;
  do_fasta   = FALSE;
  randomfile = NULL;

  while ((optc = getopt(argc, argv, OPTIONS)) != -1)
    switch (optc) {

    case 'b': do_best    = TRUE;         break;
    case 'f': do_fasta   = TRUE;         break;
    case 'n': emitnum    = atoi(optarg); break;
    case 'o': outfile    = optarg;       break;
    case 'q': be_quiet   = TRUE;         break;
    case 'r': randomfile = optarg;       break;
    case 's': seed       = atoi(optarg); break;
    case 'B': do_rd_best = TRUE;         break;

    case 'h':
      printf("%s\n   version %s, %s\n\n%s\n", banner, RELEASE, RELEASEDATE, usage);
      exit(0);
    default:
      fprintf(stderr, "Unrecognized option: -%c\n%s\n", optc, usage);
      exit(1);
    }

  if (argc - optind != 1)
    { fprintf(stderr, "%s\n", usage); exit(1);  }

  hmmfile = argv[optind];

  sre_srandom(seed);

  if (outfile == NULL) ofp = stdout;
  else if ((ofp = fopen(outfile, "w")) == NULL)
    Die ("Failed to open output file %s", outfile);

  /***********************************************
   * Input of HMM (and sets alphabet)
   ***********************************************/

  if ((hmmfp = fopen(hmmfile, "rb")) == NULL)
    Die("failed to open HMM file %s for reading.", hmmfile);

  if ((hmm = ReadHMM(hmmfp)) == NULL)
    Die("failed to parse HMM file %s", hmmfile);

  if (fclose(hmmfp) == EOF)
    Die("file close failed!?");

  if (randomfile == NULL) DefaultRandomModel(randomseq);
  else                    ReadRandomModel(randomfile, randomseq);

  /***********************************************
   * Allocations
   ***********************************************/

  if (do_best || do_rd_best) emitnum = 1;
  if ((rseqs      = (char **) malloc (emitnum * sizeof(char *))) == NULL ||
      (sqinfo     = (SQINFO *) malloc (emitnum * sizeof(SQINFO))) == NULL ||
      (tr = (struct trace_s **) malloc (emitnum * sizeof(struct trace_s *))) == NULL)
    Die("malloc failed");

  /***********************************************
   * Emit and align the sequences, then print 'em
   ***********************************************/

  if (! be_quiet)
    {
      printf("%s\n", banner);
      printf("     version %s, %s\n", RELEASE, RELEASEDATE);
      puts("");
    }

  /* There are two versions of the best sequence code.
   * Mine produces the best *state* sequence, then emits the most likely
   * symbol sequence from it. Richard Durbin's version emits the
   * most likely sequence relative to a random model.
   */
  if (do_best || do_rd_best)
    {
      struct shmm_s *shmm;

      if (do_rd_best)
	RD_EmitBestSequence(hmm, randomseq, &(rseqs[0]), &(tr[0]));
      else
	EmitBestSequence(hmm, &(rseqs[0]), &(tr[0]));

      shmm = AllocSearchHMM(hmm->M);
      MakeSearchHMM(hmm, randomseq, shmm);
      TraceScore(shmm, rseqs[0], tr[0], &score);

      if (do_rd_best)
	{
	  strcpy(sqinfo[0].name, "best-score");
	  sprintf(sqinfo[0].desc, "Best scoring sequence (score %.2f bits)", score);
	  sqinfo[0].flags = SQINFO_NAME | SQINFO_DESC;
	}
      else
	{
	  strcpy(sqinfo[0].name, "most-likely");
	  sprintf(sqinfo[0].desc, "Most probable sequence (score %.2f bits)", score);
	  sqinfo[0].flags = SQINFO_NAME | SQINFO_DESC;
	}

      WriteSeq(ofp, kPearson, rseqs[0], &(sqinfo[0]));

      FreeSequence(rseqs[0], &(sqinfo[0]));
      FreeTrace(tr[0]);
      FreeSearchHMM(shmm);
    }
  else
    {
      for (idx = 0; idx < emitnum; idx++)
	if (! EmitSequence(hmm, &rseqs[idx], &tr[idx]))
	  Die("failed to emit sequence number %d", idx);

				/* give them names */
      for (idx = 0; idx < emitnum; idx++)
	{
	  sqinfo[idx].flags = SQINFO_NAME;
	  sprintf(sqinfo[idx].name, "seq%d", idx);
	}

      if (do_fasta)
	{
	  for (idx = 0; idx < emitnum; idx++)
	    WriteSeq(ofp, kPearson, rseqs[idx], &(sqinfo[idx]));
	}
      else /* SELEX alignment */
	{
	  if (! Traces2Alignment(rseqs, sqinfo, emitnum, hmm->M, tr, FALSE, &aseqs, &ainfo))
	    Die("Traces2Alignment failed");
	  if (! WriteSELEX(ofp, aseqs, emitnum, &ainfo, 50))
	    Die("WriteSELEX failed");
	  FreeAlignment(aseqs, emitnum, &ainfo);
	}

      for (idx = 0; idx < emitnum; idx++)
	{
	  FreeSequence(rseqs[idx], &(sqinfo[idx]));
	  FreeTrace(tr[idx]);
	}
    }

  /***********************************************
   * Exit
   ***********************************************/

  if (outfile != NULL) fclose(ofp);
  free(tr);
  free(rseqs);
  free(sqinfo);
  FreeHMM(hmm);
  return 0;
}


text:
package betahouse.model;

public class UserInfo {
    private Integer id;

    private String realName;

    private String schoolId;

    private String eMail;

    private String tel;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName == null ? null : realName.trim();
    }

    public String getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(String schoolId) {
        this.schoolId = schoolId == null ? null : schoolId.trim();
    }

    public String geteMail() {
        return eMail;
    }

    public void seteMail(String eMail) {
        this.eMail = eMail == null ? null : eMail.trim();
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel == null ? null : tel.trim();
    }
}


text:
using System;

namespace Lucene.Net.Search
{

    /// <summary>
    /// <see cref="ReferenceContext{T}"/> holds a reference instance and
    /// ensures it is properly de-referenced from its corresponding <see cref="ReferenceManager{G}"/>
    /// when <see cref="Dispose()"/> is called. This class is primarily intended
    /// to be used with a using block.
    /// <para/>
    /// LUCENENET specific
    /// </summary>
    /// <typeparam name="T">The reference type</typeparam>
    public sealed class ReferenceContext<T> : IDisposable
        where T : class
    {
        private readonly ReferenceManager<T> referenceManager;
        private T reference;

        internal ReferenceContext(ReferenceManager<T> referenceManager)
        {
            this.referenceManager = referenceManager;
            this.reference = referenceManager.Acquire();
        }

        /// <summary>
        /// The reference acquired from the <see cref="ReferenceManager{G}"/>.
        /// </summary>
        public T Reference => reference;

        /// <summary>
        /// Ensures the reference is properly de-referenced from its <see cref="ReferenceManager{G}"/>.
        /// After this call, <see cref="Reference"/> will be <c>null</c>.
        /// </summary>
        public void Dispose()
        {
            if (this.reference != null)
            {
                this.referenceManager.Release(this.reference);
                this.reference = null;
            }
        }
    }
}


text: #include "simple_node.h"


text:
package com.planet57.gshell.util.converter.basic;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;

import com.planet57.gshell.util.converter.ConverterSupport;

/**
 * Converter for {@link Date} types.
 *
 * @since 2.0
 */
public class DateConverter
    extends ConverterSupport
{
  private List<DateFormat> formats = new ArrayList<DateFormat>();

  public DateConverter() {
    super(Date.class);

    formats.add(DateFormat.getInstance());
    formats.add(DateFormat.getDateInstance());
    formats.add(new SimpleDateFormat("yyyy-MM-dd")); // Atom (ISO 8601))) -- short version;
    formats.add(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz")); // Atom (ISO 8601)));
  }

  @Override
  protected Object convertToObject(final String text) throws Exception {
    for (DateFormat format : formats) {
      try {
        return format.parse(text);
      }
      catch (ParseException e) {
        // ignore
      }
    }

    return complexParse(text);
  }

  private Object complexParse(String text) throws ParseException {
    // find out whether the first token is a locale id and style in that order
    // if there's locale, style is mandatory
    Locale locale = Locale.getDefault();
    int style = DateFormat.MEDIUM;
    int firstSpaceIndex = text.indexOf(' ');
    if (firstSpaceIndex != -1) {
      String token = text.substring(0, firstSpaceIndex).intern();
      if (token.startsWith("locale")) {
        String localeStr = token.substring(token.indexOf('=') + 1);
        int underscoreIndex = localeStr.indexOf('_');
        if (underscoreIndex != -1) {
          String language = localeStr.substring(0, underscoreIndex);
          String country = localeStr.substring(underscoreIndex + 1);
          locale = new Locale(language, country);
        }
        else {
          locale = new Locale(localeStr);
        }
        // locale is followed by mandatory style
        int nextSpaceIndex = text.indexOf(' ', firstSpaceIndex + 1);
        token = text.substring(firstSpaceIndex + 1, nextSpaceIndex);
        String styleStr = token.substring(token.indexOf('=') + 1);
        if (styleStr.equalsIgnoreCase("SHORT")) {
          style = DateFormat.SHORT;
        }
        else if (styleStr.equalsIgnoreCase("MEDIUM")) {
          style = DateFormat.MEDIUM;
        }
        else if (styleStr.equalsIgnoreCase("LONG")) {
          style = DateFormat.LONG;
        }
        else if (styleStr.equalsIgnoreCase("FULL")) {
          style = DateFormat.FULL;
        }
        else {
          // unknown style name
          // throw exception or assume default?
          style = DateFormat.MEDIUM;
        }
        text = text.substring(nextSpaceIndex + 1);
      }
    }
    DateFormat formats = DateFormat.getDateInstance(style, locale);
    return formats.parse(text);
  }

  @Override
  protected String convertToString(final Object value) {
    Date date = (Date) value;
    return formats.get(0).format(date);
  }
}


text:
#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(ENABLE_FP16_KERNELS)
#include "src/cpu/kernels/maxunpool/generic/neon/impl.h"
namespace arm_compute
{
namespace cpu
{
void neon_fp16_maxunpooling(const ITensor *input, const ITensor *indices, ITensor *output, const Window &window)
{
    return max_unpooling<float16_t>(input, indices, output, window);
}
} // namespace cpu
} // namespace arm_compute
#endif /* defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(ENABLE_FP16_KERNELS) */


text:
package org.ovirt.engine.core.vdsbroker.irsbroker;

import org.ovirt.engine.core.compat.*;
import org.ovirt.engine.core.common.*;
import org.ovirt.engine.core.common.businessentities.*;
import org.ovirt.engine.core.vdsbroker.*;
import org.ovirt.engine.core.common.errors.*;

import org.ovirt.engine.core.common.vdscommands.*;
import org.ovirt.engine.core.dal.dbbroker.*;

public class ResetIrsVDSCommand<P extends ResetIrsVDSCommandParameters> extends IrsBrokerCommand<P> {
    public ResetIrsVDSCommand(P parameters) {
        super(parameters);
    }

    @Override
    protected void ExecuteVDSCommand() {
        P parameters = getParameters();
        if (StringHelper.EqOp(parameters.getHostName(), getCurrentIrsProxyData().getmCurrentIrsHost()) ||
                StringHelper.isNullOrEmpty(getCurrentIrsProxyData().getmCurrentIrsHost())) {
            Guid vdsId = parameters.getVdsId();
            if (ResourceManager
                    .getInstance()
                    .runVdsCommand(VDSCommandType.SpmStop,
                            new SpmStopVDSCommandParameters(vdsId, parameters.getStoragePoolId())).getSucceeded()
                    || parameters.getIgnoreStopFailed()) {
                getCurrentIrsProxyData().ResetIrs();
                storage_pool pool = DbFacade.getInstance().getStoragePoolDao().get(parameters.getStoragePoolId());
                if (pool != null && (pool.getstatus() == StoragePoolStatus.NotOperational)) {
                    ResourceManager
                            .getInstance()
                            .getEventListener()
                            .storagePoolStatusChange(parameters.getStoragePoolId(), StoragePoolStatus.Problematic,
                                    AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_RESET_IRS, VdcBllErrors.ENGINE);
                }
            } else {
                getVDSReturnValue().setSucceeded(false);
            }
        }
    }
}


text:
#ifndef humidity_sensor_base_h
#define humidity_sensor_base_h

#include "senstick_sensor_base.h"

extern const senstick_sensor_base_t humiditySensorBase;

#endif /* humidity_sensor_base_h */


text:
const db = require('./helpers/db');

beforeEach(() => {
  return db.truncateBooks()
  .then(() => console.log('Books table from simple_book_store_test has been truncated'));
});

beforeEach(() => {
  return db.truncateAuthors()
  .then(() => console.log('Authors table from simple_book_store_test has been truncated'));
});

beforeEach(() => {
  return db.truncateGenres()
  .then(() => console.log('Genres table from simple_book_store_test has been truncated'));
});

beforeEach(() => {
  return db.truncateUsers()
  .then(() => console.log('Users table from simple_book_store_test has been truncated'));
});

beforeEach(() => {
  return db.truncateCarts()
  .then(() => console.log('Carts table from simple_book_store_test has been truncated'));
});

beforeEach(() => {
  return db.seedBooks()
  .then(() => db.seedAuthors())
  .then(() => db.seedGenres())
  .then(() => db.seedAuthorsBooks())
  .then(() => db.seedGenresBooks())
  .then(() => db.seedUsers('badpassword', { username: 'bob', email: 'bob@bob.com', }))
  .then(() => db.seedUsers('worsepassword', { username: 'jim', email: 'jim@jim.com', }))
  .then(() => db.seedCarts(1, 1))
  .then(() => db.seedCarts(2, 2))
  .then(() => db.makeAdmin())
  .then(() => console.log('Test database seeded'));
});


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/video/livestream/v1/resources.proto

namespace Google\Cloud\Video\LiveStream\V1\Event;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Inserts a new ad opportunity.
 *
 * Generated from protobuf message google.cloud.video.livestream.v1.Event.AdBreakTask
 */
class AdBreakTask extends \Google\Protobuf\Internal\Message
{
    /**
     * Duration of an ad opportunity. Must be greater than 0.
     *
     * Generated from protobuf field .google.protobuf.Duration duration = 1;
     */
    private $duration = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Duration $duration
     *           Duration of an ad opportunity. Must be greater than 0.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Duration of an ad opportunity. Must be greater than 0.
     *
     * Generated from protobuf field .google.protobuf.Duration duration = 1;
     * @return \Google\Protobuf\Duration|null
     */
    public function getDuration()
    {
        return $this->duration;
    }

    public function hasDuration()
    {
        return isset($this->duration);
    }

    public function clearDuration()
    {
        unset($this->duration);
    }

    /**
     * Duration of an ad opportunity. Must be greater than 0.
     *
     * Generated from protobuf field .google.protobuf.Duration duration = 1;
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->duration = $var;

        return $this;
    }

}


text:
namespace device {

namespace {

// Formats the platform device IDs in |platform_device_id_map| into a
// comma-separated list for logging. The report IDs are not logged.
std::string PlatformDeviceIdsToString(
    const HidDeviceInfo::PlatformDeviceIdMap& platform_device_id_map) {
  std::ostringstream buf("'");
  bool first = true;
  for (const auto& entry : platform_device_id_map) {
    if (!first)
      buf << "', '";
    first = false;
    buf << entry.platform_device_id;
  }
  buf << "'";
  return buf.str();
}

}  // namespace

void HidService::Observer::OnDeviceAdded(mojom::HidDeviceInfoPtr device_info) {}

void HidService::Observer::OnDeviceRemoved(
    mojom::HidDeviceInfoPtr device_info) {}

void HidService::Observer::OnDeviceChanged(
    mojom::HidDeviceInfoPtr device_info) {}

// static
constexpr base::TaskTraits HidService::kBlockingTaskTraits;

// static
std::unique_ptr<HidService> HidService::Create() {
#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_UDEV)
  return base::WrapUnique(new HidServiceLinux());
#elif BUILDFLAG(IS_MAC)
  return base::WrapUnique(new HidServiceMac());
#elif BUILDFLAG(IS_WIN)
  return base::WrapUnique(new HidServiceWin());
#else
  return nullptr;
#endif
}

void HidService::GetDevices(GetDevicesCallback callback) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  bool was_empty = pending_enumerations_.empty();
  pending_enumerations_.push_back(std::move(callback));
  if (enumeration_ready_ && was_empty) {
    base::SequencedTaskRunnerHandle::Get()->PostTask(
        FROM_HERE,
        base::BindOnce(&HidService::RunPendingEnumerations, GetWeakPtr()));
  }
}

void HidService::AddObserver(HidService::Observer* observer) {
  observer_list_.AddObserver(observer);
}

void HidService::RemoveObserver(HidService::Observer* observer) {
  observer_list_.RemoveObserver(observer);
}

HidService::HidService() = default;

HidService::~HidService() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}

void HidService::AddDevice(scoped_refptr<HidDeviceInfo> device_info) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  // A HidDeviceInfo object may represent multiple platform devices. For
  // instance, on Windows each HID interface is split into separate platform
  // devices for each top-level collection. When adding devices to HidService,
  // callers should add each platform device as a separate HidDeviceInfo and
  // allow HidService to merge them together.
  DCHECK_EQ(device_info->platform_device_id_map().size(), 1u);
  if (FindDeviceGuidInDeviceMap(
          device_info->platform_device_id_map().front().platform_device_id)) {
    return;
  }

  // If |device_info| has an interface ID then it represents a single top-level
  // collection within a HID interface that may contain other top-level
  // collections. Check if a sibling device has already been added and, if so,
  // merge |device_info| into the sibling device.
  if (device_info->interface_id()) {
    auto sibling_device = FindSiblingDevice(*device_info);
    if (sibling_device) {
      // Merge |device_info| into |sibling_device|.
      sibling_device->AppendDeviceInfo(std::move(device_info));
      if (enumeration_ready_) {
        for (auto& observer : observer_list_)
          observer.OnDeviceChanged(sibling_device->device()->Clone());
      }
      return;
    }
  }

  devices_[device_info->device_guid()] = device_info;

  HID_LOG(USER) << "HID device " << (enumeration_ready_ ? "added" : "detected")
                << ": vendorId=" << device_info->vendor_id()
                << ", productId=" << device_info->product_id() << ", name='"
                << device_info->product_name() << "', serial='"
                << device_info->serial_number() << "', deviceIds=["
                << PlatformDeviceIdsToString(
                       device_info->platform_device_id_map())
                << "]";

  if (enumeration_ready_) {
    for (auto& observer : observer_list_)
      observer.OnDeviceAdded(device_info->device()->Clone());
  }
}

void HidService::RemoveDevice(const HidPlatformDeviceId& platform_device_id) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  auto found_guid = FindDeviceGuidInDeviceMap(platform_device_id);
  if (found_guid) {
    HID_LOG(USER) << "HID device removed: deviceId='" << platform_device_id
                  << "'";
    DCHECK(base::Contains(devices_, *found_guid));

    scoped_refptr<HidDeviceInfo> device_info = devices_[*found_guid];
    if (enumeration_ready_) {
      for (auto& observer : observer_list_)
        observer.OnDeviceRemoved(device_info->device()->Clone());
    }
    devices_.erase(*found_guid);
  }
}

void HidService::RunPendingEnumerations() {
  DCHECK(enumeration_ready_);
  DCHECK(!pending_enumerations_.empty());

  std::vector<GetDevicesCallback> callbacks;
  callbacks.swap(pending_enumerations_);

  // Clone and pass mojom::HidDeviceInfoPtr vector for each clients.
  for (auto& callback : callbacks) {
    std::vector<mojom::HidDeviceInfoPtr> devices;
    for (const auto& map_entry : devices_)
      devices.push_back(map_entry.second->device()->Clone());
    std::move(callback).Run(std::move(devices));
  }
}

void HidService::FirstEnumerationComplete() {
  enumeration_ready_ = true;
  if (!pending_enumerations_.empty()) {
    RunPendingEnumerations();
  }
}

absl::optional<std::string> HidService::FindDeviceGuidInDeviceMap(
    const HidPlatformDeviceId& platform_device_id) {
  for (const auto& device_entry : devices_) {
    const auto& platform_device_map =
        device_entry.second->platform_device_id_map();
    for (const auto& platform_device_entry : platform_device_map) {
      if (platform_device_entry.platform_device_id == platform_device_id)
        return device_entry.first;
    }
  }
  return absl::nullopt;
}

scoped_refptr<HidDeviceInfo> HidService::FindSiblingDevice(
    const HidDeviceInfo& device_info) const {
  if (!device_info.interface_id())
    return nullptr;

  for (const auto& device_entry : devices_) {
    if (device_entry.second->interface_id() == device_info.interface_id())
      return device_entry.second;
  }
  return nullptr;
}

}  // namespace device


text:
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.

package org.jetbrains.kotlin;

import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.idea.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.idea.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TestMetadata;
import org.jetbrains.kotlin.idea.base.test.TestRoot;
import org.junit.runner.RunWith;

/**
 * This class is generated by {@link org.jetbrains.kotlin.testGenerator.generator.TestGenerator}.
 * DO NOT MODIFY MANUALLY.
 */
@SuppressWarnings("all")
@TestRoot("idea/tests")
@TestDataPath("$CONTENT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/dataFlowValueRendering")
public class DataFlowValueRenderingTestGenerated extends AbstractDataFlowValueRenderingTest {
    private void runTest(String testDataFilePath) throws Exception {
        KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
    }

    @TestMetadata("classProperty.kt")
    public void testClassProperty() throws Exception {
        runTest("testData/dataFlowValueRendering/classProperty.kt");
    }

    @TestMetadata("complexIdentifier.kt")
    public void testComplexIdentifier() throws Exception {
        runTest("testData/dataFlowValueRendering/complexIdentifier.kt");
    }

    @TestMetadata("complexIdentifierWithImplicitReceiver.kt")
    public void testComplexIdentifierWithImplicitReceiver() throws Exception {
        runTest("testData/dataFlowValueRendering/complexIdentifierWithImplicitReceiver.kt");
    }

    @TestMetadata("complexIdentifierWithInitiallyNullableReceiver.kt")
    public void testComplexIdentifierWithInitiallyNullableReceiver() throws Exception {
        runTest("testData/dataFlowValueRendering/complexIdentifierWithInitiallyNullableReceiver.kt");
    }

    @TestMetadata("complexIdentifierWithReceiver.kt")
    public void testComplexIdentifierWithReceiver() throws Exception {
        runTest("testData/dataFlowValueRendering/complexIdentifierWithReceiver.kt");
    }

    @TestMetadata("multipleVariables.kt")
    public void testMultipleVariables() throws Exception {
        runTest("testData/dataFlowValueRendering/multipleVariables.kt");
    }

    @TestMetadata("packageProperty.kt")
    public void testPackageProperty() throws Exception {
        runTest("testData/dataFlowValueRendering/packageProperty.kt");
    }

    @TestMetadata("receivers.kt")
    public void testReceivers() throws Exception {
        runTest("testData/dataFlowValueRendering/receivers.kt");
    }

    @TestMetadata("smartCast.kt")
    public void testSmartCast() throws Exception {
        runTest("testData/dataFlowValueRendering/smartCast.kt");
    }

    @TestMetadata("smartNotNull.kt")
    public void testSmartNotNull() throws Exception {
        runTest("testData/dataFlowValueRendering/smartNotNull.kt");
    }
}