text:
/**
 * Defines template and style encapsulation options available for Component's {@link Component}.
 *
 * See {@link Component#encapsulation}.
 * @stable
 */
export enum ViewEncapsulation {
  /**
   * Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host
   * Element and pre-processing the style rules provided via
   * {@link Component#styles} or {@link Component#styleUrls}, and adding the new Host Element
   * attribute to all selectors.
   *
   * This is the default option.
   */
  Emulated,
  /**
   * Use the native encapsulation mechanism of the renderer.
   *
   * For the DOM this means using [Shadow DOM](https://w3c.github.io/webcomponents/spec/shadow/) and
   * creating a ShadowRoot for Component's Host Element.
   */
  Native,
  /**
   * Don't provide any template or style encapsulation.
   */
  None
}

/**
 * Metadata properties available for configuring Views.
 *
 * For details on the `@Component` annotation, see {@link Component}.
 *
 * ### Example
 *
 * ```
 * @Component({
 *   selector: 'greet',
 *   template: 'Hello {{name}}!',
 * })
 * class Greet {
 *   name: string;
 *
 *   constructor() {
 *     this.name = 'World';
 *   }
 * }
 * ```
 *
 * @deprecated Use Component instead.
 *
 * {@link Component}
 */
export class ViewMetadata {
  /** {@link Component#templateUrl} */
  templateUrl: string|undefined;
  /** {@link Component#template} */
  template: string|undefined;
  /** {@link Component#stylesUrl} */
  styleUrls: string[]|undefined;
  /** {@link Component#styles} */
  styles: string[]|undefined;
  /** {@link Component#encapsulation} */
  encapsulation: ViewEncapsulation|undefined;
  /** {@link Component#animation} */
  animations: any[]|undefined;
  /** {@link Component#interpolation} */
  interpolation: [string, string]|undefined;

  constructor(opts: {
    templateUrl?: string,
    template?: string,
    encapsulation?: ViewEncapsulation,
    styles?: string[],
    styleUrls?: string[],
    animations?: any[],
    interpolation?: [string, string]
  } = {}) {
    this.templateUrl = opts.templateUrl;
    this.template = opts.template;
    this.styleUrls = opts.styleUrls;
    this.styles = opts.styles;
    this.encapsulation = opts.encapsulation;
    this.animations = opts.animations;
    this.interpolation = opts.interpolation;
  }
}


text:
from __future__ import print_function

import unittest
import numpy

import pymic

from helper import skipNoDevice

class OffloadDeviceTest(unittest.TestCase):
    """This class defines the test cases for the OffloadDevice class."""

    @skipNoDevice
    def test_library_not_loaded(self):
        """Test if load_library throws an exception if a library cannot be loaded
           for any reason."""

        device = pymic.devices[0]
        self.assertRaises(pymic.OffloadError, device.load_library,
                          "this_library_does_not_exist_anywhere")

redpajama_set_name: RedPajamaGithub


text:
require 'spec_helper'

describe 'openvpn::client' do
  let(:chef_runner) do
    runner = ChefSpec::ChefRunner.new(:cookbook_path => cb_path)
    runner.node.set['openvpn']['client_configs'] = client_configs
    runner
  end

  let(:chef_run) do
    chef_runner.converge 'openvpn::client'
  end

  before do
    Chef::Config[:data_bag_path] = 'spec/support/data_bags'
  end

  it 'installs openvpn' do
    expect(chef_run).to install_package 'openvpn'
  end

  it 'creates openvpn user and group' do
    expect(chef_run).to create_user 'openvpn'
    expect(chef_run).to create_group 'openvpn'
  end

  it 'creates log directory' do
    expect(chef_run).to create_directory '/var/log/openvpn'
  end

  it 'enables and starts openvpn' do
    expect(chef_run).to start_service 'openvpn'
    expect(chef_run).to set_service_to_start_on_boot 'openvpn'
  end

  client_configs.keys.each do |config_name|
    context "for config #{config_name}" do
      it 'creates .conf file' do
        expect(chef_run).to create_file_with_content "/etc/openvpn/#{config_name}-foo.conf", ""
      end

      it 'creates necessary cert/key files if needed' do
        if config_name == 'test12' or config_name == 'test13'
          expect(chef_run).to create_file_with_content "/etc/openvpn/#{config_name}-foo-ca.crt", ""
          expect(chef_run).to create_file_with_content "/etc/openvpn/#{config_name}-foo.crt", ""
          expect(chef_run).to create_file_with_content "/etc/openvpn/#{config_name}-foo.key", ""
        end
      end
    end
  end
end


text:
package com.vmware.vim25;

/**
 * @author Steve Jin (http://www.doublecloud.org)
 * @version 5.1
 */

@SuppressWarnings("all")
public class AlarmSpec extends DynamicData {
    public String name;
    public String systemName;
    public String description;
    public boolean enabled;
    public AlarmExpression expression;
    public AlarmAction action;
    public Integer actionFrequency;
    public AlarmSetting setting;

    public String getName() {
        return this.name;
    }

    public String getSystemName() {
        return this.systemName;
    }

    public String getDescription() {
        return this.description;
    }

    public boolean isEnabled() {
        return this.enabled;
    }

    public AlarmExpression getExpression() {
        return this.expression;
    }

    public AlarmAction getAction() {
        return this.action;
    }

    public Integer getActionFrequency() {
        return this.actionFrequency;
    }

    public AlarmSetting getSetting() {
        return this.setting;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setSystemName(String systemName) {
        this.systemName = systemName;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public void setExpression(AlarmExpression expression) {
        this.expression = expression;
    }

    public void setAction(AlarmAction action) {
        this.action = action;
    }

    public void setActionFrequency(Integer actionFrequency) {
        this.actionFrequency = actionFrequency;
    }

    public void setSetting(AlarmSetting setting) {
        this.setting = setting;
    }
}


text:
"""Contain the class to generate a view for the partial autocorrelation
function.
"""

from mpf.views.correlogram import Correlogram

__all__ = ('PACF')

class PACF(Correlogram):
    """Provide a view for the partial autocorrelation function."""

    def __init__(self, path, title, _ids):
        super().__init__(path, title, _ids, 'pacf')


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.sql.planner.optimizations;

import com.facebook.presto.Session;
import com.facebook.presto.spi.type.Type;
import com.facebook.presto.sql.planner.PlanNodeIdAllocator;
import com.facebook.presto.sql.planner.Symbol;
import com.facebook.presto.sql.planner.SymbolAllocator;
import com.facebook.presto.sql.planner.plan.LateralJoinNode;
import com.facebook.presto.sql.planner.plan.PlanNode;
import com.facebook.presto.sql.planner.plan.SimplePlanRewriter;

import java.util.Map;

import static com.facebook.presto.sql.planner.optimizations.ScalarQueryUtil.isScalar;
import static com.facebook.presto.sql.planner.plan.SimplePlanRewriter.rewriteWith;

/**
 * Remove LateralJoinNodes with unreferenced scalar input, e.g: "SELECT (SELECT 1)".
 */
public class RemoveUnreferencedScalarLateralNodes
        implements PlanOptimizer
{
    @Override
    public PlanNode optimize(PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator)
    {
        return rewriteWith(new Rewriter(), plan, null);
    }

    private static class Rewriter
            extends SimplePlanRewriter<PlanNode>
    {
        @Override
        public PlanNode visitLateralJoin(LateralJoinNode node, RewriteContext<PlanNode> context)
        {
            if (node.getInput().getOutputSymbols().isEmpty() && isScalar(node.getInput())) {
                return context.rewrite(node.getSubquery());
            }

            if (node.getSubquery().getOutputSymbols().isEmpty() && isScalar(node.getSubquery())) {
                return context.rewrite(node.getInput());
            }

            return context.defaultRewrite(node);
        }
    }
}


text:
package org.codegist.common.collect;

import java.lang.reflect.Array;
import java.util.Collection;

/**
 * @author Laurent Gilles (laurent.gilles@codegist.org)
 */
public final class Arrays {

    private Arrays() {
        throw new IllegalStateException();
    }

    /**
     * Merges a list of arrays into a single array.
     *
     * @param cls    Array type
     * @param arrays Arrays to merge
     * @param <T>    Arrays type argument
     * @return merged array
     */
    public static <T> T[] merge(Class<T> cls, T[]... arrays) {
        int totalLength = 0;
        for (T[] arr : arrays) {
            totalLength += arr.length;
        }
        T[] merge = (T[]) java.lang.reflect.Array.newInstance(cls, totalLength);
        int pos = 0;
        for (T[] arr : arrays) {
            System.arraycopy(arr, 0, merge, pos, arr.length);
            pos += arr.length;
        }
        return merge;
    }

    public static <T> String join(String sep, T... items){
        StringBuilder sb = new StringBuilder();
        int i = 0, max= items.length;
        for(T s : items){
            sb.append(s);
            if(++i < max) {
                sb.append(sep);
            }
        }
        return sb.toString();
    }

    public static <T> T[] arrify(Collection<T> collection, Class<T> clazz){
        return collection.toArray((T[])Array.newInstance(clazz, collection.size()));
    }

}


text:
package better.jsonrpc.jetty.test.server;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.util.thread.QueuedThreadPool;

public class TestServer {

    private Server mServer;
    private SelectChannelConnector mConnector;
    private ServletHandler mServletHandler;

    private ObjectMapper  mJsonMapper;

    public TestServer() {
        mJsonMapper = new ObjectMapper();

        mServletHandler = new ServletHandler();
        mServletHandler.addServletWithMapping(TestServletWs.class, "/ws");
        mServletHandler.addServletWithMapping(TestServletHttp.class, "/http");

        mConnector = new SelectChannelConnector();
        mConnector.setThreadPool(new QueuedThreadPool(10));
        mConnector.setHost("localhost");
        mConnector.setPort(0);

        mServer = new Server();
        mServer.setThreadPool(new QueuedThreadPool(10));
        mServer.setHandler(mServletHandler);
        mServer.setConnectors(new Connector[]{mConnector});
    }

    public int getLocalPort() {
        return mConnector.getLocalPort();
    }

    public void start() throws Exception {
        mServer.start();
    }

    public void stop() throws Exception {
        mServer.stop();
    }

    public void join() throws InterruptedException {
        mServer.join();
    }

}


text:
process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function (chunk) {
	process.stdout.write('Data! -> '+ chunk);
});

process.stdin.on('end', function () {
	process.stderr.write('End!\n');
});


text:
    <link rel="import" href="import.html">
    <link rel="import" href="contact-card.html">

<polymer-element name="contact-contacts">
<template>

