text:
"""Pynche -- The PYthon Natural Color and Hue Editor.

Contact: %(AUTHNAME)s
Email:   %(AUTHEMAIL)s
Version: %(__version__)s

Pynche is based largely on a similar color editor I wrote years ago for the
SunView window system.  That editor was called ICE: the Interactive Color
Editor.  I'd always wanted to port the editor to X but didn't feel like
hacking X and C code to do it.  Fast forward many years, to where Python +
Tkinter provides such a nice programming environment, with enough power, that
I finally buckled down and implemented it.  I changed the name because these
days, too many other systems have the acronym `ICE'.

This program currently requires Python 2.2 with Tkinter.

Usage: %(PROGRAM)s [-d file] [-i file] [-X] [-v] [-h] [initialcolor]

Where:
    --database file
    -d file
        Alternate location of a color database file

    --initfile file
    -i file
        Alternate location of the initialization file.  This file contains a
        persistent database of the current Pynche options and color.  This
        means that Pynche restores its option settings and current color when
        it restarts, using this file (unless the -X option is used).  The
        default is ~/.pynche

    --ignore
    -X
        Ignore the initialization file when starting up.  Pynche will still
        write the current option settings to this file when it quits.

    --version
    -v
        print the version number and exit

    --help
    -h
        print this message

    initialcolor
        initial color, as a color name or #RRGGBB format
"""

__version__ = '1.4.1'

import sys
import os
import getopt
import ColorDB

from PyncheWidget import PyncheWidget
from Switchboard import Switchboard
from StripViewer import StripViewer
from ChipViewer import ChipViewer
from TypeinViewer import TypeinViewer

PROGRAM = sys.argv[0]
AUTHNAME = 'Barry Warsaw'
AUTHEMAIL = 'barry@python.org'

# Default locations of rgb.txt or other textual color database
RGB_TXT = [
    # Solaris OpenWindows
    '/usr/openwin/lib/rgb.txt',
    # Linux
    '/usr/lib/X11/rgb.txt',
    # The X11R6.4 rgb.txt file
    os.path.join(sys.path[0], 'X/rgb.txt'),
    # add more here
    ]

# Do this because PyncheWidget.py wants to get at the interpolated docstring
# too, for its Help menu.
def docstring():
    return __doc__ % globals()

def usage(code, msg=''):
    print(docstring())
    if msg:
        print(msg)
    sys.exit(code)

def initial_color(s, colordb):
    # function called on every color
    def scan_color(s, colordb=colordb):
        try:
            r, g, b = colordb.find_byname(s)
        except ColorDB.BadColor:
            try:
                r, g, b = ColorDB.rrggbb_to_triplet(s)
            except ColorDB.BadColor:
                return None, None, None
        return r, g, b
    #
    # First try the passed in color
    r, g, b = scan_color(s)
    if r is None:
        # try the same color with '#' prepended, since some shells require
        # this to be escaped, which is a pain
        r, g, b = scan_color('#' + s)
    if r is None:
        print('Bad initial color, using gray50:', s)
        r, g, b = scan_color('gray50')
    if r is None:
        usage(1, 'Cannot find an initial color to use')
        # does not return
    return r, g, b

def build(master=None, initialcolor=None, initfile=None, ignore=None,
          dbfile=None):
    # create all output widgets
    s = Switchboard(not ignore and initfile)
    # defer to the command line chosen color database, falling back to the one
    # in the .pynche file.
    if dbfile is None:
        dbfile = s.optiondb().get('DBFILE')
    # find a parseable color database
    colordb = None
    files = RGB_TXT[:]
    if dbfile is None:
        dbfile = files.pop()
    while colordb is None:
        try:
            colordb = ColorDB.get_colordb(dbfile)
        except (KeyError, IOError):
            pass
        if colordb is None:
            if not files:
                break
            dbfile = files.pop(0)
    if not colordb:
        usage(1, 'No color database file found, see the -d option.')
    s.set_colordb(colordb)

    # create the application window decorations
    app = PyncheWidget(__version__, s, master=master)
    w = app.window()

    # these built-in viewers live inside the main Pynche window
    s.add_view(StripViewer(s, w))
    s.add_view(ChipViewer(s, w))
    s.add_view(TypeinViewer(s, w))

    # get the initial color as components and set the color on all views.  if
    # there was no initial color given on the command line, use the one that's
    # stored in the option database
    if initialcolor is None:
        optiondb = s.optiondb()
        red = optiondb.get('RED')
        green = optiondb.get('GREEN')
        blue = optiondb.get('BLUE')
        # but if there wasn't any stored in the database, use grey50
        if red is None or blue is None or green is None:
            red, green, blue = initial_color('grey50', colordb)
    else:
        red, green, blue = initial_color(initialcolor, colordb)
    s.update_views(red, green, blue)
    return app, s

def run(app, s):
    try:
        app.start()
    except KeyboardInterrupt:
        pass

def main():
    try:
        opts, args = getopt.getopt(
            sys.argv[1:],
            'hd:i:Xv',
            ['database=', 'initfile=', 'ignore', 'help', 'version'])
    except getopt.error as msg:
        usage(1, msg)

    if len(args) == 0:
        initialcolor = None
    elif len(args) == 1:
        initialcolor = args[0]
    else:
        usage(1)

    ignore = False
    dbfile = None
    initfile = os.path.expanduser('~/.pynche')
    for opt, arg in opts:
        if opt in ('-h', '--help'):
            usage(0)
        elif opt in ('-v', '--version'):
            print("""\
Pynche -- The PYthon Natural Color and Hue Editor.
Contact: %(AUTHNAME)s
Email:   %(AUTHEMAIL)s
Version: %(__version__)s""" % globals())
            sys.exit(0)
        elif opt in ('-d', '--database'):
            dbfile = arg
        elif opt in ('-X', '--ignore'):
            ignore = True
        elif opt in ('-i', '--initfile'):
            initfile = arg

    app, sb = build(initialcolor=initialcolor,
                    initfile=initfile,
                    ignore=ignore,
                    dbfile=dbfile)
    run(app, sb)
    sb.save_views()

if __name__ == '__main__':
    main()


text:
<?php

namespace Silk\Test;
use Silk\Exchange\Populator\Populator;

/**
 * Class Model
 * @author  Lucas A. de Araújo <lucas@painapp.com.br>
 * @package Silk\Test
 * @configure {"table":"cad_model"}
 * @configure {"primary_key":"idmodel"}
 */
class NewModel
{
    /**
     * @configure {"alias":"elemento"}
     */
    private $element = 1;

    /**
     * @configure {"ignoreIfNull":true}
     */
    private $ignored = null;

    /**
     * @configure {"ignoreIfNull":true}
     */
    private $notIgnored = 123;

    /**
     * @return mixed
     */
    public function getElement()
    {
        return $this->element;
    }

    /**
     * @param mixed $element
     */
    public function setElement($element)
    {
        $this->element = $element;
    }

    /**
     * @return mixed
     */
    public function getIgnored()
    {
        return $this->ignored;
    }

    /**
     * @param mixed $ignored
     */
    public function setIgnored($ignored)
    {
        $this->ignored = $ignored;
    }

    /**
     * @return mixed
     */
    public function getNotIgnored()
    {
        return $this->notIgnored;
    }

    /**
     * @param mixed $notIgnored
     */
    public function setNotIgnored($notIgnored)
    {
        $this->notIgnored = $notIgnored;
    }
}

