text:
<?php

namespace Naucon\Breadcrumbs\Tests;

use Naucon\Breadcrumbs\Breadcrumb;
use Naucon\Breadcrumbs\Handler\BreadcrumbHandlerInterface;
use Naucon\Breadcrumbs\Handler\BreadcrumbHandlerSession;

class BreadcrumbHandlerSessionTest extends \PHPUnit_Framework_TestCase
{
    public static $sessionData = array();

    public function setUp()
    {
        $_SESSION = self::$sessionData;
    }

    public function tearDown()
    {
        self::$sessionData = $_SESSION;
    }

    /**
     * @return      BreadcrumbHandlerInterface
     */
    public function testInit()
    {
        $breadcrumbHandler = new BreadcrumbHandlerSession();
        return $breadcrumbHandler;
    }

    /**
     * @depends     testInit
     * @param       BreadcrumbHandlerInterface      $breadcrumbHandler
     * @return      BreadcrumbHandlerInterface
     */
    public function testAdd(BreadcrumbHandlerInterface $breadcrumbHandler)
    {
        $breadcrumbHandler->add(new Breadcrumb('home', '/home/'));
        $breadcrumbHandler->add(new Breadcrumb('profile', '/profile/'));
        $breadcrumbHandler->add(new Breadcrumb('address'));

        return $breadcrumbHandler;
    }

    /**
     * @depends     testAdd
     * @param       BreadcrumbHandlerInterface      $breadcrumbHandler
     * @return      BreadcrumbHandlerInterface
     */
    public function testCount(BreadcrumbHandlerInterface $breadcrumbHandler)
    {
        $expectedSessionNamespace = '__NcBreadcrumbStorage';

        $this->assertEquals(3, $breadcrumbHandler->count());
        $this->assertCount(3, $_SESSION[$expectedSessionNamespace]);

        return $breadcrumbHandler;
    }

    /**
     * @depends     testAdd
     * @param       BreadcrumbHandlerInterface      $breadcrumbHandler
     * @return      BreadcrumbHandlerInterface
     */
    public function testIterator(BreadcrumbHandlerInterface $breadcrumbHandler)
    {
        $expectedSessionNamespace = '__NcBreadcrumbStorage';

        $breadcrumbIterator = $breadcrumbHandler->getIterator();

        $expectedBreadcrumbs = array();
        $expectedBreadcrumbs[0]['title'] = 'home';
        $expectedBreadcrumbs[0]['url'] = '/home/';
        $expectedBreadcrumbs[1]['title'] = 'profile';
        $expectedBreadcrumbs[1]['url'] = '/profile/';
        $expectedBreadcrumbs[2]['title'] = 'address';
        $expectedBreadcrumbs[2]['url'] = null;

        $i = 0;
        foreach ($breadcrumbIterator as $key => $breadcrumb) {
            $this->assertInstanceOf('Naucon\Breadcrumbs\BreadcrumbInterface', $breadcrumb);
            $this->assertEquals($expectedBreadcrumbs[$i]['title'], $breadcrumb->getTitle());
            $this->assertEquals($expectedBreadcrumbs[$i]['url'], $breadcrumb->getUrl());
            $i++;
        }
        $this->assertEquals(3, $i);

        $this->assertEquals($expectedBreadcrumbs, $_SESSION[$expectedSessionNamespace]);

        return $breadcrumbHandler;
    }

    /**
     * @depends     testAdd
     * @param       BreadcrumbHandlerInterface      $breadcrumbHandler
     * @return      BreadcrumbHandlerInterface
     */
    public function testReverseIterator(BreadcrumbHandlerInterface $breadcrumbHandler)
    {
        $expectedSessionNamespace = '__NcBreadcrumbStorage';

        $breadcrumbIterator = $breadcrumbHandler->getReverseIterator();

        $expectedBreadcrumbs = array();
        $expectedBreadcrumbs[0]['title'] = 'address';
        $expectedBreadcrumbs[0]['url'] = null;
        $expectedBreadcrumbs[1]['title'] = 'profile';
        $expectedBreadcrumbs[1]['url'] = '/profile/';
        $expectedBreadcrumbs[2]['title'] = 'home';
        $expectedBreadcrumbs[2]['url'] = '/home/';

        $i = 0;
        foreach ($breadcrumbIterator as $key => $breadcrumb) {
            $this->assertInstanceOf('Naucon\Breadcrumbs\BreadcrumbInterface', $breadcrumb);
            $this->assertEquals($expectedBreadcrumbs[$i]['title'], $breadcrumb->getTitle());
            $this->assertEquals($expectedBreadcrumbs[$i]['url'], $breadcrumb->getUrl());
            $i++;
        }
        $this->assertEquals(3, $i);

        return $breadcrumbHandler;
    }

