text:
import sys
import os
import numpy as np

from basic.constant import ROOT_PATH
from basic.common import readRankingResults,writeRankingResults,checkToSkip
from basic.annotationtable import readConcepts
from basic.util import readImageScoreTable

def process(options, collection, annotationName, runfile, newRunName):
    rootpath = options.rootpath
    overwrite = options.overwrite

    dataset = options.testset if options.testset else collection

    concepts = readConcepts(collection, annotationName, rootpath)
    simdir = os.path.join(rootpath, collection, "SimilarityIndex", dataset)

    data = [x.strip() for x in open(runfile).readlines() if x.strip() and not x.strip().startswith("#")]
    models = []
    for line in data:
        weight,run = str.split(line)
        models.append((run, float(weight), 1))

    for concept in concepts:
        resultfile = os.path.join(simdir, newRunName, concept + ".txt")
        if checkToSkip(resultfile, overwrite):
            continue

        scorefile = os.path.join(simdir, models[0][0], concept + ".txt")
        if not os.path.exists(scorefile):
            print ("%s does not exist. skip" % scorefile)
            continue

        ranklist = readRankingResults(scorefile)
        names = sorted([x[0] for x in ranklist])

        nr_of_images = len(names)
        name2index = dict(zip(names, range(nr_of_images)))

        print ('%s %d' % (concept, nr_of_images))

        scoreTable = readImageScoreTable(concept, name2index, simdir, models, torank=options.torank)
        assert(scoreTable.shape[1] == nr_of_images)

        weights = [model[1] for model in models]

        scores = np.matrix(weights) * scoreTable
        scores = [float(scores[0,k]) for k in range(nr_of_images)]

        newranklist = [(names[i], scores[i]) for i in range(nr_of_images)]
        newranklist.sort(key=lambda v:(v[1],v[0]), reverse=True)

        writeRankingResults(newranklist, resultfile)

def main(argv=None):
    if argv is None:
        argv = sys.argv[1:]

    from optparse import OptionParser
    parser = OptionParser(usage="""usage: %prog [options] collection annotationName runfile newRunName""")
    parser.add_option("--overwrite", default=0, type="int", help="overwrite existing file (default: 0)")
    parser.add_option("--rootpath", default=ROOT_PATH, type="string", help="rootpath (default: %s)" % ROOT_PATH)
    parser.add_option("--testset", default=None, type="string", help="subset to process. Default is None")
    parser.add_option("--torank", default=1, type=int, help="rank-based score normalization (default: 1)")

    (options, args) = parser.parse_args(argv)
    if len(args) < 4:
        parser.print_help()
        return 1

    return process(options, args[0], args[1], args[2], args[3])

if __name__ == "__main__":
    sys.exit(main())


text:
ALTER TABLE ${ohdsiSchema}.source ADD COLUMN username VARCHAR(255);
ALTER TABLE ${ohdsiSchema}.source ADD COLUMN password VARCHAR(255);

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Author likang01(com@baidu.com)

#ifndef  TERA_BENCHMARK_MARK_H_
#define  TERA_BENCHMARK_MARK_H_

#include <pthread.h>
#include <iostream>
#include <map>
#include <string>
#include <vector>

#include <gflags/gflags.h>
#include <glog/logging.h>

#include "common/mutex.h"
#include "tera.h"
#include "utils/counter.h"

DECLARE_int64(pend_size);
DECLARE_int64(pend_count);
DECLARE_int64(max_outflow);
DECLARE_int64(max_rate);
DECLARE_int64(batch_count);

enum MODE {
    WRITE = 1,
    READ = 2,
    SCAN = 3,
    MIX = 4,
    DELETE = 5
};
extern int mode;

enum TYPE {
    SYNC = 1,
    ASYNC = 2
};
extern int type;

enum OP {
    NONE= 0,
    PUT = 1,
    GET = 2,
    SCN = 3,
    DEL = 4
};

int64_t Now();

class Marker {
public:
    Marker(uint32_t max_latency)
        : latency_limit_(max_latency),
          operation_count_(0),
          total_latency_(0),
          min_latency_(0) {
        latency_vector_ = new uint64_t[max_latency + 1];
        memset(latency_vector_, 0, (max_latency + 1) * sizeof(uint64_t));
        for (int i = 0; i < 11; i++) {
            m_ten_percentile_latency[i] = 0;
            m_ten_percentile_latency_count_sum[i] = 0;
        }
    }

    ~Marker() {
        delete[] latency_vector_;
    }

    void AddLatency(uint32_t latency) {
        if (latency > latency_limit_) {
            latency = latency_limit_;
        }
        MutexLock lock(&mutex_);
        latency_vector_[latency]++;
        operation_count_++;
        total_latency_ += latency;
        if (operation_count_ == 1) {
            min_latency_ = latency;
        }
        if (min_latency_ > latency) {
            min_latency_ = latency;
        }
        for (int i = 1; i < 11; i++) {
            if (m_ten_percentile_latency[i] < latency) {
                MoveTenPercentileLatencyRight(i);
            } else if (m_ten_percentile_latency[i] > latency) {
                m_ten_percentile_latency_count_sum[i]++;
                MoveTenPercentileLatencyLeft(i);
            }
        }
    }

    uint32_t MinLatency() {
        return PercentileLatency(0);
    }

    uint32_t MaxLatency() {
        return PercentileLatency(100);
    }

    double AverageLatency() {
        if (operation_count_ == 0) {
            return 0;
        }
        MutexLock lock(&mutex_);
        return (double)total_latency_ / operation_count_;
    }

    uint32_t PercentileLatency(uint32_t percentile) {
        MutexLock lock(&mutex_);
        if (percentile > 100) {
            percentile = 100;
        }
        if (percentile == 0) {
            return min_latency_;
        }
        if (percentile % 10 == 0) {
            return m_ten_percentile_latency[percentile / 10];
        }
        return NormalPercentileLatency(percentile);
    }

private:
    uint32_t NormalPercentileLatency(uint32_t percentile) {
        uint64_t percentile_operation_count = percentile * operation_count_ / 100;
        int ten_percentile = percentile / 10 + 1;
        uint32_t latency = m_ten_percentile_latency[ten_percentile];
        if (percentile_operation_count == 0) {
            return latency;
        }
        uint64_t count_sum = m_ten_percentile_latency_count_sum[ten_percentile];
        while (count_sum >= percentile_operation_count) {
            latency--;
            while (latency_vector_[latency] == 0) {
                latency--;
            }
            count_sum -= latency_vector_[latency];
        }
        return latency;
    }

    void MoveTenPercentileLatencyRight(int ten_percentile) {
        uint64_t percentile_operation_count = ten_percentile * operation_count_ / 10;
        uint32_t latency = m_ten_percentile_latency[ten_percentile];
        while (m_ten_percentile_latency_count_sum[ten_percentile]
               + latency_vector_[latency]
               < percentile_operation_count) {
            m_ten_percentile_latency_count_sum[ten_percentile] += latency_vector_[latency];
            latency++;
            while (latency_vector_[latency] == 0) {
                latency++;
            }
        }
        m_ten_percentile_latency[ten_percentile] = latency;
    }

    void MoveTenPercentileLatencyLeft(int ten_percentile) {
        uint64_t percentile_operation_count = ten_percentile * operation_count_ / 10;
        if (percentile_operation_count == 0) {
            return;
        }
        uint32_t latency = m_ten_percentile_latency[ten_percentile];
        while (m_ten_percentile_latency_count_sum[ten_percentile]
               >= percentile_operation_count) {
            latency--;
            while (latency_vector_[latency] == 0) {
                latency--;
            }
            m_ten_percentile_latency_count_sum[ten_percentile] -= latency_vector_[latency];
        }
        m_ten_percentile_latency[ten_percentile] = latency;
    }

private:
    const uint32_t latency_limit_;

    uint64_t operation_count_;
    uint64_t total_latency_;
    uint32_t min_latency_;
    uint64_t* latency_vector_;

    uint32_t m_ten_percentile_latency[11]; // 0, 10, 20, ..., 90, 100
    uint64_t m_ten_percentile_latency_count_sum[11];

    mutable Mutex mutex_;
};

class Statistic {
public:
    Statistic(int opt)
        : opt_(opt),
          last_send_size_(0),
          last_send_time_(0),
          last_total_count_(0),
          last_total_size_(0),
          last_finish_count_(0),
          last_finish_size_(0),
          last_success_count_(0),
          last_success_size_(0),
          finish_marker_(1000000),
          success_marker_(1000000) {}

    int GetOpt() {
        return opt_;
    }

    void GetStatistic(int64_t* total_count, int64_t* total_size,
                      int64_t* finish_count, int64_t* finish_size,
                      int64_t* success_count, int64_t* success_size) {
        *total_count = last_total_count_ = total_count_.Get();
        *total_size = last_total_size_ = total_size_.Get();
        *finish_count = last_finish_count_ = finish_count_.Get();
        *finish_size = last_finish_size_ = finish_size_.Get();
        *success_count = last_success_count_ = success_count_.Get();
        *success_size = last_success_size_ = success_size_.Get();
    }

    void GetLastStatistic(int64_t* total_count, int64_t* total_size,
                          int64_t* finish_count, int64_t* finish_size,
                          int64_t* success_count, int64_t* success_size) {
        *total_count = last_total_count_;
        *total_size = last_total_size_;
        *finish_count = last_finish_count_;
        *finish_size = last_finish_size_;
        *success_count = last_success_count_;
        *success_size = last_success_size_;
    }

    Marker* GetFinishMarker() {
        return &finish_marker_;
    }

    Marker* GetSuccessMarker() {
        return &success_marker_;
    }

    void OnReceive(size_t size) {
        last_send_time_ = Now();
        last_send_size_ = size;
        total_count_.Inc();
        total_size_.Add(size);
    }

    void OnFinish(size_t size, uint32_t latency) {
        finish_count_.Inc();
        finish_size_.Add(size);
        finish_marker_.AddLatency(latency);
    }

    void OnSuccess(size_t size, uint32_t latency) {
        success_count_.Inc();
        success_size_.Add(size);
        success_marker_.AddLatency(latency);
    }

    void CheckPending() {
        int64_t max_pend_count = FLAGS_pend_count;
        int64_t max_pend_size = FLAGS_pend_size << 20;
        while (total_count_.Get() - finish_count_.Get() > max_pend_count) {
            usleep(1000);
        }
        while (total_size_.Get() - finish_size_.Get() > max_pend_size) {
            usleep(1000);
        }
    }