class PopulatorTest extends \PHPUnit_Framework_TestCase
{
    public function testPopulation()
    {
        $model = new NewModel();
        $array = ['elemento' => 2, 'notIgnored' => 321];
        Populator::populate($model, $array);

        $this->assertEquals($array['elemento'], $model->getElement());
        $this->assertEquals($array['notIgnored'], $model->getNotIgnored());
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.xmlbeam.tests.bugs;

import static org.junit.Assert.*;

import org.junit.Test;
import org.xmlbeam.XBProjector;
import org.xmlbeam.XBProjector.Flags;
import org.xmlbeam.annotation.XBWrite;

/**
 * @author sven
 *
 */
public class TestBug51ClassCastException {
    public interface Child {
        @XBWrite("ChildData")
        void setData(String data);
    }

    public interface ParentNoRootElement {

        @XBWrite("/*")
        void setChild(Child child);
    }

    @Test
    public void testSetChildOnParentAsDocumentRoot() {
        XBProjector projector = new XBProjector(Flags.TO_STRING_RENDERS_XML);

        ParentNoRootElement parent = projector.projectEmptyDocument(ParentNoRootElement.class);

        Child child = projector.projectEmptyElement("Child",Child.class);
        child.setData("child data...");
        parent.setChild(child);
        System.out.println("Result: " + parent);
    }
}


text:
<title>
Stop & Shop out to bust union
</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>

<?php include "../../legacy-includes/TopLogo.htmlf" ?>

<?php include "../../legacy-includes/TopAd.htmlf" ?>

<?php include "../../legacy-includes/LeftButtons.htmlf" ?>

<?php include "../../legacy-includes/BodyInsert.htmlf" ?>

UFCW votes overwhelmingly to authorize a strike

Stop & Shop out to bust union

By Wayne Standley | February 23, 2007 | Page 15

WORKERS IN five locals of the United Food and Commercial Workers (UFCW), representing almost 43,000 members, voted almost unanimously to authorize a strike at all Stop & Shop supermarkets in Massachusetts, Connecticut and Rhode Island.

At the last minute, despite the overwhelming rank-and-file enthusiasm for a strike, UCFW officials called off the work action and agreed to further talks with management. This strategy has not only weakened the union's position at the bargaining table, but has set the stage for management to step up its attack.

Stop & Shop's real plan is not negotiation, but busting the union, as the company has ordered pre-cut meat to sell if butchers are on the picket line. Top on the list of management's demands is that workers pay a larger share of a new health insurance plan.

Already, part-time employees--almost 80 percent of the workforce--have to wait two years before they can even become eligible for health care coverage. So it wasn't surprising that a recent report revealed that Stop & Shop in Massachusetts has the second-largest number of workers (after Wal-Mart) who rely on MassHealth (Medicaid) or the state's free care pool for basic health care.

The company also wants to eliminate the traditional defined pension benefit plan for all newly hired workers and replace it with a 401(k) plan. And management wants to cut the number of sick days, reduce the premium paid for overtime, holiday and Sunday work, and eliminate the work rotation schedule for holidays and Sundays.

One UFCW official described negotiations as only "getting uglier and uglier" after management announced it would turn seafood and floral departments into self-service units, transferring or eliminating workers there.

Further, the company has hired a union-busting "labor consultant" and taken out full-page ads in local newspapers for scabs, offering $15 an hour for full-time and $11 for part-time help --almost double the usual starting pay for new workers.

Stop & Shop, along with Giant Food and Tops grocery stores, is owned by Dutch conglomerate Royal Ahold N.V. Over the past few years, the company's market share has declined with competition from non-union and low-wage food retailers like Wal-Mart and discount clubs.

In April 2006, Ahold installed José Alvarez, formerly executive vice-president of supply and logistics at Stop & Shop, as CEO. His main task is to implement Ahold's new "Strategy for Profitable Growth" plan to "reduce operating costs...and increase efficiency." If labor costs aren't reduced enough to increase profits in a store, it will be closed.

Given this all-out assault, the union officials' threats of a strike just to get management back to the bargaining table won't achieve much.

Last year, Stop & Shop made more than $700 million in profits. It can well afford to provide a living wage and benefits for all its employees. And Stop & Shop workers have shown with their strike vote that they're willing to fight.

To add your voice to the demand for a decent contract, go www.unionvoice.org/campaign/justiceatstopandshop to send an e-mail to Stop & Shop CEO José Alvarez.

<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>

<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>


text:
<?xml version="1.0" encoding="UTF-8"?>

		<item value="708" key="DIALOG_X_ORIGIN"/>
		<item value="287" key="DIALOG_Y_ORIGIN"/>

		<item value="-1" key="dialogHeight"/>
		<item value="-1" key="dialogWidth"/>
		<list key="textEntries">
		</list>
		<list key="orderedElements">
		</list>
		<list key="orderedProviders">
		</list>
		<list key="textArray">
		</list>

		<item value="org.eclipse.egit.ui.internal.clone.GitCloneWizard" key="ImportExportPage.STORE_SELECTED_IMPORT_WIZARD_ID"/>
		<list key="ImportExportPage.STORE_EXPANDED_IMPORT_CATEGORIES">
			<item value="org.eclipse.ui.Basic"/>
			<item value="org.eclipse.egit.ui.internal.clone.gitclonecategory"/>
		</list>


text:
# 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.

import argparse

def main():
    """Main function"""

    parser = argparse.ArgumentParser(description='An argparse snippet.')
    parser.add_argument('filenames', nargs='+', type=file, metavar='FILE', help='file to read')
    args = parser.parse_args()

    for fd in args.filenames:
        print fd.read()
        fd.close()

if __name__ == '__main__':
    main()


text:
@extends('core::app.layout')

@section('content')

        @include('bumi-shares::app/facility/bumi-shares/_breadcrumb')

Owner

Owner

    @include('bumi-shares::app.facility.bumi-shares.owner._menu')

            <form action="{{ url('facility/bumi-shares/owner') }}" method="get" class="form-horizontal">

                        <input type="text" name="search" class="form-control" placeholder="Search Name..." value="{{app('request')->input('search')}}" autofocus>

                        <button type="submit" class="btn btn-effect-ripple btn-effect-ripple btn-primary"> Search</button>

            </form>

                {!! $owner_list->render() !!}

                            Name

                        @foreach($owner_list as $owner)

id}}">
                            id) }}">{{ $owner->name }}

                        @endforeach

                {!! $owner_list->render() !!}

@stop


text:
Discussion::Engine.routes.draw do
  resources :threads do
    resources :comments, except: [:show]
  end
end


text:
<!doctype html>

<meta charset="utf-8">
<title>Page Not Found – Byteloot</title>
<meta name="description" content="Page not found. Your pixels are in another canvas.">
<meta name="keywords" content="">

<meta name="twitter:title" content="Page Not Found">
<meta name="twitter:description" content="Page not found. Your pixels are in another canvas.">

<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="/images/default-thumb.png">

<meta property="og:locale" content="en_US">
<meta property="og:type" content="article">
<meta property="og:title" content="Page Not Found">
<meta property="og:description" content="Page not found. Your pixels are in another canvas.">
<meta property="og:url" content="/404.html">
<meta property="og:site_name" content="Byteloot">

<link rel="canonical" href="/404.html">
<link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Byteloot Feed">

<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="/assets/css/main.css">

<meta http-equiv="cleartype" content="on">

<link href='//fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700%7CPT+Serif:400,700,400italic' rel='stylesheet' type='text/css'>

<link rel="shortcut icon" href="/favicon.ico">

<link rel="shortcut icon" href="/favicon.png">

<link rel="apple-touch-icon-precomposed" href="/images/apple-touch-icon-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/images/apple-touch-icon-72x72-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/images/apple-touch-icon-114x114-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/images/apple-touch-icon-144x144-precomposed.png">

		Byteloot

Games

Blog

About

Art Shmatkov

Page Not Found

Sorry, but the page you were trying to view does not exist — perhaps you can try searching for it below.

Share on

       Twitter

       Facebook

       Google+

© 2015 Art Shmatkov. Powered by Jekyll using the Minimal Mistakes theme.


text:
package in.projectmanas.manasliaison.activities;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.backendless.async.callback.AsyncCallback;
import com.backendless.exceptions.BackendlessFault;

import java.util.Date;

import in.projectmanas.manasliaison.R;
import in.projectmanas.manasliaison.backendless_classes.Links;
import in.projectmanas.manasliaison.backendless_classes.RecruitmentDetails;

public class OnlineChallengeOngoing extends AppCompatActivity {
    private Button onlineChallengeRedirectButton;
    private TextView tvOLDaysRemaining;
    private CoordinatorLayout coordinatorLayout;
    private View pbOLDaysRemaining;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        linkViews();
        RecruitmentDetails.findFirstAsync(new AsyncCallback<RecruitmentDetails>() {
            @Override
            public void handleResponse(RecruitmentDetails response) {
                pbOLDaysRemaining.setVisibility(View.INVISIBLE);
                tvOLDaysRemaining.setText(String.valueOf(
                        (response.getOnlineChallengeDate().getTime() - new Date().getTime()) / ((24 * 60 * 60 * 1000))
                ));
            }

            @Override
            public void handleFault(BackendlessFault fault) {
                Snackbar.make(coordinatorLayout, fault.getMessage(), Snackbar.LENGTH_INDEFINITE).show();
            }
        });
        onlineChallengeRedirectButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Links.findFirstAsync(new AsyncCallback<Links>() {
                    @Override
                    public void handleResponse(Links response) {
                        Intent httpIntent = new Intent(Intent.ACTION_VIEW);
                        httpIntent.setData(Uri.parse(response.getOnlineChallenge()));
                        startActivity(httpIntent);
                    }

                    @Override
                    public void handleFault(BackendlessFault fault) {
                        Toast.makeText(getApplicationContext(), "Please connect to internet", Toast.LENGTH_LONG).show();
                    }
                });
            }
        });
    }

    private void linkViews() {
        setContentView(R.layout.activity_online_challenge_ongoing);
        coordinatorLayout = (CoordinatorLayout) findViewById(R.id.cl_ongoing_ol);
        onlineChallengeRedirectButton = (Button) findViewById(R.id.button_reg_hacker_rank);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        pbOLDaysRemaining = findViewById(R.id.pb_online_challenge);
        tvOLDaysRemaining = (TextView) findViewById(R.id.tv_ol_days_remaining);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                Intent intent = new Intent(this, HomeActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }
}


text:
Babel preset for ExtPlug and plugins.

This includes ES2015 and some proposal plugins, targeting AMD or CommonJS
modules.

## Install

```sh
$ npm install --save-dev babel-preset-extplug
```

## Usage

In your `.babelrc`:

```js
{
  "presets": [
    ["extplug", { "amd": true|false }]
  ]
}
```

Because the preset can target AMD modules for plugins, it doesn't play nice with
a `gulpfile.babel.js`. This means that you can't put it in your `.babelrc` if
you also want to use ES-future in your gulpfile. Instead, put a config that
works for gulp in your `.babelrc`, and pass `babel-preset-extplug` to Babel
manually when you compile your plugin.