    <core-scaffold id="core_scaffold">
      <core-header-panel mode="seamed" id="core_header_panel" navigation flex>
        <core-toolbar id="core_toolbar">
            <core-icon id="core_icon_search" icon="search"></core-icon>

<paper-input id="search"></paper-input>

          </core-toolbar>
        <core-menu selected="All" valueattr="label" selectedindex="0" id="core_menu" theme="core-light-theme">
          <core-item id="core_item" icon="view-list" label="All" horizontal center layout on-tap="{{view_all}}"></core-item>
          <core-item id="core_item1" icon="favorite" label="Favorite" horizontal center layout on-tap="{{view_favored}}"></core-item>
        </core-menu>
      </core-header-panel>

{{heading}}

                    <template repeat="{{contact in contacts}}">
                        <contact-card name="{{contact.name}}"
                                      phone="{{contact.phone}}"
                                      group="{{contact.group}}"
                                      favored="{{contact.favored}}"
                                      icon="{{contact.icon}}"
                                      on-favorite-tap="{{handleFavorite}}">
                        </contact-card>
                    </template>

                <template repeat="{{contact in contacts}}" >
                   <template if="{{contact.favored === 'true'}}">
                        <contact-card name="{{contact.name}}"
                                  phone="{{contact.phone}}"
                                  group="{{contact.group}}"
                                  favored="{{contact.favored}}"
                                  icon="{{contact.icon}}"
                                  on-favorite-tap="{{handleFavorite}}">
                        </contact-card>
                    </template>
                </template>

    </core-scaffold>

  </template>


text:
"""
    werkzeug.testsuite.cache
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Tests the cache system

    :copyright: (c) 2014 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
"""
import os
import time
import unittest
import tempfile
import shutil

from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.contrib import cache

try:
    import redis
    try:
        from redis.exceptions import ConnectionError as RedisConnectionError
        cache.RedisCache(key_prefix='werkzeug-test-case:')._client.set('test','connection')
    except RedisConnectionError:
        redis = None
except ImportError:
    redis = None
try:
    import pylibmc as memcache
except ImportError:
    try:
        from google.appengine.api import memcache
    except ImportError:
        try:
            import memcache
        except ImportError:
            memcache = None

class SimpleCacheTestCase(WerkzeugTestCase):

    def test_get_dict(self):
        c = cache.SimpleCache()
        c.set('a', 'a')
        c.set('b', 'b')
        d = c.get_dict('a', 'b')
        assert 'a' in d
        assert 'a' == d['a']
        assert 'b' in d
        assert 'b' == d['b']

    def test_set_many(self):
        c = cache.SimpleCache()
        c.set_many({0: 0, 1: 1, 2: 4})
        assert c.get(2) == 4
        c.set_many((i, i*i) for i in range(3))
        assert c.get(2) == 4

class FileSystemCacheTestCase(WerkzeugTestCase):

    def test_set_get(self):
        tmp_dir = tempfile.mkdtemp()
        try:
            c = cache.FileSystemCache(cache_dir=tmp_dir)
            for i in range(3):
                c.set(str(i), i * i)
            for i in range(3):
                result = c.get(str(i))
                assert result == i * i
        finally:
            shutil.rmtree(tmp_dir)

    def test_filesystemcache_prune(self):
        THRESHOLD = 13
        tmp_dir = tempfile.mkdtemp()
        c = cache.FileSystemCache(cache_dir=tmp_dir, threshold=THRESHOLD)
        for i in range(2 * THRESHOLD):
            c.set(str(i), i)
        cache_files = os.listdir(tmp_dir)
        shutil.rmtree(tmp_dir)
        assert len(cache_files) <= THRESHOLD

    def test_filesystemcache_clear(self):
        tmp_dir = tempfile.mkdtemp()
        c = cache.FileSystemCache(cache_dir=tmp_dir)
        c.set('foo', 'bar')
        cache_files = os.listdir(tmp_dir)
        assert len(cache_files) == 1
        c.clear()
        cache_files = os.listdir(tmp_dir)
        assert len(cache_files) == 0
        shutil.rmtree(tmp_dir)

class RedisCacheTestCase(WerkzeugTestCase):

    def make_cache(self):
        return cache.RedisCache(key_prefix='werkzeug-test-case:')

    def teardown(self):
        self.make_cache().clear()

    def test_compat(self):
        c = self.make_cache()
        c._client.set(c.key_prefix + 'foo', b'Awesome')
        self.assert_equal(c.get('foo'), b'Awesome')
        c._client.set(c.key_prefix + 'foo', b'42')
        self.assert_equal(c.get('foo'), 42)

    def test_get_set(self):
        c = self.make_cache()
        c.set('foo', ['bar'])
        assert c.get('foo') == ['bar']

    def test_get_many(self):
        c = self.make_cache()
        c.set('foo', ['bar'])
        c.set('spam', 'eggs')
        assert c.get_many('foo', 'spam') == [['bar'], 'eggs']

    def test_set_many(self):
        c = self.make_cache()
        c.set_many({'foo': 'bar', 'spam': ['eggs']})
        assert c.get('foo') == 'bar'
        assert c.get('spam') == ['eggs']

    def test_expire(self):
        c = self.make_cache()
        c.set('foo', 'bar', 1)
        time.sleep(2)
        assert c.get('foo') is None

    def test_add(self):
        c = self.make_cache()
        # sanity check that add() works like set()
        c.add('foo', 'bar')
        assert c.get('foo') == 'bar'
        c.add('foo', 'qux')
        assert c.get('foo') == 'bar'

    def test_delete(self):
        c = self.make_cache()
        c.add('foo', 'bar')
        assert c.get('foo') == 'bar'
        c.delete('foo')
        assert c.get('foo') is None

    def test_delete_many(self):
        c = self.make_cache()
        c.add('foo', 'bar')
        c.add('spam', 'eggs')
        c.delete_many('foo', 'spam')
        assert c.get('foo') is None
        assert c.get('spam') is None

    def test_inc_dec(self):
        c = self.make_cache()
        c.set('foo', 1)
        self.assert_equal(c.inc('foo'), 2)
        self.assert_equal(c.dec('foo'), 1)
        c.delete('foo')

    def test_true_false(self):
        c = self.make_cache()
        c.set('foo', True)
        assert c.get('foo') == True
        c.set('bar', False)
        assert c.get('bar') == False

class MemcachedCacheTestCase(WerkzeugTestCase):