    void CheckLimit() {
        int64_t max_outflow = FLAGS_max_outflow << 20;
        int64_t max_rate = FLAGS_max_rate;
        if (max_outflow > 0) {
            int64_t sleep_micros =
                (int64_t)(last_send_time_ +
                        (double)last_send_size_ * 1000000.0 / max_outflow - Now());
            if (sleep_micros > 0) {
                usleep(sleep_micros);
            }
        }
        if (max_rate > 0) {
            int64_t sleep_micros =
                (int64_t)(last_send_time_ + (double)1000000.0 / max_rate - Now());
            if (sleep_micros > 0) {
                usleep(sleep_micros);
            }
        }
    }

private:
    int opt_;

    tera::Counter total_count_;
    tera::Counter total_size_;
    tera::Counter finish_count_;
    tera::Counter finish_size_;
    tera::Counter success_count_;
    tera::Counter success_size_;

    size_t last_send_size_;
    int64_t last_send_time_;

    int64_t last_total_count_;
    int64_t last_total_size_;
    int64_t last_finish_count_;
    int64_t last_finish_size_;
    int64_t last_success_count_;
    int64_t last_success_size_;

    Marker finish_marker_;
    Marker success_marker_;
};

class Adapter {
public:
    Adapter(tera::Table* table);
    ~Adapter();

    void Write(const std::string& row,
               std::map<std::string, std::set<std::string> >& column,
               uint64_t timestamp,
               std::string& value);
    void CommitSyncWrite();
    void WriteCallback(tera::RowMutation* row_mu,
                       size_t req_size,
                       int64_t req_time);

    void Read(const std::string& row,
              const std::map<std::string, std::set<std::string> >& column,
              uint64_t largest_ts, uint64_t smallest_ts);
    void CommitSyncRead();
    void ReadCallback(tera::RowReader* reader,
                      size_t req_size,
                      int64_t req_time);

    void Delete(const std::string& row,
               std::map<std::string, std::set<std::string> >& column,
               uint64_t ts);

    void Scan(const std::string& start_key,
              const std::string& end_key,
              const std::vector<std::string>& cf_list,
              bool print = false, bool is_async =  false);

    void WaitComplete();

    Statistic* GetWriteMarker() {
        return &write_marker_;
    }

    Statistic* GetReadMarker() {
        return &read_marker_;
    }

    Statistic* GetScanMarker() {
        return &scan_marker_;
    }

private:
    tera::Counter pending_num_;
    pthread_mutex_t mutex_;
    pthread_cond_t cond_;
    tera::Table* table_;

    Statistic write_marker_;
    Statistic read_marker_;
    Statistic scan_marker_;

    std::vector<tera::RowMutation*> sync_mutations_;
    std::vector<tera::RowReader*> sync_readers_;
    std::vector<size_t> sync_req_sizes_;
};

void add_checksum(const std::string& rowkey, const std::string& family,
                  const std::string& qualifier, std::string* value);
void remove_checksum(std::string* value);
bool verify_checksum(const std::string& rowkey, const std::string& family,
                     const std::string& qualifier, const std::string& value);

/*
void add_md5sum(const std::string& rowkey, const std::string& family,
                const std::string& qualifier, std::string* value);
bool verify_md5sum(const std::string& rowkey, const std::string& family,
                   const std::string& qualifier, const std::string& value);
void remove_md5sum(std::string* value);
*/

#endif  // TERA_BENCHMARK_MARK_H_


text:
#pragma once
#include <aws/application-insights/ApplicationInsights_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace ApplicationInsights
{
namespace Model
{
  enum class Tier
  {
    NOT_SET,
    CUSTOM,
    DEFAULT,
    DOT_NET_CORE,
    DOT_NET_WORKER,
    DOT_NET_WEB_TIER,
    DOT_NET_WEB,
    SQL_SERVER,
    SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP,
    MYSQL,
    POSTGRESQL,
    JAVA_JMX,
    ORACLE
  };

namespace TierMapper
{
AWS_APPLICATIONINSIGHTS_API Tier GetTierForName(const Aws::String& name);

AWS_APPLICATIONINSIGHTS_API Aws::String GetNameForTier(Tier value);
} // namespace TierMapper
} // namespace Model
} // namespace ApplicationInsights
} // namespace Aws


text:
using System;

namespace CodeUtopia.ReadStore
{
    public class Aggregate
    {
        public Guid AggregateId { get; set; }

        public int AggregateVersionNumber { get; set; }
    }
}


text:
layout: docs
title: 'Get started with Dexie in Angular'
---
{% raw %}

  +

# 1. Create an Angular project

Here we refer to Angular's own [Getting Started](https://angular.io/start) page.

# 2. Install dexie

```
npm install dexie
```

# 3. Create a file `db.ts`

Applications typically have one single Dexie instance declared as its own module. This is where you declare which tables you need and how each table shall be indexed. A Dexie instance is a singleton throughout the application - you do not need to create it on demand. Export the resulting `db` instance from your module so that you can use it from your services to write or query data.

To make the best Typescript experience with Dexie.js, table properties (such as `db.todoLists` and `db.todoItems`) needs to be explicitely declared on a subclass of Dexie just to help out with the typings for your db instance, its tables and entity models.

```ts
// db.ts
import Dexie, { Table } from 'dexie';

export interface TodoList {
  id?: number;
  title: string;
}
export interface TodoItem {
  id?: number;
  todoListId: number;
  title: string;
  done?: boolean;
}

export class AppDB extends Dexie {
  todoItems!: Table<TodoItem, number>;
  todoLists!: Table<TodoList, number>;

  constructor() {
    super('ngdexieliveQuery');
    this.version(3).stores({
      todoLists: '++id',
      todoItems: '++id, todoListId',
    });
    this.on('populate', () => this.populate());
  }

  async populate() {
    const todoListId = await db.todoLists.add({
      title: 'To Do Today',
    });
    await db.todoItems.bulkAdd([
      {
        todoListId,
        title: 'Feed the birds',
      },
      {
        todoListId,
        title: 'Watch a movie',
      },
      {
        todoListId,
        title: 'Have some sleep',
      },
    ]);
  }
}

export const db = new AppDB();

```

# 4. Turn App into an Offline ToDo app

In this sample we will use two components that builds up our ToDo application. For simplicity, we are letting our components talk directly to the db here. In a real application you might prefer to put the database action and queries via services.

```ts
// app.component.ts
import { Component, VERSION } from '@angular/core';
import { liveQuery } from 'dexie';
import { db, TodoList } from '../db';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent {
  todoLists$ = liveQuery(() => db.todoLists.toArray());
  listName = 'My new list';

  async addNewList() {
    await db.todoLists.add({
      title: this.listName,
    });
  }

  identifyList(index: number, list: TodoList) {
    return `${list.id}${list.title}`;
  }
}
```

```html
<!-- app.component.html -->
<h1>A very simple liveQuery() example</h1>

<div *ngFor="let todoList of todoLists$ | async; trackBy: identifyList">
  <itemlist [todoList]="todoList"></itemlist>
</div>
<label>
  Add new list:
  <input
    autocomplete="off"
    type="text"
    id="name"
    #name
    [(ngModel)]="listName"
  />
</label>
<button type="submit" (click)="addNewList()">Add new list</button>

```

# 5. Add the ItemList component

```ts
// itemlist.component.ts
import { Component, ElementRef, Input, ViewChild } from '@angular/core';
import { liveQuery } from 'dexie';
import { db, Item, TodoItem, TodoList } from '../db';

@Component({
  selector: 'itemlist',
  templateUrl: './itemlist.component.html',
  styleUrls: ['./itemlist.component.css'],
})
export class ItemListComponent {
  @Input() todoList: TodoList;
  // Observe an arbritary query:
  todoItems$ = liveQuery(
    () => this.listTodoItems()
  );

  async listTodoItems() {
    return await db.todoItems
      .where({
        todoListId: this.todoList.id,
      })
      .toArray();
  }

  async addItem() {
    await db.todoItems.add({
      title: this.itemName,
      todoListId: this.todoList.id,
    });
  }

  itemName = 'My new item';
}
```

```html
<!-- itemlist.component.html -->
<h3>{{ todoList.title }}</h3>

<!--
    Adding item form
-->
<label>
  Add item:
  <input
    autocomplete="off"
    type="text"
    id="name"
    #name
    [(ngModel)]="itemName"
  />
</label>
<button type="submit" (click)="addItem()">Add ToDo</button>

<!--

    Rendering todoItems$

-->
<ul>
  <li *ngFor="let item of todoItems$ | async">
    {{ item.title }}
  </li>
</ul>

```

# 6. Put it together

```ts
// app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';

import { AppComponent } from './app.component';
import { ItemListComponent } from './itemlist.component';

@NgModule({
  imports: [BrowserModule, FormsModule],
  declarations: [AppComponent, ItemListComponent],
  bootstrap: [AppComponent],
})
export class AppModule {}
```