```js
// .babelrc
{
  "presets": [
    ["extplug", { "amd": false }]
  ]
}
```

```js
// gulpfile.babel.js
gulp.src(myPluginSources)
  .pipe(babel({
    babelrc: false,
    presets: [
      ['extplug', { amd: true }]
    ]
  }))
  .pipe(gulp.dest(builtPluginDirectory))
```

## License

[MIT](./LICENSE)


text:
XBPS_TARGET_ARCH="armv6l-musl"
XBPS_CROSS_TRIPLET="arm-linux-musleabi"
XBPS_CFLAGS="-O2 -pipe -fstack-protector-strong"
XBPS_CXXFLAGS="$XBPS_CFLAGS"
XBPS_CROSS_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"


text:
from setuptools import setup, find_packages

requirements = ["pytz"]

setup(
    name = "cubes-mongo",
    version = '0.1',

    install_requires = requirements,

    packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
    package_data = {
    },

    classifiers = [
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python',
        'Topic :: Database',
        'Topic :: Scientific/Engineering',
        'Topic :: Utilities'
    ],

    entry_points={
    },

    test_suite = "tests",

    # metadata for upload to PyPI
    author = "Robin Thomas",
    author_email = "rthomas@squarespace.com",
    description = "MongoDB Backend for Cubes Python OLAP",
    license = "MIT",
    keywords = "olap multidimensional data analysis",
    url = "http://cubes.databrewery.org"
)


text:
package org.pageobject.core.page

import org.openqa.selenium.Keys

/**
 * PageModule for keyboard driven tests.
 *
 * For an example see WikipediaTest.
 */
class KeyboardModule(implicit parentPageReference: ParentPageReference) extends PageModule {
  def sendKeys(keys: String): Unit = {
    (switch to activeElement).sendKeys(keys)
  }

  def press(keys: Keys*): Unit = sendKeys(keys.mkString)

  def pressTab(): Unit = press(Keys.TAB)

  def pressShiftTab(): Unit = press(Keys.SHIFT, Keys.TAB)

  def pressEnter(): Unit = press(Keys.ENTER)
}


text:
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>

   <parent>
      <artifactId>artemis-protocols</artifactId>
      <groupId>org.apache.activemq</groupId>
      <version>2.7.0-SNAPSHOT</version>
   </parent>

   <artifactId>artemis-amqp-protocol</artifactId>
   <packaging>bundle</packaging>
   <name>ActiveMQ Artemis AMQP Protocol</name>

   <properties>
      <activemq.basedir>${project.basedir}/../..</activemq.basedir>
   </properties>

   <dependencies>
      <!-- JMS Client because of some conversions that are done -->
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-jms-client</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-selector</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-core-client</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.jboss.logging</groupId>
         <artifactId>jboss-logging-processor</artifactId>
         <scope>provided</scope>
         <optional>true</optional>
      </dependency>
      <dependency>
         <groupId>org.jboss.logging</groupId>
         <artifactId>jboss-logging-annotations</artifactId>
         <scope>provided</scope>
         <optional>true</optional>
      </dependency>

      <!--
          JBoss Logging
      -->

      <dependency>
         <groupId>org.jboss.logmanager</groupId>
         <artifactId>jboss-logmanager</artifactId>
         <scope>test</scope>
      </dependency>

      <!-- this is for the log assertion -->
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-commons</artifactId>
         <version>${project.version}</version>
      </dependency>

      <dependency>
         <groupId>org.jboss.logging</groupId>
         <artifactId>jboss-logging</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-server</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-journal</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.qpid</groupId>
         <artifactId>proton-j</artifactId>
      </dependency>
      <dependency>
         <groupId>commons-collections</groupId>
         <artifactId>commons-collections</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-jms_2.0_spec</artifactId>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>io.netty</groupId>
         <artifactId>netty-buffer</artifactId>
      </dependency>
      <dependency>
         <groupId>io.netty</groupId>
         <artifactId>netty-transport</artifactId>
      </dependency>
      <dependency>
         <groupId>org.osgi</groupId>
         <artifactId>osgi.cmpn</artifactId>
      </dependency>
      <dependency>
         <groupId>org.mockito</groupId>
         <artifactId>mockito-core</artifactId>
         <scope>test</scope>
      </dependency>
   </dependencies>
</project>


text:
package lxd

import (
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"os/exec"
	"strings"

	"github.com/lxc/lxd/shared"
	"github.com/lxc/lxd/shared/api"
)

// Image handling functions

// GetImages returns a list of available images as Image structs
func (r *ProtocolSimpleStreams) GetImages() ([]api.Image, error) {
	return r.ssClient.ListImages()
}

// GetImageFingerprints returns a list of available image fingerprints
func (r *ProtocolSimpleStreams) GetImageFingerprints() ([]string, error) {
	// Get all the images from simplestreams
	images, err := r.ssClient.ListImages()
	if err != nil {
		return nil, err
	}

	// And now extract just the fingerprints
	fingerprints := []string{}
	for _, img := range images {
		fingerprints = append(fingerprints, img.Fingerprint)
	}

	return fingerprints, nil
}

// GetImage returns an Image struct for the provided fingerprint
func (r *ProtocolSimpleStreams) GetImage(fingerprint string) (*api.Image, string, error) {
	image, err := r.ssClient.GetImage(fingerprint)
	if err != nil {
		return nil, "", err
	}

	return image, "", err
}

// GetImageFile downloads an image from the server, returning an ImageFileResponse struct
func (r *ProtocolSimpleStreams) GetImageFile(fingerprint string, req ImageFileRequest) (*ImageFileResponse, error) {
	// Sanity checks
	if req.MetaFile == nil && req.RootfsFile == nil {
		return nil, fmt.Errorf("No file requested")
	}

	// Get the file list
	files, err := r.ssClient.GetFiles(fingerprint)
	if err != nil {
		return nil, err
	}

	// Prepare the response
	resp := ImageFileResponse{}

	// Download function
	download := func(path string, filename string, sha256 string, target io.WriteSeeker) (int64, error) {
		// Try over http
		url := fmt.Sprintf("http://%s/%s", strings.TrimPrefix(r.httpHost, "https://"), path)

		size, err := shared.DownloadFileSha256(r.http, r.httpUserAgent, req.ProgressHandler, req.Canceler, filename, url, sha256, target)
		if err != nil {
			// Try over https
			url = fmt.Sprintf("%s/%s", r.httpHost, path)
			size, err = shared.DownloadFileSha256(r.http, r.httpUserAgent, req.ProgressHandler, req.Canceler, filename, url, sha256, target)
			if err != nil {
				return -1, err
			}
		}

		return size, nil
	}

	// Download the LXD image file
	meta, ok := files["meta"]
	if ok && req.MetaFile != nil {
		size, err := download(meta.Path, "metadata", meta.Sha256, req.MetaFile)
		if err != nil {
			return nil, err
		}

		parts := strings.Split(meta.Path, "/")
		resp.MetaName = parts[len(parts)-1]
		resp.MetaSize = size
	}

	// Download the rootfs
	rootfs, ok := files["root"]
	if ok && req.RootfsFile != nil {
		// Look for deltas (requires xdelta3)
		downloaded := false
		_, err := exec.LookPath("xdelta3")
		if err == nil && req.DeltaSourceRetriever != nil {
			for filename, file := range files {
				if !strings.HasPrefix(filename, "root.delta-") {
					continue
				}

				// Check if we have the source file for the delta
				srcFingerprint := strings.Split(filename, "root.delta-")[1]
				srcPath := req.DeltaSourceRetriever(srcFingerprint, "rootfs")
				if srcPath == "" {
					continue
				}

				// Create temporary file for the delta
				deltaFile, err := ioutil.TempFile("", "lxc_image_")
				if err != nil {
					return nil, err
				}
				defer deltaFile.Close()
				defer os.Remove(deltaFile.Name())

				// Download the delta
				_, err = download(file.Path, "rootfs delta", file.Sha256, deltaFile)
				if err != nil {
					return nil, err
				}

				// Create temporary file for the delta
				patchedFile, err := ioutil.TempFile("", "lxc_image_")
				if err != nil {
					return nil, err
				}
				defer patchedFile.Close()
				defer os.Remove(patchedFile.Name())

				// Apply it
				_, err = shared.RunCommand("xdelta3", "-f", "-d", "-s", srcPath, deltaFile.Name(), patchedFile.Name())
				if err != nil {
					return nil, err
				}

				// Copy to the target
				size, err := io.Copy(req.RootfsFile, patchedFile)
				if err != nil {
					return nil, err
				}

				parts := strings.Split(rootfs.Path, "/")
				resp.RootfsName = parts[len(parts)-1]
				resp.RootfsSize = size
				downloaded = true
			}
		}

		// Download the whole file
		if !downloaded {
			size, err := download(rootfs.Path, "rootfs", rootfs.Sha256, req.RootfsFile)
			if err != nil {
				return nil, err
			}

			parts := strings.Split(rootfs.Path, "/")
			resp.RootfsName = parts[len(parts)-1]
			resp.RootfsSize = size
		}
	}

	return &resp, nil
}

// GetImageSecret isn't relevant for the simplestreams protocol
func (r *ProtocolSimpleStreams) GetImageSecret(fingerprint string) (string, error) {
	return "", fmt.Errorf("Private images aren't supported by the simplestreams protocol")
}