    def make_cache(self):
        return cache.MemcachedCache(key_prefix='werkzeug-test-case:')

    def teardown(self):
        self.make_cache().clear()

    def test_compat(self):
        c = self.make_cache()
        c._client.set(c.key_prefix + b'foo', 'bar')
        self.assert_equal(c.get('foo'), 'bar')

    def test_get_set(self):
        c = self.make_cache()
        c.set('foo', 'bar')
        self.assert_equal(c.get('foo'), 'bar')

    def test_get_many(self):
        c = self.make_cache()
        c.set('foo', 'bar')
        c.set('spam', 'eggs')
        self.assert_equal(c.get_many('foo', 'spam'), ['bar', 'eggs'])

    def test_set_many(self):
        c = self.make_cache()
        c.set_many({'foo': 'bar', 'spam': 'eggs'})
        self.assert_equal(c.get('foo'), 'bar')
        self.assert_equal(c.get('spam'), 'eggs')

    def test_expire(self):
        c = self.make_cache()
        c.set('foo', 'bar', 1)
        time.sleep(2)
        self.assert_is_none(c.get('foo'))

    def test_add(self):
        c = self.make_cache()
        c.add('foo', 'bar')
        self.assert_equal(c.get('foo'), 'bar')
        c.add('foo', 'baz')
        self.assert_equal(c.get('foo'), 'bar')

    def test_delete(self):
        c = self.make_cache()
        c.add('foo', 'bar')
        self.assert_equal(c.get('foo'), 'bar')
        c.delete('foo')
        self.assert_is_none(c.get('foo'))

    def test_delete_many(self):
        c = self.make_cache()
        c.add('foo', 'bar')
        c.add('spam', 'eggs')
        c.delete_many('foo', 'spam')
        self.assert_is_none(c.get('foo'))
        self.assert_is_none(c.get('spam'))

    def test_inc_dec(self):
        c = self.make_cache()
        c.set('foo', 1)
        # XXX: Is this an intended difference?
        c.inc('foo')
        self.assert_equal(c.get('foo'), 2)
        c.dec('foo')
        self.assert_equal(c.get('foo'), 1)

    def test_true_false(self):
        c = self.make_cache()
        c.set('foo', True)
        self.assert_equal(c.get('foo'), True)
        c.set('bar', False)
        self.assert_equal(c.get('bar'), False)

def suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(SimpleCacheTestCase))
    suite.addTest(unittest.makeSuite(FileSystemCacheTestCase))
    if redis is not None:
        suite.addTest(unittest.makeSuite(RedisCacheTestCase))
    if memcache is not None:
        suite.addTest(unittest.makeSuite(MemcachedCacheTestCase))
    return suite