    /**
     * @depends     testAdd
     * @param       BreadcrumbsInterface        $breadcrumbHandler
     * @return      BreadcrumbsInterface
     */
    public function testClear(BreadcrumbHandlerInterface $breadcrumbHandler)
    {
        $expectedSessionNamespace = '__NcBreadcrumbStorage';

        $this->assertEquals(3, $breadcrumbHandler->count());
        $this->assertCount(3, $_SESSION[$expectedSessionNamespace]);

        $breadcrumbHandler->clear();

        $this->assertEquals(0, $breadcrumbHandler->count());
        $this->assertCount(0, $_SESSION[$expectedSessionNamespace]);

        return $breadcrumbHandler;
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Capnodium salicinum Mont., 1849

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
@interface UIChannelTableViewCell : UITableViewCell

- (void)showSelectedState;

- (void)hideSelectedState;

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal"
	android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#fff" android:padding="5dip">
	<ImageView android:layout_width="100dip" android:layout_height="70dip" android:scaleType="fitXY"></ImageView>
	<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"
		android:background="#fff" android:paddingLeft="2dip" android:paddingRight="2dip">
		<TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#fff"
			android:paddingLeft="8dip" android:paddingTop="5dip" android:paddingRight="8dip" android:paddingBottom="1dip"
			android:text="Title" android:textSize="16dip" android:textColor="#505050" android:textStyle="bold" />
		<RelativeLayout android:layout_marginTop="-25dip" android:gravity="right" android:layout_height="wrap_content"
			android:layout_width="fill_parent" android:layout_alignParentBottom="true">
			<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#fff"
				android:paddingLeft="8dip" android:paddingTop="5dip" android:paddingRight="8dip" android:paddingBottom="1dip"
				android:text="Title" android:textSize="12dip" android:textColor="#202020" android:gravity="right" />
		</RelativeLayout>
	</LinearLayout>
</LinearLayout>


text:
@implementation OBOYourItemsObject

- (instancetype)initWithInfo:(NSDictionary *)info {
    self = [super init];
    if (self) {
        self.name = info[@"name"];
    }
    return self;
}

@end


text:
<?php
// filename : module/Users/src/Users/Form/UploadEditForm.php
namespace FileManager\Form;

use Zend\Form\Form;

class UploadEditForm extends Form
{
    public function __construct($name = null)
    {
        parent::__construct('Upload');
        $this->setAttribute('method', 'post');
        $this->setAttribute('enctype','multipart/form-data');

        $this->add(array(
            'name' => 'label',
            'attributes' => array(
                'type'  => 'text',
            ),
            'options' => array(
                'label' => 'File Description',
            ),
        ));

        $this->add(array(
            'name' => 'submit',
            'attributes' => array(
                'type'  => 'submit',
                'value' => 'Update Document'
            ),
        ));
    }
}


text:
import pyrax
import sys
import argparse
import time
import prettytable
import os

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('fqdn', help='The Fully Qualified Domain Name to use')
    parser.add_argument('--dc', required=False, help='The region to '
                        'build the servers in', choices=['DFW', 'ORD', 'LON'],
                        default=pyrax.default_region)
    parser.add_argument('--image', required=False, help='The image ID to build'
                        ' the servers with',
                        default='5cebb13a-f783-4f8c-8058-c4182c724ccd')
    parser.add_argument('--flavor', required=False, help='The flavor ID to'
                        ' build the servers with',
                        default=2, type=int)

    args = parser.parse_args()

    parts = args.fqdn.split('.')
    if len(parts) < 3:
        print 'Not a proper FQDN: %s' % args.fqdn
        sys.exit(1)
    domain = '.'.join(parts[-2:])

    credentials_file = os.path.expanduser('~/.rackspace_cloud_credentials')
    pyrax.set_credential_file(credentials_file, region=args.dc)
    cs = pyrax.cloudservers
    dns = pyrax.cloud_dns

    domains = dns.list()
    try:
        dom = filter(lambda x: x.name == domain, domains)[0]
    except IndexError:
        raise SystemExit('No matching domains: %s' % domain)

    print 'Building servers in: %s' % args.dc
    print 'Creating server: %s' % args.fqdn
    server = cs.servers.create(args.fqdn.split('.')[0], args.image,
                               args.flavor)
    adminPass = server.adminPass
    id = server.id
    print '%s: %s' % (args.fqdn, id)
    statuses = ['ACTIVE', 'ERROR', 'UNKNOWN']
    server = pyrax.utils.wait_until(server, 'status', statuses, interval=30,
                                    verbose=True)
    if server.status in ['ERROR', 'UNKNOWN']:
        server.get(id)
        raise SystemExit('Failed to build %s (%s, %s)' %
                         (id, server.status, server.progress))

    print 'Creating DNS record...'

    records = [
        {
            'ttl': 300,
            'name': args.fqdn,
            'type': 'A',
            'data': server.accessIPv4
        }
    ]
    domain = dom.add_records(records)
    print 'Record added'

    t = prettytable.PrettyTable(['ID', 'Host', 'Status', 'IP',
                                 'Admin Password'])
    t.add_row([server.id, args.fqdn, server.status,
               ', '.join(server.networks['public']), adminPass])
    print '\n\nServers online and ready...'
    print t

if __name__ == '__main__':
    main()

# vim:set ts=4 sw=4 expandtab:


text:
//
//  ViewController.m
//  TWTiledSpriteNode
//
//  Created by Thomas Wilson on 12/10/2013.
//  Copyright (c) 2013 Thomas Wilson. All rights reserved.
//

#import "ViewController.h"
#import "MyScene.h"
@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    // Configure the view.
    SKView * skView = (SKView *)self.view;
	[skView setIgnoresSiblingOrder:YES];
    skView.showsFPS = YES;
    skView.showsNodeCount = YES;

    // Create and configure the scene.
    SKScene * scene = [MyScene sceneWithSize:skView.bounds.size];
    scene.scaleMode = SKSceneScaleModeAspectFill;
    		//Present the scene.
    [skView presentScene:scene];
}

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        return UIInterfaceOrientationMaskAllButUpsideDown;
    } else {
        return UIInterfaceOrientationMaskAll;
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

@end


text:
Executando os testes unitários
===============================

Os testes unitários dessa aplicação foram desenvolvidos com o framework `Py.test <http://doc.pytest.org/en/latest/>`_ e a biblioteca integradora: `pytest-flask <http://pytest-flask.readthedocs.io/>`_.

Como é executado os testes com o banco de dados
--------------------------------------------------

Como é muito complexo mockar objetos do banco (flask-sqlalchemy), segui uma pratica da própria documentação do flask, onde defini fixtures: localizado em: ``tests/conftest.py``

Antes de iniciar os testes:
  - é construido um objeto Flask app
    - forçando alterar a conexão com o banco dados (SQLITE Temporário) ``sqlite:///tests/db/testing.db``
      - Recriando o arquivo de banco de dados para testes ``tests/db/testing.db``
       - Executando os scripts de migração ``db upgrade``
        - Disponibilidando banco de dados SQLite APENAS para os testes

Executando os testes (com coverage simplificado)
--------------------------------------------------

Nesse exemplo abaixo vamos demonstrar a execução dos testes com o relatório de coberturar dos teste em **modo simplificado** imprimindo na telas

1. Acesse a pasta do projeto

.. code-block:: bash

    $ cd api-feiras-livres

2. Ative o virtualenv

.. code-block:: bash

    $ source venv/bin/activate

3. Acesse a pasta do projeto ``src``

.. code-block:: bash

    (venv) $ cd src

4. Chame o executavel do py.test

.. code-block:: bash

    (venv) $ py.test

Executando os testes (com coverage detalhado)
--------------------------------------------------

Nesse ultimo exemplo vamos demonstrar como executar os testes unitários, com o relatório de coberturar dos teste em **modo detalhado** gerando arquivos html

.. code-block:: bash

    $ cd api-feiras-livres

    $ source venv/bin/activate

    (venv) $ cd src

    (venv) $ py.test --cov-report=html

E ao final desse comando será criado uma pasta com os arquivos html dos relatórios de cobertura dos testes em ``src/html``

Analisando mais opções de testes
--------------------------------------------------

Caso queira deixar fixo um metódo de testes apenas, defina no arquivo de configuração:

``src/pytest.ini``

Como está o arquivo de configuração (``src/pytest.ini``) atualmente:

.. code-block:: ini

    [pytest]

    ; simplified coverage (just in screen)
    addopts = -ra -s -v --flakes --cov=.

    ; full coverage (at html files)
    ; addopts = -ra -s -v --flakes --cov-report=html --cov=.

    ; exclude unrelated folders and all old tests
    norecursedirs =
        .*
        env
        venv

    flakes-ignore =
      *.py UnusedImport
      *.py UnusedVariable


text:
<!--- Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com> -->

# Accessing an SQL database

> **NOTE**: JDBC is a blocking operation that will cause threads to wait.  You can negatively impact the performance of your Play application by running JDBC queries directly in your controller!  Please see the "Configuring a CustomExecutionContext" section.

## Configuring JDBC connection pools

Play provides a plugin for managing JDBC connection pools. You can configure as many databases as you need.

To enable the database plugin add the build dependencies:

Java
: @[jdbc-java-dependencies](code/database.sbt)

Scala
: @[jdbc-scala-dependencies](code/database.sbt)

## Configuring the JDBC Driver dependency

Play does not provide any database drivers. Consequently, to deploy in production you will have to add your database driver as an application dependency.

For example, if you use MySQL5, you need to add a [[dependency| SBTDependencies]] for the connector:

@[jdbc-driver-dependencies](code/database.sbt)

## Databases configuration

Then you must configure a connection pool in the `conf/application.conf` file. By convention, the default JDBC data source must be called `default` and the corresponding configuration properties are `db.default.driver` and `db.default.url`.

```properties
# Default database configuration
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
```

If something isn't properly configured, you will be notified directly in your browser:

[[images/dbError.png]]

You can also change the `default` name by setting `play.db.default`, for example:

```properties
play.db.default = "primary"

db.primary.driver=org.h2.Driver
db.primary.url="jdbc:h2:mem:play"
```

### How to configure several data sources

To configure several data sources:

```properties
# Orders database
db.orders.driver=org.h2.Driver
db.orders.url="jdbc:h2:mem:orders"

# Customers database
db.customers.driver=org.h2.Driver
db.customers.url="jdbc:h2:mem:customers"
```

### H2 database engine connection properties

In memory database:

```properties
# Default database configuration using H2 database engine in an in-memory mode
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
```

File based database:

```properties
# Default database configuration using H2 database engine in a persistent mode
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:/path/to/db-file"
```

The details of the H2 database URLs are found from [H2 Database Engine Cheat Sheet](http://www.h2database.com/html/cheatSheet.html).

### SQLite database engine connection properties

```properties
# Default database configuration using SQLite database engine
db.default.driver=org.sqlite.JDBC
db.default.url="jdbc:sqlite:/path/to/db-file"
```

### PostgreSQL database engine connection properties

```properties
# Default database configuration using PostgreSQL database engine
db.default.driver=org.postgresql.Driver
db.default.url="jdbc:postgresql://database.example.com/playdb"
```

### MySQL database engine connection properties

```properties
# Default database configuration using MySQL database engine
# Connect to playdb as playdbuser
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://localhost/playdb"
db.default.username=playdbuser
db.default.password="a strong password"
```

### Exposing the datasource through JNDI

Some libraries expect to retrieve the `Datasource` reference from [JNDI](https://docs.oracle.com/javase/tutorial/jndi/overview/index.html). You can expose any Play managed datasource via JNDI by adding this configuration in `conf/application.conf`:

```properties
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
db.default.jndiName=DefaultDS
```

### How to configure SQL log statement

Not all connection pools offer (out of the box) a way to log SQL statements. HikariCP, per instance, suggests that you use the log capacities of your database vendor. From [HikariCP docs](https://github.com/brettwooldridge/HikariCP/tree/dev#log-statement-text--slow-query-logging):

> **Log Statement Text / Slow Query Logging**
>
> *Like Statement caching, most major database vendors support statement logging through properties of their own driver. This includes Oracle, MySQL, Derby, MSSQL, and others. Some even support slow query logging. We consider this a "development-time" feature. For those few databases that do not support it, jdbcdslog-exp is a good option. Great stuff during development and pre-Production.*

Because of that, Play uses [jdbcdslog-exp](https://github.com/jdbcdslog/jdbcdslog) to enable consistent SQL log statement support for supported pools. The SQL log statement can be configured by database, using `logSql` property:

```properties
# Default database configuration using PostgreSQL database engine
db.default.driver=org.postgresql.Driver
db.default.url="jdbc:postgresql://database.example.com/playdb"
db.default.logSql=true
```

After that, you can configure the jdbcdslog-exp [log level as explained in their manual](https://code.google.com/p/jdbcdslog/wiki/UserGuide#Setup_logging_engine). Basically, you need to configure your root logger to `INFO` and then decide what jdbcdslog-exp will log (connections, statements and result sets). Here is an example using `logback.xml` to configure the logs:

@[](code/logback-play-logSql.xml)

> **Warning**: Keep in mind that this is intended to be used just in development environments and you should not configure it in production, since there is a performance degradation and it will pollute your logs.

## Accessing the JDBC datasource

Play database packages provides access to the default datasource, primarily through the `Database` (see docs for [Java](api/java/play/db/Database.html) and [Scala](api/scala/play/api/db/Database.html)) class.

Java
: @[java-jdbc-database](code/jdatabase/JavaApplicationDatabase.java)

Scala
: @[scala-jdbc-database](code/sdatabase/ScalaApplicationDatabase.scala)

For a database other than the default:

Java
: @[java-jdbc-named-database](code/jdatabase/JavaNamedDatabase.java)

Scala
: @[scala-jdbc-named-database](code/sdatabase/ScalaNamedDatabase.scala)

In both cases, when using `withConnection`, the connection will be automatically closed at the end of the block.

## Obtaining a JDBC connection

You can retrieve a JDBC connection the same way:

Java
: @[java-jdbc-connection](code/jdatabase/JavaJdbcConnection.java)

Scala
: @[scala-jdbc-connection](code/sdatabase/ScalaJdbcConnection.scala)

It is important to note that resulting Connections are not automatically disposed at the end of the request cycle. In other words, you are responsible for calling their `close()` method somewhere in your code so that they can be immediately returned to the pool.

## Using a `CustomExecutionContext`

You should always use a custom execution context when using JDBC, to ensure that Play's rendering thread pool is completely focused on rendering results and using cores to their full extent.  You can use Play's `CustomExecutionContext` (see docs for [Java](api/java/play/libs/concurrent/CustomExecutionContext.html) and [Scala](api/scala/play/api/libs/concurrent/CustomExecutionContext.html)) class to configure a custom execution context dedicated to serving JDBC operations.  See [[JavaAsync]]/[[ScalaAsync]] and [[ThreadPools]] for more details.

All of the Play example templates on [Play's download page](https://playframework.com/download#examples) that use blocking APIs (i.e. Anorm, JPA) have been updated to use custom execution contexts where appropriate.  For example:

1. Scala: going to [playframework/play-scala-anorm-example/](https://github.com/playframework/play-samples/tree/2.8.x/play-scala-anorm-example) shows that the [CompanyRepository](https://github.com/playframework/play-samples/blob/2.8.x/play-scala-anorm-example/app/models/CompanyRepository.scala) class takes a `DatabaseExecutionContext` that wraps all the database operations.
1. Java: going to [playframework/play-java-jpa-example](https://github.com/playframework/play-samples/tree/2.8.x/play-java-jpa-example/) shows that the [JPAPersonRepository](https://github.com/playframework/play-samples/blob/2.8.x/play-java-jpa-example/app/models/JPAPersonRepository.java) class takes a `DatabaseExecutionContext` that wraps all the database operations.

For thread pool sizing involving JDBC connection pools, you want a fixed thread pool size matching the connection pool, using a thread pool executor.  Following the advice in [HikariCP's pool sizing page](https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing), you should configure your JDBC connection pool to double the number of physical cores, plus the number of disk spindles, i.e. if you have a four core CPU and one disk, you have a total of 9 JDBC connections in the pool:

```HOCON
# db connections = ((physical_core_count * 2) + effective_spindle_count)
fixedConnectionPool = 9

database.dispatcher {
  executor = "thread-pool-executor"
  throughput = 1
  thread-pool-executor {
    fixed-pool-size = ${fixedConnectionPool}
  }
}
```

## Configuring the connection pool

Out of the box, Play uses [HikariCP](https://github.com/brettwooldridge/HikariCP) as the default database connection pool implementation. Also, you can use your own pool that implements `play.api.db.ConnectionPool` by specifying the fully-qualified class name:

```properties
play.db.pool=your.own.ConnectionPool
```

The full range of configuration options for connection pools can be found by inspecting the `play.db.prototype` property in Play's JDBC [`reference.conf`](resources/confs/play-jdbc/reference.conf).

## Testing

For information on testing with databases, including how to setup in-memory databases and, see :

- [[Java: Testing With Databases|JavaTestingWithDatabases]]
- [[Scala: Testing With Databases|ScalaTestingWithDatabases]]

## Enabling Play database evolutions

Read [[Evolutions]] to find out what Play database evolutions are useful for, and follow the instructions for using it.


text:
package com.vladsch.md.nav.psi.element;

public interface MdInlineQuoted extends MdComposite, MdInlineStyleElement {
}


text:
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

class Foo {

  public void main(@NotNull Object nn) {
    foo(nn).hashCode();
  }

  @Contract("null->null;!null->!null")
  @Nullable
  Object foo(Object a) { return a; }

  @NotNull
  Object notNull() {
    return <warning descr="Expression 'nullable(false)' might evaluate to null but is returned by the method declared as @NotNull">nullable(false)</warning>;
  }

  @NotNull
  Object notNull2() {
    return <warning descr="Expression 'nullable2(false)' might evaluate to null but is returned by the method declared as @NotNull">nullable2(false)</warning>;
  }

  @Nullable
  @Contract("true -> !null")
  Object nullable(boolean notNull) {
    return notNull ? "" : anotherNullable();
  }

  @Nullable
  @Contract("true -> !null; _->_")
  Object nullable2(boolean notNull) {
    return notNull ? "" : anotherNullable();
  }

  @Nullable
  Object anotherNullable() {
    return null;
  }

}

class Test {
  @NotNull
  String getName() {
    return "";
  }

  @Nullable
  @Contract("!null -> !null")
  String convert(@Nullable String name) {
    return name;
  }

  @NotNull
  String test() {
    return convert(getName());
  }
}


text:
'use strict';

const Iterable = require('../iterable');

/**
 * Transducer chain actions.
 */
const Action = {
  terminate: Symbol('terminate'),
  repeat: Symbol('repeat')
};

/**
 * State wrapper used for stateful transducers.
 */
class Wrapper {
  /**
   * @param {mixed} outter
   * @param {mixed} inner
   */
  constructor(outter, inner, action) {
    this.outter = outter;
    this.inner = inner;
    this.action = action;
  }
}

// todo: unit-test
function shouldTerminate(state) {
  return (state.action === Action.terminate);
}

// todo: unit-test
function shouldRepeat(state) {
  return (state.action === Action.repeat);
}

/**
 * Generates a transducer.
 *
 * @param {function}
 * @return {function}
 */
function transducer(transform) {
  return step => {
    return (...inputs) => {
      return transform(step, ...inputs);
    };
  };
}

/**
 * Unwrap wrapper into contintuent parts.
 *
 * @param {mixed} state
 * @param {mixed} state
 * @return {array[mixed, mixed]}
 */
function unwrap(state, value) {
  return [outter(state), inner(state, value)];
}

/**
 * Determine if a state is wrapped.
 *
 * @param {mixed} state
 * @return {boolean}
 */
function isWrapped(state) {
  return (state instanceof Wrapper);
}

/**
 * Wrap state.
 *
 * Wraps the state using state as outter and value as inner state if not wrapped.
 * Updates wrapper inner if already wrapped.
 *
 * @param {mixed} state
 * @param {mixed} state
 * @return {Wrapper}
 */
function wrap(state, value, action) {
  if (isWrapped(state)) {
    state.inner = value;
    state.action = action;

    return state;
  }

  return new Wrapper(state, value, action);
}

/**
 * Return transducer's inner state.
 *
 * @param {mixed} state
 * @param {mixed} state
 * @return {mixed}
 */
function inner(state, value) {
  if (isWrapped(state)) {
    return state.inner;
  }

  return value;
}

/**
 * Return transducer's outter state.
 *
 * @param {mixed} state
 * @return {mixed}
 */
function outter(state) {
  if (isWrapped(state)) {
    return state.outter;
  }

  return state;
}

/**
 * Return outter state.
 *
 * If wrapped the outter state is returned.
 * If not wrapped state is returned as is.
 *
 * @param {mixed} state
 * @return {mixed}
 */
function complete(state) {
  if (isWrapped(state)) {
    return state.outter;
  }

  return state;
}

/**
 * Correctly forwards inputs with any updated values in a transducer ->
 * transducer chain.
 *
 * TODO: unit-test the Iterable.isInputTuple return.
 *
 * @param {array[mixed]} inputs
 * @param {mixed} value - new initial input (output) for next transducer
 */
function forward(inputs, value) {
  if (Iterable.isInputTuple(value)) {
    return value;
  } else if (inputs.length > 1) {
    return [value, ...inputs.slice(1, inputs.length)];
  }

  return [value];
}

module.exports = {
  Action,
  complete,
  forward,
  inner,
  isWrapped,
  shouldTerminate,
  shouldRepeat,
  outter,
  transducer,
  unwrap,
  wrap
};


text:
using System;
using System.Numerics;
/// <summary>
///
/// In combinatorics, the number of ways to choose k different members out of a group of n different elements (also known as the number of combinations)
/// is calculated by the following formula: formula For example, there are 2598960 ways to withdraw 5 cards out of a standard deck of 52 cards.
/// Your task is to write a program that calculates n! / (k! * (n-k)!) for given n and k (1 < k < n < 100). Try to use only two loops.
///
/// </summary>
class CalculateNК
{
    static void Main()
    {
        Console.Write("Enter first number between 1..100: ");
        int n = int.Parse(Console.ReadLine());
        Console.Write("Enter second number between 1..100: ");
        int k = int.Parse(Console.ReadLine());

        BigInteger result = 1;

        if (1 < k && n > k && n < 100)
        {
            result = Factorial(n) / (Factorial(k) * Factorial(n-k));
            Console.WriteLine("N! / (K! * (N-K)! = {0}", result);
        }
        else
        {
            Console.WriteLine("Invalid Input");
        }
    }

    private static BigInteger Factorial(int n)
    {
        BigInteger factorial = 1;
        for (int i = 1; i <= n; i++)
        {
            factorial *= i;
        }
        return factorial;
    }
}


text:
/* $OpenLDAP: pkg/ldap/libraries/librewrite/rewrite.c,v 1.16.2.6 2011/01/04 23:50:13 kurt Exp $ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
 *
 * Copyright 2000-2011 The OpenLDAP Foundation.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted only as authorized by the OpenLDAP
 * Public License.
 *
 * A copy of this license is available in the file LICENSE in the
 * top-level directory of the distribution or, alternatively, at
 * <http://www.OpenLDAP.org/license.html>.
 */
/* ACKNOWLEDGEMENT:
 * This work was initially developed by Pierangelo Masarati for
 * inclusion in OpenLDAP Software.
 */

#include <portable.h>

#include <ac/stdlib.h>
#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/regex.h>
#include <ac/socket.h>
#include <ac/unistd.h>
#include <ac/ctype.h>
#include <ac/string.h>
#include <stdio.h>

#include <rewrite.h>
#include <lutil.h>
#include <ldap.h>

int ldap_debug;
int ldap_syslog;
int ldap_syslog_level;

static void
apply(
		FILE *fin,
		const char *rewriteContext,
		const char *arg
)
{
	struct rewrite_info *info;
	char *string, *sep, *result = NULL;
	int rc;
	void *cookie = &info;

	info = rewrite_info_init( REWRITE_MODE_ERR );

	if ( rewrite_read( fin, info ) != 0 ) {
		exit( EXIT_FAILURE );
	}

	rewrite_param_set( info, "prog", "rewrite" );

	rewrite_session_init( info, cookie );

	string = (char *)arg;
	for ( sep = strchr( rewriteContext, ',' );
			rewriteContext != NULL;
			rewriteContext = sep,
			sep ? sep = strchr( rewriteContext, ',' ) : NULL )
	{
		char	*errmsg = "";

		if ( sep != NULL ) {
			sep[ 0 ] = '\0';
			sep++;
		}
		/* rc = rewrite( info, rewriteContext, string, &result ); */
		rc = rewrite_session( info, rewriteContext, string,
				cookie, &result );

		switch ( rc ) {
		case REWRITE_REGEXEC_OK:
			errmsg = "ok";
			break;

		case REWRITE_REGEXEC_ERR:
			errmsg = "error";
			break;

		case REWRITE_REGEXEC_STOP:
			errmsg = "stop";
			break;

		case REWRITE_REGEXEC_UNWILLING:
			errmsg = "unwilling to perform";
			break;

		default:
			if (rc >= REWRITE_REGEXEC_USER) {
				errmsg = "user-defined";
			} else {
				errmsg = "unknown";
			}
			break;
		}

		fprintf( stdout, "%s -> %s [%d:%s]\n", string,
				( result ? result : "(null)" ),
				rc, errmsg );
		if ( result == NULL ) {
			break;
		}
		if ( string != arg && string != result ) {
			free( string );
		}
		string = result;
	}

	if ( result && result != arg ) {
		free( result );
	}

	rewrite_session_delete( info, cookie );

	rewrite_info_delete( &info );
}

int
main( int argc, char *argv[] )
{
	FILE	*fin = NULL;
	char	*rewriteContext = REWRITE_DEFAULT_CONTEXT;
	int	debug = 0;

	while ( 1 ) {
		int opt = getopt( argc, argv, "d:f:hr:" );

		if ( opt == EOF ) {
			break;
		}

		switch ( opt ) {
		case 'd':
			if ( lutil_atoi( &debug, optarg ) != 0 ) {
				fprintf( stderr, "illegal log level '%s'\n",
						optarg );
				exit( EXIT_FAILURE );
			}
			break;

		case 'f':
			fin = fopen( optarg, "r" );
			if ( fin == NULL ) {
				fprintf( stderr, "unable to open file '%s'\n",
						optarg );
				exit( EXIT_FAILURE );
			}
			break;

		case 'h':
			fprintf( stderr,
	"usage: rewrite [options] string\n"
	"\n"
	"\t\t-f file\t\tconfiguration file\n"
	"\t\t-r rule[s]\tlist of comma-separated rules\n"
	"\n"
	"\tsyntax:\n"
	"\t\trewriteEngine\t{on|off}\n"
	"\t\trewriteContext\tcontextName [alias aliasedContextName]\n"
	"\t\trewriteRule\tpattern subst [flags]\n"
	"\n"
				);
			exit( EXIT_SUCCESS );

		case 'r':
			rewriteContext = optarg;
			break;
		}
	}

	if ( debug != 0 ) {
		ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &debug);
		ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &debug);
	}

	if ( optind >= argc ) {
		return -1;
	}

	apply( ( fin ? fin : stdin ), rewriteContext, argv[ optind ] );

	if ( fin ) {
		fclose( fin );
	}

	return 0;
}


text:
import github3
import logging

# Set up a file to have all the logs written to
file_handler = logging.FileHandler('github_script.log')

# Send the logs to stderr as well
stream_handler = logging.StreamHandler()

# Format the log output and include the log level's name and the time it was
# generated
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')

# Use that Formatter on both handlers
file_handler.setFormatter(formatter)
stream_handler.setFormatter(formatter)

# Get the logger used by github3.py internally by referencing its name
# directly
logger = logging.getLogger('github3')
# Add the handlers to it
logger.addHandler(file_handler)
logger.addHandler(stream_handler)
# Set the level which determines what you see
logger.setLevel(logging.DEBUG)

# Make a library call and see the information posted
r = github3.repository('sigmavirus24', 'github3.py')
print('{0} - {0.html_url}'.format(r))


text:
.class Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1$1;
.super Ljava/lang/Object;
.source "MediaSessionManager.java"

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1;->onActiveSessionsChanged(Ljava/util/List;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$2:Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1;

.field final synthetic val$tokens:Ljava/util/List;

# direct methods
.method constructor <init>(Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1;Ljava/util/List;)V
    .locals 0

    iput-object p1, p0, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1$1;->this$2:Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1;

    iput-object p2, p0, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1$1;->val$tokens:Ljava/util/List;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public run()V
    .locals 6

    iget-object v3, p0, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1$1;->this$2:Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1;

    iget-object v3, v3, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1;->this$1:Landroid/media/session/MediaSessionManager$SessionsChangedWrapper;

    invoke-static {v3}, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper;->-get2(Landroid/media/session/MediaSessionManager$SessionsChangedWrapper;)Landroid/media/session/MediaSessionManager$OnActiveSessionsChangedListener;

    move-result-object v3

    if-eqz v3, :cond_1

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iget-object v3, p0, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1$1;->val$tokens:Ljava/util/List;

    invoke-interface {v3}, Ljava/util/List;->size()I

    move-result v2

    const/4 v1, 0x0

    :goto_0
    if-ge v1, v2, :cond_0

    new-instance v4, Landroid/media/session/MediaController;

    iget-object v3, p0, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1$1;->this$2:Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1;

    iget-object v3, v3, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1;->this$1:Landroid/media/session/MediaSessionManager$SessionsChangedWrapper;

    invoke-static {v3}, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper;->-get0(Landroid/media/session/MediaSessionManager$SessionsChangedWrapper;)Landroid/content/Context;

    move-result-object v5

    iget-object v3, p0, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1$1;->val$tokens:Ljava/util/List;

    invoke-interface {v3, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/media/session/MediaSession$Token;

    invoke-direct {v4, v5, v3}, Landroid/media/session/MediaController;-><init>(Landroid/content/Context;Landroid/media/session/MediaSession$Token;)V

    invoke-virtual {v0, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_0
    iget-object v3, p0, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1$1;->this$2:Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1;

    iget-object v3, v3, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper$1;->this$1:Landroid/media/session/MediaSessionManager$SessionsChangedWrapper;

    invoke-static {v3}, Landroid/media/session/MediaSessionManager$SessionsChangedWrapper;->-get2(Landroid/media/session/MediaSessionManager$SessionsChangedWrapper;)Landroid/media/session/MediaSessionManager$OnActiveSessionsChangedListener;

    move-result-object v3

    invoke-interface {v3, v0}, Landroid/media/session/MediaSessionManager$OnActiveSessionsChangedListener;->onActiveSessionsChanged(Ljava/util/List;)V

    :cond_1
    return-void
.end method


text:
"""
Output mapserver configuration information to `node-gyp`

Configuration options are retrieved from environment variables set using `npm
config set`.  This allows for a simple `npm install mapserv` to work.
"""

from optparse import OptionParser
import os, sys
import re

def warn(msg):
    print >> sys.stderr, msg

def die(msg):
    warn('Configuration failed: %s' % msg)
    sys.exit(1)

class ConfigError(Exception):
    pass

class Config(object):
    """Base class for obtaining Mapserver configuration information"""

    def __init__(self, build_dir):
        self.build_dir = build_dir

    def getLibDir(self):
        return ''

    def getIncludeDir(self):
        return os.path.join(self.build_dir)

    def getLdflags(self):
        lib_dir = self.getLibDir()
        ldflags = ''
        if lib_dir:
            # write the library path into the resulting binary
            ldflags += "-Wl,-rpath=%s -L%s\n" % (lib_dir, lib_dir)
        return ldflags

    def getCflags(self):
        return ''

class AutoconfConfig(Config):
    """Class for obtaining mapserver configuration pre mapserver 6.4

    Mapserver uses autotools for building and configuration in this version.
    """

    def __init__(self, *args, **kwargs):
        super(AutoconfConfig, self).__init__(*args, **kwargs)
        makefile = os.path.join(self.build_dir, 'Makefile')
        if not os.path.exists(makefile):
            raise ConfigError('Expected `Makefile` in %s' % self.build_dir)

        self.makefile = makefile

    def iterMakefile(self):
        """
        Iterate over the contents of the `Makefile`

        This additionally checks to ensure that Mapserver has been compiled
        with threads, raising an error if this is not the case.
        """
        with_threads = False
        p = re.compile('^THREAD *= *(.*)$')
        with open(self.makefile, 'r') as f:
            for line in f:
                match = p.match(line)
                if match:
                    with_threads = bool(match.groups()[0].strip())
                yield line.rstrip()
        if not with_threads:
            raise ConfigError('Mapserver has not been compiled with support for threads')

    def getLibDir(self):
        p = re.compile('^prefix\s*=\s*(.+)$') # match the prefix
        libdir = ''
        for line in self.iterMakefile():
            match = p.match(line)
            if match:
                arg = match.groups()[0].strip()
                if arg:
                    # we don't return here to let iterMakefile iterate over the
                    # whole file performing its thread check
                    libdir = os.path.join(arg, 'lib')
        return libdir

    def getCflags(self):
        # add includes from the Makefile
        p = re.compile('^[A-Z]+_INC *= *(.+)$') # match an include header
        matches = []
        for line in self.iterMakefile():
            match = p.match(line)
            if match:
                arg = match.groups()[0].strip()
                if arg:
                    matches.append(arg)

        return ' '.join(matches)

class CmakeConfig(Config):
    """Class for obtaining Mapserver configuration for versions >= 6.4

    Mapserver uses Cmake for building and configuration in this version.
    """

    def __init__(self, *args, **kwargs):
        super(CmakeConfig, self).__init__(*args, **kwargs)
        cmake_cache = os.path.join(self.build_dir, 'CMakeCache.txt')
        if not os.path.exists(cmake_cache):
            raise ConfigError('Expected `CMakeCache.txt` in %s' % self.build_dir)

        self.cmake_cache = cmake_cache

    def iterCmakeCache(self):
        """
        Iterate over the contents of the `CmakeCache.txt` file

        This additionally checks to ensure that Mapserver has been compiled
        with threads, raising an error if this is not the case.
        """
        with_threads = False
        patterns = [
            re.compile('^WITH_THREAD_SAFETY:BOOL *= *(.+)$'), # >= Mapserver 6.4
            re.compile('^WITH_THREADS:BOOL *= *(.+)$')        # < Mapserver 6.4
            ]

        with open(self.cmake_cache, 'r') as f:
            for line in f:
                for p in patterns:
                    match = p.match(line)
                    if match:
                        with_threads = match.groups()[0].strip() in ('ON', '1')
                yield line
        if not with_threads:
            raise ConfigError('Mapserver has not been compiled with support for threads')

    def getLibDir(self):
        p = re.compile('^CMAKE_INSTALL_PREFIX:PATH *= *(.+)$') # match the prefix
        lib_dir = ''
        for line in self.iterCmakeCache():
            match = p.match(line)
            if match:
                arg = match.groups()[0].strip()
                if arg:
                    # we don't return here to let iterCmakeCache iterate over
                    # the whole file performing its thread check
                    lib_dir = os.path.join(arg, 'lib')

        return lib_dir

    def getIncludeDir(self):
        dirs = []
        patterns = [
            re.compile('^\w+_INCLUDE_DIR:PATH *= *(.+)$'), # match a library directory
            re.compile('^MapServer_(?:SOURCE|BINARY)_DIR:STATIC *= *(.+)$') # match the mapserver directories
            ]

        for line in self.iterCmakeCache():
            for p in patterns:
                match = p.match(line)
                if match:
                    arg = match.groups()[0].strip()
                    if arg:
                        dirs.append(arg)
                    continue # skip the other patterns

        return ' '.join(dirs)

parser = OptionParser()
parser.add_option("--include",
                  action="store_true", default=False,
                  help="output the mapserver include path")

parser.add_option("--libraries",
                  action="store_true", default=False,
                  help="output the mapserver library link option")

parser.add_option("--ldflags",
                  action="store_true", default=False,
                  help="output the mapserver library rpath option")

parser.add_option("--cflags",
                  action="store_true", default=False,
                  help="output the mapserver cflag options")

(options, args) = parser.parse_args()

try:
    # gyp provides the build directory in an environment variable
    build_dir = os.environ['npm_config_mapserv_build_dir']
except KeyError:
    # for cases where gyp is not the caller just use `npm` directly
    import subprocess
    cmd = ['npm', 'config', 'get', 'mapserv:build_dir']
    npm = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout, stderr = npm.communicate()
    if npm.returncode != 0:
        die('npm failed: ' + stderr)

    build_dir = stdout.strip()
    if build_dir == 'undefined':
        die('`npm config set mapserv:build_dir` has not been called')

# get the config object, trying the new cmake system first and falling back to
# the legacy autoconf build sytem
try:
    try:
        config = CmakeConfig(build_dir)
    except ConfigError, e:
        try:
            config = AutoconfConfig(build_dir)
        except ConfigError, e2:
            warn("Failed to configure using Cmake: %s" % e)
            warn("Attempting configuration using autotools...")
            die(e2)

    # output the requested options
    if options.include:
        print config.getIncludeDir()

    if options.libraries:
        lib_dir = config.getLibDir()
        if lib_dir:
            print "-L%s" % lib_dir

    if options.ldflags:
        print config.getLdflags()

    if options.cflags:
        print config.getCflags()

except ConfigError, e:
    die(e)


text:
// ==UserScript==
// @name          sexyhf
// @namespace     https://github.com/iHydra
// @version       1.5.578
// @description   Custom theme for Hack Forums. Base theme by Sasori.
// @include       http://www.hackforums.net/*
// @include       http://hackforums.net/*
// @author        iHydra/Kondax/Sasori
// @require       https://code.jquery.com/jquery-2.1.4.min.js
// @require       https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.8.0/highlight.min.js
// @resource      MainCSS https://raw.githubusercontent.com/StunningFX/StunningHFs/master/stylesheet_1.5.5.css
// @resource      HLCSS https://raw.githubusercontent.com/isagalaev/highlight.js/master/src/styles/monokai-sublime.css
// @grant         GM_addStyle
// @grant         GM_setValue
// @grant         GM_getValue
// @grant         GM_getResourceText
// @run-at        document-start
// ==/UserScript==

var quotedPosts = GM_getValue("quotedPosts") == undefined ? [] : GM_getValue("quotedPosts");
console.log(quotedPosts);
//alert(GM_getValue("quotedPosts"));

/* INFORMATION - READ */
// You can change Highlighter Theme: https://github.com/isagalaev/highlight.js/tree/master/src/styles || Demo of Themes: https://highlightjs.org/static/demo/
// You can change the preview button shortcut key if you scroll down to USER EDITING.

// Copyright (c) 2011 Pete Boere (the-echoplex.net) Free under terms of the MIT license: http://www.opensource.org/licenses/mit-license.php
!function(s){s.fn.alterClass=function(a,e){var r=this;if(-1===a.indexOf("*"))return r.removeClass(a),e?r.addClass(e):r;var n=new RegExp("\\s"+a.replace(/\*/g,"[A-Za-z0-9-_]+").split(" ").join("\\s|\\s")+"\\s","g");return r.each(function(a,e){for(var r=" "+e.className+" ";n.test(r);)r=r.replace(n," ");e.className=s.trim(r)}),e?r.addClass(e):r}}(jQuery);

var MainCSS = GM_getResourceText('MainCSS');
GM_addStyle(MainCSS);
var HLCSS = GM_getResourceText('HLCSS');
GM_addStyle(HLCSS);

/*
 * USER EDITING
 */

var quotedColor = "#00ffd2"; // Color for when quoted by someone - Keep inside quotes - if you enter hex code, put # as prefix. Ex: "#282828" vs. "teal"
var showLogo = false; // true to show logo, false to hide logo
var enableSFW = false; // true to enable SFW, false to disable SFW (Safe For Work)
var previewKey = 'w'; // ALT + {KEY} for Chrome || ALT + SHIFT + {KEY} for Firefox - More Info: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey
var hideMenu = false; // true to remove menu nav links, false to show.
var badges = false; // Badges Feature - false to disable feature. || **NOT DONE**

/*
 * END USER EDITING
 */

$(window).load(function () { // Theme Color Scheme Changer
    var cp = $('
');
    var select = $('
');
    $('body').append(cp, select);
    var colours = {
        'black': '#393939',
        'blue': '#619ECB',
        'green': '#117713',
        'orange': '#D29C2D',
        'purple': '#724FAD',
        'red': '#CB6161',
        'darkblue': '#00528f',
        'darkgreen': '#117713',
        'darkorange': '#9A782E',
        'darkpurple': '#4D2D5E',
        'darkred': '#641C1C'
    };
    if (!localStorage.getItem('theme'))
        localStorage.setItem('theme', 'cl-' + Object.keys(colours) [0]);
    $('body').addClass(localStorage.getItem('theme') ? localStorage.getItem('theme')  : 'cl-' + Object.keys(colours) [0]);
    $('.cp').css('background', colours[$('body').attr('class').split(' ') [0].substring(3, $('body').attr('class').split(' ') [0].length)]);
    $.each(colours, function (key, value) {
        select.append($('
'));
    });
    $('.cp').click(function () {
        $('.select').toggleClass('show');
    });
    $('.part').click(function () {
        var cl = 'cl-' + $(this).attr('cid');
        $('.cp').css('background', colours[$(this).attr('cid')]);
        $('body').alterClass('cl-*', cl);
        localStorage.setItem('theme', cl);
    });
});

/** START SETTINGS PANEL **/

// TBA

/** END SETTINGS PANEL **/

/** Custom Functions **/

$('code').each(function(i, block) { // Highlight Syntax
    hljs.highlightBlock(block);

});

/*
 * Modifications (jQuery/jS for multi-browser support)
 */

$(document).ready(function () {
    $('div.menu > ul').attr('style','text-align:center !important;');
    $('img[src$="hackforums.net/images/modern_bl/starstaff.png"]').attr('style', 'filter: hue-rotate(5deg) saturate(8); -webkit-filter: hue-rotate(5deg) saturate(8)'); // Staff Stars Color Change
    $('img[src$="hackforums.net/images/modern_bl/dismiss_notice.gif"]').attr('src', 'http://i.imgur.com/uxvQQDI.png'); // PM Notif Dismiss Icon
    $('img[src$="hackforums.net/images/modern_bl/add_buddy.gif"]').attr('src', 'http://i.imgur.com/3d5FKNX.png'); // Add Buddy Icon
    $('img[src$="hackforums.net/images/modern_bl/remove_buddy.gif"]').attr('src', 'http://i.imgur.com/zDwBkq5.png'); // Remove Buddy Icon
    $('img[src$="hackforums.net/images/modern_bl/add_ignore.gif"]').attr('src', 'http://i.imgur.com/u3NZbDu.png'); // Add Ignore Icon
    $('img[src$="hackforums.net/images/modern_bl/remove_ignore.gif"]').attr('src', 'http://i.imgur.com/zDwBkq5.png'); // Remove Ignore Icon
    $('img[src$="/img/disable.png"]').attr('src', 'http://i.imgur.com/LXGekE9.png'); // Disable icon for multi-page loader userscript(not included)
    $('img[src$="/img/enable.png"]').attr('src', 'http://i.imgur.com/YHDATSF.png'); // Enable icon for multi-page loader userscript(not included)
    $('img[src$="hackforums.net/images/modern_bl/minioff.gif"]').attr('src', 'http://i.imgur.com/AP6vLRo.png').attr('style', 'padding-bottom: 2px;'); // No Posts SF Icon
    $('img[src$="hackforums.net/images/modern_bl/miniofflock.gif"]').attr('src', 'http://i.imgur.com/AP6vLRo.png').attr('style', 'padding-bottom: 2px;'); // No Posts SF Icon Locked
    $('img[src$="hackforums.net/images/modern_bl/minion.gif"]').attr('src', 'http://i.imgur.com/Wsl1Gfc.png').attr('style', 'padding-bottom: 3px;'); // New Posts SF icon
    $('img[src$="http://hackforums.net/images/modern_bl/spinner_big.gif"]').attr('src', 'http://i.imgur.com/y3wDcUA.gif'); // Quick Reply Spinner Change
    $('span:contains("Moderated")').addClass('sevenpad'); // Padding fix
    $('link[href*="star_ratings"]').remove(); // Star Ratings Change
    $('#pm_notice').removeClass('pm_alert').addClass('pm_alert2'); // Group vs. PM Alert

    $('code[class="hljs markdown"]').dblclick(function() {
        $(this).select();

        var text = this,
            range, selection;

        if (document.body.createTextRange) {
            range = document.body.createTextRange();
            range.moveToElementText(text);
            range.select();
        } else if (window.getSelection) {
            selection = window.getSelection();
            range = document.createRange();
            range.selectNodeContents(text);
            selection.removeAllRanges();
            selection.addRange(range);
        }
    });

    if($("img[id*='multiquote_']").attr("src") === "http://hackforums.net/images/modern_bl/english/postbit_multiquote_on.gif") { // Multiquote IMG to CSS - By Snorlax
        $("img[id*='multiquote_']").hide().after("<button class='button' style='bottom: 7px;position: relative;cursor: pointer;outline: none;'>MQ-</button>");
    } else {
        $("img[id*='multiquote_']").hide().after("<button class='button' style='bottom: 7px;position: relative;cursor: pointer;outline: none;'>MQ+</button>");
    }
    $(".trow1 .button").on("click", function() {
        var postId = $(this).parent().attr("id").match(/multiquote_link_([0-9]*)/)[1];
        if($(this).text() == "MQ-") {
            quotedPosts.splice(quotedPosts.indexOf(postId), 1);
        } else {
            quotedPosts.push(postId);
            console.log(quotedPosts);
        }
        GM_setValue("quotedPosts", quotedPosts);
        $(this).text($(this).text() == "MQ+" ? "MQ-" : "MQ+");
    });

    $(".trow1 .button").each(function() {
        var postId = $(this).parent().attr("id").match(/multiquote_link_([0-9]*)/)[1];
        if(GM_getValue("quotedPosts").indexOf(postId) >= 0) {
            $(this).text("MQ-");
            console.log(postId);
        }
    });

    $("body").on("click", "#quickreply_multiquote", function() {
        console.log("Clicked");
        quotedPosts = [];
        GM_setValue("quotedPosts", quotedPosts);
        $(".button").each(function() {
            $(this).text("MQ+");
            console.log("SET TO MQ+");
        });
    });

    $('.button2[name="previewpost"]').attr('accesskey',previewKey); // Preview Key Hotkey Shortcut

    if(window.location.href == "http://hackforums.net/misc.php?action=buddypopup"){ // Buddy List Online Status Fix
        $('img[src$="hackforums.net/images/modern_bl/buddy_away.gif"]').attr('src', 'http://i.imgur.com/x7dAaGE.png').attr('style', ''); // Away Status
        $('img[src$="hackforums.net/images/modern_bl/buddy_online.gif"]').attr('src', 'http://i.imgur.com/lpKaTIB.png').attr('style', ''); // Online Status
        $('img[src$="hackforums.net/images/modern_bl/buddy_offline.gif"]').attr('src', 'http://i.imgur.com/EKt4fXk.png').attr('style', ''); // Offline Status
    }else if(window.location.href == "http://hackforums.net/usercp.php?action=editlists"){
        $('img[src$="hackforums.net/images/modern_bl/buddy_away.gif"]').attr('src', 'http://i.imgur.com/x7dAaGE.png').attr('style', 'vertical-align: top;'); // Away Status
        $('img[src$="hackforums.net/images/modern_bl/buddy_online.gif"]').attr('src', 'http://i.imgur.com/lpKaTIB.png').attr('style', 'vertical-align: top;'); // Online Status
        $('img[src$="hackforums.net/images/modern_bl/buddy_offline.gif"]').attr('src', 'http://i.imgur.com/EKt4fXk.png').attr('style', 'vertical-align: top;'); // Offline Status
    }else{
        $('img[src$="hackforums.net/images/modern_bl/buddy_away.gif"]').attr('src', 'http://i.imgur.com/x7dAaGE.png').attr('style', 'position: absolute; padding-top: 4px;'); // Away Status
        $('img[src$="hackforums.net/images/modern_bl/buddy_online.gif"]').attr('src', 'http://i.imgur.com/lpKaTIB.png').attr('style', 'position: absolute; padding-top: 4px;'); // Online Status
        $('img[src$="hackforums.net/images/modern_bl/buddy_offline.gif"]').attr('src', 'http://i.imgur.com/EKt4fXk.png').attr('style', 'position: absolute; padding-top: 4px;'); // Offline Status
    }

    $("td[class*='trow'] input:checkbox").on("click", function() { // Mods & Staf Only - Highlight checkboxed rows - Conflicts with HFES for me, please test and report back
        console.log("something");
        var selector = $(this).closest("tr").find("td");
        if($(this).is(":checked")) {
            selector.css("background", "#242424");
        } else {
            selector.css("background", "");
        }
    });

    if(window.location.pathname == "/gauth.php"){
        $('span[class="float_right smalltext"]').attr('style','display: block !important'); // Gauth Reset Link Reveal
    }

    if(window.location.pathname == "/reputation.php"){
        $('a[href$="&show=positive"]').attr('style','font-size: 14px; background-color: #2DA546; border: 1px solid #2CC330; padding: 5px 10px 5px 10px; font-weight: bold; color: white;').after("
"); // Positive Rep Box
        $('a[href$="&show=neutral"]').attr('style','font-size: 14px; background-color: #777777; border: 1px solid #949494; padding: 5px 10px 5px 10px; font-weight: bold; color: white;').after("
"); // Neutral Rep Box
        $('a[href$="&show=negative"]').attr('style','font-size: 14px; background-color: #CC4444; border: 1px solid #FF5656; padding: 5px 10px 5px 10px; font-weight: bold; color: white;'); // Negative Rep Box
        $('strong[class="reputation_positive"]:contains("Positives")').remove(); // Legend Text Remove
        $('strong[class="reputation_neutral"]:contains("Neutrals")').remove(); // Legend Text Remove
        $('strong[class="reputation_negative"]:contains("Negatives")').remove(); // Legend Text Remove
        $('span[class="smalltext"]:contains("Total Reputation:")').find("br").remove(); // Received Rep Boxes Layout
        $('strong:contains("Total Reputation:")').before("

"); // Received Rep Boxes Layout
        $('span[class^="repbox"]').after("

"); // Received Rep Boxes Layout
    }
    if(showLogo === true){ // Show Logo
        $('img[src$="http://hackforums.net/images/modern_bl/logo_bl.gif"]').attr('src', 'http://i.imgur.com/fAzkq6w.png');
        $('div[class="logo"]').removeClass("logo").attr('style','text-align:center');
    }

    if(enableSFW === true) { // Enable Safe-For-Work
        $('div[style="overflow:hidden; max-height:200px;"]').attr('class','sigArea');
        $('div[style="overflow:hidden; max-height:200px;"] img').attr('class','sigImage');
        $('td[class="post_avatar"]').attr('style','display:none;');
        var sigShow = $('<input type="button" class="button sigButton" value="toggle" style="position:relative; float:right;" />');

        $("table[id*='post_']").each(function() {
            src = $(this).find("tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(3) img").attr("src");
            if (src != null) {
                $(this).find("tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(3) img").attr('style','display:none;');
                $(this).find("tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(3)").prepend('<input type="button" class="bitButton sigButton" value="toggle" style="position:relative; float:right; outline:none;" />');
            }
        });

        $('.sigButton').click(function() {
            $(this).parent().find('.sigImage').toggleClass("sigReveal");
            $(this).parent().toggleClass("sigResize");

        });
    }

    if(window.location.pathname != "/private.php") {
        var userName = $('strong > a[href^="http://hackforums.net/member.php?action=profile&uid="]').text();
        $('blockquote > cite:contains(' + userName + ')').css({'color': quotedColor, 'font-weight': 'bold','border-bottom': '1px dotted' + quotedColor});
    }

    if(window.location.pathname == "/showstaff.php" || window.location.pathname == "/showmods.php") {
        $('head').append('')
        $('td[class="trow1"]').attr("style","background: none; border: 0px !important;");
        $('div[style="width: 48%; min-height: 120px;float: left; border: 1px #4F3A6B solid; margin: 4px; padding: 2px;"]').attr("style","").addClass("staffCard");
        $('div[style="width: 48%; float: left; border: 1px #4F3A6B solid; margin: 4px; padding: 2px;"]').attr("style","").addClass("staffCard");
        $('td[class="trow1"][width="75%"]').attr("width","90%").attr("style","border: 0px !important").removeClass('trow1').addClass('staffCardParts').addClass('trow2');
        $('td[width="25%"]').attr("style","").addClass('staffCardParts');
    }

    if(window.location.pathname == "/showgroups.php") {
        $('head').append('')
        $('td[class="trow1"]').attr("style","background: none; border: 0px !important;");
        $('div[style="width: 46%; min-height:168px;float: left; border: 1px #4F3A6B solid; margin: 4px; padding: 2px;"]').attr("style","").addClass("groupsCard");
        $('td[class="trow1"][width="75%"]').attr("width","90%").attr("style","border: 0px !important").removeClass('trow1').addClass('groupsCardParts').addClass('trow2');
        $('td[width="25%"]').attr("style","").attr("valign","middle").addClass('groupsCardParts');
        $('td[valign="bottom"]').attr("style","background-color: #333; border-radius: 0px; vertical-align: baseline; font-size: 12px;");
        $('table[width="100%"]').attr("height","100%").attr("cellpadding","10");
    }

    if(hideMenu === true) {
        $("div[class='menu']").hide();
    }

    if(badges === true) {
        // BADGES - LIST OF UIDs
        var adminList = [1]; // Omniscient
        var staffList = [1292605,1093501,370510,1570078,992020,1450348]; // Skorp, Roger Waters, Alone Vampire, Sam Winchester, King of Hearts, Walt Disney
        var mentorList = [4066,330676,1320406]; // Judge Dredd, Diabolic, Froggy
        var groupLeadersList = []; //
        for(var I = 0; I < staffList.length; I++) {
            $("a[href='http://hackforums.net/member.php?action=profile&uid=" + staffList[I] + "']").append('');
        }
        for(var I = 0; I < mentorList.length; I++) {
            $("a[href='http://hackforums.net/member.php?action=profile&uid=" + mentorList[I] + "']").append('');
        }
        for(var I = 0; I < adminList.length; I++) {
            $("a[href='http://hackforums.net/member.php?action=profile&uid=" + adminList[I] + "']").append('');
        }
        for(var I = 0; I < groupLeadersList.length; I++) {
            $("a[href='http://hackforums.net/member.php?action=profile&uid=" + groupLeadersList[I] + "']").append('');
        }
    }

    $('img[src$="hackforums.net/images/modern_bl/groupimages/english/ub3r.png"]').attr('style', '-webkit-filter: hue-rotate(15deg); filter: hue-rotate(15deg);'); // Uber Userbar Color Change
    $('img[src$="hackforums.net/images/modern_bl/starub3r2.png"]').attr('style', '-webkit-filter: hue-rotate(15deg); filter: hue-rotate(15deg);'); // Uber Stars Color Change
    $('strong span[style="rgb(56, 56, 56)"]').addClass("closedGroup"); // Changes Closed Usergroup Color
    $('strong:contains("Post:") > a[href^="showthread.php?tid="]').attr('id','postLink').attr('style','padding-top: 3px; padding-right: 5px; display: inline-block;'); // Post # Centered
    $('span[style="color:#383838"]').attr('style','color:#444444;'); // Closed Account Username Color Change
    $('a[href="http://hackforums.net/member.php?action=profile&uid=561239"] > span[class^="group"]').append('');
    $('a[href="http://hackforums.net/member.php?action=profile&uid=2377407"] > span[class^="group"]').append('');

});


text:
#ifndef __mitkContourModelIOFactory_h
#define __mitkContourModelIOFactory_h

#ifdef _MSC_VER
#pragma warning ( disable : 4786 )
#endif

#include <MitkContourModelExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"

namespace mitk
{
//##Documentation
//## @brief Create instances of ContourModelReader objects using an object factory.
//##
//## @ingroup IO
class MitkContourModel_EXPORT ContourModelIOFactory : public itk::ObjectFactoryBase
{
public:
  /** Standard class typedefs. */
  typedef ContourModelIOFactory   Self;
  typedef itk::ObjectFactoryBase  Superclass;
  typedef itk::SmartPointer<Self>  Pointer;
  typedef itk::SmartPointer<const Self>  ConstPointer;

  /** Class methods used to interface with the registered factories. */
  virtual const char* GetITKSourceVersion(void) const;
  virtual const char* GetDescription(void) const;

  /** Method for class instantiation. */
  itkFactorylessNewMacro(Self);
  static ContourModelIOFactory* FactoryNew() { return new ContourModelIOFactory;}
  /** Run-time type information (and related methods). */
  itkTypeMacro(ContourModelIOFactory, ObjectFactoryBase);

  /**
   * Register one factory of this type
   * \deprecatedSince{2013_09}
   */
  DEPRECATED(static void RegisterOneFactory(void))
  {
    ContourModelIOFactory::Pointer ContourModelIOFactory = ContourModelIOFactory::New();
    ObjectFactoryBase::RegisterFactory(ContourModelIOFactory);
  }

protected:
  ContourModelIOFactory();
  ~ContourModelIOFactory();

private:
  ContourModelIOFactory(const Self&); //purposely not implemented
  void operator=(const Self&); //purposely not implemented

};

} // end namespace mitk

#endif


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.resourcemover.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;

/** Defines the move resource errors. */
@Immutable
public final class MoveResourcePropertiesErrors extends MoveResourceError {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourcePropertiesErrors.class);

    /** {@inheritDoc} */
    @Override
    public MoveResourcePropertiesErrors withProperties(MoveResourceErrorBody properties) {
        super.withProperties(properties);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
    }
}


text:
<?php

// hr

return [

	'attendance'							=> 'Attendance',
	'attendee'								=> 'Attendee|Attendees',
	'audience'								=> 'Audience',
	'blood'									=> 'Blood',
	'building'								=> 'Building',
	'campus'								=> 'Campus',
	'code'									=> 'Code',
	'communication'							=> 'Communication',
	'contact'								=> 'Contact|Contacts',
	'contact_information'					=> 'Contact Information',
	'contract'								=> 'Contract|Contracts',
	'department'							=> 'Department|Departments',
	'directory'								=> 'Directory',
	'division'								=> 'Division|Divisions',
	'education'								=> 'Education',
	'employee'								=> 'Employee|Employees',
	'employment_information'				=> 'Employment Information',
	'employee_type'							=> 'Employee Type|Employee Types',
	'ethnicity'								=> 'Ethnicity|Ethnicities',
	'evidence'								=> 'Evidence',
	'gender'								=> 'Gender|Genders',
	'grade'									=> 'Grade|Grades',
	'hr'									=> 'HR|Human Resources',
	'incident'								=> 'Incident|Incidents',
	'incident_type'							=> 'Incident Type|Incident Types',
	'infraction'							=> 'Infraction|Infractions',
	'is_settled'							=> 'Settled ?',
	'job_information'						=> 'Job Information',
	'job_title'								=> 'Job Title|Job Titles',
	'lea'									=> 'LEA',
	'legal'									=> 'Legal',
	'location'								=> 'location|Locations',
	'marital'								=> 'Marital',
	'member'								=> 'Member|Members',
	'member_type'							=> 'Member Type|Member Types',
	'office'								=> 'Office',
	'position'								=> 'Position|Positions',
	'presented'								=> 'Presented',
	'presenter'								=> 'Presenter|Presenters',
	'principal'								=> 'Principal',
	'profile'								=> 'Profile|Profiles',
	'room'									=> 'Room|Rooms',
	'rule'									=> 'Rule|Rules',
	'school'								=> 'School|Schools',
	'student'								=> 'Student|Students',
	'seminar'								=> 'Seminar|Seminars',
	'settled'								=> 'Settled',
	'site'									=> 'Site|Sites',
	'subject'								=> 'Subject|Subjects',
	'supervisor'							=> 'Supervisor',
	'staff'									=> 'Staff',
	'teacher'								=> 'Teacher|Teachers',

// ask
	'ask' => [
		'isSupervisior'						=> 'Supervisior ?',
		'isTeacher'							=> 'Teacher ?',
	],

// success
	'success' => [
		'attendance_email'					=> 'Attendance Request Email has been Sent.',
		'code_create'						=> 'The Code was successfully created.',
		'code_delete'						=> 'The Code was successfully deleted.',
		'code_update'						=> 'The Code was successfully updated.',
		'contact_create'					=> 'The Contact was successfully created.',
		'contact_delete'					=> 'The Contact was successfully deleted.',
		'contact_update'					=> 'The Contact was successfully updated.',
		'contract_create'					=> 'The Contract was successfully created.',
		'contract_delete'					=> 'The Contract was successfully deleted.',
		'contract_update'					=> 'The Contract was successfully updated.',
		'department_create'					=> 'The Department was successfully created.',
		'department_delete'					=> 'The Department was successfully deleted.',
		'department_update'					=> 'The Department was successfully updated.',
		'division_create'					=> 'The Division was successfully created.',
		'division_delete'					=> 'The Division was successfully deleted.',
		'division_update'					=> 'The Division was successfully updated.',
		'employee_create'					=> 'The Employee was successfully created.',
		'employee_delete'					=> 'The Employee was successfully deleted.',
		'employee_update'					=> 'The Employee was successfully updated.',
		'employee_type_create'				=> 'The Employee Type was successfully created.',
		'employee_type_delete'				=> 'The Employee Type was successfully deleted.',
		'employee_type_update'				=> 'The Employee Type was successfully updated.',
		'grade_create'						=> 'The Grade was successfully created.',
		'grade_delete'						=> 'The Grade was successfully deleted.',
		'grade_update'						=> 'The Grade was successfully updated.',
		'incident_create'					=> 'The Incident was successfully created.',
		'incident_delete'					=> 'The Incident was successfully deleted.',
		'incident_update'					=> 'The Incident was successfully updated.',
		'incident_type_create'				=> 'The Incident Type was successfully created.',
		'incident_type_delete'				=> 'The Incident Type was successfully deleted.',
		'incident_type_update'				=> 'The Incident Type was successfully updated.',
		'job_title_create'					=> 'The Job Title was successfully created.',
		'job_title_delete'					=> 'The Job Title was successfully deleted.',
		'job_title_update'					=> 'The Job Title was successfully updated.',
		'member_create'						=> 'The Member was successfully created.',
		'member_update'						=> 'The Member was successfully updated.',
		'member_type_create'				=> 'The Member Type was successfully created.',
		'member_type_update'				=> 'The Member Type was successfully deleted.',
		'position_create'					=> 'The Position was successfully created.',
		'position_delete'					=> 'The Position was successfully deleted.',
		'position_update'					=> 'The Position was successfully updated.',
		'room_checkin'						=> 'The Room was successfully Checked In.',
		'room_checkout'						=> 'The Room was successfully Checked Out.',
		'room_create'						=> 'The Room was successfully created.',
		'room_delete'						=> 'The Room was successfully deleted.',
		'room_update'						=> 'The Room was successfully updated.',
		'rule_create'						=> 'The Rule was successfully created.',
		'rule_delete'						=> 'The Rule was successfully deleted.',
		'rule_update'						=> 'The Rule was successfully updated.',
		'seminar_create'					=> 'The Seminar was successfully created.',
		'seminar_delete'					=> 'The Seminar was successfully deleted.',
		'seminar_join'						=> 'Enrolled in Seminar',
		'seminar_update'					=> 'The Seminar was successfully updated.',
		'seminar_withdraw'					=> 'Wihdrew from Seminar',
		'site_create'						=> 'The Site was successfully created.',
		'site_update'						=> 'The Site was successfully updated.',
		'site_deelte'						=> 'The Site was successfully deleted.',
		'subject_create'					=> 'The Subject was successfully created.',
		'subject_delete'					=> 'The Subject was successfully deleted.',
		'subject_update'					=> 'The Subject was successfully updated.',
	],

];


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

  <title>Description of README</title>
  <meta name="keywords" content="README">
  <meta name="description" content="README for the FVCOM preprocessing toolbox">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 © 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">

Home >  fvcom_prepro > README.m

README

PURPOSE

README for the FVCOM preprocessing toolbox

SYNOPSIS

This is a script file.

DESCRIPTION

 README for the FVCOM preprocessing toolbox

 This directory contains matlab scripts for preprocessing input files
 for FVCOM 3.x.   These include files which read a mesh in from SMS,
 files that allow you to select open boundary and river nodes and generate
 river, tidal, and wind forcing.  Template files for generating wind forcing
 are also included.

 Author(s):
    Geoff Cowles (University of Massachusetts Dartmouth)
    Ricardo Torres (Plymouth Marine Laboratory)
    Pierre Cazenave (Plymouth Marine Laboratory)
    Karen Amoudry (National Oceanography Centre, Liverpool)
    Rory O'Hara Murray (Marine Scotland Science)
    Hakeem Johnson (CH2M-Hill)
    Chang Liu (University of Massachusetts Dartmouth)
    Jenny Brown (National Oceanography Centre, Liverpool)

 Revision history

==============================================================================

CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

SOURCE CODE

0001 % README for the FVCOM preprocessing toolbox
0002 %
0003 % This directory contains matlab scripts for preprocessing input files
0004 % for FVCOM 3.x.   These include files which read a mesh in from SMS,
0005 % files that allow you to select open boundary and river nodes and generate
0006 % river, tidal, and wind forcing.  Template files for generating wind forcing
0007 % are also included.
0008 %
0009 % Author(s):
0010 %    Geoff Cowles (University of Massachusetts Dartmouth)
0011 %    Ricardo Torres (Plymouth Marine Laboratory)
0012 %    Pierre Cazenave (Plymouth Marine Laboratory)
0013 %    Karen Amoudry (National Oceanography Centre, Liverpool)
0014 %    Rory O'Hara Murray (Marine Scotland Science)
0015 %    Hakeem Johnson (CH2M-Hill)
0016 %    Chang Liu (University of Massachusetts Dartmouth)
0017 %    Jenny Brown (National Oceanography Centre, Liverpool)
0018 %
0019 % Revision history
0020 %
0021 %==============================================================================

<address>Generated on Wed 20-Feb-2019 16:06:01 by m2html © 2005</address>


text:
package org.apache.hadoop.fs.impl.prefetch;

import org.junit.Test;

import org.apache.hadoop.test.AbstractHadoopTestBase;

import static org.apache.hadoop.test.LambdaTestUtils.intercept;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;

public class TestBufferPool extends AbstractHadoopTestBase {

  private static final int POOL_SIZE = 2;

  private static final int BUFFER_SIZE = 10;

  private final PrefetchingStatistics statistics =
      EmptyPrefetchingStatistics.getInstance();

  @Test
  public void testArgChecks() throws Exception {
    // Should not throw.
    BufferPool pool = new BufferPool(POOL_SIZE, BUFFER_SIZE, statistics);

    // Verify it throws correctly.

    intercept(IllegalArgumentException.class,
        "'size' must be a positive integer",
        () -> new BufferPool(0, 10, statistics));

    intercept(IllegalArgumentException.class,
        "'size' must be a positive integer",
        () -> new BufferPool(-1, 10, statistics));

    intercept(IllegalArgumentException.class,
        "'bufferSize' must be a positive integer",
        () -> new BufferPool(10, 0, statistics));

    intercept(IllegalArgumentException.class,
        "'bufferSize' must be a positive integer",
        () -> new BufferPool(1, -10, statistics));

    intercept(NullPointerException.class,
        () -> new BufferPool(1, 10, null));

    intercept(IllegalArgumentException.class,
        "'blockNumber' must not be negative",
        () -> pool.acquire(-1));

    intercept(IllegalArgumentException.class,
        "'blockNumber' must not be negative",
        () -> pool.tryAcquire(-1));

    intercept(NullPointerException.class, "data",
        () -> pool.release((BufferData) null));

  }

  @Test
  public void testGetAndRelease() {
    BufferPool pool = new BufferPool(POOL_SIZE, BUFFER_SIZE, statistics);
    assertInitialState(pool, POOL_SIZE);

    int count = 0;
    for (BufferData data : pool.getAll()) {
      count++;
    }
    assertEquals(0, count);

    BufferData data1 = this.acquire(pool, 1);
    BufferData data2 = this.acquire(pool, 2);
    BufferData data3 = pool.tryAcquire(3);
    assertNull(data3);

    count = 0;
    for (BufferData data : pool.getAll()) {
      count++;
    }
    assertEquals(2, count);

    assertEquals(2, pool.numCreated());
    assertEquals(0, pool.numAvailable());

    data1.updateState(BufferData.State.READY, BufferData.State.BLANK);
    pool.release(data1);

    assertEquals(2, pool.numCreated());
    assertEquals(1, pool.numAvailable());

    data2.updateState(BufferData.State.READY, BufferData.State.BLANK);
    pool.release(data2);

    assertEquals(2, pool.numCreated());
    assertEquals(2, pool.numAvailable());
  }

  @Test
  public void testRelease() throws Exception {
    testReleaseHelper(BufferData.State.BLANK, true);
    testReleaseHelper(BufferData.State.PREFETCHING, true);
    testReleaseHelper(BufferData.State.CACHING, true);
    testReleaseHelper(BufferData.State.READY, false);
  }

  private void testReleaseHelper(BufferData.State stateBeforeRelease,
      boolean expectThrow)
      throws Exception {

    BufferPool pool = new BufferPool(POOL_SIZE, BUFFER_SIZE, statistics);
    assertInitialState(pool, POOL_SIZE);

    BufferData data = this.acquire(pool, 1);
    data.updateState(stateBeforeRelease, BufferData.State.BLANK);

    if (expectThrow) {

      intercept(IllegalArgumentException.class, "Unable to release buffer",
          () -> pool.release(data));

    } else {
      pool.release(data);
    }
  }

  private BufferData acquire(BufferPool pool, int blockNumber) {
    BufferData data = pool.acquire(blockNumber);
    assertNotNull(data);
    assertSame(data, pool.acquire(blockNumber));
    assertEquals(blockNumber, data.getBlockNumber());
    return data;
  }

  private void assertInitialState(BufferPool pool, int poolSize) {
    assertEquals(poolSize, pool.numAvailable());
    assertEquals(0, pool.numCreated());
  }
}


text:
using System;
using Helpful.CircuitBreaker.Config;

namespace Helpful.CircuitBreaker.Exceptions
{
    /// <summary>
    ///
    /// </summary>
    public abstract class CircuitBreakerException : Exception
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CircuitBreakerException"/> class.
        /// </summary>
        /// <param name="config">The configuration.</param>
        protected CircuitBreakerException(CircuitBreakerConfig config)
        {
            AddConfig(config);
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CircuitBreakerException"/> class.
        /// </summary>
        /// <param name="config">The configuration.</param>
        /// <param name="innerException">The inner exception.</param>
        protected CircuitBreakerException(CircuitBreakerConfig config, Exception innerException)
            : base(string.Empty, innerException)
        {
            AddConfig(config);
        }

        /// <summary>
        /// Gets the configuration.
        /// </summary>
        /// <value>
        /// The configuration.
        /// </value>
        public CircuitBreakerConfig Config { get; private set; }

        private void AddConfig(CircuitBreakerConfig config)
        {
            Config = config;
            Data.Add("CircuitBreakerConfig", Config);
        }
    }
}


text:
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from test import run_only
from mock import Mock
from mock import patch

from diamond.collector import Collector
from netapp_inode import netapp_inode

###############################################################################

class Testnetapp_inode(CollectorTestCase):
    def setUp(self):
        config = get_collector_config('netapp_inode', {
        })
        self.collector = netapp_inode(config, None)

    def test_import(self):
        self.assertTrue(netapp_inode)

###############################################################################
if __name__ == "__main__":
    unittest.main()


text:
        <legend class="text-center">{{'SEARCH_SPECIALITIES'| translate}}</legend>
        <app-search (onChanged)="onChanged($event)"></app-search>

          <legend>

{{speciality.name | translate}}

            {{getInstitution(speciality.id).name | translate}} / {{getInstitution(speciality.id).city | translate}}
          </legend>

 0">{{'DIRECTION' | translate}}:
                {{direction.name | translate}}

 0">
                {{'LEVEL_OF_EDUCATION' | translate}}: {{level.name | translate}}.

 0">{{'LANGUAGE_OF_INSTRUCTION' | translate}}:
                {{language.name | translate}}.

{{'DURATION' | translate}}:
                {{speciality.duration}} {{'YEARS' | translate}}.

 0">{{'FORM_OF_EDUCATION' | translate}}:
                {{form.name | translate}}.

{{'FREE_EDUCATION' | translate}}:
                {{speciality.freeEducation.toString() | translate}}.

{{'PRICE' | translate}}: {{speciality.price}} {{'DOLLARS_IN_YEAR' | translate}}.

                {{'MORE_ABOUT_THE_SPECIALITY' | translate}}


text:
package almhirt.tooling

import almhirt.common._
import almhirt.problem._
import almhirt.tracking.CommandRepresentation

trait Reporter {
  def reportDebug(message: ⇒ String): Unit

  def reportInfo(message: ⇒ String): Unit

  def reportWarning(message: ⇒ String): Unit

  def reportError(message: String, cause: almhirt.problem.ProblemCause): Unit

  def reportRejectedCommand(command: CommandRepresentation, severity: almhirt.problem.Severity, cause: ProblemCause): Unit

  def reportMissedEvent(event: Event, severity: almhirt.problem.Severity, cause: ProblemCause): Unit

  def reportFailure(cause: ProblemCause, severity: almhirt.problem.Severity): Unit

  final def reportMinorFailure(failure: ProblemCause): Unit = reportFailure(failure, MinorSeverity)

  final def reportMajorFailure(failure: ProblemCause): Unit = reportFailure(failure, MajorSeverity)

  final def reportCriticalFailure(failure: ProblemCause): Unit = reportFailure(failure, CriticalSeverity)

  def report(message: ⇒ String, importance: Importance): Unit

  final def reportNotWorthMentioning(message: ⇒ String): Unit = report(message, Importance.NotWorthMentioning)

  final def reportMentionable(message: ⇒ String): Unit = report(message, Importance.Mentionable)

  final def reportImportant(message: ⇒ String): Unit = report(message, Importance.Important)

  final def reportVeryImportant(message: ⇒ String): Unit = report(message, Importance.VeryImportant)

}

//trait ReporterFactory {
//  def createReporter(forComponent: ComponentId)
//}

object Reporter {
  val DevNull = new Reporter {
    def report(message: ⇒ String, importance: Importance): Unit = {}

    def reportDebug(message: ⇒ String): Unit = {}

    def reportError(message: String, cause: ProblemCause): Unit = {}

    def reportFailure(cause: ProblemCause, severity: Severity): Unit = {}

    def reportInfo(message: ⇒ String): Unit = {}

    def reportMissedEvent(event: Event, severity: Severity, cause: ProblemCause): Unit = {}

    def reportRejectedCommand(command: CommandRepresentation, severity: Severity, cause: ProblemCause): Unit = {}

    def reportWarning(message: ⇒ String): Unit = {}
  }
}

trait CompositeReporter extends Reporter {
  def addReporter(rep: Reporter): Unit
}

object CompositeReporter {
  def apply(initial: Reporter*) = new MyCompositeReporter(initial.toList)
}

private[tooling] class MyCompositeReporter(initial: List[Reporter]) extends CompositeReporter {
  private[this] var reporters = initial

  def report(message: ⇒ String, importance: Importance): Unit = {
    reporters.foreach { _.report(message, importance) }
  }

  def reportDebug(message: ⇒ String): Unit = {
    reporters.foreach { _.reportDebug(message) }
  }

  def reportError(message: String, cause: ProblemCause): Unit = {
    reporters.foreach { _.reportError(message, cause) }
  }

  def reportFailure(cause: ProblemCause, severity: Severity): Unit = {
    reporters.foreach { _.reportFailure(cause, severity) }
  }

  def reportInfo(message: ⇒ String): Unit = {
    reporters.foreach { _.reportInfo(message) }
  }

  def reportMissedEvent(event: Event, severity: Severity, cause: ProblemCause): Unit = {
    reporters.foreach { _.reportMissedEvent(event, severity, cause) }
  }

  def reportRejectedCommand(command: CommandRepresentation, severity: Severity, cause: ProblemCause): Unit = {
    reporters.foreach { _.reportRejectedCommand(command, severity, cause) }
  }

  def reportWarning(message: ⇒ String): Unit = {
    reporters.foreach { _.reportWarning(message) }
  }

  def addReporter(rep: Reporter): Unit = {
    reporters = rep :: reporters
  }
}


text:
<!DOCTYPE html>

  <title>Bastonis | The Right Attitude</title>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="../default.css">
  <link rel="stylesheet" type="text/css" href="../blog/blog-stylesheet.css">
  <link href='http://fonts.googleapis.com/css?family=Merriweather|Kaushan+Script' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

Home

About Me

Portfolio

My Blog

Diving in with the Right Attitude

Thoughts on the Restaurant vs Kitchen mentality

April 10, 2015

        Shereef from Dev Bootcamp talked to us in a video today that was describing a bit about the different types of mentality coming in. On one hand, there is the consumer/Restaurant mindset, where you come in to DBC having paid and expecting to get in, do the work, and get out. The counter to this is his Kitchen mentality which speaks to the fact that every person coming into the DBC Kitchen with varying levels of experince. The core difference is that every person is coming in together, working together, and building off one another to create and become better as one.

        Using this Kitchen mindset, I am thoroughly more excited than ever to jump into Dev Bootcamp. I am in control of what I want to learn and I want to put in 110%. After learning about fixed vs growth mindsets, I am eager to have the opportunity to utilize the growth mindset and push myself to learn more and become better every day. After years of being part of a system so hidebound with its fixed mindset, it's refreshing hearing Shareef talk about every person in DBC coming in with a unique set of skills, all ready to learn.

        One of the main reasons why I found DBC so interesting was its interest with the mind, body, spirit, and most importantly, emotional intelligence. I had learned about emotional intelligence and read Daniel Goleman's book Emotional Intelligence in different courses during my time at university, but I never really had a course built around it. Seeing this, I am so excited to be a part of jumping into the fire with everyone at DBC. I want to work with everyone I possibly can, learn from others, and engage as much as possible with this community.

        Coming into the program, I knew this was going to be difficult. Without a doubt, I was told it would be the most challenging 9 weeks + remote time I'd have undergone. I'm excited for it. It's going to be one of my biggest challenges as I have never done any programming before. However, even though I have only  just started the remote prep, every day I'm learning something new, something exciting, something innovative. I'm pushing my mind and my education beyond what I thought was possible. I'm not just reading from a textbook and spitting it out on a scantron, but I'm actually seeing progress in my own self-growth.

        I'm definitely nervous coming into DBC, as I have never done programming before, but it's a nervous-excitement. I know some days I'm going to be challenged to the edge, but part of me is excited to have that happen. I want to be pushed. I want to be challenged. Most of all, I want to prove that I can overcome these challenges and grow. I'm really eager to learn more, and despite the difficulties and challenges that I've already begun facing, it's thrilling to be learning. I can't wait for the next week!

    Previous
    Next


text:
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
{
    internal class TeamDisplay : MultiplayerRoomComposite
    {
        private readonly MultiplayerRoomUser user;

        private Drawable box;

        private Sample sampleTeamSwap;

        [Resolved]
        private OsuColour colours { get; set; }

        public TeamDisplay(MultiplayerRoomUser user)
        {
            this.user = user;

            RelativeSizeAxes = Axes.Y;
            Width = 15;

            Margin = new MarginPadding { Horizontal = 3 };

            Alpha = 0;
            Scale = new Vector2(0, 1);
        }

        [BackgroundDependencyLoader]
        private void load(AudioManager audio)
        {
            box = new Container
            {
                RelativeSizeAxes = Axes.Both,
                CornerRadius = 5,
                Masking = true,
                Scale = new Vector2(0, 1),
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Child = new Box
                {
                    Colour = Color4.White,
                    RelativeSizeAxes = Axes.Both,
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                }
            };

            if (Client.LocalUser?.Equals(user) == true)
            {
                InternalChild = new OsuClickableContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    TooltipText = "Change team",
                    Action = changeTeam,
                    Child = box
                };
            }
            else
            {
                InternalChild = box;
            }

            sampleTeamSwap = audio.Samples.Get(@"Multiplayer/team-swap");
        }

        private void changeTeam()
        {
            Client.SendMatchRequest(new ChangeTeamRequest
            {
                TeamID = ((Client.LocalUser?.MatchState as TeamVersusUserState)?.TeamID + 1) % 2 ?? 0,
            });
        }

        private int? displayedTeam;

        protected override void OnRoomUpdated()
        {
            base.OnRoomUpdated();

            // we don't have a way of knowing when an individual user's state has updated, so just handle on RoomUpdated for now.

            var userRoomState = Room?.Users.FirstOrDefault(u => u.Equals(user))?.MatchState;

            const double duration = 400;

            int? newTeam = (userRoomState as TeamVersusUserState)?.TeamID;

            if (newTeam == displayedTeam)
                return;

            // only play the sample if an already valid team changes to another valid team.
            // this avoids playing a sound for each user if the match type is changed to/from a team mode.
            if (newTeam != null && displayedTeam != null)
                sampleTeamSwap?.Play();

            displayedTeam = newTeam;

            if (displayedTeam != null)
            {
                box.FadeColour(getColourForTeam(displayedTeam.Value), duration, Easing.OutQuint);
                box.ScaleTo(new Vector2(box.Scale.X < 0 ? 1 : -1, 1), duration, Easing.OutQuint);

                this.ScaleTo(Vector2.One, duration, Easing.OutQuint);
                this.FadeIn(duration);
            }
            else
            {
                this.ScaleTo(new Vector2(0, 1), duration, Easing.OutQuint);
                this.FadeOut(duration);
            }
        }

        private ColourInfo getColourForTeam(int id)
        {
            switch (id)
            {
                default:
                    return colours.Red;

                case 1:
                    return colours.Blue;
            }
        }
    }
}


text:
package com.github.thbrown.softballsim.util;

import java.io.IOException;
import java.text.NumberFormat;

public class MathUtil {
  /**
   * Takes a number (value) between oldMin and oldMax and maps linearly to a new value between newMin
   * and newMax
   */
  public static int transform(int value, int oldMin, int oldMax, int newMin, int newMax) {
    double x = (double) value;
    double a = (double) oldMin;
    double b = (double) oldMax;
    double c = (double) newMin;
    double d = (double) newMax;
    return (int) ((x - a) * (d - c) / (b - a) + c);
  }

  public static String percentChange(double A, double B) throws IOException {
    NumberFormat nf = NumberFormat.getInstance();
    nf.setMaximumFractionDigits(3);
    return nf.format(Math.abs(A - B) / ((A + B) / 2) * 100);
  }

}


text:
<div id="page" class="<?php print $classes; ?>"<?php print $attributes; ?>>

    <?php if ($page['header']): ?>

        <?php print render($page['header']); ?>

    <?php endif; ?>

        <button id="save">Load User</button>

        <?php print render($page['content']) ?>

    <?php if ($page['sidebar_first']): ?>

        <?php print render($page['sidebar_first']); ?>

    <?php endif; ?>

    <?php if ($page['sidebar_second']): ?>

        <?php print render($page['sidebar_second']); ?>

    <?php endif; ?>

  <?php if ($page['footer']): ?>

      <?php print render($page['footer']); ?>

  <?php endif; ?>


text:
<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>
		<groupId>com.whenling</groupId>
		<artifactId>extension</artifactId>
		<version>1.0.0.RELEASE</version>
	</parent>
	<artifactId>extension-wechat</artifactId>
</project>


text:
package GUI.Swing.gridbag;

import java.awt.*;
import java.awt.event.*;
import java.beans.*;
import javax.swing.*;

/**
 * A frame that uses a grid bag layout to arrange font selection components.
 */
public class FontFrame extends JFrame
{
   public static final int TEXT_ROWS = 10;
   public static final int TEXT_COLUMNS = 20;

   private JComboBox<String> face;
   private JComboBox<Integer> size;
   private JCheckBox bold;
   private JCheckBox italic;
   private JTextArea sample;

   public FontFrame()
   {
      GridBagLayout layout = new GridBagLayout();
      setLayout(layout);

      ActionListener listener = EventHandler.create(ActionListener.class, this, "updateSample");

      // construct components

      JLabel faceLabel = new JLabel("Face: ");

      face = new JComboBox<>(new String[] { "Serif", "SansSerif", "Monospaced", "Dialog",
            "DialogInput" });

      face.addActionListener(listener);

      JLabel sizeLabel = new JLabel("Size: ");

      size = new JComboBox<>(new Integer[] { 8, 10, 12, 15, 18, 24, 36, 48 });

      size.addActionListener(listener);

      bold = new JCheckBox("Bold");
      bold.addActionListener(listener);

      italic = new JCheckBox("Italic");
      italic.addActionListener(listener);

      sample = new JTextArea(TEXT_ROWS, TEXT_COLUMNS);
      sample.setText("The quick brown fox jumps over the lazy dog");
      sample.setEditable(false);
      sample.setLineWrap(true);
      sample.setBorder(BorderFactory.createEtchedBorder());

      // add components to grid, using GBC convenience class

      add(faceLabel, new GBC(0, 0).setAnchor(GBC.EAST));
      add(face, new GBC(1, 0).setFill(GBC.HORIZONTAL).setWeight(100, 0).setInsets(1));
      add(sizeLabel, new GBC(0, 1).setAnchor(GBC.EAST));
      add(size, new GBC(1, 1).setFill(GBC.HORIZONTAL).setWeight(100, 0).setInsets(1));
      add(bold, new GBC(0, 2, 2, 1).setAnchor(GBC.CENTER).setWeight(100, 100));
      add(italic, new GBC(0, 3, 2, 1).setAnchor(GBC.CENTER).setWeight(100, 100));
      add(sample, new GBC(2, 0, 1, 4).setFill(GBC.BOTH).setWeight(100, 100));
      pack();
      updateSample();
   }

   public void updateSample()
   {
      String fontFace = (String) face.getSelectedItem();
      int fontStyle = (bold.isSelected() ? Font.BOLD : 0)
            + (italic.isSelected() ? Font.ITALIC : 0);
      int fontSize = size.getItemAt(size.getSelectedIndex());
      Font font = new Font(fontFace, fontStyle, fontSize);
      sample.setFont(font);
      sample.repaint();
   }
}