// GetPrivateImage isn't relevant for the simplestreams protocol
func (r *ProtocolSimpleStreams) GetPrivateImage(fingerprint string, secret string) (*api.Image, string, error) {
	return nil, "", fmt.Errorf("Private images aren't supported by the simplestreams protocol")
}

// GetPrivateImageFile isn't relevant for the simplestreams protocol
func (r *ProtocolSimpleStreams) GetPrivateImageFile(fingerprint string, secret string, req ImageFileRequest) (*ImageFileResponse, error) {
	return nil, fmt.Errorf("Private images aren't supported by the simplestreams protocol")
}

// GetImageAliases returns the list of available aliases as ImageAliasesEntry structs
func (r *ProtocolSimpleStreams) GetImageAliases() ([]api.ImageAliasesEntry, error) {
	return r.ssClient.ListAliases()
}

// GetImageAliasNames returns the list of available alias names
func (r *ProtocolSimpleStreams) GetImageAliasNames() ([]string, error) {
	// Get all the images from simplestreams
	aliases, err := r.ssClient.ListAliases()
	if err != nil {
		return nil, err
	}

	// And now extract just the names
	names := []string{}
	for _, alias := range aliases {
		names = append(names, alias.Name)
	}

	return names, nil
}

// GetImageAlias returns an existing alias as an ImageAliasesEntry struct
func (r *ProtocolSimpleStreams) GetImageAlias(name string) (*api.ImageAliasesEntry, string, error) {
	alias, err := r.ssClient.GetAlias(name)
	if err != nil {
		return nil, "", err
	}

	return alias, "", err
}


text:
#ifndef __FASTPIN_ARM_NRF52_H
#define __FASTPIN_ARM_NRF52_H

/*
//
// Background:
// ===========
// the nRF52 has more than 32 ports, and thus must support
// two distinct GPIO port registers.
//
// For the nRF52 series, the structure to control the port is
// `NRF_GPIO_Type`, with separate addresses mapped for set, clear, etc.
// The two ports are defined as NRF_P0 and NRF_P1.
// An example declaration for the ports is:
//     #define NRF_P0_BASE   0x50000000UL
//     #define NRF_P1_BASE   0x50000300UL
//     #define NRF_P0        ((NRF_GPIO_Type*)NRF_P0_BASE)
//     #define NRF_P1        ((NRF_GPIO_Type*)NRF_P1_BASE)
//
// Therefore, ideally, the _FL_DEFPIN() macro would simply
// conditionally pass either NRF_P0 or NRF_P1 to the underlying
// FastPin<> template class class.
//
// The "pin" provided to the FastLED<> template (and which
// the _FL_DEFPIN() macro specializes for valid pins) is NOT
// the microcontroller port.pin, but the Arduino digital pin.
// Some boards have an identity mapping (e.g., nRF52832 Feather)
// but most do not.  Therefore, the _FL_DEFPIN() macro
// must translate the Arduino pin to the mcu port.pin.
//
//
// Difficulties:
// =============
// The goal is to avoid any such lookups, using compile-time
// optimized functions for speed, in line with FastLED's
// overall design goals. This means constexpr, compile-time
// and aggressive inlining of functions....
//
// Right away, this precludes the use of g_ADigitalPinMap,
// which is not constexpr, and thus not available for
// preprocessor/compile-time optimizations.  Therefore,
// we have to specialize FastPin<uint8_t PIN>, given a
// compile-time value for PIN, into at least a PORT and
// a BITMASK for the port.
//
// Arduino compiles using C++11 for at least Feather nRF52840 Express.
// C++11 is very restrictive about template parameters.
// Template parameters can only be:
// 1. a type (as most people expect)
// 2. a template
// 3. a constexpr native integer type
//
// Therefore, attempts to use `NRF_GPIO_Type *` as a
// template parameter will fail....
//
// Solution:
// =========
// The solution chosen is to define a unique structure for each port,
// whose SOLE purpose is to have a static inline function that
// returns the `NRF_GPIO_Type *` that is needed.
//
// Thus, while it's illegal to pass `NRF_P0` as a template
// parameter, it's perfectly legal to pass `__generated_struct_NRF_P0`,
// and have the template call a well-known `static inline` function
// that returns `NRF_P0` ... which is itself a compile-time constant.
//
// Note that additional magic can be applied that will automatically
// generate the structures.  If you want to add that to this platform,
// check out the KL26 platform files for a starting point.
//
*/

// manually define two structures, to avoid fighting with preprocessor macros
struct __generated_struct_NRF_P0 {
    FASTLED_NRF52_INLINE_ATTRIBUTE constexpr static uintptr_t r() {
        return NRF_P0_BASE;
    }
};
// Not all NRF52 chips have two ports.  Only define if P1 is present.
#if defined(NRF_P1_BASE)
struct __generated_struct_NRF_P1 {
    FASTLED_NRF52_INLINE_ATTRIBUTE constexpr static uintptr_t r() {
        return NRF_P1_BASE;
    }
};
#endif

// The actual class template can then use a typename, for what is essentially a constexpr NRF_GPIO_Type*
template <uint32_t _MASK, typename _PORT, uint8_t _PORT_NUMBER, uint8_t _PIN_NUMBER> class _ARMPIN  {
public:
    typedef volatile uint32_t * port_ptr_t;
    typedef uint32_t port_t;

    FASTLED_NRF52_INLINE_ATTRIBUTE static void       setOutput() {
        // OK for this to be more than one instruction, as unusual to quickly switch input/output modes
        nrf_gpio_cfg(
            nrf_pin(),
            NRF_GPIO_PIN_DIR_OUTPUT,        // set pin as output
            NRF_GPIO_PIN_INPUT_DISCONNECT,  // disconnect the input buffering
            NRF_GPIO_PIN_NOPULL,            // neither pull-up nor pull-down resistors enabled
            NRF_GPIO_PIN_H0H1,              // high drive mode required for faster speeds
            NRF_GPIO_PIN_NOSENSE            // pin sense level disabled
            );
    }
    FASTLED_NRF52_INLINE_ATTRIBUTE static void       setInput()  {
        // OK for this to be more than one instruction, as unusual to quickly switch input/output modes
        nrf_gpio_cfg(
            nrf_pin(),
            NRF_GPIO_PIN_DIR_INPUT,         // set pin as input
            NRF_GPIO_PIN_INPUT_DISCONNECT,  // disconnect the input buffering
            NRF_GPIO_PIN_NOPULL,            // neither pull-up nor pull-down resistors enabled
            NRF_GPIO_PIN_H0H1,              // high drive mode required for faster speeds
            NRF_GPIO_PIN_NOSENSE            // pin sense level disabled
            );
    }
    FASTLED_NRF52_INLINE_ATTRIBUTE static void       hi()        { (reinterpret_cast<NRF_GPIO_Type*>(_PORT::r()))->OUTSET = _MASK;            } // sets _MASK in the SET   OUTPUT register (output set high)
    FASTLED_NRF52_INLINE_ATTRIBUTE static void       lo()        { (reinterpret_cast<NRF_GPIO_Type*>(_PORT::r()))->OUTCLR = _MASK;            } // sets _MASK in the CLEAR OUTPUT register (output set low)
    FASTLED_NRF52_INLINE_ATTRIBUTE static void       toggle()    { (reinterpret_cast<NRF_GPIO_Type*>(_PORT::r()))->OUT ^= _MASK;              } // toggles _MASK bits in the OUTPUT GPIO port directly
    FASTLED_NRF52_INLINE_ATTRIBUTE static void       strobe()    { toggle();     toggle();                } // BUGBUG -- Is this used by FastLED?  Without knowing (for example) SPI Speed?
    FASTLED_NRF52_INLINE_ATTRIBUTE static port_t     hival()     { return (reinterpret_cast<NRF_GPIO_Type*>(_PORT::r()))->OUT | _MASK;        } // sets all _MASK bit(s) in the OUTPUT GPIO port to 1
    FASTLED_NRF52_INLINE_ATTRIBUTE static port_t     loval()     { return (reinterpret_cast<NRF_GPIO_Type*>(_PORT::r()))->OUT & ~_MASK;       } // sets all _MASK bit(s) in the OUTPUT GPIO port to 0
    FASTLED_NRF52_INLINE_ATTRIBUTE static port_ptr_t port()      { return &((reinterpret_cast<NRF_GPIO_Type*>(_PORT::r()))->OUT);             } // gets raw pointer to OUTPUT          GPIO port
    FASTLED_NRF52_INLINE_ATTRIBUTE static port_ptr_t cport()     { return &((reinterpret_cast<NRF_GPIO_Type*>(_PORT::r()))->OUTCLR);          } // gets raw pointer to SET   DIRECTION GPIO port
    FASTLED_NRF52_INLINE_ATTRIBUTE static port_ptr_t sport()     { return &((reinterpret_cast<NRF_GPIO_Type*>(_PORT::r()))->OUTSET);          } // gets raw pointer to CLEAR DIRECTION GPIO port
    FASTLED_NRF52_INLINE_ATTRIBUTE static port_t     mask()      { return _MASK;                          } // gets the value of _MASK
    FASTLED_NRF52_INLINE_ATTRIBUTE static void hi (REGISTER port_ptr_t port) { hi();                      } // sets _MASK in the SET   OUTPUT register (output set high)
    FASTLED_NRF52_INLINE_ATTRIBUTE static void lo (REGISTER port_ptr_t port) { lo();                      } // sets _MASK in the CLEAR OUTPUT register (output set low)
    FASTLED_NRF52_INLINE_ATTRIBUTE static void set(REGISTER port_t     val ) { (reinterpret_cast<NRF_GPIO_Type*>(_PORT::r()))->OUT = val;     } // sets entire port's value (optimization used by FastLED)
    FASTLED_NRF52_INLINE_ATTRIBUTE static void fastset(REGISTER port_ptr_t port, REGISTER port_t val) { *port = val; }
    constexpr                      static uint32_t   nrf_pin2() { return NRF_GPIO_PIN_MAP(_PORT_NUMBER, _PIN_NUMBER); }
    constexpr                      static bool       LowSpeedOnlyRecommended() {
        // Caller must always determine if high speed use if allowed on a given pin,
        // because it depends on more than just the chip packaging ... it depends on entire board (and even system) design.
        return false; // choosing default to be FALSE, to allow users to ATTEMPT to use high-speed on pins where support is not known
    }
    // Expose the nrf pin (port/pin combined), port, and pin as properties (e.g., for setting up SPI)

    FASTLED_NRF52_INLINE_ATTRIBUTE static uint32_t   nrf_pin()  { return NRF_GPIO_PIN_MAP(_PORT_NUMBER, _PIN_NUMBER); }
};