text:
Jison
=====
* [issues](http://github.com/zaach/jison/issues)
* [discuss](mailto:jison@librelist.com)

[![build status](https://secure.travis-ci.org/zaach/jison.png)](http://travis-ci.org/zaach/jison)

An API for creating parsers in JavaScript
-----------------------------------------

Jison generates bottom-up parsers in JavaScript. Its API is similar to Bison's, hence the name. It supports many of Bison's major features, plus some of its own. If you are new to parser generators such as Bison, and Context-free Grammars in general, a [good introduction][1] is found in the Bison manual. If you already know Bison, Jison should be easy to pickup.

Briefly, Jison takes a JSON encoded grammar or Bison style grammar and outputs a JavaScript file capable of parsing the language described by that grammar. You can then use the generated script to parse inputs and accept, reject, or perform actions based on the input.

Installation
------------
Jison can be installed for [Node](http://nodejs.org) using [`npm`](http://github.com/isaacs/npm/)

Using npm:

    npm install jison -g

Usage from the command line
-----------------------

Clone the github repository for examples:

    git clone git://github.com/zaach/jison.git
    cd jison/examples

Now you're ready to generate some parsers:

    jison calculator.jison

This will generate `calculator.js` in your current working directory. This file can be used to parse an input file, like so:

    echo "2^32 / 1024" > testcalc
    node calculator.js testcalc

This will print out `4194304`.

Full cli option list:

    Usage: jison [file] [lexfile] [options]

    file        file containing a grammar
    lexfile     file containing a lexical grammar

    Options:
       -j, --json                    force jison to expect a grammar in JSON format
       -o FILE, --outfile FILE       Filename and base module name of the generated parser
       -t, --debug                   Debug mode
       -m TYPE, --module-type TYPE   The type of module to generate (commonjs, amd, js)
       -p TYPE, --parser-type TYPE   The type of algorithm to use for the parser (lr0, slr, lalr, lr)
       -V, --version                 print version and exit

Usage from a CommonJS module
--------------------------

You can generate parsers programatically from JavaScript as well. Assuming Jison is in your commonjs environment's load path:

    // mygenerator.js
    var Parser = require("jison").Parser;

    // a grammar in JSON
    var grammar = {
        "lex": {
            "rules": [
               ["\\s+", "/* skip whitespace */"],
               ["[a-f0-9]+", "return 'HEX';"]
            ]
        },

        "bnf": {
            "hex_strings" :[ "hex_strings HEX",
                             "HEX" ]
        }
    };

    // `grammar` can also be a string that uses jison's grammar format
    var parser = new Parser(grammar);

    // generate source, ready to be written to disk
    var parserSource = parser.generate();

    // you can also use the parser directly from memory

    // returns true
    parser.parse("adfe34bc e82a");

    // throws lexical error
    parser.parse("adfe34bc zxg");

More Documentation
------------------
For more information on creating grammars and using the generated parsers, read the [documentation](http://jison.org/docs).

How to contribute
-----------------
Fork, make your changes, run tests and/or add tests then send a pull request.

Run tests with:

    make test

Projects using Jison
------------------

View them on the [wiki](https://github.com/zaach/jison/wiki/ProjectsUsingJison), or add your own.

Contributors
------------
[Githubbers](http://github.com/zaach/jison/contributors)

Special thanks to Jarred Ligatti, Manuel E. Bermúdez

License
-------

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

  [1]: http://dinosaur.compilertools.net/bison/bison_4.html


text:
package sun.jvm.hotspot.ui;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import sun.jvm.hotspot.debugger.*;

/** Wraps a MemoryPanel with a field allowing the user to type in an
    address. */

public class MemoryViewer extends JPanel {
  public MemoryViewer(final Debugger debugger, boolean is64Bit) {
    super();
    final MemoryPanel memory = new MemoryPanel(debugger, is64Bit);
    memory.setBorder(GraphicsUtilities.newBorder(5));
    JPanel addressPanel = new JPanel();
    addressPanel.setLayout(new BoxLayout(addressPanel, BoxLayout.X_AXIS));
    addressPanel.add(new JLabel("Address: "));
    final JTextField addressField = new JTextField(20);
    addressPanel.add(addressField);
    addressField.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          try {
            memory.makeVisible(debugger.parseAddress(addressField.getText()));
          } catch (NumberFormatException ex) {
          }
        }
      });
    setLayout(new BorderLayout());
    add(addressPanel, BorderLayout.NORTH);
    add(memory, BorderLayout.CENTER);
  }
}


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

namespace Microsoft.Azure.Commands.HDInsight.Models
{
    /// <summary>
    /// Provides creation details for a new Pig jobDetails.
    /// </summary>
    public class AzureHDInsightPigJobDefinition : AzureHDInsightJobDefinition
    {
        /// <summary>
        /// Gets or sets the query file to use for a pig jobDetails.
        /// </summary>
        public string File { get; set; }

        /// <summary>
        /// Gets or sets the query to use for a pig jobDetails.
        /// </summary>
        public string Query { get; set; }
    }
}


text:
package org.opencb.opencga.catalog.monitor.executors;

import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.ObjectReader;
import org.opencb.opencga.catalog.models.Job;
import org.slf4j.Logger;

import java.io.IOException;
import java.nio.file.Path;

/**
 * Created by pfurio on 22/08/16.
 */
public abstract class AbstractExecutor {

    public static final String TIMEOUT = "timeout";
    public static final String STDOUT = "stdout";
    public static final String STDERR = "stderr";
    public static final String OUTDIR = "outdir";
    public static final String NUM_THREADS = "num_threads";
    public static final String MAX_MEM = "max_mem";
    public static final String JOB_STATUS_FILE = "job.status";
    public static final String OUT_LOG_EXTENSION = ".out";
    public static final String ERR_LOG_EXTENSION = ".err";

    protected Logger logger;
    protected ObjectMapper objectMapper;
    protected ObjectReader objectReader;

    public AbstractExecutor() {
        objectMapper = new ObjectMapper();
        objectReader = objectMapper.reader(Job.JobStatus.class);
    }

    public abstract void execute(Job job) throws Exception;

    public String status(Path jobOutput, Job job) {
        Path jobStatusFilePath = jobOutput.resolve(JOB_STATUS_FILE);
        if (!jobStatusFilePath.toFile().exists()) {
            return getStatus(job);
        }
        // File exists
        try {
            Job.JobStatus jobStatus = objectReader.readValue(jobStatusFilePath.toFile());
            return jobStatus.getName();
        } catch (IOException e) {
            logger.warn("Job status file could not be read.");
            return getStatus(job);
        }
    }

    protected abstract String getStatus(Job job);

    public abstract boolean stop(Job job) throws Exception;

    public abstract boolean resume(Job job) throws Exception;

    public abstract boolean kill(Job job) throws Exception;

    public abstract boolean isExecutorAlive();

    protected ExecutorConfig getExecutorConfig(Job job) {
        ExecutorConfig executorConfig = null;

        if (job != null && job.getResourceManagerAttributes() != null) {
            executorConfig = new ExecutorConfig();

            if (job.getResourceManagerAttributes().get(STDOUT) != null) {
                executorConfig.setStdout(job.getResourceManagerAttributes().get(STDOUT).toString());
            }

            if (job.getResourceManagerAttributes().get(STDERR) != null) {
                executorConfig.setStderr(job.getResourceManagerAttributes().get(STDERR).toString());
            }

            if (job.getResourceManagerAttributes().get(OUTDIR) != null) {
                executorConfig.setOutdir(job.getResourceManagerAttributes().get(OUTDIR).toString());
            }

            if (job.getResourceManagerAttributes().get(TIMEOUT) != null) {
                executorConfig.setTimeout(Integer.parseInt(job.getResourceManagerAttributes().get(TIMEOUT).toString()));
            }

            if (job.getResourceManagerAttributes().get(MAX_MEM) != null) {
                executorConfig.setMaxMem(Integer.parseInt(job.getResourceManagerAttributes().get(MAX_MEM).toString()));
            }

            if (job.getResourceManagerAttributes().get(NUM_THREADS) != null) {
                executorConfig.setNumThreads(Integer.parseInt(job.getResourceManagerAttributes().get(NUM_THREADS).toString()));
            }
        }

        return executorConfig;
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:layout_margin="2dp">

    <ImageView
        android:id="@+id/imgPic"
        android:layout_width="90dp"
        android:layout_height="90dp"
        android:src="@mipmap/cam_photo" />

    <ImageButton
        android:id="@+id/imgbtDelete"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:background="@drawable/clear_icon" />
</FrameLayout>


text:
int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([day7AcademyAppDelegate class]));
    }
}


text:
    <md-content>

No API found.

                <div flex-xs="100"
                     flex-sm="{{vm.data.ui.sidenavLocked ? 100 : 50}}"
                     flex-md="{{vm.data.ui.sidenavLocked ? 50 : 33}}"
                     flex-lg="{{vm.data.ui.sidenavLocked ? 33 : 25}}"
                     flex-xl="{{vm.data.ui.sidenavLocked ? 25 : 20}}"
                     ng-repeat="group in vm.data.model.groups track by $index"
                     ng-if="(group.operations | filter:vm.data.model.search:false).length"
                     style="padding: 12px"
                     ng-include="'modules/group/group.html'">

    </md-content>

<md-sidenav
    layout="column"
    class="md-sidenav-right md-whiteframe-z2"
    md-is-open="vm.data.ui.sidenavOpen"
    md-is-locked-open="vm.data.ui.sidenavLocked">
        <md-toolbar ng-if="vm.sop" class="md-accent" md-whiteframe="2">

                {{t}},
                <md-button hide show-gt-xs
                           ng-click="vm.data.ui.sidenavLocked = !vm.data.ui.sidenavLocked"
                           aria-label="toggle"
                           class="md-icon-button md-accent md-hue-3">
                    <md-icon ng-bind="vm.data.ui.sidenavLocked ? 'chevron_right' : 'chevron_left'"></md-icon>
                </md-button>

        </md-toolbar>

            <md-subheader class="md-warn md-no-sticky" ng-if="vm.sop.deprecated">Deprecated</md-subheader>

                    <md-button ng-class="vm.theme[vm.sop.httpMethod]"
                               ng-click="vm.utils.method(vm.sop.httpMethod, $event)"
                               aria-label="method"
                               class="sum-http-method md-raised"
                               ng-bind="vm.sop.httpMethod">
                    </md-button>

        <md-tabs class="md-hue-2"
                 flex
                 md-stretch-tabs="always"
                 md-selected="vm.sop.tab"
                 ng-class="{'sum-slide-disabled': vm.omg}">
            <md-tab label="Info" layout="column">

            </md-tab>
            <md-tab label="Scripts" layout="column">

            </md-tab>
            <md-tab class="sum-tab-result" label="Result" ng-disabled="!vm.sop.explorerResult">

            </md-tab>
        </md-tabs>

No endpoint method selected.

        <md-button class="md-fab md-fab-bottom-right md-primary md-raised"
                   ng-disabled="vm.sop.loading || !vm.ngForm.explorerForm.$valid"
                   ng-style="{padding: vm.sop.loading ? '1px 0 0 0' : null}"
                   ng-if="vm.sop && vm.data.ui.explorer"
                   ng-click="vm.submit(vm.sop)"
                   ng-class="(vm.sop.explorerResult.response.status === -1) ? 'md-warn' : 'md-primary'"
                   aria-label="submit">
            <md-icon ng-if="!vm.sop.loading" ng-bind="vm.sop.explorerResult ? 'replay' : 'play_arrow'"></md-icon>
            <md-progress-circular ng-if="vm.sop.loading"
                                  md-diameter="56"
                                  class="md-accent md-hue-1"
                                  md-mode="indeterminate"></md-progress-circular>
        </md-button>
</md-sidenav>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>nucleo-dynamixel: WWDG_Exported_Functions_Group1</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

nucleo-dynamixel
    0.0.1

A library for controlling dynamixel servomotors, designed for nucleo stm32

Main Page

Related Pages

Modules

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Functions

WWDG_Exported_Functions_Group1
STM32F4xx_HAL_Driver » WWDG » WWDG_Exported_Functions

Functions

HAL_StatusTypeDef 	HAL_WWDG_Init (WWDG_HandleTypeDef *hwwdg)

HAL_StatusTypeDef 	HAL_WWDG_DeInit (WWDG_HandleTypeDef *hwwdg)

void 	HAL_WWDG_MspInit (WWDG_HandleTypeDef *hwwdg)

void 	HAL_WWDG_MspDeInit (WWDG_HandleTypeDef *hwwdg)

void 	HAL_WWDG_WakeupCallback (WWDG_HandleTypeDef *hwwdg)

Detailed Description

Generated by

     1.8.11


text:
import { A as emberArray } from '@ember/array';
import { typeOf } from '@ember/utils';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import sinon from 'sinon';

module('Unit | Service | user activity', function (hooks) {
  setupTest(hooks);

  test('init', function (assert) {
    let service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create({
        enableEvent: sinon.stub(),
      });

    assert.strictEqual(
      typeOf(service._boundEventHandler),
      'function',
      'bound event handler initialized'
    );
    assert.strictEqual(
      typeOf(service.enabledEvents),
      'array',
      'enabledEvents set to empty array'
    );
    assert.strictEqual(
      service.enableEvent.callCount,
      service.defaultEvents.length,
      'Events enabled by default'
    );
  });

  test('enableEvent', function (assert) {
    let event = 'foo';
    let service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create({
        _listen: sinon.stub(),
        _setupListeners: sinon.stub(),
      });

    service.enableEvent(event);

    assert.true(
      service.enabledEvents.includes(event),
      'adds event name to enabled events'
    );
    let stub = service._listen;
    assert.true(stub.calledOnce, 'sets up listener');
    assert.strictEqual(
      stub.firstCall.args[0],
      event,
      'passes event name to _listen'
    );
  });

  test('enableEvent - already enabled', function (assert) {
    let event = 'foo';
    let service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create({
        enabledEvents: emberArray([event]),
        _listen: sinon.stub(),
        _setupListeners: sinon.stub(),
      });

    service.enableEvent(event);

    assert.false(service._listen.called, 'does nothing if already enabled');
  });

  test('disableEvent', function (assert) {
    let event = 'foo';
    let service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create({
        enabledEvents: emberArray([event]),
        _setupListeners: sinon.stub(),
      });

    assert.true(
      service.enabledEvents.includes(event),
      'enabledEvents preserved on init'
    );

    service.disableEvent(event);

    assert.false(
      service.enabledEvents.includes(event),
      'removed event from enabledEvents'
    );
    assert.false(
      service._eventsListened.includes(event),
      'event should not be listed as listened'
    );
  });

  test('re-enabled events should fire', function (assert) {
    let event = 'foo';
    let service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create({
        enabledEvents: emberArray(),
        _setupListeners: sinon.stub(),
      });

    let addEventListenerStub = sinon.stub(window, 'addEventListener');

    assert.notOk(
      service.enabledEvents.length,
      'enabledEvents preserved on init'
    );

    service.enableEvent(event);
    assert.true(addEventListenerStub.called, 'event was not handled');
    assert.true(
      service.enabledEvents.includes(event),
      'enabledEvents should include added event'
    );

    window.addEventListener.reset();
    service.disableEvent(event);
    assert.false(
      service.enabledEvents.includes(event),
      'removed event from enabledEvents'
    );

    service.enableEvent(event);
    assert.true(window.addEventListener.called, 'event was not handled');
    assert.true(
      service.enabledEvents.includes(event),
      'enabledEvents should include added event'
    );
    window.addEventListener.restore();
  });

  test('fireEvent - no subscribers', function (assert) {
    let event = { type: 'foo' };
    let service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create({
        trigger: sinon.stub(),
        _setupListeners: sinon.stub(),
      });

    service.fireEvent(event);

    assert.false(service.trigger.called, 'no events triggered');
  });

  test('fireEvent - subscribed to event', function (assert) {
    let event = { type: 'foo' };
    let service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create({
        trigger: sinon.stub(),
        _setupListeners: sinon.stub(),
      });

    service.on(event.type, this, function () {});

    service.fireEvent(event);

    let stub = service.trigger;
    assert.true(stub.calledOnce, 'triggers one event');
    let { args } = stub.firstCall;
    assert.strictEqual(args[0], event.type, 'triggers event by type');
    assert.strictEqual(args[1], event, 'passes event');
  });

  test('fireEvent - subscribed to userActive', function (assert) {
    let event = { type: 'foo' };
    let service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create({
        trigger: sinon.stub(),
        _setupListeners: sinon.stub(),
      });

    service.on('userActive', this, function () {});

    service.fireEvent(event);

    let stub = service.trigger;
    assert.true(stub.calledOnce, 'triggers one event');
    let { args } = stub.firstCall;
    assert.strictEqual(args[0], 'userActive', 'triggers userActive event');
    assert.strictEqual(args[1], event, 'passes event');
  });

  test('isEnabled', function (assert) {
    let event = 'foo';
    let service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create({
        enabledEvents: emberArray([event]),
        _setupListeners: sinon.stub(),
      });

    assert.true(service.isEnabled(event), 'event is enabled');
    assert.false(service.isEnabled('bar'), 'other events are not enabled');
  });

  test('unsubscribe from events', function (assert) {
    sinon.spy(window, 'addEventListener');
    sinon.spy(window, 'removeEventListener');

    const service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create();

    assert.strictEqual(
      window.addEventListener.callCount,
      4,
      'Subscribed to 4 window events'
    );

    service.willDestroy();
    assert.strictEqual(
      window.removeEventListener.callCount,
      4,
      'Unsubscribed from 4 window events'
    );

    window.addEventListener.restore();
    window.removeEventListener.restore();
  });

  test('localStorage is updated when subscribed to storage event and other registered event is fired', function (assert) {
    let event = { type: 'foo' };
    let service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create({
        defaultEvents: ['foo', 'storage'],
      });

    localStorage.removeItem(service.localStorageKey);

    service.fireEvent(event);

    assert.true(!!localStorage.getItem(service.localStorageKey), '');
  });

  test('localStorage is not updated when not subscribed to storage event and other registered event is fired', function (assert) {
    let event = { type: 'foo' };
    let service = this.owner
      .factoryFor('service:ember-user-activity@user-activity')
      .create({
        defaultEvents: ['foo'],
      });

    localStorage.removeItem(service.localStorageKey);

    service.fireEvent(event);

    assert.false(!!localStorage.getItem(service.localStorageKey), '');
  });
});


text:
using FrequentPatternMining::Pattern;
using FrequentPatternMining::patterns;

vector<double> f;
vector<int> pre;

int highlights = 0, sentences = 0;

void process(const vector<TOTAL_TOKENS_TYPE>& tokens, const vector<POS_ID_TYPE>& tags, Segmentation& segmenter, FILE* out)
{
    ++ sentences;
    if (ENABLE_POS_TAGGING) {
        segmenter.viterbi_for_testing(tokens, tags, f, pre, SEGMENT_MULTI_WORD_QUALITY_THRESHOLD, SEGMENT_SINGLE_WORD_QUALITY_THRESHOLD);
    } else {
        segmenter.viterbi_for_testing(tokens, f, pre, SEGMENT_MULTI_WORD_QUALITY_THRESHOLD, SEGMENT_SINGLE_WORD_QUALITY_THRESHOLD);
    }

    int i = (int)tokens.size();
    assert(f[i] > -1e80);
    vector<string> ret;
    while (i > 0) {
        int j = pre[i];
        size_t u = 0;
        bool quality = true;
        for (int k = j; k < i; ++ k) {
            if (!trie[u].children.count(tokens[k])) {
                quality = false;
                break;
            }
            u = trie[u].children[tokens[k]];
        }

        double quality_score = (trie[u].id == patterns.size()? 1 : patterns[trie[u].id].quality);
        quality &= (segmenter.qualify(trie[u].id, i - j, SEGMENT_MULTI_WORD_QUALITY_THRESHOLD, SEGMENT_SINGLE_WORD_QUALITY_THRESHOLD));

        if (quality) {
            ret.push_back("</phrase>");
            ++ highlights;
        }
        for (int k = i - 1; k >= j; -- k) {
            ostringstream sout;
            sout << tokens[k];
            ret.push_back(sout.str());
        }
        if (quality) {
            stringstream phrase_xml_tag;
            phrase_xml_tag << std::setprecision(3) << std::fixed << "<phrase_Q=" << quality_score << ">";
            ret.push_back(phrase_xml_tag.str());
        }

        i = j;
    }

    reverse(ret.begin(), ret.end());
    for (int i = 0; i < ret.size(); ++ i) {
        fprintf(out, "%s%c", ret[i].c_str(), i + 1 == ret.size() ? '\n' : ' ');
    }
}

inline bool byQuality(const Pattern& a, const Pattern& b)
{
    return a.quality > b.quality + EPS || fabs(a.quality - b.quality) < EPS && a.currentFreq > b.currentFreq;
}

int main(int argc, char* argv[])
{
    parseCommandFlags(argc, argv);

    sscanf(argv[1], "%d", &NTHREADS);
    omp_set_num_threads(NTHREADS);

    Dump::loadSegmentationModel(SEGMENTATION_MODEL);

    sort(patterns.begin(), patterns.end(), byQuality);

    constructTrie(false); // update the current frequent enough patterns

    Segmentation* segmenter;
    if (ENABLE_POS_TAGGING) {
        segmenter = new Segmentation(ENABLE_POS_TAGGING);
        Segmentation::getDisconnect();
        Segmentation::logPosTags();
    } else {
        segmenter = new Segmentation(Segmentation::penalty);
    }

    char currentTag[100];

    FILE* in = tryOpen(TEXT_TO_SEG_FILE, "r");
    FILE* posIn = NULL;
    if (ENABLE_POS_TAGGING) {
        posIn = tryOpen(TEXT_TO_SEG_POS_TAGS_FILE, "r");
    }

    FILE* out = tryOpen("tmp/tokenized_segmented_sentences.txt", "w");

    while (getLine(in)) {
        stringstream sin(line);
        vector<TOTAL_TOKENS_TYPE> tokens;
        vector<POS_ID_TYPE> tags;

        string lastPunc = "";
        for (string temp; sin >> temp;) {
            // get pos tag
            POS_ID_TYPE posTagId = -1;
            if (ENABLE_POS_TAGGING) {
                myAssert(fscanf(posIn, "%s", currentTag) == 1, "POS file doesn't have enough POS tags");
                if (!Documents::posTag2id.count(currentTag)) {
                    posTagId = -1; // unknown tag
                } else {
                    posTagId = Documents::posTag2id[currentTag];
                }
            }

            // get token
            bool flag = true;
            TOKEN_ID_TYPE token = 0;
            for (size_t i = 0; i < temp.size() && flag; ++ i) {
                flag &= isdigit(temp[i]) || i == 0 && temp.size() > 1 && temp[0] == '-';
            }
            stringstream sin(temp);
            sin >> token;

            if (!flag) {
                string punc = temp;
                if (Documents::separatePunc.count(punc)) {
                    process(tokens, tags, *segmenter, out);
                    tokens.clear();
                    tags.clear();
                }
            } else {
                tokens.push_back(token);
                if (ENABLE_POS_TAGGING) {
                    tags.push_back(posTagId);
                }
            }
        }
        if (tokens.size() > 0) {
            process(tokens, tags, *segmenter, out);
        }
    }
    fclose(in);
    if (ENABLE_POS_TAGGING) {
        fclose(posIn);
    }
    fclose(out);

    cerr << "Phrasal segmentation finished." << endl;
    cerr << "   # of total highlighted quality phrases = " << highlights << endl;
    cerr << "   # of total processed sentences = " << sentences << endl;
    cerr << "   avg highlights per sentence = " << (double)highlights / sentences << endl;

    return 0;
}


text:
<?php
/**
 * single Post template 4
 **/

if (have_posts()) {
    the_post();

    $td_mod_single = new td_module_single($post);

    ?>

    <?php echo $td_mod_single->get_social_sharing_top(); ?>

        <?php echo $td_mod_single->get_content();?>

        <?php echo $td_mod_single->get_post_pagination();?>
        <?php echo $td_mod_single->get_review();?>

            <?php echo $td_mod_single->get_source_and_via();?>
            <?php echo $td_mod_single->get_the_tags();?>

        <?php echo $td_mod_single->get_social_sharing_bottom();?>
        <?php echo $td_mod_single->get_next_prev_posts();?>
        <?php echo $td_mod_single->get_author_box();?>
	    <?php echo $td_mod_single->get_item_scope_meta();?>

    <?php echo $td_mod_single->related_posts();?>

<?php
} else {
    //no posts
    echo td_page_generator::no_posts();
}


text:
class UserGroup
  include Ubiquity::Model
  include Ubiquity::Profile::Group

  storage 'user_groups'

end


text:
package de.dhbw.wi13c.jguicreator.elemente;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;

import de.dhbw.wi13c.jguicreator.Settings;
import de.dhbw.wi13c.jguicreator.Settings.Setting;
import de.dhbw.wi13c.jguicreator.data.uielements.Dataset;
import de.dhbw.wi13c.jguicreator.data.uielements.DomainObject;
import de.dhbw.wi13c.jguicreator.listener.AddEditRemoveListener;

/**
 * Klasse für die GUIKomponente ComboBox zur Darstellung von Listen mit beschreibendem Label und Buttons.
 *
 * @author Tim Bayer
 *
 */
@SuppressWarnings("serial")
public class ListCombo extends InputGuiKomponente
{
	private String labelValue;

	private JComboBox<String> comboBoxObject;

	private JLabel labelObject;

	private JButton btnEditObject;

	private JButton btnRemoveObject;

	private JButton btnAddObject;

	private List<AddEditRemoveListener> listener;

	private Dataset dataset;

	private Collection<String> s;

	private Collection<String> listKeys;

	/**
	 * Konstruktor zur Erstellung der ListCombo-GUIKomponente. Größe wird anhand der Settings gesetzt.
	 *
	 * @param pValueLabel
	 * @param pListKeys
	 * @param pActionListener
	 * @param pSettings
	 */
	public ListCombo(String pValueLabel, Collection<String> pListKeys, Dataset dataset, Settings pSettings)
	{
		super();
		this.listKeys = pListKeys;
		this.dataset = dataset;
		this.listener = new ArrayList<>();
		this.labelValue = pValueLabel;

		Dimension size = new Dimension(Integer.parseInt(pSettings.getSetting(Setting.WINDOWWIDTH)), Integer.parseInt(pSettings.getSetting(Setting.WINDOWHEIGHT)));
		size.setSize((int) (size.getWidth() * 0.92), (int) (size.getHeight() * 0.1));
		setPanelSize(size);

		this.setLayout(new BorderLayout());
		checkLabelValue();
		labelObject = new JLabel(labelValue);
		labelObject.setFont(textfont);
		labelObject.setBorder(BorderFactory.createEmptyBorder((int) (size.getHeight() * 0), (int) (size.getWidth() * 0.05), (int) (size.getHeight() * 0), (int) (size.getWidth() * 0)));
		this.add(labelObject, BorderLayout.WEST);

		String[] keys = new String[pListKeys.size()];
		keys = pListKeys.toArray(keys);
		comboBoxObject = new JComboBox<>(keys);

		initFont(17);
		comboBoxObject.setFont(textfont);

		//		comboBoxObject.setBorder(BorderFactory.createEmptyBorder((int) (size.getHeight() * 0.01), (int) (size.getWidth() * 0.05), (int) (size.getHeight() * 0.01), (int) (size.getWidth() * 0.05)));

		this.add(comboBoxObject, BorderLayout.CENTER);

		JPanel pnlAdd = new JPanel();
		btnAddObject = new JButton("add");
		btnAddObject.addActionListener(e -> {
			for(AddEditRemoveListener l : listener)
			{
				l.add();
			}
		});
		initFont(17);
		btnAddObject.setFont(textfont);
		pnlAdd.setBorder(BorderFactory.createEmptyBorder((int) (size.getHeight() * 0.01), (int) (size.getWidth() * 0.0001), (int) (size.getHeight() * 0.01), (int) (size.getWidth() * 0.0001)));
		pnlAdd.add(btnAddObject);
		pnlAdd.setOpaque(false);

		JPanel pnlEdit = new JPanel();
		btnEditObject = new JButton("edit");
		btnEditObject.addActionListener(e -> {
			for(AddEditRemoveListener l : listener)
			{
				l.edit((String) comboBoxObject.getSelectedItem());
			}
		});
		initFont(17);
		btnEditObject.setFont(textfont);
		pnlEdit.setBorder(BorderFactory.createEmptyBorder((int) (size.getHeight() * 0.01), (int) (size.getWidth() * 0.0001), (int) (size.getHeight() * 0.01), (int) (size.getWidth() * 0.0001)));
		pnlEdit.add(btnEditObject);
		pnlEdit.setOpaque(false);

		JPanel pnlRemove = new JPanel();
		btnRemoveObject = new JButton("remove");
		btnRemoveObject.addActionListener(e -> {
			for(AddEditRemoveListener l : listener)
			{
				l.remove((String) comboBoxObject.getSelectedItem());
			}
		});
		initFont(17);
		btnRemoveObject.setFont(textfont);
		pnlRemove.setBorder(BorderFactory.createEmptyBorder((int) (size.getHeight() * 0.01), (int) (size.getWidth() * 0.0001), (int) (size.getHeight() * 0.01), (int) (size.getWidth() * 0.0001)));
		pnlRemove.add(btnRemoveObject);
		pnlRemove.setOpaque(false);

		JPanel pnlBtns = new JPanel();
		pnlBtns.add(pnlAdd);
		pnlBtns.add(pnlEdit);
		pnlBtns.add(pnlRemove);
		pnlBtns.setOpaque(false);

		this.add(pnlBtns, BorderLayout.EAST);
	}

	public String getSelectedKey()
	{
		return (String) comboBoxObject.getSelectedItem();
	}

	public JButton getBtnEdit()
	{
		return btnEditObject;
	}

	public JButton getBtnRemove()
	{
		return btnRemoveObject;
	}

	public JButton getBtnAdd()
	{
		return btnAddObject;
	}

	public void updateListValue(Collection<String> pListKeys)
	{
		comboBoxObject.removeAllItems();
		for(String item : pListKeys)
		{
			comboBoxObject.addItem(item);
		}
	}

	/**
	 * Methode die den Text des Labels um ":" erweitert.
	 */
	private void checkLabelValue()
	{
		if(labelValue != null && !"".equals(labelValue))
		{
			labelValue += ": ";
		}
	}

	@Override
	public void reflectData()
	{
		List l = new ArrayList();
		for(DomainObject d : dataset.getElements().values())
		{
			l.add(d.getUiElementContainer().getElements().get(0).getDatafield().getInstance());
		}
		dataset.setValue(l);
	}

	public void reflectData(Dataset dataset)
	{
		List l = new ArrayList();
		for(DomainObject d : dataset.getElements().values())
		{
			l.add(d.getUiElementContainer().getElements().get(0).getDatafield().getInstance());
		}
		dataset.setValue(l);
	}

	public void AddAddEditRemoveListener(AddEditRemoveListener listener)
	{
		this.listener.add(listener);
	}

	@Override
	public boolean validateContent()
	{
		// ich wuesste nicht was hier schief gehen kann bei comboboxen...
		return true;
	}

}


text:
Reference Manual {#manual_root}
==========================

* [Install and build Chrono](@ref tutorial_install_chrono)

* [Build a project](@ref tutorial_install_project)

* @subpage modularity

* @subpage mathematical_objects
	* [Linear algebra](@ref linear_algebra)
	* [ChFunction objects](@ref ChFunction_objects)
	* [Quadrature](@ref quadrature)

* @subpage shared_pointers

* @subpage coordinate_transformations
	* [Vectors](@ref manual_ChVector)
	* [Quaternions](@ref manual_ChQuaternion)
	* [Rotation matrices](@ref manual_ChMatrix33)
	* [ChCoordsys](@ref manual_ChCoordsys)
	* [ChFrame](@ref manual_ChFrame)
	* [ChFrameMoving](@ref manual_ChFrameMoving)

* @subpage rigid_bodies
	* [ChBody](@ref manual_ChBody)
	* [ChBodyAuxRef](@ref manual_ChBodyAuxRef)
	* [Other bodies](@ref manual_otherbodies)

* @subpage markers

* @subpage collision_shapes
	* [Collision models](@ref collision_models)
	* [Collision families](@ref collision_families)
	* [Collision materials](@ref collision_materials)

* @subpage visualization_assets
	* [ChAsset](@ref manual_ChAsset)
	* [Visualization shapes](@ref manual_ChVisualization)

* @subpage links

* @subpage simulation_system
	* [ChSystem](@ref manual_ChSystem)
	* [Time steppers](@ref time_steppers)
	* [Solvers](@ref solvers)
	* [Other simulation parameters](@ref other_simulation_parameters)

* @subpage manual_fea
	* [List of nodes](@ref manual_fea_nodes)
	* [List of elements](@ref manual_fea_elements)

* @subpage introduction_chrono_pyengine

* @subpage introduction_chrono_solidworks

* @subpage tutorial_root


text:
[![](https://raw.github.com/HaxeFlixel/haxeflixel.com/master/src/files/images/flixel-logos/HaxeFlixel.png)](http://haxeflixel.com/)

[flixel](https://github.com/HaxeFlixel/flixel) | [addons](https://github.com/HaxeFlixel/flixel-addons) | [ui](https://github.com/HaxeFlixel/flixel-ui) | [demos](https://github.com/HaxeFlixel/flixel-demos) | [tools](https://github.com/HaxeFlixel/flixel-tools) | [templates](https://github.com/HaxeFlixel/flixel-templates) | [docs](https://github.com/HaxeFlixel/flixel-docs) | [haxeflixel.com](https://github.com/HaxeFlixel/haxeflixel.com)

[![Haxelib Version](https://img.shields.io/github/tag/HaxeFlixel/flixel.svg?label=haxelib)](http://lib.haxe.org/p/flixel) [![Patreon](https://img.shields.io/badge/donate-patreon-blue.svg)](https://www.patreon.com/haxeflixel) [![Build Status](https://img.shields.io/travis/HaxeFlixel/flixel.svg)](https://travis-ci.org/HaxeFlixel/flixel) [![Code Climate](https://img.shields.io/codeclimate/issues/HaxeFlixel/flixel.svg)](https://codeclimate.com/github/HaxeFlixel/flixel/issues)

[![](images/showcase.png)](http://www.haxeflixel.com/showcase)

## Links

Here are the most important links to get you started with HaxeFlixel:

- [Getting Started](https://haxeflixel.com/documentation/getting-started/)
- [Documentation](https://www.haxeflixel.com/documentation)
- [API](https://api.haxeflixel.com/)
- [Community](https://haxeflixel.com/documentation/community/)

If you want to contribute code or report an issue, please check our [CONTRIBUTING.md](https://github.com/HaxeFlixel/flixel/blob/dev/.github/CONTRIBUTING.md).

## Platforms

Thanks to being built on top of [Haxe](https://haxe.org/) and [OpenFL](http://www.openfl.org/), HaxeFlixel can target the following platforms _natively_:

![](images/platforms.png)

## About

HaxeFlixel has its roots in the original [ActionScript 3 version of Flixel](https://github.com/AdamAtomic/flixel), created by [Adam "Atomic" Saltsman](http://www.adamatomic.com/). It was started by [Alexander Hohlov](https://github.com/beeblerox) in 2011, initially as a straightforward Haxe port of the AS3 codebase and Richard Davey's [Flixel Power Tools](http://www.photonstorm.com/flixel-power-tools).

Thanks to the efforts of the [core team](https://github.com/orgs/HaxeFlixel/people) as well as [over 100 contributors](https://github.com/HaxeFlixel/flixel/graphs/contributors), today's version of HaxeFlixel far surpasses the capabilities of the original. Not only has the core engine seen many substantial improvements and new features, there is also a far richer ecosystem with additional libaries and [over 80 demo projects](https://github.com/HaxeFlixel/flixel-demos) to learn from.


text:
# A0164889E
###### /java/guitests/guihandles/PersonCardHandle.java
``` java
    public String getGroup() {
        return getTextFromLabel(GROUP_FIELD_ID);
    }

```
###### /java/guitests/guihandles/PersonCardHandle.java
``` java
    public String getStartDate() {
        String startDateField = getTextFromLabel(STARTDATE_FIELD_ID);
        String[] parts = startDateField.split(" +");
        String start = parts[0]; //Starts:
        String date = parts[1]; //01.01
        return date;
    }

```
###### /java/guitests/guihandles/PersonCardHandle.java
``` java
    public String getEndDate() {
        String endDateField = getTextFromLabel(ENDDATE_FIELD_ID);
        String[] parts = endDateField.split(" +");
        String end = parts[0]; //ends:
        String date = parts[1]; //01.01
        return date;
    }

    public List<String> getTags() {
        return getTags(getTagsContainer());
    }

    private List<String> getTags(Region tagsContainer) {
        return tagsContainer
                .getChildrenUnmodifiable()
                .stream()
                .map(node -> ((Labeled) node).getText())
                .collect(Collectors.toList());
    }

    private List<String> getTags(UniqueTagList tags) {
        return tags
                .asObservableList()
                .stream()
                .map(tag -> tag.tagName)
                .collect(Collectors.toList());
    }

    private Region getTagsContainer() {
        return guiRobot.from(node).lookup(TAGS_FIELD_ID).query();
    }

    public boolean isSamePerson(ReadOnlyTask person) {
        return getFullName().equals(person.getName().fullName)
                && getStartDate().equals(person.getStartDate().getInputValue())
                && getEndDate().equals(person.getEndDate().getInputValue())
                && getGroup().equals(person.getGroup().value);
        //&& getTags().equals(getTags(person.getTags()));
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof PersonCardHandle) {
            PersonCardHandle handle = (PersonCardHandle) obj;
            return getFullName().equals(handle.getFullName())
                    && getStartDate().equals(handle.getStartDate())
                    && getEndDate().equals(handle.getEndDate())
                    && getGroup().equals(handle.getGroup());
            //&& getTags().equals(handle.getTags());
        }
        return super.equals(obj);
    }

    @Override
    public String toString() {
        return getFullName() + " " + getGroup();
    }
}
```
###### /java/seedu/address/logic/LogicManagerTest.java
``` java
        Task adam() throws Exception {
            Name name = new Name("Adm Brown");
            EndDate privateEndDate = new EndDate("12.11");
            StartDate privateStartDate = new StartDate("12.00");
            Group privateGroup = new Group("leisure time");
            return new Task(name, privateStartDate, privateEndDate,
                    privateGroup, UniqueTagList.build(Tag.TAG_INCOMPLETE));
        }

```
###### /java/seedu/address/logic/LogicManagerTest.java
``` java
        /**
         * Generates a valid person using the given seed.
         * Running this function with the same parameter values guarantees the returned person will have the same state.
         * Each unique seed will generate a unique Person object.
         *
         * @param seed used to generate the person data field values
         */
        Task generatePerson(int seed) throws Exception {
            return new Task(
                    new Name("Person " + seed),
                    new StartDate("0" + Math.abs(seed) + ".0" + Math.abs(seed)),
                    new EndDate("0" + Math.abs(seed) + ".0" + Math.abs(seed)),
                    new Group("list of " + seed),
                    new UniqueTagList(new Tag("tag" + Math.abs(seed)), new Tag("tag" + Math.abs(seed + 1)))
                    );
        }

```
###### /java/seedu/address/logic/LogicManagerTest.java
``` java
        /**
         * Generates a Person object with given name. Other fields will have some dummy values.
         */
        Task generatePersonWithName(String name) throws Exception {
            return new Task(
                    new Name(name),
                    new StartDate("12.21"),
                    new EndDate("12.11"),
                    new Group("list of 1"),
                    new UniqueTagList(new Tag("tag"))
                    );
        }
    }
}
```
###### /java/seedu/address/testutil/PersonBuilder.java
``` java
    public PersonBuilder withGroup(String group) throws IllegalValueException {
        this.person.setGroup(new Group(group));
        return this;
    }

```
###### /java/seedu/address/testutil/PersonBuilder.java
``` java
    public PersonBuilder withEndDate(String date) throws IllegalValueException {
        this.person.setEndDate(new EndDate(date));
        return this;
    }

```
###### /java/seedu/address/commons/util/ConfigUtilTest.java
``` java
    private Config getTypicalConfig() {
        Config config = new Config();
        config.setAppTitle("Typical App Title");
        config.setLogLevel(Level.INFO);
        config.setUserPrefsFilePath("C:\\preferences.json");
        config.setTaskManagerFilePath("addressbook.xml");
        config.setTaskManagerName("TypicalAddressBookName");
        return config;
    }

    private Optional<Config> read(String configFileInTestDataFolder) throws DataConversionException {
        String configFilePath = addToTestDataPathIfNotNull(configFileInTestDataFolder);
        return ConfigUtil.readConfig(configFilePath);
    }

    @Test
    public void save_nullConfig_assertionFailure() throws IOException {
        thrown.expect(AssertionError.class);
        save(null, "SomeFile.json");
    }

    @Test
    public void save_nullFile_assertionFailure() throws IOException {
        thrown.expect(AssertionError.class);
        save(new Config(), null);
    }

    @Test
    public void saveConfig_allInOrder_success() throws DataConversionException, IOException {
        Config original = getTypicalConfig();

        String configFilePath = testFolder.getRoot() + File.separator + "TempConfig.json";

        //Try writing when the file doesn't exist
        ConfigUtil.saveConfig(original, configFilePath);
        Config readBack = ConfigUtil.readConfig(configFilePath).get();
        assertEquals(original, readBack);

        //Try saving when the file exists
        original.setAppTitle("Updated Title");
        original.setLogLevel(Level.FINE);
        ConfigUtil.saveConfig(original, configFilePath);
        readBack = ConfigUtil.readConfig(configFilePath).get();
        assertEquals(original, readBack);
    }

    private void save(Config config, String configFileInTestDataFolder) throws IOException {
        String configFilePath = addToTestDataPathIfNotNull(configFileInTestDataFolder);
        ConfigUtil.saveConfig(config, configFilePath);
    }

    private String addToTestDataPathIfNotNull(String configFileInTestDataFolder) {
        return configFileInTestDataFolder != null
                                  ? TEST_DATA_FOLDER + configFileInTestDataFolder
                                  : null;
    }

}
```


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

describe "Logger#debug?" do
  before :each do
    @path = tmp("test_log.log")
    @log_file = File.open(@path, "w+")
    @logger = Logger.new(@path)
  end

  after :each do
    @log_file.close unless @log_file.closed?
    File.unlink(@path) if File.exists?(@path)
  end

  it "returns true if severity level allows debug messages" do
    @logger.level = Logger::DEBUG
    @logger.debug?.should == true
  end

  it "returns false if severity level does not allow debug messages" do
    @logger.level = Logger::WARN
    @logger.debug?.should == false
  end
end

describe "Logger#debug" do
  before :each do
    @path = tmp("test_log.log")
    @log_file = File.open(@path, "w+")
    @logger = Logger.new(@path)
  end

  after :each do
    @log_file.close unless @log_file.closed?
    File.unlink(@path) if File.exists?(@path)
  end

  it "logs a DEBUG message" do
    @logger.debug("test")
    @log_file.rewind
    LoggerSpecs::strip_date(@log_file.readlines.first).should == "DEBUG -- : test\n"
  end

  it "accepts an application name with a block" do
    @logger.debug("MyApp") { "Test message" }
    @log_file.rewind
    LoggerSpecs::strip_date(@log_file.readlines.first).should == "DEBUG -- MyApp: Test message\n"
  end
end


text:
const durationCalc = require('./durationCalc')
const participationRate = require('./participationRate')
const contributionRate = require('./contributionRate')
const focusness = require('./focusness')
const discussionProductivity = require('./discussionProductivity')
const arrToObj = require('./arrToObj')

module.exports = payload => {
  const {
    topic = {},
    chat = {},
    timestamp = 0,
    participant = {},
    minnie = {}
  } = payload

  const {
    relevantChat = {},
    notes = {},
    todo = {}
  } = minnie

  // parsing data to array
  const participantArr = Object.keys(participant).map(key => participant[key])
  const chatArr = Object.keys(chat).map(key => chat[key])
  const relevantChatArr = Object.keys(relevantChat).map(key => relevantChat[key])
  const notesArr = Object.keys(notes).map(key => notes[key])

  // data
  const duration = durationCalc(timestamp)
  const durationString = `${duration.getHours}:${duration.getMinutes}`
  const userParticipationRate = participationRate(participantArr, relevantChatArr)
  const userContributionRate = contributionRate(participantArr, notesArr)
  const userFocusness = focusness(participantArr, relevantChatArr, chatArr)
  const discussionProductivityScore = discussionProductivity(relevantChatArr, chatArr)

  // push status to each todo
  Object.keys(todo).forEach(key => {
    todo[key].status = true
  })

  return {
    notes: notes,
    participant: participant,
    report: {
      duration: durationString,
      userParticipationRate: arrToObj(userParticipationRate),
      userContributionRate: arrToObj(userContributionRate),
      userFocusness: arrToObj(userFocusness),
      discussionProductivity: discussionProductivityScore,
      relevantChat: relevantChat
    },
    timestamp: Date.now(),
    status: false,
    todo: todo,
    topic: topic
  }
}


text:
import { AxiosResponse } from 'axios';
import { VideoSubmissionListData } from 'types/course/videoSubmissions';

import BaseCourseAPI from './Base';

export default class VideoSubmissionsAPI extends BaseCourseAPI {
  _getUrlPrefix(): string {
    return `/courses/${this.getCourseId()}/users/${this.getCourseUserId()}/video_submissions`;
  }

  /**
   * Fetches a list of video submitted by a user in a course.
   */
  index(): Promise<
    AxiosResponse<{
      videoSubmissions: VideoSubmissionListData[];
    }>
  > {
    return this.getClient().get(this._getUrlPrefix());
  }
}


text:
cask 'axure-rp' do
  version '9.0.0.3701'
  sha256 '55d4ef076a7edf8c9dda50d1122999f7340901289a7e2d1a172ea7271a61d29f'

  # axure.cachefly.net/ was verified as official when first introduced to the cask
  url 'https://axure.cachefly.net/AxureRP-Setup.dmg'
  appcast 'https://www.axure.com/release-history'
  name 'Axure RP'
  homepage 'https://www.axure.com/'

  app "Axure RP #{version.major}.app"

  zap trash: [
               "~/Library/Preferences/com.axure.AxureRP#{version.major}.plist",
               "~/Library/Saved Application State/com.axure.AxureRP#{version.major}.savedState",
               "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.axure.axurerp#{version.major}.sfl*",
             ]
end


text:
@interface FingerprintTemplate : NSObject

@property (nonatomic, assign) BOOL isSelected;
@property (nonatomic, assign) BOOL is_prepare_for_duress;
@property (nonatomic, strong) NSString *template0;
@property (nonatomic, strong) NSString *template1;

@end