[Click here to see this component live](https://angular-ivy-4666q1.stackblitz.io)

[Click here to play around in the source](https://stackblitz.com/edit/angular-ivy-4666q1?file=src%2Fapp%2Fapp.module.ts)

{% endraw %}


text:
<?php

/**
 * @category   Zend
 * @package    Zend_Service_WindowsAzure_CommandLine
 * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Scaffolder
	extends Zend_Service_WindowsAzure_CommandLine_PackageScaffolder_PackageScaffolderAbstract
{
	/**
	 * Invokes the scaffolder.
	 *
	 * @param Phar $phar Phar archive containing the current scaffolder.
	 * @param string $root Path Root path.
	 * @param array $options Options array (key/value).
	 */
	public function invoke(Phar $phar, $rootPath, $options = array())
	{
		// Check required parameters
		if (empty($options['DiagnosticsConnectionString'])) {
			// require_once 'Zend/Service/Console/Exception.php';
			throw new Zend_Service_Console_Exception('Missing argument for scaffolder: DiagnosticsConnectionString');
		}

		// Extract to disk
		$this->log('Extracting resources...');
		$this->createDirectory($rootPath);
		$this->extractResources($phar, $rootPath);
		$this->log('Extracted resources.');

		// Apply transforms
		$this->log('Applying transforms...');
		$this->applyTransforms($rootPath, $options);
		$this->log('Applied transforms.');

		// Show "to do" message
		$contentRoot = realpath($rootPath . '/PhpOnAzure.Web');
		echo "\r\n";
		echo "Note: before packaging your application, please copy your application code to $contentRoot";
	}
}


text:
package ioke.lang.test;

/**
 *
 * @author Ola Bini
 */
public interface SimpleDoubleInterface {
	public double doSomething();
}// SimpleDoubleInterface


text:
import os, shutil
import yamlParser

def site(project_name, wahji_dir):
    site_dir = wahji_dir + "/" + project_name

    # Create the new site directory
    os.mkdir(project_name)
    os.chdir(project_name)

    # Copy the default site settings file into the new site dir
    shutil.copyfile(wahji_dir + "/wahji.yml",site_dir + "/wahji.yml")

    # Copy the default content from the Wahji installation dir to the new site dir
    shutil.copytree(wahji_dir + "/content", site_dir + "/content")

    # Now that we have a site-specific wahji.yml settings file, read it!
    site_settings = yamlParser.yamlParse(site_dir)

    print "Site settings:"
    print site_settings

    # Copy the default theme from the Wahji installation dir to the new site dir
    shutil.copytree(wahji_dir + "/themes/" + site_settings["theme"], site_dir + "/themes")


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.buzzrobotics.commands;

/**
 *
 * @author buzz5
 */
public class BridgeArm_Set extends CommandBase {
     public double M_setpoint;
     public BridgeArm_Set(double setpoint) {

       M_setpoint = setpoint;
    }

    // Called just before this Command runs the first time
    protected void initialize() {
        bridgearm.disable();
       // setTimeout(2);
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        bridgearm.setSetpoint(M_setpoint);
        bridgearm.enable();

    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
//        if (isTimedOut()){
//            return true;
//        }else{
//            return false;
//        }
        if (bridgearm.getPosition() + 0.1 >= bridgearm.getSetpoint() && bridgearm.getPosition() - 0.1 <= bridgearm.getSetpoint()){
            return true;
        }else{
            return false;
        }
    }

    // Called once after isFinished returns true
    protected void end() {
        bridgearm.disable();
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
        bridgearm.disable();
    }
}


text:
package org.apache.pulsar.functions.windowing;

import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
import org.apache.pulsar.functions.api.Context;
import org.apache.pulsar.functions.api.Record;

import org.apache.pulsar.common.functions.WindowConfig;
import org.apache.pulsar.functions.api.WindowContext;
import org.mockito.Mockito;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;

/**
 * Unit tests for {@link WindowFunctionExecutor}
 */
@Slf4j
public class WindowFunctionExecutorTest {

    private static class TestWindowFunctionExecutor extends WindowFunctionExecutor<Long, Long> {

        List<Window<Record<Long>>> windows = new ArrayList<>();

        @Override
        public Long process(Window<Record<Long>> inputWindow, WindowContext context) throws Exception {
            windows.add(inputWindow);
            return null;
        }
    }

    private static class TestFunction implements Function<Collection<Long>, Long> {

        @Override
        public Long apply(Collection<Long> longs) {
            return null;
        }
    }

    private static class TestWrongFunction implements Function<Long, Long> {

        @Override
        public Long apply(Long aLong) {
            return null;
        }
    }

    private static class TestTimestampExtractor implements TimestampExtractor<Long> {
        @Override
        public long extractTimestamp(Long input) {
            return input;
        }
    }

    private static class TestWrongTimestampExtractor implements TimestampExtractor<String> {
        @Override
        public long extractTimestamp(String input) {
            return Long.valueOf(input);
        }
    }

    private TestWindowFunctionExecutor testWindowedPulsarFunction;
    private Context context;
    private WindowConfig windowConfig;

    @BeforeMethod
    public void setUp() {
        testWindowedPulsarFunction = new TestWindowFunctionExecutor();
        context = Mockito.mock(Context.class);
        Mockito.doReturn("test-function").when(context).getFunctionName();
        Mockito.doReturn("test-namespace").when(context).getNamespace();
        Mockito.doReturn("test-tenant").when(context).getTenant();

        Record<?> record = Mockito.mock(Record.class);
        Mockito.doReturn(Optional.of("test-topic")).when(record).getTopicName();
        Mockito.doReturn(record).when(context).getCurrentRecord();

        windowConfig = new WindowConfig();
        windowConfig.setTimestampExtractorClassName(TestTimestampExtractor.class.getName());
        windowConfig.setWindowLengthDurationMs(20L);
        windowConfig.setSlidingIntervalDurationMs(10L);
        windowConfig.setMaxLagMs(5L);
        // trigger manually to avoid timing issues
        windowConfig.setWatermarkEmitIntervalMs(100000L);
        windowConfig.setActualWindowFunctionClassName(TestFunction.class.getName());
        Mockito.doReturn(Optional.of(new Gson().fromJson(new Gson().toJson(windowConfig), Map.class))).when(context).getUserConfigValue(WindowConfig.WINDOW_CONFIG_KEY);

        Mockito.doReturn(Collections.singleton("test-source-topic")).when(context).getInputTopics();
        Mockito.doReturn("test-sink-topic").when(context).getOutputTopic();
    }

    @AfterMethod
    public void cleanUp() {
        testWindowedPulsarFunction.shutdown();
    }

    @Test(expectedExceptions = RuntimeException.class)
    public void testExecuteWithWrongWrongTimestampExtractorType() throws Exception {
        WindowConfig windowConfig = new WindowConfig();
        windowConfig.setTimestampExtractorClassName(TestWrongTimestampExtractor.class.getName());
        Mockito.doReturn(Optional.of(new Gson().fromJson(new Gson().toJson(windowConfig), Map.class)))
                .when(context).getUserConfigValue(WindowConfig.WINDOW_CONFIG_KEY);

        testWindowedPulsarFunction.process(10L, context);
    }

    @Test(expectedExceptions = IllegalArgumentException.class)
    public void testExecuteWithWrongJavaWindowFunctionType() throws Exception {
        WindowConfig windowConfig = new WindowConfig();
        windowConfig.setActualWindowFunctionClassName(TestWrongFunction.class.getName());
        Mockito.doReturn(Optional.of(new Gson().fromJson(new Gson().toJson(windowConfig), Map.class)))
                .when(context).getUserConfigValue(WindowConfig.WINDOW_CONFIG_KEY);

        testWindowedPulsarFunction.process(10L, context);
    }

    @Test
    public void testExecuteWithTs() throws Exception {
        long[] timestamps = {603, 605, 607, 618, 626, 636};
        for (long ts : timestamps) {
            Record<?> record = Mockito.mock(Record.class);
            Mockito.doReturn(Optional.of("test-topic")).when(record).getTopicName();
            Mockito.doReturn(record).when(context).getCurrentRecord();
            Mockito.doReturn(ts).when(record).getValue();
            testWindowedPulsarFunction.process(ts, context);
        }
        testWindowedPulsarFunction.waterMarkEventGenerator.run();
        assertEquals(3, testWindowedPulsarFunction.windows.size());
        Window<Record<Long>> first = testWindowedPulsarFunction.windows.get(0);
        assertArrayEquals(
                new long[]{603, 605, 607},
                new long[]{first.get().get(0).getValue(), first.get().get(1).getValue(), first.get().get(2).getValue()});

        Window<Record<Long>> second = testWindowedPulsarFunction.windows.get(1);
        assertArrayEquals(
                new long[]{603, 605, 607, 618},
                new long[]{second.get().get(0).getValue(), second.get().get(1).getValue(), second.get().get(2).getValue(), second.get().get(3).getValue()});

        Window<Record<Long>> third = testWindowedPulsarFunction.windows.get(2);
        assertArrayEquals(new long[]{618, 626}, new long[]{third.get().get(0).getValue(), third.get().get(1).getValue()});
    }

    @Test
    public void testPrepareLateTupleStreamWithoutTs() throws Exception {
        context = Mockito.mock(Context.class);
        Mockito.doReturn("test-function").when(context).getFunctionName();
        Mockito.doReturn("test-namespace").when(context).getNamespace();
        Mockito.doReturn("test-tenant").when(context).getTenant();
        Mockito.doReturn(Collections.singleton("test-source-topic")).when(context).getInputTopics();
        Mockito.doReturn("test-sink-topic").when(context).getOutputTopic();
        WindowConfig windowConfig = new WindowConfig();
        windowConfig.setWindowLengthDurationMs(20L);
        windowConfig.setSlidingIntervalDurationMs(10L);
        windowConfig.setLateDataTopic("$late");
        windowConfig.setMaxLagMs(5L);
        windowConfig.setWatermarkEmitIntervalMs(10L);
        windowConfig.setActualWindowFunctionClassName(TestFunction.class.getName());
        Mockito.doReturn(Optional.of(new Gson().fromJson(new Gson().toJson(windowConfig), Map.class)))
                .when(context).getUserConfigValue(WindowConfig.WINDOW_CONFIG_KEY);

        try {
            testWindowedPulsarFunction.process(10L, context);
            fail();
        } catch (IllegalArgumentException e) {
            assertEquals(e.getMessage(), "Late data topic can be defined only when specifying a "
                    + "timestamp extractor class");
        }
    }

    @Test
    public void testExecuteWithLateTupleStream() throws Exception {

        windowConfig.setLateDataTopic("$late");
        Mockito.doReturn(Optional.of(new Gson().fromJson(new Gson().toJson(windowConfig), Map.class)))
                .when(context).getUserConfigValue(WindowConfig.WINDOW_CONFIG_KEY);

        long[] timestamps = {603, 605, 607, 618, 626, 636, 600};
        List<Long> events = new ArrayList<>(timestamps.length);

        for (long ts : timestamps) {
            events.add(ts);
            Record<?> record = Mockito.mock(Record.class);
            Mockito.doReturn(Optional.of("test-topic")).when(record).getTopicName();
            Mockito.doReturn(record).when(context).getCurrentRecord();
            Mockito.doReturn(ts).when(record).getValue();
            testWindowedPulsarFunction.process(ts, context);

            //Update the watermark to this timestamp
            testWindowedPulsarFunction.waterMarkEventGenerator.run();
        }
        System.out.println(testWindowedPulsarFunction.windows);
        long event = events.get(events.size() - 1);
    }
}


text:
ActiveRecord::Schema.define(:version => 20120223232000) do

  create_table "event_users", :force => true do |t|
    t.integer  "event_id"
    t.integer  "user_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "event_users", ["event_id", "user_id"], :name => "index_event_users_on_event_id_and_user_id"
  add_index "event_users", ["event_id"], :name => "index_event_users_on_event_id"
  add_index "event_users", ["user_id"], :name => "index_event_users_on_user_id"

  create_table "events", :force => true do |t|
    t.integer  "creator_id"
    t.string   "type"
    t.string   "name"
    t.string   "headline"
    t.datetime "start_time"
    t.datetime "end_time"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.float    "rank"
  end

  add_index "events", ["creator_id"], :name => "index_events_on_creator_id"

  create_table "merchant_order_items", :force => true do |t|
    t.integer  "order_id"
    t.string   "name"
    t.integer  "price"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "merchant_orders", :force => true do |t|
    t.integer  "user_id"
    t.integer  "amount"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "users", :force => true do |t|
    t.string   "first_name"
    t.string   "last_name"
    t.date     "birthday"
    t.string   "sex"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "will_filter_filters", :force => true do |t|
    t.string   "type"
    t.string   "name"
    t.text     "data"
    t.integer  "user_id"
    t.string   "model_class_name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "will_filter_filters", ["user_id"], :name => "index_will_filter_filters_on_user_id"

end


text:
<!DOCTYPE html>

    {include file='public/header.html'}

{include file='public/actionbar.html'}

{$story.title}

{$story.cat_name}

    {$story.content}

换
{literal}

{/literal}
{include file='public/footer.html'}


text:
package com.ea.core.facade;

import org.springframework.transaction.annotation.Transactional;

/**
 * Facade类,无事务控制
 *
 * @author yiyongfei
 *
 */
public abstract class AbstractFacade implements IFacade {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	@Transactional(readOnly=true, rollbackFor={Exception.class})
	public Object facade(Object... models) throws Exception {
		return perform(models);
	}

	protected abstract Object perform(Object... models) throws Exception ;
}


text:
/*-------------------------------------------------------------------------*/
/**
   @file    SSL_Font.c
   @author  P. Batty
   @brief   Implements a TTF_Font lading and drawing.

   This module implements a simple font object, a structure containing a
   TTF_Font, which will be used where ever font is needed.
*/
/*--------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------
                                Includes
 ---------------------------------------------------------------------------*/

#include "SSL_window.h"
#include "SSL_Font.h"
#include "../misc/SSL_Logger.h"

#include "SDL2/SDL.h"
#include "SDL2/SDL_ttf.h"

#include <stdlib.h>

/*---------------------------------------------------------------------------
                            Private functions
 ---------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------
                            Function codes
 ---------------------------------------------------------------------------*/

/*!--------------------------------------------------------------------------
   @brief	 Creates a new SSL_Font object.
   @param    file         The path to the font including file name.extention.
   @param    size         The font size.
   @return 	 A pointer to a SDL_Font on successful creation otherwise 0.

   Creates a new SSL_Font object with allocated memory destroy with
   SSL_Font_Destroy.

   If it cannot create the object it will return 0

\-----------------------------------------------------------------------------*/
SSL_Font *SSL_Font_Load(char *file, int size) {

	/* Allocate memory */
	SSL_Font *font = malloc(sizeof(SSL_Font));

	/* return if failed allocation */
	if (!font) {
		SSL_Log_Write("Failed to allocate memory, loading font! ");
		return 0;
	}

	/* load the font */
	font->font = TTF_OpenFont(file, size);

	/* return the font */
	return font;
}

/*!--------------------------------------------------------------------------
  @brief    Draws an SSL_Font object to the window.
  @param    x   		  X position on the window to draw.
  @param    y  		  Y position on the window to draw.
  @param    angle        Angle to draw the image at, 0 - 360.
  @param    flip         Flip state of the image, one of the following:
								:: SDL_FLIP_NONE :: SDL_FLIP_HORIZONTAL :: SDL_FLIP_VERTICAL
  @param	 text		  The text to draw.
  @param    font         The SSL_Font object to draw.
  @param    fontColor    The SDL_Color representing the color of the text.
  @param    window       The SSL_Window object to draw the SSL_Font too.
  @return 	 void

  Draws an SSL_Font to the SSL_Window passed.

------------------------------------------------------------------------------*/
void SSL_Font_Draw(int x, int y, int angle, SDL_RendererFlip flip, char *text, SSL_Font *font, SDL_Color fontColor, SSL_Window *window) {

	/* create the font texture */
	SDL_Surface *textSurface = TTF_RenderText_Solid(font->font, text, fontColor);
	SDL_Texture *textTexture = SDL_CreateTextureFromSurface(window->renderer, textSurface);

	/* check that it's valid */
	if (SDL_QueryTexture(textTexture, NULL, NULL, &textSurface->w, &textSurface->h) != 0) {
		SSL_Log_Write("Failed to create font texture! ");
		return;
	} else {

		/* rectangle to hold the position */
		SDL_Rect offset;
			offset.x = x;
			offset.y = y;
			offset.w = textSurface->w;
			offset.h = textSurface->h;

		/* draw the text */
		SDL_RenderCopyEx( window->renderer, textTexture, NULL, &offset, angle, NULL, flip);
	}

	/* DO NOT REMOVE STOPS MEMORY LEAK */
	SDL_FreeSurface(textSurface);
	SDL_DestroyTexture(textTexture);
}

/*!--------------------------------------------------------------------------
   @brief    Destroys the SSL_Font Object.
   @param    font      The SSL_Font object to destroy.
   @return 	 1 on success else 0.

   Destroys the SSL_Font object.

   If it cannot destroy the object it will return 0.
\-----------------------------------------------------------------------------*/
int SSL_Font_Destroy(SSL_Font *font) {
 free(font->font);
 free(font);

 return 1;
}


text:
set -e

export LC_ALL=C
BASE_DIR=$(pwd)
LIBVPX_SRC_DIR="source/libvpx"
LIBVPX_CONFIG_DIR="source/config"
DISABLE_AVX512="--disable-avx512"
HIGHBD="--enable-vp9-highbitdepth"

# Only disable avx512 if it is an option.
grep -q avx512 source/libvpx/configure || unset DISABLE_AVX512

for i in "$@"; do
  case $i in
    --enable-avx512)
      unset DISABLE_AVX512
      shift
      ;;
    --only-configs)
      ONLY_CONFIGS=true
      shift
      ;;
    --enable-vp9-highbitdepth)
      shift
      ;;
    --disable-vp9-highbitdepth)
      unset HIGHBD
      shift
      ;;
    *)
      echo "Unknown option: $i"
      exit 1
      ;;
  esac