//
// BOARD_PIN can be either the pin portion of a port.pin, or the combined NRF_GPIO_PIN_MAP() number.
// For example both the following two defines refer to P1.15 (pin 47) as Arduino pin 3:
//     _FL_DEFPIN(3, 15, 1);
//     _FL_DEFPIN(3, 47, 1);
//
// Similarly, the following defines are all equivalent:
//     _DEFPIN_ARM_IDENTITY_P1(47);
//     _FL_DEFPIN(47, 15, 1);
//     _FL_DEFPIN(47, 47, 1);
//

#define _FL_DEFPIN(ARDUINO_PIN, BOARD_PIN, BOARD_PORT)   \
    template<> class FastPin<ARDUINO_PIN> :              \
    public _ARMPIN<                                      \
        1u << (BOARD_PIN & 31u),                         \
        __generated_struct_NRF_P ## BOARD_PORT,          \
        (BOARD_PIN / 32),                                \
        BOARD_PIN & 31u                                  \
        >                                                \
    {}

#define _DEFPIN_ARM_IDENTITY_P0(ARDUINO_PIN)      \
    template<> class FastPin<ARDUINO_PIN> :       \
    public _ARMPIN<                               \
        1u << (ARDUINO_PIN & 31u),                \
        __generated_struct_NRF_P0,                \
        0,                                        \
        (ARDUINO_PIN & 31u) + 0                   \
        >                                         \
    {}

#define _DEFPIN_ARM_IDENTITY_P1(ARDUINO_PIN)      \
    template<> class FastPin<ARDUINO_PIN> :       \
    public _ARMPIN<                               \
        1u << (ARDUINO_PIN & 31u),                \
        __generated_struct_NRF_P1,                \
        1,                                        \
        (ARDUINO_PIN & 31u) + 32                  \
        >                                         \
    {}

// The actual pin definitions are in a separate header file...
#include "fastpin_arm_nrf52_variants.h"

#define HAS_HARDWARE_PIN_SUPPORT

#endif // #ifndef __FASTPIN_ARM_NRF52_H


text:
=======================

## Tests

Included are a bunch of functional tests. These will be improved over time, but are here to make sure
Everything works in function. Note that this does not mean it works in frontend instantly. That requires Behat tests.

Feel free to improve or add tests.


text:
package ai.vespa.client.dsl;

import java.util.List;
import java.util.Map;

public class Wand extends QueryChain {

    private final String fieldName;
    private final Object value;
    private Annotation annotation;

    Wand(String fieldName, Map<String, Integer> weightedSet) {
        this.fieldName = fieldName;
        this.value = weightedSet;
        this.nonEmpty = true;
    }

    Wand(String fieldName, List<List<Integer>> numeric) {
        boolean invalid = numeric.stream().anyMatch(range -> range.size() != 2);
        if (invalid) {
            throw new IllegalArgumentException("incorrect range format");
        }

        this.fieldName = fieldName;
        this.value = numeric;
        this.nonEmpty = true;
    }

    public Wand annotate(Annotation annotation) {
        this.annotation = annotation;
        return this;
    }

    @Override
    public Select getSelect() {
        return sources.select;
    }

    @Override
    boolean hasPositiveSearchField(String fieldName) {
        // TODO: implementation
        throw new UnsupportedOperationException("method not implemented");
    }

    @Override
    boolean hasPositiveSearchField(String fieldName, Object value) {
        // TODO: implementation
        throw new UnsupportedOperationException("method not implemented");
    }

    @Override
    boolean hasNegativeSearchField(String fieldName) {
        // TODO: implementation
        throw new UnsupportedOperationException("method not implemented");
    }

    @Override
    boolean hasNegativeSearchField(String fieldName, Object value) {
        // TODO: implementation
        throw new UnsupportedOperationException("method not implemented");
    }

    @Override
    public String toString() {
        boolean hasAnnotation = A.hasAnnotation(annotation);
        String s = Text.format("wand(%s, %s)", fieldName, Q.toJson(value));
        return hasAnnotation ? Text.format("(%s%s)", annotation, s) : s;
    }

}


text:
from setuptools import setup

setup(
    name="strichliste",
    packages=["strichliste"],
    include_package_data=True,
    install_requires=[
        "flask",
        "flask-sqlalchemy",
        'eventlet',
        "whitenoise",
        "requests",
        "selenium"
    ]
)


text:
export const AnnouncementTemplatePreviewPopupController = function ($mdDialog, fields, data, templates, results, hubApiService) {
  'ngInject';

  const ctrl = this;

  ctrl.processing = false;
  ctrl.readOnly = false;
  ctrl.fields = fields;
  ctrl.data = {};
  ctrl.results = null;

  ctrl.finish = $mdDialog.hide;
  ctrl.preview = preview;

  init();

  function init() {
    if (results) {
      ctrl.readOnly = true;
      ctrl.results = results;
    } else if (data) {
      ctrl.readOnly = true;
      ctrl.data = data;
      preview();
    } else {
      ctrl.readOnly = false;
    }
  }

  function preview() {
    ctrl.processing = true;
    ctrl.results = null;

    hubApiService
      .previewAnnouncementTemplate(templates, ctrl.data)
      .then(results => {
        ctrl.results = results;
      })
      .finally(() => {
        ctrl.processing = false;
      });
  }
};


text:
var Vue = require('vue');

// var ExampleZoom = require('./components/example-zoom.vue');
var ExamplePinyin = require('./components/example-pinyin.vue');

var MyComponent = Vue.extend({
	template: '
A custom component
'
});

Vue.component('my-component', MyComponent);

new Vue({
	el: 'body',
	data: {
		title: 'Hello Vue!'
	},
	components: {
		// 'example-zoom': ExampleZoom,
		'example-pinyin': ExamplePinyin
	},
	methods: {
		getRequest: function() {
			alert('outch');
			var myImage = this.$els.myImage;

			var myHeaders = new Headers();
			var myInit = {
				method: 'GET',
				headers: myHeaders,
				mode: 'cors',
				cache: 'default'
			};

			fetch('flowers.jpg', myInit)
				.then(function(response) {
					return response.blob();
				})
				.then(function(myBlob) {
					var objectURL = URL.createObjectURL(myBlob);

					myImage.src = objectURL;
				});
		}
	}
});


text:
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:

/**
 * Emphazised text rule parser class for Mediawiki. Makes Emphasis, Strong or both
 * This class implements a Text_Wiki_Parse to find source text marked for
 * emphasis, stronger and very as defined by text surrounded by 2,3 or 5 single-quotes.
 * On parsing, the text itself is left in place, but the starting and ending
 * instances of the single-quotes are replaced with tokens.
 *
 * This class does not follow the standard structure of other Text_Wiki_Parse class and
 * is heavily based on the code from Mediawiki (Parser::doAllQuotes() and Parser::doQuotes())
 * that handles emphazised text
 *
 * @category   Text
 * @package    Text_Wiki
 * @author     Bertrand Gugger <bertrand@toggg.com>
 * @copyright  2005 bertrand Gugger
 * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
 * @version    Release: @package_version@
 * @link       http://pear.php.net/package/Text_Wiki
 * @see        Text_Wiki_Parse::Text_Wiki_Parse()
 */
class Text_Wiki_Parse_Emphasis extends Text_Wiki_Parse {

    /**
     * Split $this->wiki->source by line break and call $this->process()
     * for each line of the source text
     *
     * @access public
     * @return void
     */
    function parse() {
        $lines = explode("\n", $this->wiki->source);
        $this->wiki->source = '';
        foreach ($lines as $line) {
            $this->wiki->source .= $this->process($line) . "\n";
        }
        $this->wiki->source = substr($this->wiki->source, 0, -1);
    }

    /**
     * Generates a replacement for the matched text.  Token options are:
     * - 'type' => ['start'|'end'] The starting or ending point of the emphasized text.
     * Generated tokens are Emphasis (this rule), Strong or Emphasis / Strong
     * The text itself is left in the source but may content bested blocks
     *
     * This function is basically a copy of Parser::doQuotes() from the Mediawiki software.
     * The algorithm is the same but instead of replacing the syntax by HTML we replace by
     * tokens
     *
     * @param string $text a line from $this->wiki->source
     * @return string $output the source line with the wiki syntax replaced by tokens
     */
    function process($text) {
        $arr = preg_split("/(''+)/", $text, -1, PREG_SPLIT_DELIM_CAPTURE);
        if (count($arr) == 1) {
            return $text;
        } else {
            # First, do some preliminary work. This may shift some apostrophes from
            # being mark-up to being text. It also counts the number of occurrences
            # of bold and italics mark-ups.
            $i = 0;
            $numbold = 0;
            $numitalics = 0;
            foreach ($arr as $r) {
                if (($i % 2) == 1) {
                    # If there are ever four apostrophes, assume the first is supposed to
                    # be text, and the remaining three constitute mark-up for bold text.
                    if (strlen($arr[$i]) == 4) {
                        $arr[$i-1] .= "'";
                        $arr[$i] = "'''";
                    }
                    # If there are more than 5 apostrophes in a row, assume they're all
                    # text except for the last 5.
                    else if (strlen( $arr[$i]) > 5 ) {
                        $arr[$i-1] .= str_repeat("'", strlen($arr[$i]) - 5);
                        $arr[$i] = "'''''";
                    }
                    # Count the number of occurrences of bold and italics mark-ups.
                    # We are not counting sequences of five apostrophes.
                    if (strlen($arr[$i]) == 2)
                        $numitalics++;
                    else if (strlen($arr[$i]) == 3)
                        $numbold++;
                    else if (strlen($arr[$i]) == 5)
                        $numitalics++; $numbold++;
                }
                $i++;
            }

            # If there is an odd number of both bold and italics, it is likely
            # that one of the bold ones was meant to be an apostrophe followed
            # by italics. Which one we cannot know for certain, but it is more
            # likely to be one that has a single-letter word before it.
            if (($numbold % 2 == 1) && ($numitalics % 2 == 1)) {
                $i = 0;
                $firstsingleletterword = -1;
                $firstmultiletterword = -1;
                $firstspace = -1;
                foreach ($arr as $r) {
                    if (( $i % 2 == 1) and (strlen($r) == 3)) {
                        $x1 = substr($arr[$i-1], -1);
                        $x2 = substr($arr[$i-1], -2, 1);
                        if ($x1 === ' ') {
                            if ($firstspace == -1) $firstspace = $i;
                        } else if ($x2 === ' ') {
                            if ($firstsingleletterword == -1) $firstsingleletterword = $i;
                        } else {
                            if ($firstmultiletterword == -1) $firstmultiletterword = $i;
                        }
                    }
                    $i++;
                }

                # If there is a single-letter word, use it!
                if ($firstsingleletterword > -1) {
                    $arr[$firstsingleletterword] = "''";
                    $arr[$firstsingleletterword-1] .= "'";
                }
                # If not, but there's a multi-letter word, use that one.
                else if ($firstmultiletterword > -1) {
                    $arr[$firstmultiletterword] = "''";
                    $arr[$firstmultiletterword-1] .= "'";
                }
                # ... otherwise use the first one that has neither.
                # (notice that it is possible for all three to be -1 if, for example,
                # there is only one pentuple-apostrophe in the line)
                else if ($firstspace > -1) {
                    $arr[$firstspace] = "''";
                    $arr[$firstspace-1] .= "'";
                }
            }

            # Now let's actually convert our apostrophic mush to HTML!
            $output = '';
            $buffer = '';
            $state = '';
            $i = 0;
            foreach ($arr as $r) {
                if (($i % 2) == 0) {
                    if ($state === 'both')
                        $buffer .= $r;
                    else
                        $output .= $r;
                } else {
                    if (strlen($r) == 2) {
                        if ($state === 'i') {
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'end'));
                            $state = '';
                        } else if ($state === 'bi')    {
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'end'));
                            $state = 'b';
                        } else if ($state === 'ib')    {
                            $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'end'));
                            $output .= $this->wiki->addToken('Strong', array('type' => 'start'));
                            $state = 'b';
                        } else if ($state === 'both') {
                            $output .= $this->wiki->addToken('Strong', array('type' => 'start'));
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'start'));
                            $output .= $buffer;
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'end'));
                            $state = 'b';
                        } else {
                            # $state can be 'b' or ''
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'start'));
                            $state .= 'i';
                        }
                    } else if (strlen($r) == 3)    {
                        if ($state === 'b')    {
                            $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
                            $state = '';
                        } else if ($state === 'bi')    {
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'end'));
                            $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'start'));
                            $state = 'i';
                        } else if ($state === 'ib') {
                            $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
                            $state = 'i';
                        } else if ($state === 'both') {
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'start'));
                            $output .= $this->wiki->addToken('Strong', array('type' => 'start'));
                            $output .= $buffer;
                            $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
                            $state = 'i';
                        } else {
                            # $state can be 'i' or ''
                            $output .= $this->wiki->addToken('Strong', array('type' => 'start'));
                            $state .= 'b';
                        }
                    } else if (strlen($r) == 5) {
                        if ($state === 'b') {
                            $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'start'));
                            $state = 'i';
                        } else if ($state === 'i') {
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'end'));
                            $output .= $this->wiki->addToken('Strong', array('type' => 'start'));
                            $state = 'b';
                        } else if ($state === 'bi')    {
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'end'));
                            $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
                            $state = '';
                        } else if ($state === 'ib') {
                            $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'end'));
                            $state = '';
                        } else if ($state === 'both') {
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'start'));
                            $output .= $this->wiki->addToken('Strong', array('type' => 'start'));
                            $output .= $buffer;
                            $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
                            $output .= $this->wiki->addToken($this->rule, array('type' => 'end'));
                            $state = '';
                        } else {
                            # ($state == '')
                            $buffer = '';
                            $state = 'both';
                        }
                    }
                }
                $i++;
            }
            # Now close all remaining tags.  Notice that the order is important.
            if ($state === 'b' || $state === 'ib')
                $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
            if ($state === 'i' || $state === 'bi' || $state === 'ib')
                $output .= $this->wiki->addToken($this->rule, array('type' => 'end'));
            if ($state === 'bi')
                $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
            # There might be lonely ''''', so make sure we have a buffer
            if ($state === 'both' && $buffer) {
                $output .= $this->wiki->addToken('Strong', array('type' => 'start'));
                $output .= $this->wiki->addToken($this->rule, array('type' => 'start'));
                $output .= $buffer;
                $output .= $this->wiki->addToken($this->rule, array('type' => 'end'));
                $output .= $this->wiki->addToken('Strong', array('type' => 'end'));
            }
            return $output;
        }
    }

}
?>


text:
.. automodule:: pynance.opt.spread.vert

.. autoclass:: pynance.opt.spread.vert.Vert


text:
class SorceryRememberMe < ActiveRecord::Migration
  def self.up
    add_column :<%= model_class_name.tableize %>, :remember_me_token, :string, :default => nil
    add_column :<%= model_class_name.tableize %>, :remember_me_token_expires_at, :datetime, :default => nil

    add_index :<%= model_class_name.tableize %>, :remember_me_token
  end

  def self.down
    remove_index :<%= model_class_name.tableize %>, :remember_me_token

    remove_column :<%= model_class_name.tableize %>, :remember_me_token_expires_at
    remove_column :<%= model_class_name.tableize %>, :remember_me_token
  end
end


text:
using Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker;
using Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using Xunit;

namespace QnAMaker.Tests
{
    public class QnAMakerKnowledgebasePreviewTests: BaseTests
    {
        [Fact]
        public void QnAMakerKnowledgebasePreviewCrud()
        {
            using (MockContext context = MockContext.Start(this.GetType()))
            {
                HttpMockServer.Initialize(this.GetType(), "QnAMakerKnowledgebasePreviewCrud");
                IQnAMakerClient client = GetQnAMakerPreviewClient(HttpMockServer.CreateInstance());

                // Create
                var createOp = client.Knowledgebase.CreateAsync(new CreateKbDTO { Name = "testqna", QnaList = new List<QnADTO> { new QnADTO { Questions = new List<string> { "hi" }, Answer = "hello" } } }).Result;

                // Loop while operation is success
                createOp = OperationHelper.MonitorOperation(createOp, client);

                Assert.Equal(createOp.OperationState, OperationStateType.Succeeded);

                var kbid = createOp.ResourceLocation.Replace("/knowledgebases/", string.Empty);
                Assert.NotEmpty(kbid);

                var newKb = client.Knowledgebase.GetDetailsAsync(kbid).Result;

                var kbdata = client.Knowledgebase.DownloadAsync(kbid, EnvironmentType.Test).Result;
                Assert.Equal("hello", kbdata.QnaDocuments[0].Answer);

                // Update
                var updateOp = client.Knowledgebase.UpdateAsync(kbid, new UpdateKbOperationDTO { Add = new UpdateKbOperationDTOAdd { QnaList = new List<QnADTO> { new QnADTO { Questions = new List<string> { "bye" }, Answer = "goodbye" } } } }).Result;

                // Loop while operation is success
                updateOp = OperationHelper.MonitorOperation(updateOp, client);

                Assert.Equal(updateOp.OperationState, OperationStateType.Succeeded);

                kbdata = client.Knowledgebase.DownloadAsync(kbid, EnvironmentType.Test).Result;
                Assert.Equal("goodbye", kbdata.QnaDocuments[1].Answer);

                // Delete
                client.Knowledgebase.DeleteAsync(kbid).Wait();
            }
        }
    }
}