done

# Print license header.
# $1 - Output base name
function write_license() {
  echo "# This file is generated. Do not edit." >> $1
  echo "" >> $1
}

# Search for source files with the same basename in vp8, vp9, and vpx_dsp. The
# build can support such files but only when they are built into disparate
# modules. Configuring such modules for both gyp and gn are tricky so avoid the
# issue at least until gyp is removed.
function find_duplicates() {
  local readonly duplicate_file_names=$(find \
    $BASE_DIR/$LIBVPX_SRC_DIR/vp8 \
    $BASE_DIR/$LIBVPX_SRC_DIR/vp9 \
    $BASE_DIR/$LIBVPX_SRC_DIR/vpx_dsp \
    -type f -name \*.c  | xargs -I {} basename {} | sort | uniq -d \
  )

  if [[ -n "${duplicate_file_names}" ]]; then
    echo "WARNING: DUPLICATE FILES FOUND"
    for file in  ${duplicate_file_names}; do
      find \
        $BASE_DIR/$LIBVPX_SRC_DIR/vp8 \
        $BASE_DIR/$LIBVPX_SRC_DIR/vp9 \
        $BASE_DIR/$LIBVPX_SRC_DIR/vpx_dsp \
        -name $file
    done
    exit 1
  fi
}

# Generate a gni with a list of source files.
# $1 - Array name for file list. This is processed with 'declare' below to
#      regenerate the array locally.
# $2 - GN variable name.
# $3 - Output file.
function write_gni() {
  # Convert the first argument back in to an array.
  declare -a file_list=("${!1}")

  echo "$2 = [" >> "$3"
  for f in $file_list
  do
    echo "  \"//third_party/libvpx/source/libvpx/$f\"," >> "$3"
  done
  echo "]" >> "$3"
}

# Convert a list of source files into gni files.
# $1 - Input file.
function convert_srcs_to_project_files() {
  # Do the following here:
  # 1. Filter .c, .h, .s, .S and .asm files.
  # 2. Move certain files to a separate lists to allow applying different
  #    compiler options.
  # 3. Replace .asm.s to .asm because gn will do the conversion.

  local source_list=$(grep -E '(\.c|\.h|\.S|\.s|\.asm)$' $1)

  # Not sure why vpx_config.c is not included.
  source_list=$(echo "$source_list" | grep -v 'vpx_config\.c')

  # Ignore include files.
  source_list=$(echo "$source_list" | grep -v 'x86_abi_support\.asm')

  # These headers are #included conditionally with #if VPX_ARCH_ARM and
  # similar. However, only the header(s) relevant for the current architecture
  # are present in $1, hence "gn check" will detect them as invalid includes
  # unless explicitly added.
  source_list=$(echo -e "$source_list\\nvpx_ports/arm.h")
  source_list=$(echo -e "$source_list\\nvpx_ports/x86.h")
  source_list=$(echo -e "$source_list\\nvpx_ports/mips.h")
  source_list=$(echo "$source_list" | sort -u)

  # The actual ARM files end in .asm. We have rules to translate them to .S
  source_list=$(echo "$source_list" | sed s/\.asm\.s$/.asm/)

  # Select all x86 files ending with .c
  local intrinsic_list=$(echo "$source_list" \
    | egrep '(mmx|sse2|sse3|ssse3|sse4|avx|avx2|avx512).c$')

  # Select all neon files ending in C but only when building in RTCD mode
  if [[ "libvpx_srcs_arm_neon_cpu_detect" == "$2" ]]; then
    # Select all arm neon files ending in _neon.c and all asm files.
    # The asm files need to be included in the intrinsics target because
    # they need the -mfpu=neon flag.
    # the pattern may need to be updated if vpx_scale gets intrinsics
    local intrinsic_list=$(echo "$source_list" \
      | egrep 'neon.*(\.c|\.asm)$')
  fi

  # Remove these files from the main list.
  source_list=$(comm -23 <(echo "$source_list") <(echo "$intrinsic_list"))

  local x86_list=$(echo "$source_list" | egrep '/x86/')

  # Write a single .gni file that includes all source files for all archs.
  if [[ ${#x86_list} -ne 0 ]]; then
    local c_sources=$(echo "$source_list" | egrep '\.c$')
    local c_headers=$(echo "$source_list" | egrep '\.h$')
    local assembly_sources=$(echo "$source_list" | egrep '\.asm$')
    local mmx_sources=$(echo "$intrinsic_list" | grep '_mmx\.c$')
    local sse2_sources=$(echo "$intrinsic_list" | grep '_sse2\.c$')
    local sse3_sources=$(echo "$intrinsic_list" | grep '_sse3\.c$')
    local ssse3_sources=$(echo "$intrinsic_list" | grep '_ssse3\.c$')
    local sse4_1_sources=$(echo "$intrinsic_list" | grep '_sse4\.c$')
    local avx_sources=$(echo "$intrinsic_list" | grep '_avx\.c$')
    local avx2_sources=$(echo "$intrinsic_list" | grep '_avx2\.c$')
    local avx512_sources=$(echo "$intrinsic_list" | grep '_avx512\.c$')

    write_gni c_sources $2 "$BASE_DIR/libvpx_srcs.gni"
    write_gni c_headers $2_headers "$BASE_DIR/libvpx_srcs.gni"
    write_gni assembly_sources $2_assembly "$BASE_DIR/libvpx_srcs.gni"
    write_gni mmx_sources $2_mmx "$BASE_DIR/libvpx_srcs.gni"
    write_gni sse2_sources $2_sse2 "$BASE_DIR/libvpx_srcs.gni"
    write_gni sse3_sources $2_sse3 "$BASE_DIR/libvpx_srcs.gni"
    write_gni ssse3_sources $2_ssse3 "$BASE_DIR/libvpx_srcs.gni"
    write_gni sse4_1_sources $2_sse4_1 "$BASE_DIR/libvpx_srcs.gni"
    write_gni avx_sources $2_avx "$BASE_DIR/libvpx_srcs.gni"
    write_gni avx2_sources $2_avx2 "$BASE_DIR/libvpx_srcs.gni"
    write_gni avx512_sources $2_avx512 "$BASE_DIR/libvpx_srcs.gni"
  else
    local c_sources=$(echo "$source_list" | egrep '\.c$')
    local c_headers=$(echo "$source_list" | egrep '\.h$')
    local assembly_sources=$(echo -e "$source_list\n$intrinsic_list" \
      | egrep '\.asm$')
    local neon_sources=$(echo "$intrinsic_list" | grep '_neon\.c$')
    write_gni c_sources $2 "$BASE_DIR/libvpx_srcs.gni"
    write_gni c_headers $2_headers "$BASE_DIR/libvpx_srcs.gni"
    write_gni assembly_sources $2_assembly "$BASE_DIR/libvpx_srcs.gni"
    if [[ ${#neon_sources} -ne 0 ]]; then
      write_gni neon_sources $2_neon "$BASE_DIR/libvpx_srcs.gni"
    fi
  fi
}

# Clean files from previous make.
function make_clean() {
  make clean > /dev/null
  rm -f libvpx_srcs.txt
}

# Lint a pair of vpx_config.h and vpx_config.asm to make sure they match.
# $1 - Header file directory.
function lint_config() {
  # mips and native client do not contain any assembly so the headers do not
  # need to be compared to the asm.
  if [[ "$1" != *mipsel && "$1" != *mips64el && "$1" != nacl ]]; then
    $BASE_DIR/lint_config.sh \
      -h $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \
      -a $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.asm
  fi
}

# Print the configuration.
# $1 - Header file directory.
function print_config() {
  $BASE_DIR/lint_config.sh -p \
    -h $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \
    -a $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.asm
}

# Print the configuration from Header file.
# This function is an abridged version of print_config which does not use
# lint_config and it does not require existence of vpx_config.asm.
# $1 - Header file directory.
function print_config_basic() {
  combined_config="$(cat $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \
                   | grep -E ' +[01] *$')"
  combined_config="$(echo "$combined_config" | grep -v DO1STROUNDING)"
  combined_config="$(echo "$combined_config" | sed 's/[ \t]//g')"
  combined_config="$(echo "$combined_config" | sed 's/.*define//')"
  combined_config="$(echo "$combined_config" | sed 's/0$/=no/')"
  combined_config="$(echo "$combined_config" | sed 's/1$/=yes/')"
  echo "$combined_config" | sort | uniq
}

# Generate *_rtcd.h files.
# $1 - Header file directory.
# $2 - Architecture.
# $3 - Optional - any additional arguments to pass through.
function gen_rtcd_header() {
  echo "Generate $LIBVPX_CONFIG_DIR/$1/*_rtcd.h files."
  format="clang-format -i -style=Chromium"

  rm -rf $BASE_DIR/$TEMP_DIR/libvpx.config
  if [[ "$2" == "mipsel" || "$2" == "mips64el" || "$2" == nacl ]]; then
    print_config_basic $1 > $BASE_DIR/$TEMP_DIR/libvpx.config
  else
    $BASE_DIR/lint_config.sh -p \
      -h $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \
      -a $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.asm \
      -o $BASE_DIR/$TEMP_DIR/libvpx.config
  fi

  $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \
    --arch=$2 \
    --sym=vp8_rtcd $DISABLE_AVX512 $3 \
    --config=$BASE_DIR/$TEMP_DIR/libvpx.config \
    $BASE_DIR/$LIBVPX_SRC_DIR/vp8/common/rtcd_defs.pl \
    > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vp8_rtcd.h

  ${format} $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vp8_rtcd.h

  $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \
    --arch=$2 \
    --sym=vp9_rtcd $DISABLE_AVX512 $3 \
    --config=$BASE_DIR/$TEMP_DIR/libvpx.config \
    $BASE_DIR/$LIBVPX_SRC_DIR/vp9/common/vp9_rtcd_defs.pl \
    > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vp9_rtcd.h

  ${format} $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vp9_rtcd.h

  $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \
    --arch=$2 \
    --sym=vpx_scale_rtcd $DISABLE_AVX512 $3 \
    --config=$BASE_DIR/$TEMP_DIR/libvpx.config \
    $BASE_DIR/$LIBVPX_SRC_DIR/vpx_scale/vpx_scale_rtcd.pl \
    > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_scale_rtcd.h

  ${format} $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_scale_rtcd.h

  $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \
    --arch=$2 \
    --sym=vpx_dsp_rtcd $DISABLE_AVX512 $3 \
    --config=$BASE_DIR/$TEMP_DIR/libvpx.config \
    $BASE_DIR/$LIBVPX_SRC_DIR/vpx_dsp/vpx_dsp_rtcd_defs.pl \
    > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_dsp_rtcd.h

  ${format} $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_dsp_rtcd.h

  rm -rf $BASE_DIR/$TEMP_DIR/libvpx.config
}

# Generate Config files. "--enable-external-build" must be set to skip
# detection of capabilities on specific targets.
# $1 - Header file directory.
# $2 - Config command line.
function gen_config_files() {
  ./configure $2 > /dev/null

  # Disable HAVE_UNISTD_H as it causes vp8 to try to detect how many cpus
  # available, which doesn't work from inside a sandbox on linux.
  sed -i.bak -e 's/\(HAVE_UNISTD_H[[:space:]]*\)1/\10/' vpx_config.h
  # Maintain old ARCH_ defines to avoid build errors because assembly file
  # dependencies are incorrect.
  sed -i.bak -e 's/\(#define \)VPX_\(ARCH_[_0-9A-Z]\+ [01]\)/&\n\1\2/' \
    vpx_config.h

  rm vpx_config.h.bak

  # Use the correct ads2gas script.
  if [[ "$1" == linux* ]]; then
    local ASM_CONV=ads2gas.pl
  else
    local ASM_CONV=ads2gas_apple.pl
  fi

  # Generate vpx_config.asm. Do not create one for mips or native client.
  if [[ "$1" != *mipsel && "$1" != *mips64el && "$1" != nacl ]]; then
    if [[ "$1" == *x64* ]] || [[ "$1" == *ia32* ]]; then
      egrep "#define [A-Z0-9_]+ [01]" vpx_config.h \
        | awk '{print "%define " $2 " " $3}' > vpx_config.asm
    else
      egrep "#define [A-Z0-9_]+ [01]" vpx_config.h \
        | awk '{print $2 " EQU " $3}' \
        | perl $BASE_DIR/$LIBVPX_SRC_DIR/build/make/$ASM_CONV > vpx_config.asm
    fi
  fi

  mkdir -p $BASE_DIR/$LIBVPX_CONFIG_DIR/$1
  cp vpx_config.* $BASE_DIR/$LIBVPX_CONFIG_DIR/$1
  make_clean
  rm -rf vpx_config.*
}

function update_readme() {
  local IFS=$'\n'
  # Split git log output '<date>\n<commit hash>' on the newline to produce 2
  # array entries.
  local vals=($(git --no-pager log -1 --format="%cd%n%H" \
    --date=format:"%A %B %d %Y"))
  sed -E -i.bak \
    -e "s/^(Date:)[[:space:]]+.*$/\1 ${vals[0]}/" \
    -e "s/^(Revision:)[[:space:]]+[a-f0-9]{40}/\1 ${vals[1]}/" \
    ${BASE_DIR}/README.chromium
  rm ${BASE_DIR}/README.chromium.bak
  cat <<EOF

README.chromium updated with:
Date: ${vals[0]}
Revision: ${vals[1]}
EOF
}

find_duplicates

echo "Create temporary directory."
TEMP_DIR="$LIBVPX_SRC_DIR.temp"
rm -rf $TEMP_DIR
cp -R $LIBVPX_SRC_DIR $TEMP_DIR
cd $TEMP_DIR

echo "Generate config files."
all_platforms="--enable-external-build"
all_platforms+=" --enable-postproc"
all_platforms+=" --enable-multi-res-encoding"
all_platforms+=" --enable-temporal-denoising"
all_platforms+=" --enable-vp9-temporal-denoising"
all_platforms+=" --enable-vp9-postproc"
all_platforms+=" --size-limit=16384x16384"
all_platforms+=" --enable-realtime-only"
all_platforms+=" --disable-install-docs"
all_platforms+=" --disable-libyuv"
x86_platforms="--enable-pic --as=yasm $DISABLE_AVX512 $HIGHBD"
gen_config_files linux/ia32 \
  "--target=x86-linux-gcc ${all_platforms} ${x86_platforms}"
gen_config_files linux/x64 \
  "--target=x86_64-linux-gcc ${all_platforms} ${x86_platforms}"
gen_config_files linux/arm \
  "--target=armv7-linux-gcc --disable-neon ${all_platforms}"
gen_config_files linux/arm-neon "--target=armv7-linux-gcc ${all_platforms}"
gen_config_files linux/arm-neon-cpu-detect \
  "--target=armv7-linux-gcc --enable-runtime-cpu-detect ${all_platforms}"
gen_config_files linux/arm64 "--target=armv8-linux-gcc ${all_platforms}"
gen_config_files linux/arm-neon-highbd \
  "--target=armv7-linux-gcc ${all_platforms} ${HIGHBD}"
gen_config_files linux/arm64-highbd \
  "--target=armv8-linux-gcc ${all_platforms} ${HIGHBD}"
gen_config_files linux/mipsel "--target=mips32-linux-gcc ${all_platforms}"
gen_config_files linux/mips64el "--target=mips64-linux-gcc ${all_platforms}"
gen_config_files linux/ppc64 "--target=ppc64le-linux-gcc ${all_platforms}"
gen_config_files linux/generic "--target=generic-gnu $HIGHBD ${all_platforms}"
gen_config_files win/arm64 \
  "--target=arm64-win64-vs15 ${all_platforms} ${HIGHBD}"
gen_config_files win/ia32 \
  "--target=x86-win32-vs14 ${all_platforms} ${x86_platforms}"
gen_config_files win/x64 \
  "--target=x86_64-win64-vs14 ${all_platforms} ${x86_platforms}"
gen_config_files mac/ia32 \
  "--target=x86-darwin9-gcc ${all_platforms} ${x86_platforms}"
gen_config_files mac/x64 \
  "--target=x86_64-darwin9-gcc ${all_platforms} ${x86_platforms}"
gen_config_files ios/arm-neon "--target=armv7-linux-gcc ${all_platforms}"
gen_config_files ios/arm64 "--target=armv8-linux-gcc ${all_platforms}"
gen_config_files nacl "--target=generic-gnu $HIGHBD ${all_platforms}"

echo "Remove temporary directory."
cd $BASE_DIR
rm -rf $TEMP_DIR

echo "Lint libvpx configuration."
lint_config linux/ia32
lint_config linux/x64
lint_config linux/arm
lint_config linux/arm-neon
lint_config linux/arm-neon-cpu-detect
lint_config linux/arm64
lint_config linux/arm-neon-highbd
lint_config linux/arm64-highbd
lint_config linux/mipsel
lint_config linux/mips64el
lint_config linux/ppc64
lint_config linux/generic
lint_config win/arm64
lint_config win/ia32
lint_config win/x64
lint_config mac/ia32
lint_config mac/x64
lint_config ios/arm-neon
lint_config ios/arm64
lint_config nacl

echo "Create temporary directory."
TEMP_DIR="$LIBVPX_SRC_DIR.temp"
rm -rf $TEMP_DIR
cp -R $LIBVPX_SRC_DIR $TEMP_DIR
cd $TEMP_DIR

# chromium has required sse2 for x86 since 2014
require_sse2="--require-mmx --require-sse --require-sse2"

gen_rtcd_header linux/ia32 x86 "${require_sse2}"
gen_rtcd_header linux/x64 x86_64
gen_rtcd_header linux/arm armv7 "--disable-neon --disable-neon_asm"
gen_rtcd_header linux/arm-neon armv7
gen_rtcd_header linux/arm-neon-cpu-detect armv7
gen_rtcd_header linux/arm64 armv8
gen_rtcd_header linux/arm-neon-highbd armv7
gen_rtcd_header linux/arm64-highbd armv8
gen_rtcd_header linux/mipsel mipsel
gen_rtcd_header linux/mips64el mips64el
gen_rtcd_header linux/ppc64 ppc
gen_rtcd_header linux/generic generic
gen_rtcd_header win/arm64 armv8
gen_rtcd_header win/ia32 x86 "${require_sse2}"
gen_rtcd_header win/x64 x86_64
gen_rtcd_header mac/ia32 x86 "${require_sse2}"
gen_rtcd_header mac/x64 x86_64
gen_rtcd_header ios/arm-neon armv7
gen_rtcd_header ios/arm64 armv8
gen_rtcd_header nacl nacl

echo "Prepare Makefile."
./configure --target=generic-gnu > /dev/null
make_clean

if [[ -z $ONLY_CONFIGS ]]; then
  # Remove existing .gni file.
  rm -rf $BASE_DIR/libvpx_srcs.gni
  write_license $BASE_DIR/libvpx_srcs.gni

  echo "Generate X86 source list."
  config=$(print_config linux/ia32)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_x86

  # Copy vpx_version.h. The file should be the same for all platforms.
  clang-format -i -style=Chromium vpx_version.h
  cp vpx_version.h $BASE_DIR/$LIBVPX_CONFIG_DIR

  echo "Generate X86_64 source list."
  # Windows needs float_control_word.asm for Windows. This was previously
  # emms_mmx.asm but a refactoring pulled out the cross platform bits. Because
  # of this, use the win/x64 configuration as the reference. The empty asm
  # object should not perturb the other builds.
  config=$(print_config win/x64)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_x86_64

  echo "Generate ARM source list."
  config=$(print_config linux/arm)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_arm

  echo "Generate ARM NEON source list."
  config=$(print_config linux/arm-neon)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_arm_neon

  echo "Generate ARM NEON CPU DETECT source list."
  config=$(print_config linux/arm-neon-cpu-detect)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_arm_neon_cpu_detect

  echo "Generate ARM64 source list."
  config=$(print_config linux/arm64)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_arm64

  echo "Generate ARM NEON HighBD source list."
  config=$(print_config linux/arm-neon-highbd)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_arm_neon_highbd

  echo "Generate ARM64 HighBD source list."
  config=$(print_config linux/arm64-highbd)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_arm64_highbd

  echo "ARM64 Windows and Mac use the ARM64 Linux HighBD source list." \
       "No need to generate it."

  echo "Generate MIPS source list."
  config=$(print_config_basic linux/mipsel)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_mips

  echo "MIPS64 source list is identical to MIPS source list." \
       "No need to generate it."

  echo "Generate ppc64 source list."
  config=$(print_config_basic linux/ppc64)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_ppc64

  echo "Generate NaCl source list."
  config=$(print_config_basic nacl)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_nacl

  echo "Generate GENERIC source list."
  config=$(print_config_basic linux/generic)
  make_clean
  make libvpx_srcs.txt target=libs $config > /dev/null
  convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_generic
fi

echo "Remove temporary directory."
cd $BASE_DIR
rm -rf $TEMP_DIR

gn format --in-place $BASE_DIR/BUILD.gn
gn format --in-place $BASE_DIR/libvpx_srcs.gni

cd $BASE_DIR/$LIBVPX_SRC_DIR
update_readme

cd $BASE_DIR


text:
package oddEven;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class OddRunner
{
	public static void main( String args[] ) throws IOException
	{
		Scanner in = new Scanner(new File("H:\\workspace\\ATCompSci\\somesets\\oddEven\\oddevendata.dat"));

		while(in.hasNextLine()){
			System.out.println(new OddEvenSets(in.nextLine()));
		}
		in.close();
	}
}


text:
module BraintreeRails
  class AddressValidator < Validator
    Validations = [
      [:customer_id, :presence => true, :length => {:maximum => 36}, :on => :create],
      [:first_name, :last_name, :company, :street_address, :extended_address, :locality, :region, :length => {:maximum => 255}],
      [:country_name, :allow_blank => true, :inclusion => { :in => Braintree::Address::CountryNames.map {|country| country[0]}, :message => "%{value} is not allowed" }],
      [:street_address, :presence => true, :if => Proc.new { Configuration.require_street_address }],
      [:postal_code, :presence => true, :format => { :with => /\A[- a-z0-9]+\z/i}, :if => Proc.new { |address| address.errors[:postal_code].blank? && Configuration.require_postal_code }]
    ]
  end
end


text:
import abc
import logging
import six

from pecan import conf as pconf

from managesf.services import exceptions as exc

logger = logging.getLogger(__name__)

@six.add_metaclass(abc.ABCMeta)
class BaseHooksManager(object):
    """Abstract class handling hooks triggered by specific events in the CI
    workflow. These are mainly based on gerrit's own hook events."""
    def __init__(self, plugin):
        self.plugin = plugin

    def patchset_created(self, *args, **kwargs):
        """Called whenever a new patch is submitted. Expected arguments
        based on the gerrit hook with the same name:
        'change', 'is_draft', 'change_url', 'project',
        'branch', 'topic', 'uploader', 'commit', 'patchset',
        'commit_message'
        (The last one will be computed by the local hook script)"""
        raise exc.UnavailableActionError()

    def change_merged(self, *args, **kwargs):
        """Called whenever a new patch is merged into a project's master
        branch. Expected arguments based on the gerrit hook with the same name:
        'change', 'change_url', 'project',
        'branch', 'topic', 'submitter', 'commit', 'commit_message'
        (The last one will be computed by the local hook script)"""
        raise exc.UnavailableActionError()

    def __getattr__(self, hook):
        """Generic behavior for undefined hooks"""
        def _generic_hook(*args, **kwargs):
            msg = "[%s] undefined hook %s" % (self.plugin.service_name,
                                              hook)
            raise exc.UnavailableActionError(msg)
        return _generic_hook

@six.add_metaclass(abc.ABCMeta)
class BaseCRUDManager(object):
    def __init__(self, plugin):
        self.plugin = plugin

    def create(self, *args, **kwargs):
        """Creation operation"""
        raise exc.UnavailableActionError()

    def get(self, *args, **kwargs):
        """Fetching operation"""
        raise exc.UnavailableActionError()

    def update(self, *args, **kwargs):
        """Update operation"""
        raise exc.UnavailableActionError()

    def delete(self, *args, **kwargs):
        """Deletion operation"""
        raise exc.UnavailableActionError()

@six.add_metaclass(abc.ABCMeta)
class ProjectManager(BaseCRUDManager):
    """Abstract class handling CRUD operations on projects in Software
    Factory, if the service has a notion of projects."""

@six.add_metaclass(abc.ABCMeta)
class UserManager(BaseCRUDManager):
    """Abstract class handling CRUD operations on users in Software
    Factory, if the service has a notion of users."""

    # list of fields that cannot be updated. For example, it is not allowed
    # to change the username in gerrit.
    _immutable_fields_ = []

    @classmethod
    def check_forbidden_fields(cls, **kwargs):
        return list(set(cls._immutable_fields_) & set(kwargs.keys()))

    def update(self, uid, *args, **kwargs):
        """Update operation"""
        raise exc.UnavailableActionError()

@six.add_metaclass(abc.ABCMeta)
class GroupManager(BaseCRUDManager):
    """Abstract class handling CRUD operations on groups in Software
    Factory, if the service has a notion of groups."""

    # list of fields that cannot be updated. For example, it is not allowed
    # to change the group name in gerrit.
    _immutable_fields_ = []

    @classmethod
    def check_forbidden_fields(cls, **kwargs):
        return list(set(cls._immutable_fields_) & set(kwargs.keys()))

    def update(self, uid, *args, **kwargs):
        """Update operation"""
        raise exc.UnavailableActionError()

@six.add_metaclass(abc.ABCMeta)
class MembershipManager(BaseCRUDManager):
    """Abstract class handling membership operations between
    users/standalone groups and projects in Software Factory"""

@six.add_metaclass(abc.ABCMeta)
class ReplicationManager(BaseCRUDManager):
    """Abstract class handling replication operations if the service can
    handle them (usually, a repository service)"""
    def get_config(self, **kwargs):
        return self.get(**kwargs)

    def apply_config(self, **kwargs):
        return self.update(**kwargs)

    def trigger(self, **kwargs):
        """Trigger a replication"""
        raise exc.UnavailableActionError()

@six.add_metaclass(abc.ABCMeta)
class RepositoryManager(BaseCRUDManager):
    """Abstract class handling repository creation and other repository
    related operations"""

@six.add_metaclass(abc.ABCMeta)
class CodeReviewManager(BaseCRUDManager):
    """Abstract class handling code reviews operations for a given
    gerrit-like service."""

    def propose_test_definition(self, **kwargs):
        """creates a review adding tests in the zuul pipelines for a project"""
        raise exc.UnavailableActionError()

    def propose_test_scripts(self, **kwargs):
        """creates a review for template tests scripts on a project"""
        raise exc.UnavailableActionError()

@six.add_metaclass(abc.ABCMeta)
class RoleManager(BaseCRUDManager):
    """Abstract class handling roles if the service can handle them"""

    @staticmethod
    def is_admin(user):
        return user == pconf.admin['name']

@six.add_metaclass(abc.ABCMeta)
class JobManager(BaseCRUDManager):
    """Abstract class handling jobs for a "job runner"-type service"""

    def get_job(self, job_name, **kwargs):
        """lists one or several jobs depending on filtering with kwargs"""
        raise exc.UnavailableActionError()

    def get_job_parameters(self, job_name, job_id):
        """get parameters used to run a job"""
        raise exc.UnavailableActionError()

    def get_job_status(self, job_name, job_id):
        """get parameters used to run a job"""
        raise exc.UnavailableActionError()

    def get_job_logs(self, job_name, job_id):
        """get logs of a finished job"""
        raise exc.UnavailableActionError()

    def run(self, job_name, job_parameters):
        """run a job"""
        raise exc.UnavailableActionError()

    def stop(self, job_name, job_id):
        """stop a running job"""
        raise exc.UnavailableActionError()

@six.add_metaclass(abc.ABCMeta)
class NodeManager(BaseCRUDManager):
    """Abstract class handling nodes for an "agent provider"-type service"""

    def get(self, node_id=None, **kwargs):
        """lists one or several nodes depending on filtering with node's
        id or kwargs"""
        raise exc.UnavailableActionError()

    def hold(self, node_id):
        """prevents node node_id from being deleted after a completed job"""
        raise exc.UnavailableActionError()

    def delete(self, node_id):
        """schedules node node_id for deletion"""
        raise exc.UnavailableActionError()

    def add_authorized_key(self, node_id, public_key, user=None):
        """adds public_key as an authorized key on user's account on node_id"""
        raise exc.UnavailableActionError()

@six.add_metaclass(abc.ABCMeta)
class ImageManager(BaseCRUDManager):
    """Abstract class handling image building tasks for an
    "agent provider"-type service"""

    def get(self, provider_name=None, image_name=None, **kwargs):
        """lists one or several images depending on filtering options"""
        raise exc.UnavailableActionError()

    def start_update(self, provider_name, image_name):
        """updates (rebuild) the image image_name on provider provider_name"""
        raise exc.UnavailableActionError()

    def get_update_info(self, id):
        """fetches relevant info on an image update possibly still
        in progress"""
        raise exc.UnavailableActionError()

@six.add_metaclass(abc.ABCMeta)
class BaseServicePlugin(object):
    """Base plugin for a service that can be managed by Software Factory.
    """

    _config_section = "base"
    service_name = "base service"

    def __init__(self, conf):
        self._full_conf = conf
        try:
            self.configure_plugin(conf)
        except AttributeError:
            raise Exception(repr(conf))
        # place holders
        self.project = ProjectManager(self)
        self.user = UserManager(self)
        self.membership = MembershipManager(self)
        self.role = RoleManager(self)
        self.hooks = BaseHooksManager(self)

    def configure_plugin(self, conf):
        try:
            self.conf = getattr(conf, self._config_section, None)
        except KeyError:
            msg = ("The %s service is not available" % self._config_section)
            raise exc.ServiceNotAvailableError(msg)
        if not self.conf:
            msg = ("The %s service is not available" % self._config_section)
            raise exc.ServiceNotAvailableError(msg)

    def get_client(self, cookie=None):
        """returns a service client to be used by the managers."""

@six.add_metaclass(abc.ABCMeta)
class BaseIssueTrackerServicePlugin(BaseServicePlugin):
    """Base plugin for a service managing issues."""

    def get_open_issues(self):
        """Return the open issues on the tracker"""

    def get_active_users(self):
        """Return a list of active users"""

@six.add_metaclass(abc.ABCMeta)
class BaseAgentProviderServicePlugin(BaseServicePlugin):
    """Base plugin for a service used to provide agents on which to run jobs,
    for example Nodepool."""

    def __init__(self, conf):
        super(BaseAgentProviderServicePlugin, self).__init__(conf)
        self.node = NodeManager(self)
        self.image = ImageManager(self)

@six.add_metaclass(abc.ABCMeta)
class BaseJobRunnerServicePlugin(BaseServicePlugin):
    """Base plugin for a service used to execute jobs, for example Jenkins."""

    def __init__(self, conf):
        super(BaseJobRunnerServicePlugin, self).__init__(conf)
        self.job = JobManager(self)

@six.add_metaclass(abc.ABCMeta)
class BaseRepositoryServicePlugin(BaseServicePlugin):
    """Base plugin for a service managing repositories. This adds repository
    replication and repository operations."""

    def __init__(self, conf):
        super(BaseRepositoryServicePlugin, self).__init__(conf)
        self.replication = ReplicationManager(self)
        self.repository = RepositoryManager(self)

@six.add_metaclass(abc.ABCMeta)
class BaseCodeReviewServicePlugin(BaseRepositoryServicePlugin):
    """Base plugin for a service managing code review systems. This adds
    code review operations like submitting a file for review to a project."""

    def __init__(self, conf):
        super(BaseCodeReviewServicePlugin, self).__init__(conf)
        self.review = CodeReviewManager(self)


text:
layout: post
title: Jessa Hogtied BJ
titleinfo: pornvd
desc: Watch Jessa Hogtied BJ. Pornhub is the ultimate xxx porn and sex site.
---

Jessa Hogtied BJ

Watch Jessa Hogtied BJ. Pornhub is the ultimate xxx porn and sex site.


text:
ng-bs-components
================

Some bootstrap components for AngularJS


text:
![BottleJS](/bottle-logo.jpg)
# BottleJS [![Build Status](https://travis-ci.org/young-steveo/bottlejs.svg?branch=master)](https://travis-ci.org/young-steveo/bottlejs)

> A powerful dependency injection micro container

## Introduction

BottleJS is a tiny, powerful dependency injection container.  It features lazy loading, middleware hooks, decorators and a clean api inspired by the [AngularJS Module API](https://docs.angularjs.org/api/ng/type/angular.Module) and the simple PHP library [Pimple](http://pimple.sensiolabs.org/).  You'll like BottleJS if you enjoy:

* building a stack from components rather than a kitchen-sink framework.
* uncoupled objects and dependency injection.
* an API that makes sense.
* lazily loaded objects.
* trying cool stuff :smile:

## Browser Support

BottleJS supports IE9+ and other ECMAScript 5 compliant browsers.

## Installation

BottleJS can be used in a browser or in a nodejs app.  It can be installed via bower or npm:

```bash
$ bower install bottlejs
```

```bash
$ npm install bottlejs
```

## Simple Example

The simplest recipe to get started with is `Bottle#service`.  Say you have a constructor for a service object:

```js
var Beer = function() { /* A beer service, :yum: */ };
```

You can register the constructor with `Bottle#service`:

```js
var bottle = new Bottle();
bottle.service('Beer', Beer);
```

Later, when you need the constructed service, you just access the `Beer` property like this:

```js
bottle.container.Beer;
```

A lot happened behind the scenes:

1. Bottle created a provider containing a factory function when you registered the Beer service.
2. When the `bottle.container.Beer` property was accessed, Bottle looked up the provider and executed the factory to build and return the Beer service.
3. The provider and factory were deleted, and the `bottle.container.Beer` property was set to be the Beer service instance.  Accessing `bottle.container.Beer` in the future becomes a simple property lookup.

## Injecting Dependencies

The above example is simple.  But, what if the Beer service had dependencies?  For example:

```js
var Barley = function() {};
var Hops = function() {};
var Water = function() {};
var Beer = function(barley, hops, water) { /* A beer service, :yum: */ };
```

You can register services with `Bottle#service` and include dependencies like this:

```js
var bottle = new Bottle();
bottle.service('Barley', Barley);
bottle.service('Hops', Hops);
bottle.service('Water', Water);
bottle.service('Beer', Beer, 'Barley', 'Hops', 'Water');
```

Now, when you access `bottle.container.Beer`, Bottle will lazily load all of the dependencies and inject them into your Beer service before returning it.

### Service Factory

If you need more complex logic when generating a service, you can register a factory instead.  A factory function receives the container as an argument, and should return your constructed service:

```js
var bottle = new Bottle();
bottle.service('Barley', Barley);
bottle.service('Hops', Hops);
bottle.service('Water', Water);
bottle.factory('Beer', function(container) {
    var barley = container.Barley;
    var hops = container.Hops;
    var water = container.Water;

    barley.halved();
    hops.doubled();
    water.spring();
    return new Beer(barley, hops, water);
});
```

### Service Provider

This is the meat of the Bottle library.  The above methods `Bottle#service` and `Bottle#factory` are just shorthand for the provider function.  You usually can get by with the simple functions above, but if you really need more granular control of your services in different environments, regiser them as a provider.  To use it, pass a constructor for the provider that exposes a `$get` function.  The `$get` function is used as a factory to build your service.

```js
var bottle = new Bottle();
bottle.service('Barley', Barley);
bottle.service('Hops', Hops);
bottle.service('Water', Water);
bottle.provider('Beer', function() {
    // This environment may not support water.
    // We should polyfill it.
    if (waterNotSupported) {
        Beer.pollyfillWater();
    }

    // this is the service factory.
    this.$get = function(container) {
        var barley = container.Barley;
        var hops = container.Hops;
        var water = container.Water;

        barley.halved();
        hops.doubled();
        water.spring();
        return new Beer(barley, hops, water);
    };
});
```

## Decorators

Bottle supports injecting decorators into the provider pipeline with the `Bottle#decorator` method.  Bottle decorators are just simple functions that intercept a service in the provider phase after it has been created, but before it is accessed for the first time.  The function should return the service, or another object to be used as the service instead.

```js
var bottle = new Bottle();
bottle.service('Beer', Beer);
bottle.service('Wine', Wine);
bottle.decorator(function(service) {
    // this decorator will be run for both Beer and Wine services.
    service.stayCold();
    return service;
});

bottle.decorator('Wine', function(wine) {
    // this decorator will only affect the Wine service.
    wine.unCork();
    return wine;
});
```

## Middleware

Bottle middleware are similar to decorators, but they are executed every time a service is accessed from the container.  They are passed the service instance and a `next` function:

```js
var bottle = new Bottle();
bottle.service('Beer', Beer);
bottle.middleware(function(service, next) {
    // this middleware will be executed for all services
    console.log('A service was accessed!');
    next();
});

bottle.middleware('Beer', function(beer, next) {
    // this middleware will only affect the Beer service.
    console.log('Beer?  Nice.  Tip your bartender...');
    next();
});
```

## Nested Bottles
Bottle will generate nested containers if dot notation is used in the service name.  A sub container will be created for you based on the name given:

```js
var bottle = new Bottle();
var IPA = function() {};
bottle.service('Beer.IPA', IPA);
bottle.container.Beer; // this is a new Bottle.container object
bottle.container.Beer.IPA; // the service
```

## API

### Bottle

#### pop([name])

Used to get an instance of bottle.  If a name is passed, bottle will return the same instance.  Calling the Bottle constructor as a function will call and return return `Bottle.pop`, so `Bottle.pop('Soda') === Bottle('Soda')`

Param                      | Type       | Details
:--------------------------|:-----------|:--------
**name**
*(optional)* | *String*   | The name of the bottle. If passed, bottle will store the instance internally and return the same instance if `Bottle.pop` is subsequently called with the same name.

### Bottle.prototype

#### constant(name, value)

Used to add a read only value to the container.

Param     | Type       | Details
:---------|:-----------|:--------
**name**  | *String*   | The name of the constant.  Must be unique to each Bottle instance.
**value** | *Mixed*    | A value that will be defined as enumerable, but not writable.

#### decorator(name, func)

Used to register a decorator function that the provider will use to modify your services at creation time.

Param                      | Type       | Details
:--------------------------|:-----------|:--------
**name**
*(optional)* | *String*   | The name of the service this decorator will affect. Will run for all services if not passed.
**func**                   | *Function* | A function that will accept the service as the first parameter.  Should return the service, or a new object to be used as the service.

#### defer(func)

Register a function to be executed when `Bottle#resolve` is called.

Param    | Type       | Details
:--------|:-----------|:--------
**func** | *Function* | A function to be called later.  Will be passed a value given to `Bottle#resolve`.

#### digest(services)

Immediately instantiate an array of services and return their instances
in the order of the array of instances.

Param        | Type    | Details
:------------|:--------|:--------
**services** | *Array* | Array of services that should be instantiated.

#### factory(name, Factory)

Used to register a service factory

Param       | Type       | Details
:-----------|:-----------|:--------
**name**    | *String*   | The name of the service.  Must be unique to each Bottle instance.
**Factory** | *Function* | A function that should return the service object.  Will only be called once; the Service will be a singleton.  Gets passed an instance of the container to allow dependency injection when creating the service.

#### middleware(name, func)

Used to register a middleware function.  This function will be executed every time the service is accessed.

Param                      | Type       | Details
:--------------------------|:-----------|:--------
**name**
*(optional)* | *String*   | The name of the service for which this middleware will be called. Will run for all services if not passed.
**func**                   | *Function* | A function that will accept the service as the first parameter, and a `next` function as the second parameter.  Should execute `next()` to allow other middleware in the stack to execute.

#### provider(name, Provider)

Used to register a service provider

Param        | Type       | Details
:------------|:-----------|:--------
**name**     | *String*   | The name of the service.  Must be unique to each Bottle instance.
**Provider** | *Function* | A constructor function that will be instantiated as a singleton.  Should expose a function called `$get` that will be used as a factory to instantiate the service.

#### register(Obj)
#### container.$register(Obj)

Used to register a service, factory, provider, or value based on properties of the Obj.  `bottle.container.$register` is an alias of `bottle.register`; this allows factories and providers to register multiple services on the container without needing access to the bottle instance itself.

Param   | Type       | Details
:-------|:-----------|:--------
**Obj** | *Object*\|*Function* | An object or constructor with one of several properties:

**Obj.$name** — *required* — the name used to register the object

**Obj.$type** — *optional* — the method used to register the object.  Defaults to `'service'` in which case the Obj will be treated as a constructor. Valid types are: `'service'`, `'factory'`, `'provider'`, `'value'`

**Obj.$inject** — *optional* — If `Obj.$type` is `'service'`, this property can be a string name or an array of names of dependencies to inject into the constructor.
E.g. `Obj.$inject = ['dep1', 'dep2'];`

#### resolve(data)

Execute any deferred functions registered by `Bottle#defer`.

Param                      | Type    | Details
:--------------------------|:--------|:--------
**data**
*(optional)* | *Mixed* | Value to be passed to each deferred function as the first parameter.

#### service(name, Constructor [, dependency [, ...]])

Used to register a service constructor

Param                            | Type       | Details
:--------------------------------|:-----------|:--------
**name**                         | *String*   | The name of the service.  Must be unique to each Bottle instance.
**Constructor**                  | *Function* | A constructor function that will be instantiated as a singleton.
**dependency**
*(optional)* | *String*   | An optional name for a dependency to be passed to the constructor.  A dependency will be passed to the constructor for each name passed to `Bottle#service` in the order they are listed.

#### value(name, val)

Used to add an arbitrary value to the container.

Param    | Type     | Details
:--------|:---------|:--------
**name** | *String* | The name of the value.  Must be unique to each Bottle instance.
**val**  | *Mixed*  | A value that will be defined as enumerable, but not writable.


text:
Sample Web Parts illustrating using jQuery and its plugins loaded from CDN for building SharePoint Framework Client-Side Web Parts.

![Sample Web Part built using jQuery showing current weather in the specified location](./assets/preview_weather.png)

## Used SharePoint Framework Version
![drop](https://img.shields.io/badge/drop-drop2-red.svg)

## Applies to

* [SharePoint Framework Developer Preview](http://dev.office.com/sharepoint/docs/spfx/sharepoint-framework-overview)
* [Office 365 developer tenant](http://dev.office.com/sharepoint/docs/spfx/set-up-your-developer-tenant)

## Solution

Solution|Author(s)
--------|---------
jquery-cdn|Waldek Mastykarz (MVP, Rencore, @waldekm)

## Version history

Version|Date|Comments
-------|----|--------
1.0|September 16, 2016|Initial release

## Disclaimer
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

---

## Minimal Path to Awesome

- clone this repo
- in the command line run:
  - `npm i`
  - `gulp serve`

## Features

This project contains sample Client-Side Web Parts built on the SharePoint Framework illustrating how to use jQuery and its plugins loaded from CDN for building SharePoint Framework Client-Side Web Parts.

This Web Part illustrates the following concepts on top of the SharePoint Framework:
- loading jQuery from CDN
- loading non-AMD jQuery plugins with configured dependency on jQuery
- using non-reactive Web Part Property Pane
- using conditional rendering for one-time Web Part setup

<img src="https://telemetry.sharepointpnp.com/sp-dev-fx-webparts/samples/jquery-cdn" />


text:
<?php
namespace Grav\Plugin;
use Grav\Common\Plugin;
use RocketTheme\Toolbox\Event\Event;
/**
 * Class CustomCSSPlugin
 * @package Grav\Plugin
 */
class CustomCSSPlugin extends Plugin
{
    /**
     * @return array
     */
    public static function getSubscribedEvents()
    {
        return [
            'onPluginsInitialized' => ['onPluginsInitialized', 0]
        ];
    }
    /**
     * Initialize the plugin
     */
    public function onPluginsInitialized()
    {
        // Don't proceed if we are in the admin plugin
        if ($this->isAdmin()) {
            return;
        }
        $this->enable([
            'onAssetsInitialized' => ['onAssetsInitialized', 0]
        ]);
    }
    public function onAssetsInitialized()
    {
        $this->grav['assets']->addInlineCss($this->config->get('plugins.custom-css.css_inline'), ['group' => 'criticalcss']);
        foreach($this->config->get('plugins.custom-css.css_files') as $file) {
            $this->grav['assets']->addCss($file['path'], isset($file['priority']) ? $file['priority'] : null);
        }
    }
}


text:
<?php

/**
 * The template that displays the welcome message when the plugin is first activated.
 */

$video_url = 'http://vimeo.com/108805711';

?>

<?php printf( __( 'You are running Version %s and deserve a hug :-)', 'tribe-events-calendar' ), TribeEvents::VERSION ); ?>

	<?php echo wp_oembed_get( $video_url ); ?>

<?php _e( 'Keep The Events Calendar Core FREE', 'tribe-events-calendar' ); ?>

<?php _e( "5 star ratings help us bring TEC to more users. More happy users mean more support, more features, and more of everything you know and love about The Events Calendar. We couldn't do this without your support.", 'tribe-events-calendar' ); ?>

<?php _e( 'Rate it five stars today!', 'tribe-events-calendar' ); ?> ★★★★★

		<?php _e( 'Rate It', 'tribe-events-calendar' ); ?>

<?php _e( "Newsletter Signup", 'tribe-events-calendar' ); ?>

<?php _e( "Stay in touch with The Events Calendar Pro. We send out periodic updates, key developer notices, and even the occasional discount.", 'tribe-events-calendar' ); ?>

		<form action="http://moderntribe.createsend.com/t/r/s/athqh/" method="post">

<input id="listthkduyk" name="cm-ol-thkduyk" type="checkbox" /> Developer News

<input id="listathqh" name="cm-ol-athqh" checked type="checkbox" /> News and Announcements

<input id="fieldEmail" class="regular-text" name="cm-athqh-athqh" type="email" placeholder="Email" required />

			<button type="submit" class="button-primary"><?php _e( 'Sign Up', 'tribe-events-calendar' ); ?></button>
		</form>

<?php _e( 'Getting Started', 'tribe-events-calendar' ); ?>

<?php _e( 'Check out the New User Primer & Tutorials', 'tribe-events-calendar' ); ?>

<?php _e( 'Looking for More Features?', 'tribe-events-calendar' ); ?>

<?php _e( 'Addons for Community, Tickets, Filters, Facebook and more.', 'tribe-events-calendar' ); ?>

<?php _e( 'Support Resources', 'tribe-events-calendar' ); ?>

<?php _e( 'FAQs, Documentation, Tutorials and Forums', 'tribe-events-calendar' ); ?>

<?php _e( 'Release Notes', 'tribe-events-calendar' ); ?>

<?php _e( 'Get the Skinny on the Latest Updates', 'tribe-events-calendar' ); ?>

<?php _e( 'News For Events Users', 'tribe-events-calendar' ); ?>

<?php _e( 'Product Releases, Tutorials and Community Activity', 'tribe-events-calendar' ); ?>