text:
import lolchat._
import lolchat.data._
import lolchat.model._

class LogInOutSpec extends BaseSpec {

  override def afterEach(): Unit = {
    whenReady(LoLChat.run(logout(bobSess)))(identity)
    whenReady(LoLChat.run(logout(aliceSess)))(identity)
  }

  "Login" should "succeed given a valid LoL account" in {
    val prg = for { _ <- login; b <- isLogin; a <- getAppearance } yield (b, a)

    whenReady(LoLChat.run(prg(bobSess))) { res =>
      res should matchPattern { case Right((true, Online)) => }
    }
  }

  it should "result in a ChatError given invalid credentials" in {
    val session = Session(bob.user, "badpass", Region.NA)
    whenReady(LoLChat.run(login(session))) { res =>
      res should matchPattern { case Left(Error(401, _, _)) => }
    }

    whenReady(LoLChat.run(login(Session("", "abc", Region.NA)))) { res =>
      res should matchPattern { case Left(Error(400, _, _)) => }
    }

    whenReady(LoLChat.run(login(Session("abc", "", Region.NA)))) { res =>
      res should matchPattern { case Left(Error(400, _, _)) => }
    }
  }

  "Multiple login ops" should "not result in a ChatError" in {
    val prg = for { _ <- login; _ <- login } yield ()

    whenReady(LoLChat.run(prg(bobSess))) { res =>
      res.fold(chatErr => false, succ => true) should be(true)
    }
  }

  "Logout" should "succeed given a logged in session" in {
    val prg = for { _ <- login; _ <- logout } yield ()
    whenReady(LoLChat.run(prg(bobSess))) { res =>
      res.isRight should be(true)
    }
  }

  "LoLChat" should "keep track of sessions" in {
    whenReady(LoLChat.run(login(bobSess)))(_ => LoLChat.sessionCount should be(1))
    whenReady(LoLChat.run(logout(bobSess)))(_ => LoLChat.sessionCount should be(0))
  }

  it should "be able to login offline" in {
    val prg1 = for { _ <- offlineLogin; a <- getAppearance } yield a

    whenReady(LoLChat.run(prg1(bobSess))) { res =>
      res should matchPattern { case Right(Offline) => }
    }

    val prg2 = for { _ <- login; f <- friendByName(bob.inGameName) } yield f

    whenReady(LoLChat.run(prg2(aliceSess))) { res =>
      val f: Friend = res.fold(err => fail(err.msg), _.getOrElse(fail(s"${bob.inGameName} not on FL")))
      f.isOnline should be(false)
    }
  }

  "Running an operation before login" should "result in a ChatError" in {
    whenReady(LoLChat.run(getProfile(bobSess))) { res =>
      res should matchPattern { case Left(Error(401, _, _)) => }
    }
  }
}


text:
Exampe code for "How-To SU"

For further details, see:

[http://su.chainfire.eu/](http://su.chainfire.eu/)

---

Gradle:

```
dependencies {
    compile 'eu.chainfire:libsuperuser:1.0.0.+'
}
```


text:
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.13">
  <compounddef id="d8/d94/structnlohmann_1_1detail_1_1is__compatible__array__type" kind="struct" language="C++" prot="public">
    <compoundname>nlohmann::detail::is_compatible_array_type</compoundname>
    <basecompoundref refid="dc/d4b/structnlohmann_1_1detail_1_1is__compatible__array__type__impl" prot="public" virt="non-virtual">nlohmann::detail::is_compatible_array_type_impl< BasicJsonType, CompatibleArrayType ></basecompoundref>
    <includes refid="d5/db8/json_8hpp" local="no">json.hpp</includes>
    <templateparamlist>
      <param>
        <type>typename BasicJsonType</type>
      </param>
      <param>
        <type>typename CompatibleArrayType</type>
      </param>
    </templateparamlist>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <inheritancegraph>
      <node id="445">
        false_type
      </node>
      <node id="446">
        nlohmann::detail::is_compatible_array_type_impl< BasicJsonType, CompatibleArrayType, typename >
        <link refid="dc/d4b/structnlohmann_1_1detail_1_1is__compatible__array__type__impl"/>
        <childnode refid="445" relation="public-inheritance">
        </childnode>
      </node>
      <node id="443">
        nlohmann::detail::is_compatible_array_type< BasicJsonType, CompatibleArrayType >
        <link refid="d8/d94/structnlohmann_1_1detail_1_1is__compatible__array__type"/>
        <childnode refid="444" relation="public-inheritance">
        </childnode>
      </node>
      <node id="444">
        nlohmann::detail::is_compatible_array_type_impl< BasicJsonType, CompatibleArrayType >
        <link refid="dc/d4b/structnlohmann_1_1detail_1_1is__compatible__array__type__impl"/>
        <childnode refid="445" relation="public-inheritance">
        </childnode>
        <childnode refid="446" relation="template-instance">
          <edgelabel>< BasicJsonType, CompatibleArrayType ></edgelabel>
        </childnode>
      </node>
    </inheritancegraph>
    <collaborationgraph>
      <node id="449">
        false_type
      </node>
      <node id="450">
        nlohmann::detail::is_compatible_array_type_impl< BasicJsonType, CompatibleArrayType, typename >
        <link refid="dc/d4b/structnlohmann_1_1detail_1_1is__compatible__array__type__impl"/>
        <childnode refid="449" relation="public-inheritance">
        </childnode>
      </node>
      <node id="447">
        nlohmann::detail::is_compatible_array_type< BasicJsonType, CompatibleArrayType >
        <link refid="d8/d94/structnlohmann_1_1detail_1_1is__compatible__array__type"/>
        <childnode refid="448" relation="public-inheritance">
        </childnode>
      </node>
      <node id="448">
        nlohmann::detail::is_compatible_array_type_impl< BasicJsonType, CompatibleArrayType >
        <link refid="dc/d4b/structnlohmann_1_1detail_1_1is__compatible__array__type__impl"/>
        <childnode refid="449" relation="public-inheritance">
        </childnode>
        <childnode refid="450" relation="template-instance">
          <edgelabel>< BasicJsonType, CompatibleArrayType ></edgelabel>
        </childnode>
      </node>
    </collaborationgraph>
    <location file="/home/agopal/trees/cudnn-frontend/include/contrib/nlohmann/json/json.hpp" line="3737" column="1" bodyfile="/home/agopal/trees/cudnn-frontend/include/contrib/nlohmann/json/json.hpp" bodystart="3736" bodyend="3737"/>
    <listofallmembers>
    </listofallmembers>
  </compounddef>
</doxygen>


text:
using Silk.Data.SQL.Expressions;
using Silk.Data.SQL.ORM.Queries;
using System.Collections.Generic;
using System.Linq;

namespace Silk.Data.SQL.ORM.Schema
{
	public abstract class Join : IQueryReference
	{
		private readonly string _alias;

		public IQueryReference Left { get; }
		public IQueryReference Right { get; }

		public AliasIdentifierExpression AliasIdentifierExpression { get; }

		public Join(IQueryReference left, IQueryReference right, string alias)
		{
			Left = left;
			Right = right;
			_alias = alias;
			AliasIdentifierExpression = new AliasIdentifierExpression(_alias);
		}

		public abstract JoinExpression GetJoinExpression();
	}

	public class EntityJoin : Join
	{
		private JoinColumnPair[] _joinColumnPairs;

		public EntityJoin(IQueryReference left, IQueryReference right, string alias) :
			base(left, right, alias)
		{
		}

		public void SetJoinColumns(IEnumerable<JoinColumnPair> joinColumnPairs)
		{
			_joinColumnPairs = joinColumnPairs.ToArray();
		}

		public override JoinExpression GetJoinExpression()
		{
			var rightIdentifier = AliasIdentifierExpression;
			var leftIdentifier = Left.AliasIdentifierExpression;

			var onCondition = default(QueryExpression);
			foreach (var columnPair in _joinColumnPairs)
			{
				var newCondition = QueryExpression.Compare(
						QueryExpression.Column(columnPair.LeftColumnName, leftIdentifier),
						ComparisonOperator.AreEqual,
						QueryExpression.Column(columnPair.RightColumnName, rightIdentifier)
						);
				onCondition = QueryExpression.CombineConditions(onCondition, ConditionType.AndAlso, newCondition);
			}

			return QueryExpression.Join(
				QueryExpression.Alias(
					Right.AliasIdentifierExpression, rightIdentifier.Identifier
					),
				onCondition,
				JoinDirection.Left
				);
		}
	}

	public class JoinColumnPair
	{
		public string LeftColumnName { get; }
		public string RightColumnName { get; }

		public JoinColumnPair(string leftColumnName, string rightColumnName)
		{
			LeftColumnName = leftColumnName;
			RightColumnName = rightColumnName;
		}
	}
}


text:
package org.topicquests.persist.json.es.blueprints;

import java.util.*;

import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Element;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex;

import org.json.simple.JSONObject;
import org.topicquests.common.api.ITopicQuestsOntology;
import org.topicquests.persist.json.es.blueprints.api.IBlueprintsGraphOntology;

/**
 * @author park
 *
 */
public class JSONDocStoreBlueprintsElement extends JSONObject
		implements Element {
	protected JSONDocStoreBlueprintsGraph myGraph;
	protected String id = null;
	protected final Graph graph;
	//public final String ID_PROPERTY = IBlueprintsGraphOntology.ID_PROPERTY;
	protected GraphUtil util;
	/**
	 * These are properties added outside the normal label, id, etc.
	 */
	protected Map<String,Object>cargoProperties=null;

	/**
	 * @param stringId
	 *
	 */
	public JSONDocStoreBlueprintsElement(final String stringId, final JSONDocStoreBlueprintsGraph g) {
		graph = g;
		id = stringId;
		util = GraphUtil.getInstance();
		if (id == null)
			id = util.getUUID();
		util.logDebug("JSONDocStoreBlueprintsElement-1 "+stringId+" "+id);
		this.setProperty(IBlueprintsGraphOntology.ID_PROPERTY, id);
	}

	public JSONDocStoreBlueprintsElement(JSONObject jo, final JSONDocStoreBlueprintsGraph g) {
		graph = g;
		util = GraphUtil.getInstance();
		id = (String)jo.get(IBlueprintsGraphOntology.ID_PROPERTY);
		util.logDebug("JSONDocStoreBlueprintsElement-2 "+id);
		Iterator<String>itr = jo.keySet().iterator();
		String key;
		while(itr.hasNext()) {
			key = itr.next();
			this.setProperty(key, jo.get(key));
		}

	}

	/**
	 *
Cargo properties are those which are preset other than
	 * label, id, etc. during object creation.

	 *
NOTE: it might be useful to let the local setProperty
	 * add to cargoProperties, but not sure on that.

	 * @param props
	 */
	public void setCargoProperties(Map<String,Object>props) {
		if (props == null)
			return;
		cargoProperties = props;
		Iterator<String>itr = props.keySet().iterator();
		String key;
		while (itr.hasNext()) {
			key = itr.next();
			this.setProperty(key, props.get(key));
		}
	}

	/**
	 * Returns cargoProperties
	 * @return can return null
	 */
	public Map<String,Object> getCargoProperties() {
		return this.cargoProperties;
	}
	/* (non-Javadoc)
	 * @see com.tinkerpop.blueprints.Element#getProperty(java.lang.String)
	 */
	@Override
	public <T> T getProperty(String key) {
		return (T) super.get(key);
	}

	/* (non-Javadoc)
	 * @see com.tinkerpop.blueprints.Element#getPropertyKeys()
	 */
	@Override
	public Set<String> getPropertyKeys() {
		return super.keySet();
	}

	/* (non-Javadoc)
	 * @see com.tinkerpop.blueprints.Element#setProperty(java.lang.String, java.lang.Object)
	 */
	@Override
	public void setProperty(String key, Object value) {
		super.put(key, value);
	}

	/* (non-Javadoc)
	 * @see com.tinkerpop.blueprints.Element#removeProperty(java.lang.String)
	 */
	@Override
	public <T> T removeProperty(String key) {
		return (T)super.remove(key);
	}

	/* (non-Javadoc)
	 * @see com.tinkerpop.blueprints.Element#remove()
	 */
	@Override
	public void remove() {
        if (this instanceof Vertex)
            this.graph.removeVertex((Vertex) this);
        else
            this.graph.removeEdge((Edge) this);
	}

	/* (non-Javadoc)
	 * @see com.tinkerpop.blueprints.Element#getId()
	 */
	@Override
	public Object getId() {
		return this.id;
	}

	protected void setType(String type) {
		setProperty(ITopicQuestsOntology.INSTANCE_OF_PROPERTY_TYPE, type);
	}

	protected void setLabel(String label) {
		setProperty(ITopicQuestsOntology.LABEL_PROPERTY, label);
	}
}


text:
/* eslint-env worker */
import hjs from 'highlight.js';

onmessage = (event) => {
  const { code, languages } = event.data;
  let result;
  if (languages && languages.length === 1) {
    result = hjs.highlight(languages[0], code, true);
  } else {
    result = hjs.highlightAuto(code, languages);
  }

  postMessage(result);
};


text:
A simple plug to allow setting variables in a connection.  For example, as a way to set default variables for a controller, view or template to use in a Phoenix app.

## Installation

The package can be installed from Hex:

Add plug_assign to your list of dependencies in `mix.exs`:

```elixir
    def deps do
      [{:plug_assign, "~> 1.0.2"}]
    end
```

Fetch and install the dependencies

```sh
    $ mix deps.get
```

## Basic Usage

Define assigns as part of any plug stack.

```elixir
    plug Plug.Assign, foo: "bar", bar: true, baz: 42
```

This will set the given key/value pairs in the `assigns` map of the Plug.Conn, for you to use
in controllers, views, and templates.

One way to use this is to set variables so you can quickly determine where you are in your app.

```elixir
    pipeline :browser do
      ...
      plug Plug.Assign, admin: false
    end

    pipeline :admin do
      plug Plug.Assign, admin: true
    end
```

And then use that in a template, such as your layout.

```html
  <%= if @admin do %>
    <p>Hello, Administrator</p>
  <% end %>
```

Since you can use this anywhere you can use a plug, you can also use it in a Phoenix Controller.

```elixir
    defmodule HelloWeb.Admin.PostController do
      use HelloWeb, :controller

      plug Plug.Assign, section: :posts
      ...
    end
```

```html
  <h1><%= @section %></h1>
```

If you want to only assign a variable for certain actions, you can use the `plug ... when` format,
but be careful that bare keyword lists are only accepted as the last arguments of a macro call,
which is no longer the case with a `when` clause, so add the square brackets `[]` around your
assigns, or use a map instead.

```elixir
    defmodule HelloWeb.Admin.PostController do
      use HelloWeb, :controller

      plug Plug.Assign, [read_request: true] when action in [:index, :show]
      plug Plug.Assign, %{write_request: true} when action in [:edit, :new, :create, :update, :delete]
      ...
    end
```

## Accessing in templates

If you're using an assign in a template that may not have been set, you can't use the
`@variable` format without throwing an error, so use one of the following techniques instead:

- Access shortcut: `assigns[:admin]` - Returns `nil` if not set.
- Map.get/2: `Map.get(assigns, :admin)` - Returns `nil` if not set.
- Map.get/3: `Map.get(assigns, :admin, false) - `Returns `false` if not set.

```html
  <%= if assigns[:admin] do %>
    <p>Hello, Administrator</p>
  <% end %>
```

## Assignment formats

Assigns can be either a keyword list

```elixir
    plug Plug.Assign, foo: "bar", bar: true, baz: 42
```

Or a map, as long as the keys are atoms.

```elixir
    plug Plug.Assign, %{foo: "foo", bar: true, baz: 42}
    plug Plug.Assign, %{:foo => "foo", :bar => true, :baz => 42}
```

Any attempt to pass it anything else will throw an exception.

```bash
** (ArgumentError) Invalid assignment, must be a keyword list or map with all keys as atoms
```

## Generate documentation

```bash
    mix docs
```


text:
#include <unicorn/system/input/Gamepad.hpp>

#include <unicorn/system/adapter/Helper.hpp>

#include <unicorn/utility/InternalLoggers.hpp>

namespace unicorn
{
namespace system
{
namespace input
{

Gamepad::Gamepad(void* handle)
    : m_id( static_cast<uint32_t>( reinterpret_cast<uintptr_t>(handle) ) )
    , m_handle( handle )
{
    m_name = GAMEPAD_ADAPTER::GetGamepadName(m_handle);
    UpdateData();
}

Gamepad::~Gamepad()
{
    Destroyed.emit(this);
}

void Gamepad::UpdateData()
{
    bool anyUpdates = false;

    auto iterateAndUpdate = [&](auto& dest, auto& source)
    {
        for (uint32_t i = 0; i < source.size(); ++i)
        {
            if (!anyUpdates && dest[i] != source[i])
            {
                anyUpdates = true;
            }

            dest[i] = source[i];
        }
    };

    {
        std::vector<float> axes = GAMEPAD_ADAPTER::GetGamepadAxes(m_handle);

        if (!m_axes.empty() && axes.size() != m_axes.size())
        {
            LOG_INPUT->Warning("Gamepad[{}]: number of axes changed during runtime", m_id);
        }

        m_axes.resize(axes.size());

        iterateAndUpdate(m_axes, axes);
    }

    {
        std::vector<bool> buttons = GAMEPAD_ADAPTER::GetGamepadButtons(m_handle);

        if (!m_buttons.empty() && buttons.size() != m_buttons.size())
        {
            LOG_INPUT->Warning("Gamepad[{}]: number of buttons changed during runtime", m_id);
        }

        m_buttons.resize(buttons.size());

        iterateAndUpdate(m_buttons, buttons);
    }

    if (anyUpdates)
    {
        Updated.emit(this);
    }
}

}
}
}


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

namespace SimpleSharpDependencyInjection.Options
{
    public enum DependencyObjectType
    {
        Any = 0,
        Singleton = 1,
        AlwaysNew = 2
    }
}