text:
<?php

namespace Okipa\LaravelBootstrapTableList\Tests\Unit;

use ErrorException;
use Okipa\LaravelBootstrapTableList\TableList;
use Okipa\LaravelBootstrapTableList\Test\Models\User;
use Okipa\LaravelBootstrapTableList\Test\TableListTestCase;

class RoutesTest extends TableListTestCase
{
    /**
     * @expectedException ErrorException
     * @expectedExceptionMessage The required « index » route key is missing. Use the « setRoutes() » method to declare
     *                           it.
     */
    public function testNoDeclaredRoutes()
    {
        $table = app(TableList::class)->setModel(User::class);
        $table->render();
    }

    public function testSetRoutesSuccess()
    {
        $routes = [
            'index'   => ['alias' => 'users.index', 'parameters' => []],
            'create'  => ['alias' => 'users.create', 'parameters' => []],
            'edit'    => ['alias' => 'users.edit', 'parameters' => []],
            'destroy' => ['alias' => 'users.destroy', 'parameters' => []],
        ];
        $table = app(TableList::class)->setRoutes($routes);
        $this->assertEquals($routes, $table->routes);
    }

    /**
     * @expectedException ErrorException
     * @expectedExceptionMessage The required « index » route key is missing. Use the « setRoutes() » method to
     *                            declare it.
     */
    public function testSetRoutesWithMissingIndex()
    {
        $routes = [
            'create'  => ['alias' => 'users.create', 'parameters' => []],
            'edit'    => ['alias' => 'users.edit', 'parameters' => []],
            'destroy' => ['alias' => 'users.destroy', 'parameters' => []],
        ];
        app(TableList::class)->setRoutes($routes);
    }

    /**
     * @expectedException ErrorException
     * @expectedExceptionMessage The « alias » key is missing from the « create » route definition. Each route key
     *                            must contain an array with a (string) « alias » key and a (array) « parameters »
     *                            value. Check the following example : ["index" => ["alias" =>
     *                            "news.index","parameters" => []]. Fix your routes declaration in the « setRoutes() »
     *                            method.
     */
    public function testSetRoutesWithWrongStructure()
    {
        $routes = [
            'index'  => ['alias' => 'users.index', 'parameters' => []],
            'create' => ['test' => 'test'],
        ];
        app(TableList::class)->setRoutes($routes);
    }

    /**
     * @expectedException ErrorException
     * @expectedExceptionMessage The « activate » key is not an authorized route key (index, create, edit, destroy).
     *                            Fix your routes declaration in the « setRoutes() » method.
     */
    public function testSetRoutesWithNotAllowedKey()
    {
        $routes = [
            'index'    => ['alias' => 'users.index', 'parameters' => []],
            'activate' => ['alias' => 'users.activate', 'parameters' => []],
        ];
        app(TableList::class)->setRoutes($routes);
    }

    public function testGetRouteSuccess()
    {
        $this->setRoutes(['users'], ['index']);
        $routes = [
            'index'   => ['alias' => 'users.index', 'parameters' => []],
            'create'  => ['alias' => 'users.create', 'parameters' => []],
            'edit'    => ['alias' => 'users.edit', 'parameters' => []],
            'destroy' => ['alias' => 'users.destroy', 'parameters' => []],
        ];
        $table = app(TableList::class)->setRoutes($routes);
        $this->assertEquals('http://localhost/users/index', $table->getRoute('index'));
    }

    /**
     * @expectedException InvalidArgumentException
     * @expectedExceptionMessage Invalid « $routeKey » argument for the « route() » method. The route key « create »
     *                            has not been found in the routes stack.
     */
    public function testGetRouteOnNotExistingRoute()
    {
        $routes = [
            'index' => ['alias' => 'users.index', 'parameters' => []],
        ];
        $table = app(TableList::class)->setRoutes($routes);
        $table->getRoute('create');
    }

    /**
     * @expectedException InvalidArgumentException
     * @expectedExceptionMessage Invalid « $routeKey » argument for the « route() » method. The route key « update »
     *                           has not been found in the routes stack.
     */
    public function testGetRouteWithNoDeclaredRouteStack()
    {
        app(TableList::class)->getRoute('update');
    }

    public function testIsRouteDefined()
    {
        $routes = [
            'index' => ['alias' => 'users.index', 'parameters' => []],
        ];
        $table = app(TableList::class)->setRoutes($routes);
        $this->assertTrue($table->isRouteDefined('index'));
        $this->assertFalse($table->isRouteDefined('update'));
    }

    public function testSetCreateRouteHtml()
    {
        $this->setRoutes(['users'], ['create']);
        $routes = [
            'index'  => ['alias' => 'users.index', 'parameters' => []],
            'create' => ['alias' => 'users.create', 'parameters' => []],
        ];
        $table = app(TableList::class)->setRoutes($routes)->setModel(User::class);
        $table->addColumn('name')->setTitle('Name')->sortByDefault();
        $table->render();
        $tfoot = view('tablelist::tfoot', ['table' => $table])->render();
        $this->assertContains('
assertContains('href="http://localhost/users/create"', $tfoot);
        $this->assertContains('title="Add"', $tfoot);
    }

    public function testSetNoCreateRouteHtml()
    {
        $this->setRoutes(['users'], ['create']);
        $routes = [
            'index' => ['alias' => 'users.index', 'parameters' => []],
        ];
        $table = app(TableList::class)->setRoutes($routes)->setModel(User::class);
        $table->addColumn('name')->setTitle('Name')->sortByDefault();
        $table->render();
        $tfoot = view('tablelist::tfoot', ['table' => $table])->render();
        $this->assertNotContains('
assertNotContains('href="http://localhost/users/create"', $tfoot);
        $this->assertNotContains('title="Add"', $tfoot);
    }

    public function testSetEditRouteHtml()
    {
        $users = $this->createMultipleUsers(5);
        $this->setRoutes(['users'], ['edit']);
        $routes = [
            'index' => ['alias' => 'users.index', 'parameters' => []],
            'edit'  => ['alias' => 'users.edit', 'parameters' => []],
        ];
        $table = app(TableList::class)->setRoutes($routes)->setModel(User::class);
        $table->addColumn('name')->setTitle('Name')->sortByDefault();
        $table->render();
        $tbody = view('tablelist::tbody', ['table' => $table])->render();
        foreach ($users as $user) {
            $this->assertContains('<form class="edit-' . $user->id, $tbody);
            $this->assertContains('action="http://localhost/users/edit?id=' . $user->id . '"', $tbody);
        }
    }

    public function testSetNoEditRouteHtml()
    {
        $users = $this->createMultipleUsers(5);
        $routes = [
            'index' => ['alias' => 'users.index', 'parameters' => []],
        ];
        $table = app(TableList::class)->setRoutes($routes)->setModel(User::class);
        $table->addColumn('name')->setTitle('Name')->sortByDefault();
        $table->render();
        $tbody = view('tablelist::tbody', ['table' => $table])->render();
        foreach ($users as $user) {
            $this->assertNotContains('<form class="edit-' . $user->id, $tbody);
            $this->assertNotContains('action="http://localhost/users/edit?id=' . $user->id . '"', $tbody);
        }
    }

    public function testSetDestroyRouteHtml()
    {
        $users = $this->createMultipleUsers(5);
        $this->setRoutes(['users'], ['destroy']);
        $routes = [
            'index' => ['alias' => 'users.index', 'parameters' => []],
            'destroy'  => ['alias' => 'users.destroy', 'parameters' => []],
        ];
        $table = app(TableList::class)->setRoutes($routes)->setModel(User::class);
        $table->addColumn('name')->setTitle('Name')->sortByDefault()->useForDestroyConfirmation();
        $table->render();
        $tbody = view('tablelist::tbody', ['table' => $table])->render();
        foreach ($users as $user) {
            $this->assertContains('<form class="destroy-' . $user->id, $tbody);
            $this->assertContains('action="http://localhost/users/destroy?id=' . $user->id . '"', $tbody);
        }
    }

    public function testSetNoDestroyRouteHtml()
    {
        $users = $this->createMultipleUsers(5);
        $routes = [
            'index' => ['alias' => 'users.index', 'parameters' => []],
        ];
        $table = app(TableList::class)->setRoutes($routes)->setModel(User::class);
        $table->addColumn('name')->setTitle('Name')->sortByDefault()->useForDestroyConfirmation();
        $table->render();
        $tbody = view('tablelist::tbody', ['table' => $table])->render();
        foreach ($users as $user) {
            $this->assertNotContains('<form class="destroy-' . $user->id, $tbody);
            $this->assertNotContains('action="http://localhost/users/destroy?id=' . $user->id . '"', $tbody);
        }
    }
}


text:
#include <memory>
#include <stdexcept>
using std::shared_ptr;

#include <pfasst.hpp>
#include <pfasst/quadrature.hpp>
#include <pfasst/encap/vector.hpp>
#include <pfasst/encap/eigen3_vector.hpp>

#include <pfasst/controller/two_level_mlsdc.hpp>
#include <pfasst/contrib/spectral_transfer.hpp>

#include "heat1d_sweeper.hpp"

using encap_traits_t = pfasst::encap::vector_encap_traits<double, double, 1>;
// using encap_traits_t = pfasst::eigen3_encap_traits<double, double, 1>;

namespace pfasst
{
  namespace examples
  {
    namespace heat1d
    {
      using pfasst::transfer_traits;
      using pfasst::contrib::SpectralTransfer;
      using pfasst::TwoLevelMLSDC;
      using pfasst::quadrature::QuadratureType;

      using sweeper_t = Heat1D<pfasst::sweeper_traits<encap_traits_t>>;
      using transfer_traits_t = pfasst::transfer_traits<sweeper_t, sweeper_t, 2>;
      using transfer_t = SpectralTransfer<transfer_traits_t>;
      using heat1d_mlsdc_t = TwoLevelMLSDC<transfer_t>;

      /**
       * @ingroup Heat1D
       */
      shared_ptr<heat1d_mlsdc_t> run_mlsdc(const size_t ndofs, const size_t coarse_factor,
                                           const size_t nnodes, const QuadratureType& quad_type,
                                           const double& t_0, const double& dt, const double& t_end,
                                           const size_t niter)
      {
        auto mlsdc = make_shared<heat1d_mlsdc_t>();

        using pfasst::quadrature::quadrature_factory;

        auto coarse = std::make_shared<sweeper_t>(ndofs / coarse_factor);
        coarse->quadrature() = quadrature_factory<double>(nnodes, quad_type);
        auto fine = std::make_shared<sweeper_t>(ndofs);
        fine->quadrature() = quadrature_factory<double>(nnodes, quad_type);

        auto transfer = make_shared<transfer_t>();

        mlsdc->add_sweeper(coarse, true);
        mlsdc->add_sweeper(fine, false);
        mlsdc->add_transfer(transfer);
        mlsdc->set_options();

        mlsdc->status()->time() = t_0;
        mlsdc->status()->dt() = dt;
        mlsdc->status()->t_end() = t_end;
        mlsdc->status()->max_iterations() = niter;

        mlsdc->setup();

        coarse->initial_state() = coarse->exact(mlsdc->get_status()->get_time());
        fine->initial_state() = fine->exact(mlsdc->get_status()->get_time());

        mlsdc->run();
        mlsdc->post_run();

        return mlsdc;
      }
    }  // ::pfasst::examples::heat1d
  } // ::pfasst::examples
}  // ::pfasst

#ifndef PFASST_UNIT_TESTING
int main(int argc, char** argv)
{
  using pfasst::config::get_value;
  using pfasst::quadrature::QuadratureType;
  using sweeper_t = pfasst::examples::heat1d::Heat1D<pfasst::sweeper_traits<encap_traits_t>>;

  pfasst::init(argc, argv, sweeper_t::init_opts);

  const size_t ndofs = get_value<size_t>("num_dofs", 8);
  const size_t coarse_factor = get_value<size_t>("coarse_factor", 2);
  const size_t nnodes = get_value<size_t>("num_nodes", 3);
  const QuadratureType quad_type = QuadratureType::GaussRadau;
  const double t_0 = 0.0;
  const double dt = get_value<double>("dt", 0.01);
  double t_end = get_value<double>("tend", -1);
  size_t nsteps = get_value<size_t>("num_steps", 0);
  if (t_end == -1 && nsteps == 0) {
    ML_CLOG(ERROR, "USER", "Either t_end or num_steps must be specified.");
    throw std::runtime_error("either t_end or num_steps must be specified");
  } else if (t_end != -1 && nsteps != 0) {
    if (!pfasst::almost_equal(t_0 + nsteps * dt, t_end)) {
      ML_CLOG(ERROR, "USER", "t_0 + nsteps * dt != t_end ("
                          << t_0 << " + " << nsteps << " * " << dt << " = " << (t_0 + nsteps * dt)
                          << " != " << t_end << ")");
      throw std::runtime_error("t_0 + nsteps * dt != t_end");
    }
  } else if (nsteps != 0) {
    t_end = t_0 + dt * nsteps;
  }
  const size_t niter = get_value<size_t>("num_iters", 5);

  pfasst::examples::heat1d::run_mlsdc(ndofs, coarse_factor, nnodes, quad_type, t_0, dt, t_end, niter);
}
#endif

redpajama_set_name: RedPajamaGithub


text:
from manage_feedback.models import *
from django.contrib import admin
from django.template import RequestContext, Context, loader
from ldap_login.models import *
from give_feedback.models import feedbackSubmission
from django.http import HttpResponse

#for displaying options directly underneath the question when creating or editing
class feedbackQuestionOptionsInline(admin.TabularInline):
    model = feedbackQuestionOption;
    extra = 4;

class feedbackQuestionAdmin(admin.ModelAdmin):
    inlines = [feedbackQuestionOptionsInline];

class feedbackFormAdmin(admin.ModelAdmin):
    actions = ['duplicateForm','notFilled'];
    list_display=['title', 'deadline_for_filling','about','created_on']
    ordering=['title']
    list_filter = ['allowed_groups','about'];
    search_fields = ['title']

    def duplicateForm(self, request, queryset):
        for existing_form in queryset:
             new_form = feedbackForm();
             new_form.title = "Copy of " + existing_form.title;
             new_form.deadline_for_filling = existing_form.deadline_for_filling;
             new_form.about = existing_form.about;
             new_form.save();
             for q in existing_form.questions.all():
                 new_form.questions.add(q);

             for g in existing_form.allowed_groups.all():
                  new_form.allowed_groups.add(g);

             #new_form.allowed_groups = existing_form.allowed_groups;

    def notFilled(self, request, queryset):
        user_dict=dict()
        for existing_form in queryset:
            user_all=list()
            groups=existing_form.allowed_groups.values()
            for g in groups:
                # to extract users who were supposed to fill the form
                u=user.objects.filter(groups=g['id']).order_by('username')
                user_all.extend(u)
            #now from this list.. remove ppl who have filled the form...!!
            forms=feedbackSubmission.objects.filter(feedbackForm=existing_form)
            for f in forms:
                user_all.remove(f.submitter)
            user_dict[str(existing_form.title)]=user_all
        t = loader.get_template('manage_feedback/notFilled.html');
        c = Context(
           {
             'forms_users_dict':user_dict
           }
         );

        return HttpResponse(t.render(c))
    duplicateForm.short_description = "Duplicate this form";
    notFilled.short_description = "People who have not filled this form";

class BatchAdmin(admin.ModelAdmin):
    model = Batch;
    list_filter = ['programme']

class SubjectAdmin(admin.ModelAdmin):
    model = Subject;
    list_display = ['name','taughtby','code'];
    list_filter = ['for_batch'];

admin.site.register(feedbackQuestion,feedbackQuestionAdmin);
#enable in admin site the following other things
admin.site.register(Batch,BatchAdmin);
admin.site.register(Subject,SubjectAdmin);
admin.site.register(feedbackQuestionOption);
admin.site.register(feedbackForm,feedbackFormAdmin);
admin.site.register(feedbackAbout);


text:
id }}">

post_title }}" data-url="{{ $node->getMetaValue('_nav_item_url') }}">

	  	{{ $node->post_title }}
	  	id }}" data-role='toggle-menu' href="#">
	  	id }}" href="#">

id }}" class="panel-body" style="display: none;">

		    id }}">Label
		    <input data-uset='label' value="{{ $node->post_title }}" data-idpar="menuItem_{{ $node->id }}" type="text" class="form-control" id="label-{{ $node->id }}" placeholder="Label">

@if(count($datas) > 0 )

	@foreach($datas as $node)
	   @include('ContentManager::menu.partials.listmenu', ['datas' => $node->children()])
	@endforeach

@endif


text:
grpc Kotlin example
==============================================

The examples require grpc-java to already be built. You are strongly encouraged
to check out a git release tag, since there will already be a build of grpc
available. Otherwise you must follow COMPILING.md.

You may want to read through the
[Quick Start Guide](https://grpc.io/docs/quickstart/java.html)
before trying out the examples.

To build the examples,

1. **[Install gRPC Java library SNAPSHOT locally, including code generation plugin](../../COMPILING.md) (Only need this step for non-released versions, e.g. master HEAD).**

2. Run in this directory:
```
$ ../gradlew installDist
```

This creates the scripts `hello-world-server`, `hello-world-client`,
`route-guide-server`, and `route-guide-client` in the
`build/install/examples/bin/` directory that run the examples. Each
example requires the server to be running before starting the client.

For example, to try the hello world example first run:

```
$ ./build/install/examples/bin/hello-world-server
```

And in a different terminal window run:

```
$ ./build/install/examples/bin/hello-world-client
```

That's it!

Please refer to gRPC Java's [README](../README.md) and
[tutorial](https://grpc.io/docs/tutorials/basic/java.html) for more
information.

Unit test examples
==============================================

Examples for unit testing gRPC clients and servers are located in [./src/test](./src/test).

In general, we DO NOT allow overriding the client stub.
We encourage users to leverage `InProcessTransport` as demonstrated in the examples to
write unit tests. `InProcessTransport` is light-weight and runs the server
and client in the same process without any socket/TCP connection.

For testing a gRPC client, create the client with a real stub
using an InProcessChannelBuilder.java and test it against an InProcessServer.java
with a mock/fake service implementation.

For testing a gRPC server, create the server as an InProcessServer,
and test it against a real client stub with an InProcessChannel.

The gRPC-java library also provides a JUnit rule, GrpcCleanupRule.java, to do the graceful shutdown
boilerplate for you.


text:
package org.commcare.xml;

import org.commcare.suite.model.Action;
import org.commcare.suite.model.Callout;
import org.commcare.suite.model.Detail;
import org.commcare.suite.model.DetailField;
import org.commcare.suite.model.DisplayUnit;
import org.javarosa.core.util.OrderedHashtable;
import org.javarosa.xml.util.InvalidStructureException;
import org.javarosa.xpath.XPathParseTool;
import org.javarosa.xpath.parser.XPathSyntaxException;
import org.kxml2.io.KXmlParser;
import org.xmlpull.v1.XmlPullParserException;

import java.io.IOException;
import java.util.Vector;

/**
 * @author ctsims
 */
public class DetailParser extends CommCareElementParser<Detail> {

    public DetailParser(KXmlParser parser) {
        super(parser);
    }

    public Detail parse() throws InvalidStructureException, IOException, XmlPullParserException {
        checkNode("detail");

        String id = parser.getAttributeValue(null, "id");
        String nodeset = parser.getAttributeValue(null, "nodeset");

        //First fetch the title
        getNextTagInBlock("detail");
        //inside title, should be a text node or a display node as the child
        checkNode("title");
        getNextTagInBlock("title");
        DisplayUnit title;
        if ("text".equals(parser.getName().toLowerCase())) {
            title = new DisplayUnit(new TextParser(parser).parse(), null, null);
        } else {
            title = parseDisplayBlock();
        }

        Callout callout = null;
        Vector<Action> actions = new Vector<Action>();

        //Now get the headers and templates.
        Vector<Detail> subdetails = new Vector<Detail>();
        Vector<DetailField> fields = new Vector<DetailField>();
        OrderedHashtable<String, String> variables = new OrderedHashtable<String, String>();

        while (nextTagInBlock("detail")) {
            if ("lookup".equals(parser.getName().toLowerCase())) {
                try {
                    checkNode("lookup");
                    callout = new CalloutParser(parser).parse();
                    parser.nextTag();

                } catch (InvalidStructureException e) {
                    System.out.println("Lookup block not found " + e);
                }
            }
            if ("variables".equals(parser.getName().toLowerCase())) {
                while (nextTagInBlock("variables")) {
                    String function = parser.getAttributeValue(null, "function");
                    if (function == null) {
                        throw new InvalidStructureException("No function in variable declaration for variable " + parser.getName(), parser);
                    }
                    try {
                        XPathParseTool.parseXPath(function);
                    } catch (XPathSyntaxException e) {
                        e.printStackTrace();
                        throw new InvalidStructureException("Invalid XPath function " + function + ". " + e.getMessage(), parser);
                    }
                    variables.put(parser.getName(), function);
                }
                continue;
            }
            if (ActionParser.NAME_ACTION.equalsIgnoreCase(parser.getName())) {
                actions.addElement(new ActionParser(parser).parse());
                continue;
            }
            if (parser.getName().equals("detail")) {
                subdetails.addElement(getDetailParser().parse());
            } else {
                DetailField detailField = new DetailFieldParser(parser, getGraphParser(), id).parse();
                fields.addElement(detailField);
            }
        }

        return new Detail(id, title, nodeset, subdetails, fields, variables, actions, callout);
    }

    protected DetailParser getDetailParser() {
        return new DetailParser(parser);
    }

    protected GraphParser getGraphParser() {
        return new DummyGraphParser(parser);
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<software-distribution project="MinGW" home="http://www.mingw.org" issue="2010090600">

  <!-- File: msys-w32api.xml ~~ mingw-get package description for MinGW API (msys) -->

  <package-collection subsystem="msys">
    <download-host uri="http://prdownloads.sourceforge.net/mingw/%F?download" />

    <!-- Provides the package descriptions for the package that provides,  -->
    <!-- suitably configured for use with the MSYS System Builder toolset, -->
    <!-- the headers and link libraries for the Windows API.               -->

    <package name="msys-w32api">
      <affiliate group="MSYS System Builder" />
      <description lang="en" title="The MinGW API for 32-Bit MS-Windows (msys)">
        <paragraph>This is not the w32api you are looking for.</paragraph>
        <paragraph>
          This package provides the header files and import libraries
          constituting a standard API for the development of applications
          which utilise the capabilities of the 32-bit MS-Windows system
          dynamic link libraries, configured specifically for use with the
          MSYS System Builder (msys-dvlpr) toolset.  It should be installed
          into the / == /usr (that is, C:\msys\1.0) directory, and NOT intoo
          the usual MinGW location /mingw (C:\MinGW).
        </paragraph>
        <paragraph>
          Install this component only if you intend to create MSYS-dependent
          applications.
        </paragraph>
      </description>

      <!-- The -dev package includes licence and documentation -->
      <licence tarname="w32api-%-msys-%-dev.tar.lzma" />
      <source tarname="w32api-%-msys-%-src.tar.lzma" />

      <component class="dev">
        <release tarname="w32api-3.14-3-msys-1.0.12-dev.tar.lzma" />
      </component>
    </package>

  </package-collection>
</software-distribution>
<!-- vim: set nocompatible expandtab fileformat=unix textwidth=80 tabstop=2 shiftwidth=2: -->


text:
#region

using System;

#endregion

namespace SocialNetwork.Core.Models
{
    /// <summary>
    ///     Получение данных статистики базы данных
    /// </summary>
    public class DbUsage
    {
        /// <summary>
        ///     Имя текущей базы данных.
        /// </summary>
        public string database_name { get; set; }

        /// <summary>
        ///     Размер текущей базы данных в мегабайтах. Значение database_size включает как файлы данных, так и файлы журналов.
        /// </summary>
        public string database_size { get; set; }

        /// <summary>
        ///     Место в базе данных, не зарезервированное для объектов базы данных.
        /// </summary>
        public string unused { get; set; }

        /// <summary>
        ///     Общий объем пространства, используемый индексами.
        /// </summary>
        public string index_size { get; set; }

        /// <summary>
        ///     Общий объем пространства, выделенный объектам в базе данных.
        /// </summary>
        public string reserved { get; set; }

        /// <summary>
        ///     Общий объем пространства, используемый данными.
        /// </summary>
        public string data { get; set; }

        /// <summary>
        ///     Общий объем пространства, зарезервированный для объектов в базе данных, но пока не используемый.
        /// </summary>
        public string unallocated_space { get; set; }
    }
}


text:
package net.cjx.framework.cache.impl;

import net.cjx.framework.cache.CacheFullRemoveType;
import net.cjx.framework.cache.CacheObject;

/**
 * Remove type when cache is full. not remove any one, it means nothing can be put later

 *
 * @author Trinea 2011-12-26
 */
public class RemoveTypeNotRemove<T> implements CacheFullRemoveType<T>
{

    private static final long serialVersionUID = 1L;

    @Override
    public int compare(CacheObject<T> obj1, CacheObject<T> obj2) {
        return 0;
    }
}


text: #include "../../../../Platform/chromium/public/WebGamepad.h"


text:
/**
  * 2016 JavaScript technology stack:
  * http://www.codeceo.com/article/2016-javascript-stack-state.html
  */
/**
  * article list:
  * http://www.codeceo.com/article/tag/javascript
  */
var Dom = {
	id: function (id) {
		return document.getElementById(id);
	},
	claz: function (claz) {
		return document.querySelector(claz);
	},
	name: function (name) {
		return document.getElementsByName(name);
	},
	html: function (dom, html) {
		dom.innerHTML = html;
	}
}, Event = {
	on: function (dom, type, callback) {
		if(dom.addEventListener) dom.addEventListener(type, callback);
		else if(dom.attachEvent) dom.attachEvent('on'+type, callback);
		else dom['on'+type] = callback;
	},
	event: function (event) {
		return event || window.event;
	},
	target: function (event) {
		event = this.event(event);
		return event.target || event.srcElement;
	},
	preventDefault: function (event) {
		event = this.event(event);
		if(event.preventDefault) event.preventDefault();
		else event.returnValue = false;
	}
};


text:
@echo Note: instructions for properly updating the variables are in the end of the file
@echo The contents here may just be copied into cmd.exe or some other shell (just note that
@echo in some cases a call to git may stop executing, so, you may need to copy the commands in chunks).

REM set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_27
set ECLIPSE_CLEAN=E:\eclipse\eclipse-SDK-3.7.1-win32\eclipse

set BUILDDIR=%~dp0
set BRANCH=development

cd /d %BUILDDIR%
cd /d ../../build

set BUILD_DIR=%BUILDDIR%..\..\build\src
set DEPLOY_DIR=%BUILDDIR%..\..\build\deploy
set FASTCOPY=%BUILDDIR%..\..\tool\ha_FastCopy2.11
set ANT_HOME=%BUILDDIR%..\..\tool\apache-ant-1.8.2
set KEYSTORE=%DEPLOY_DIR%\opsdevkeystore
set KEYSTORE_ALIAS=opsdev
set STOREPASS=key123

set LAUNCHER_PLUGIN=org.eclipse.equinox.launcher_1.2.0.v20110502
set BUILDER_PLUGIN=org.eclipse.pde.build_3.7.0.v20110512-1320

set BASEOS=win32
set BASEWS=win32
set BASEARCH=x86

set PATH=
set PATH=C:\Python27;%PATH%
set PATH=%FASTCOPY%;%PATH%
set PATH=%JAVA_HOME%\bin;%PATH%
set PATH=%ANT_HOME%\bin;%PATH%;%SystemRoot%\system32;

@echo actual build command
mkdir %BUILD_DIR%
mkdir %DEPLOY_DIR%

rmdir /S/Q  %BUILD_DIR%\Pydev\features
rmdir /S/Q  %BUILD_DIR%\Pydev\plugins
mkdir %BUILD_DIR%\Pydev\features
mkdir %BUILD_DIR%\Pydev\plugins
xcopy /E/Q/Y %BUILDDIR%..\..\features %BUILD_DIR%\Pydev\features
xcopy /E/Q/Y %BUILDDIR%..\..\plugins %BUILD_DIR%\Pydev\plugins

cd /d %BUILD_DIR%
cd Pydev

del %DEPLOY_DIR%/Pydev/* /Y

@echo If copied/pasted into cmd.exe, it will break here
@echo to clean after the build: -DcleanAfter.set=true

cd /d %BUILDDIR%
ant -logfile ./opsbuild.log -DbuildDirectory=%BUILD_DIR%\Pydev -Ddeploy.dir=%DEPLOY_DIR%\Pydev -Dvanilla.eclipse=%ECLIPSE_CLEAN%  -DKEYSTORE=%KEYSTORE% -DSTOREPASS=%STOREPASS%  -Dlocal_build=true -Dlauncher.plugin=%LAUNCHER_PLUGIN% -Dbuilder.plugin=%BUILDER_PLUGIN% -Dbaseos=%BASEOS% -Dbasews=%BASEWS% -Dbasearch=%BASEARCH% -DKEYSTORE_ALIAS=%KEYSTORE_ALIAS%


text:
package com.example.picasso;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.ViewAnimator;
import com.squareup.picasso.Picasso;

import static android.content.Intent.ACTION_PICK;
import static android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
import static com.squareup.picasso.Callback.EmptyCallback;

public class SampleGalleryActivity extends PicassoSampleActivity {
  private static final int GALLERY_REQUEST = 9391;
  private static final String KEY_IMAGE = "com.example.picasso:image";

  private ImageView imageView;
  private ViewAnimator animator;
  private String image;

  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.sample_gallery_activity);

    animator = (ViewAnimator) findViewById(R.id.animator);
    imageView = (ImageView) findViewById(R.id.image);

    findViewById(R.id.go).setOnClickListener(new View.OnClickListener() {
      @Override public void onClick(View view) {
        Intent gallery = new Intent(ACTION_PICK, EXTERNAL_CONTENT_URI);
        startActivityForResult(gallery, GALLERY_REQUEST);
      }
    });

    if (savedInstanceState != null) {
      image = savedInstanceState.getString(KEY_IMAGE);
      if (image != null) {
        loadImage();
      }
    }
  }

  @Override protected void onPause() {
    super.onPause();
    if (isFinishing()) {
      // Always cancel the request here, this is safe to call even if the image has been loaded.
      // This ensures that the anonymous callback we have does not prevent the activity from
      // being garbage collected. It also prevents our callback from getting invoked even after the
      // activity has finished.
      Picasso.get().cancelRequest(imageView);
    }
  }

  @Override protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putString(KEY_IMAGE, image);
  }

  @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == GALLERY_REQUEST && resultCode == RESULT_OK && data != null) {
      image = data.getData().toString();
      loadImage();
    } else {
      super.onActivityResult(requestCode, resultCode, data);
    }
  }

  private void loadImage() {
    // Index 1 is the progress bar. Show it while we're loading the image.
    animator.setDisplayedChild(1);

    Picasso.get().load(image).fit().centerInside().into(imageView, new EmptyCallback() {
      @Override public void onSuccess() {
        // Index 0 is the image view.
        animator.setDisplayedChild(0);
      }
    });
  }
}


text:
"""Class representing message/* MIME documents."""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import

__all__ = ['MIMEMessage']

from future.backports.email import message
from future.backports.email.mime.nonmultipart import MIMENonMultipart

class MIMEMessage(MIMENonMultipart):
    """Class representing message/* MIME documents."""

    def __init__(self, _msg, _subtype='rfc822'):
        """Create a message/* type MIME document.

        _msg is a message object and must be an instance of Message, or a
        derived class of Message, otherwise a TypeError is raised.

        Optional _subtype defines the subtype of the contained message.  The
        default is "rfc822" (this is defined by the MIME standard, even though
        the term "rfc822" is technically outdated by RFC 2822).
        """
        MIMENonMultipart.__init__(self, 'message', _subtype)
        if not isinstance(_msg, message.Message):
            raise TypeError('Argument is not an instance of Message')
        # It's convenient to use this base class method.  We need to do it
        # this way or we'll get an exception
        message.Message.attach(self, _msg)
        # And be sure our default type is set correctly
        self.set_default_type('message/rfc822')


text:
module Pah
  module Templates
    class SecretToken < Pah::Template
      def call
        append_to_file '.env', "SECRET_KEY_BASE: #{SecureRandom.hex(60)}\n"

        gsub_file 'config/secrets.yml', /secret_key_base: (.*)/, "secret_key_base: <%= ENV[\"SECRET_KEY_BASE\"] %>"

        git add: 'config/secrets.yml'
        git add: '.env'
        git_commit 'Replace secret key base with environment variable.'
      end
    end
  end
end


text:
package structs

// Bool return address of bool value
func Bool(v bool) *bool {
	return &v
}

// String return address of string value
func String(v string) *string {
	return &v
}

// Int64 return address of int64 value
func Int64(v int64) *int64 {
	return &v
}


text:
feature_name: "Service Worker Sample: Cache Video"
chrome_version: 52
feature_id: 6561526227927040
local_js_files: ['index.js', 'service-worker.js']
---

<video controls  poster="static/poster.jpg"
  style="margin: 0 0 1em 0; max-width: 100%; width: 480px;">

  <source src="https://prefetch-video-sample.storage.googleapis.com/gbike.webm" type="video/webm" />
  <source src="https://prefetch-video-sample.storage.googleapis.com/gbike.mp4" type="video/mp4" />

Your browser does not support the video element.

</video>

Background

This sample demonstrates basic service worker registration, in conjunction with pre-fetching a video and its poster image.

Visit chrome://inspect/#service-workers and click on the "inspect" link below the registered service worker to view logging statements for the various actions the service-worker.js script is performing. Since most of the action takes place during the service worker's install handler, and that is only executed the very first time you visit this page (unless the service worker script changes), it can be helpful to inspect the logging in a Chrome Incognito window.

To try out caching, disconnect from your network then reload this page.

{% include js_snippet.html filename='index.js' title='index.js' %}
{% include js_snippet.html filename='service-worker.js' displayonly=true title='service-worker.js' %}


text:
'use strict';

var Backbone = require('backbone');
var jQuery = require('jQuery');

Backbone.$ = jQuery;

module.exports = Backbone;


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2012 Andrew Neal

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<com.spollo.player.widgets.SquareView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/square_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <com.spollo.player.widgets.SquareImageView
        android:id="@+id/image"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop" />

</com.spollo.player.widgets.SquareView>


text:
package com.maxifier.guice.property;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Binder;
import com.google.inject.Key;
import com.google.inject.Module;
import com.maxifier.guice.property.converter.*;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import java.io.*;
import java.lang.annotation.Annotation;
import java.net.URI;
import java.net.URL;
import java.text.DateFormat;
import java.util.*;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Strings.nullToEmpty;
import static com.maxifier.guice.property.converter.ArrayTypeConverter.*;

/**
 * Binds module properties and type converters
 *
Module should be constructed using one of {@code #loadFrom()} methods.
 * {@link #loadFrom(Module)} and {@link #loadFrom(Class)} tries to load properties from resource
 * with the same name as a module class. To specify custom resource name use {@link #loadFrom(String)}
 * or provide resource as {@code InputStream} or {@code Reader}.

 *
Properties and it's comments will be read using {@link PropertyReader}.
 * Property comments can be parsed later to extract annotations by
 * {@link #getPropertyAnnotation(PropertyDefinition, String)}.

 *
PropertyModule instance binds property values using {@link Property} annotation.
 * Module binds itself too to provide property metadata for other tools.
 * Take property definitions by {@link #getProperties()}.

 *
To bind extended type converters call {@link #withConverters()} on module.

 *
 * @author Konstantin Lyamshin (2015-12-29 2:04)
 */
@ParametersAreNonnullByDefault
public class PropertyModule implements Module {
    private final ImmutableList<PropertyDefinition> properties;
    private final String moduleName = UUID.randomUUID().toString();
    private final String source;
    private boolean bindConverters;

    /**
     * @return general @Property instance
     */
    @Nonnull
    public static Property property(String name) {
        return new PropertyImpl(checkNotNull(name));
    }

    /**
     * @return certain property binding key
     */
    @Nonnull
    public static Key<String> propertyKey(String name) {
        return Key.get(String.class, property(name));
    }

    /**
     * Load properties from resource {@code module.getClass().properties} using UTF-8 encoding.
     * @see #loadFrom(Class)
     */
    public static PropertyModule loadFrom(Module module) {
        return loadFrom(module.getClass());
    }

    /**
     * Read properties from classpath resource {@code moduleClass.properties} using UTF-8 encoding.
     *
Property lookup sequence:

     *

     *
${moduleClass.getSimpleName()}.properties

     *
${modulePackage.getName()}/${moduleClass.getSimpleName()}.properties

     *
${moduleClass.getName()}.properties

     *

     */
    public static PropertyModule loadFrom(Class<? extends Module> moduleClass) {
        ClassLoader classLoader = moduleClass.getClassLoader();
        String resourceName = moduleClass.getSimpleName() + ".properties";
        InputStream inputStream = classLoader.getResourceAsStream(resourceName);
        if (inputStream == null) { // try with package
            inputStream = moduleClass.getResourceAsStream(resourceName);
        }
        if (inputStream == null) { // try with full name
            inputStream = classLoader.getResourceAsStream(moduleClass.getName() + ".properties");
        }
        if (inputStream == null) {
            throw new IllegalArgumentException("Can't load resource " + resourceName);
        }
        try {
            try {
                return new PropertyModule(
                    ImmutableSet.copyOf(loadProperties0(new PropertyReader(inputStream))), moduleClass.getSimpleName()
                );
            } finally {
                inputStream.close();
            }
        } catch (IOException e) {
            throw new RuntimeException("Can't read properties from " + resourceName, e);
        }
    }

    /**
     * Read properties from classpath resource by name
     */
    public static PropertyModule loadFrom(String resourceName) {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        if (classLoader == null) {
            classLoader = PropertyModule.class.getClassLoader();
        }
        InputStream inputStream = classLoader.getResourceAsStream(resourceName);
        if (inputStream == null) {
            throw new IllegalArgumentException("Can't load resource " + resourceName);
        }
        try {
            try {
                return new PropertyModule(
                    ImmutableSet.copyOf(loadProperties0(new PropertyReader(inputStream))), resourceName
                );
            } finally {
                inputStream.close();
            }
        } catch (IOException e) {
            throw new RuntimeException("Can't read properties from " + resourceName, e);
        }
    }

    /**
     * Reads properties from provided {@link InputStream} using UTF-8 encoding
     */
    public static PropertyModule loadFrom(InputStream inputStream) {
        try {
            try {
                return new PropertyModule(
                    ImmutableSet.copyOf(loadProperties0(new PropertyReader(inputStream))), ""
                );
            } finally {
                inputStream.close();
            }
        } catch (IOException e) {
            throw new RuntimeException("Can't read properties from InputStream", e);
        }
    }

    /**
     * Reads properties from provided {@link Reader}
     */
    public static PropertyModule loadFrom(Reader reader) {
        try {
            try {
                return new PropertyModule(
                    ImmutableSet.copyOf(loadProperties0(new PropertyReader(reader))), ""
                );
            } finally {
                reader.close();
            }
        } catch (IOException e) {
            throw new RuntimeException("Can't read properties from Reader", e);
        }
    }

    /**
     * Use custom properties
     */
    public static PropertyModule loadFrom(Properties properties) {
        ImmutableSet.Builder<PropertyDefinition> definitions = ImmutableSet.builder();
        for (String key : properties.stringPropertyNames()) {
            definitions.add(new PropertyDefinition(key, properties.getProperty(key), ""));
        }
        return new PropertyModule(definitions.build(), "");
    }

    /**
     * Use custom properties
     */
    public static PropertyModule loadFrom(Map<String, String> properties) {
        ImmutableSet.Builder<PropertyDefinition> definitions = ImmutableSet.builder();
        for (String key : properties.keySet()) {
            definitions.add(new PropertyDefinition(key, properties.get(key), ""));
        }
        return new PropertyModule(definitions.build(), "");
    }

    /**
     * Load properties from custom definitions
     */
    public static PropertyModule loadFrom(Set<PropertyDefinition> properties) {
        return new PropertyModule(properties, "");
    }

    /**
     * Parses property comment and extract specific annotation value.
     *
If there are more than one annotation with same name, only first one will be returned.

     *
Annotation name should include '@' sign.

     *
Whitespaces are trimmed from annotation value.

     *
     * @see PropertyAnnotationParser
     * @param definition property definition
     * @param annotation desired annotation (including '@' sign)
     * @return annotation value or null if not found
     */
    @Nullable
    public static String getPropertyAnnotation(PropertyDefinition definition, String annotation) {
        String result = null;
        PropertyAnnotationParser parser = new PropertyAnnotationParser(definition.getComment());
        while (parser.hasNext()) {
            Map.Entry<String, String> entry = parser.next();
            if (entry.getKey().equals(annotation)) {
                result = entry.getValue();
            }
        }
        return result;
    }

    /**
     * Reads properties from input stream using UTF-8 encoding.
     *
Data format is similar to original {@link Properties#load(InputStream)} format.

     *
     * @param inputStream the input stream
     * @throws IOException input stream can't be read
     */
    public static List<PropertyDefinition> loadProperties(InputStream inputStream) throws IOException {
        return loadProperties0(new PropertyReader(inputStream));
    }

    /**
     * Reads properties from character reader.
     *
Data format is similar to original {@link Properties#load(Reader)})} format.

     *
     * @param reader input reader
     * @throws IOException input stream can't be read
     */
    public static List<PropertyDefinition> loadProperties(Reader reader) throws IOException {
        return loadProperties0(new PropertyReader(reader));
    }

    private static List<PropertyDefinition> loadProperties0(PropertyReader reader) throws IOException {
        ArrayList<PropertyDefinition> properties = new ArrayList<PropertyDefinition>();
        while (!reader.isEof()) {
            String comment = reader.readComment();
            String key = reader.readKey();
            if (!key.isEmpty()) {
                String value = reader.readValue();
                properties.add(new PropertyDefinition(key, nullToEmpty(value), nullToEmpty(comment)));
            }
        }
        return properties;
    }

    private PropertyModule(Set<PropertyDefinition> properties, String source) {
        this.source = source;
        this.properties = ImmutableList.copyOf(properties);
    }

    /**
     * Binds custom type converters too
     */
    public PropertyModule withConverters() {
        this.bindConverters = true;
        return this;
    }

    /**
     * @return list of properties to bind
     */
    @Nonnull
    public ImmutableList<PropertyDefinition> getProperties() {
        return properties;
    }

    @Override
    public void configure(Binder binder) {
        binder = binder.skipSources(PropertyModule.class);

        // Bind module itself for later collection of properties
        binder.bind(PropertyModule.class).annotatedWith(property(moduleName)).toInstance(this);

        for (PropertyDefinition prop : properties) {
            binder.bindConstant().annotatedWith(property(prop.getName())).to(prop.getValue());
        }

        if (bindConverters) {
            bindConverters(binder);
        }
    }

    private void bindConverters(Binder binder) {
        binder.convertToTypes(new ArrayMatcher(String.class), STRING_ARRAY_CONVERTER);
        binder.convertToTypes(new ArrayMatcher(int.class), INT_ARRAY_CONVERTER);
        binder.convertToTypes(new ArrayMatcher(boolean.class), BOOLEAN_ARRAY_CONVERTER);
        binder.convertToTypes(new ArrayMatcher(double.class), DOUBLE_ARRAY_CONVERTER);
        binder.convertToTypes(new ClazzMatcher(File.class), new FileTypeConverter());
        binder.convertToTypes(new ClazzMatcher(URL.class), new URLTypeConverter());
        binder.convertToTypes(new ClazzMatcher(URI.class), new URITypeConverter());
        binder.convertToTypes(new ClazzMatcher(DateFormat.class), new DateFormatTypeConverter());
        binder.convertToTypes(new ClazzMatcher(Date.class), new DateTypeConverter());
    }

    @Override
    public String toString() {
        return String.format("PropertyModule{%s}", source);
    }

    @SuppressWarnings("ClassExplicitlyAnnotation")
    private static class PropertyImpl implements Property, Serializable {
        private static final long serialVersionUID = 3672977046537086190L;
        private final String value;

        private PropertyImpl(String name) {
            this.value = name;
        }

        @Override
        public String value() {
            return value;
        }

        @Override
        public Class<? extends Annotation> annotationType() {
            return Property.class;
        }

        @Override
        public int hashCode() {
            // This is specified in java.lang.Annotation.
            return (127 * "value".hashCode()) ^ value.hashCode();
        }

        @Override
        public boolean equals(Object o) {
            if (o instanceof Property) {
                Property other = (Property) o;
                return value.equals(other.value());
            }
            return false;
        }

        @Override
        public String toString() {
            return String.format("@Property(%s)", value);
        }
    }
}


text:
{
  String.prototype.codePointAt.apply(undefined);
}


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("ReactiveServices.Extensions")]
[assembly: AssemblyDescription("Reactive Services library used to provide useful extension methods in a Reactive Services application")]
[assembly: Guid("5ace75fa-ff1d-47f7-8e85-555bf553181f")]

[assembly: AssemblyProduct("Reactive Services")]
[assembly: AssemblyCompany("Reactive Services")]
[assembly: AssemblyCopyright("Copyright © Rafael Romão 2015")]

[assembly: ComVisible(false)]

[assembly: AssemblyVersion("0.2.*")]
[assembly: AssemblyFileVersion("0.2.0.0")]

[assembly: InternalsVisibleTo("ReactiveServices.Extensions.Tests")]


text:
<?xml version="1.0" encoding="utf-8"?>
<project>
  <scm class="hudson.plugins.git.GitSCM">
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <name>origin</name>
        <refspec>+refs/heads/*:refs/remotes/origin/*</refspec>
        <url>https://github.com/openstack-infra/jenkins-job-builder.git</url>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
        <name>**</name>
      </hudson.plugins.git.BranchSpec>
    </branches>
    <disableSubmodules>false</disableSubmodules>
    <recursiveSubmodules>false</recursiveSubmodules>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <remotePoll>false</remotePoll>
    <gitTool>Default</gitTool>
    <submoduleCfg class="list"/>
    <reference/>
    <gitConfigName/>
    <gitConfigEmail/>
    <extensions>
      <hudson.plugins.git.extensions.impl.PreBuildMerge>
        <options>
          <mergeRemote>repo_name</mergeRemote>
          <mergeTarget>branch_name</mergeTarget>
          <mergeStrategy>recursive</mergeStrategy>
          <fastForwardMode>FF_ONLY</fastForwardMode>
        </options>
      </hudson.plugins.git.extensions.impl.PreBuildMerge>
      <hudson.plugins.git.extensions.impl.DisableRemotePoll/>
      <hudson.plugins.git.extensions.impl.WipeWorkspace/>
    </extensions>
    <browser class="hudson.plugins.git.browser.RhodeCode">
      <url>http://github.com/foo/example.git</url>
    </browser>
  </scm>
</project>


text:
<!DOCTYPE html>

		<title>Upload</title>
		<meta charset="UTF-8" />

			<form method="post" enctype="multipart/form-data" th:action="@{/manage/photo/upload/}">

アップロード

				<input type="file" name="files" multiple="multiple" class="form-control" />

				<button type="submit" class="btn btn-primary">アップロード</button>

						facebook login

					<button type="button" class="btn btn-default logout" th:if="${authentication.login}" th:fragment="btn-facebook">
						facebook logout
					</button>

			</form>


text:
package handlers_test

import (
	"encoding/json"
	"errors"
	lfakes "lib/fakes"
	"net/http"
	"net/http/httptest"

	"github.com/cloudfoundry-incubator/ducati-daemon/fakes"
	"github.com/cloudfoundry-incubator/ducati-daemon/handlers"
	"github.com/cloudfoundry-incubator/ducati-daemon/models"
	"github.com/pivotal-golang/lager/lagertest"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/gbytes"
)

var _ = Describe("ListContainers", func() {
	var dataStore *fakes.Store
	var handler *handlers.ListContainers
	var marshaler *lfakes.Marshaler
	var containers []models.Container
	var logger *lagertest.TestLogger

	BeforeEach(func() {
		dataStore = &fakes.Store{}
		marshaler = &lfakes.Marshaler{}
		marshaler.MarshalStub = json.Marshal
		logger = lagertest.NewTestLogger("test")
		handler = &handlers.ListContainers{
			Marshaler: marshaler,
			Logger:    logger,
			Datastore: dataStore,
		}

		containers = []models.Container{
			{ID: "container-id-1", IP: "192.168.0.1", NetworkID: "network-id-1"},
			{ID: "container-id-2", IP: "192.168.0.2", NetworkID: "network-id-1"},
			{ID: "container-id-199", IP: "192.168.0.3", NetworkID: "network-id-2"},
			{ID: "container-id-200", IP: "192.168.0.4", NetworkID: "network-id-2"},
		}
		dataStore.AllReturns(containers, nil)
	})

	It("should return the containers as a JSON list", func() {
		req, err := http.NewRequest("GET", "/containers", nil)
		Expect(err).NotTo(HaveOccurred())
		resp := httptest.NewRecorder()
		handler.ServeHTTP(resp, req)

		var receivedContainers []models.Container
		err = json.Unmarshal(resp.Body.Bytes(), &receivedContainers)
		Expect(err).NotTo(HaveOccurred())

		Expect(resp.Code).To(Equal(http.StatusOK))
		Expect(receivedContainers).To(ConsistOf(containers))
	})

	It("should marshal the containers received from the datastore", func() {
		req, err := http.NewRequest("GET", "/containers", nil)
		Expect(err).NotTo(HaveOccurred())
		resp := httptest.NewRecorder()
		handler.ServeHTTP(resp, req)

		Expect(marshaler.MarshalCallCount()).To(Equal(1))
		Expect(marshaler.MarshalArgsForCall(0)).To(Equal(containers))
	})

	Context("when there are no containers", func() {
		BeforeEach(func() {
			dataStore.AllReturns([]models.Container{}, nil)
		})

		It("should return an empty list", func() {
			req, err := http.NewRequest("GET", "/containers", nil)
			Expect(err).NotTo(HaveOccurred())
			resp := httptest.NewRecorder()
			handler.ServeHTTP(resp, req)

			Expect(resp.Body.String()).To(MatchJSON(`[]`))
		})
	})

	Context("when listing from the store fails", func() {
		It("should return a 500 error and log", func() {
			dataStore.AllReturns(nil, errors.New("teapot"))

			req, err := http.NewRequest("GET", "/containers", nil)
			Expect(err).NotTo(HaveOccurred())
			resp := httptest.NewRecorder()
			handler.ServeHTTP(resp, req)

			Expect(resp.Code).To(Equal(http.StatusInternalServerError))
			Expect(logger).To(gbytes.Say("list-containers.*datastore-all-failed.*teapot"))
		})
	})

	Context("when marshaling fails", func() {
		It("should return a 500 error", func() {
			marshaler.MarshalReturns(nil, errors.New("teapot"))

			req, err := http.NewRequest("GET", "/containers", nil)
			Expect(err).NotTo(HaveOccurred())
			resp := httptest.NewRecorder()
			handler.ServeHTTP(resp, req)

			Expect(resp.Code).To(Equal(http.StatusInternalServerError))
			Expect(logger).To(gbytes.Say("list-containers.*marshal-failed.*teapot"))
		})
	})
})


text:
using DriveAPI.Core;
using DropBoxManager;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
using GalaSoft.MvvmLight.Messaging;
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Windows.Input;

namespace WebDriveUM.ViewModel
{
    ///
    /// This class contains properties that the main View can data bind to.
    /// <para>
    /// Use the mvvminpc snippet to add bindable properties to this ViewModel.
    /// </para>
    /// <para>
    /// You can also use Blend to data bind with the tool's support.
    /// </para>
    /// <para>
    /// See http://www.galasoft.ch/mvvm
    /// </para>
    ///
    public class MainViewModel : ViewModelBase
    {

        [Import("DropBox", typeof(IBaseDriveService))]
        IBaseDriveService Dropbox { get; set; }

        public UserInfo User { get; set; }

        ///
        /// Initializes a new instance of the MainViewModel class.
        ///

        public MainViewModel()
        {
            ////if (IsInDesignMode)
            ////{
            ////    // Code runs in Blend --> create design time data.
            ////}
            ////else
            ////{
            ////    // Code runs "for real"
            ////}
            AddConnectionBoxCommand = new RelayCommand(AddConnectionBox);

        }

        public ICommand AddConnectionBoxCommand { get; set; }

        void AddConnectionBox()
        {
            var uri = Dropbox.GetAuthPageAddress();
            Messenger.Default.Send<NotificationMessageWithCallback>(new NotificationMessageWithCallback(uri.ToString(), new Action<string>(async (string uri1) =>
            {
                Dropbox.SetAccessToken(new Uri(uri1));

                User = await Dropbox.GetUserInfoAsync();
                RaisePropertyChanged(() => User);
            })), "GetAuth");
        }
    }
}


text:
package com.smoketurner.dropwizard.money.jdbi;

import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Optional;
import javax.annotation.Nullable;
import org.javamoney.moneta.Money;
import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.tweak.ResultColumnMapper;

/** A {@link ResultColumnMapper} to map {@link Money} objects. */
public class MoneyMapper implements ResultColumnMapper<Money> {

  private static final String DEFAULT_CURRENCY_CODE = "USD";
  private final Optional<String> currency;

  public MoneyMapper() {
    currency = Optional.of(DEFAULT_CURRENCY_CODE);
  }

  public MoneyMapper(String currencyCode) {
    currency = Optional.ofNullable(currencyCode);
  }

  @Nullable
  @Override
  public Money mapColumn(ResultSet r, int columnNumber, @Nullable StatementContext ctx)
      throws SQLException {
    return convertToMoney(r.getBigDecimal(columnNumber));
  }

  @Nullable
  @Override
  public Money mapColumn(ResultSet r, String columnLabel, @Nullable StatementContext ctx)
      throws SQLException {
    return convertToMoney(r.getBigDecimal(columnLabel));
  }

  @Nullable
  private Money convertToMoney(@Nullable BigDecimal decimal) {
    if (decimal == null) {
      return null;
    }
    return Money.of(decimal, currency.orElse(DEFAULT_CURRENCY_CODE));
  }
}


text:
module Automation
  class Ajar < BaseEased
    # @param [Integer]
    # @target [Integer] openness
    def update_value(target, v)
      target.openness = v
    end

    type :ajar
  end
end


text:
package org.pentaho.di.core.jdbc;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.NClob;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.SQLXML;
import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.List;
import java.util.Map;

import org.pentaho.di.core.row.RowMetaInterface;

/**
 * This class is no longer used
 *
 * Data Service client code is now available in the pdi-dataservice-plugin project
 *
 */
@Deprecated
public class RowsResultSet implements ResultSet {

  private RowMetaInterface rowMeta;
  private List<Object[]> rows;

  private int currentIndex;
  private boolean lastNull;

  /**
   * @param rowMeta
   * @param rows
   */
  public RowsResultSet( RowMetaInterface rowMeta, List<Object[]> rows ) {
    this.rowMeta = rowMeta;
    this.rows = rows;
    currentIndex = -1;
  }

  @Override
  public boolean absolute( int index ) throws SQLException {
    currentIndex = index;
    return true;
  }

  @Override
  public void afterLast() throws SQLException {
    currentIndex = rows.size();
  }

  @Override
  public void beforeFirst() throws SQLException {
    currentIndex = -1;
  }

  @Override
  public void cancelRowUpdates() throws SQLException {
  }

  @Override
  public void clearWarnings() throws SQLException {
  }

  @Override
  public void close() throws SQLException {
  }

  @Override
  public void deleteRow() throws SQLException {
  }

  @Override
  public int findColumn( String name ) throws SQLException {
    int index = rowMeta.indexOfValue( name ) + 1;
    System.out.println( "findColumn(" + name + ") --> " + index );
    return index;
  }

  @Override
  public boolean first() throws SQLException {
    currentIndex = 0;
    return true;
  }

  @Override
  public boolean wasNull() throws SQLException {
    return lastNull;
  }

  // Here are the getters...

  @Override
  public Date getDate( int index ) throws SQLException {
    try {
      java.util.Date date = rowMeta.getDate( rows.get( currentIndex ), index - 1 );
      if ( date == null ) {
        lastNull = true;
        return null;
      }
      lastNull = false;
      return new Date( date.getTime() );
    } catch ( Exception e ) {
      throw new SQLException( e );
    }
  }

  @Override
  public Date getDate( String columnName ) throws SQLException {
    return getDate( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public Date getDate( int index, Calendar calendar ) throws SQLException {
    return getDate( index );
  }

  @Override
  public Date getDate( String columnName, Calendar calendar ) throws SQLException {
    return getDate( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public double getDouble( int index ) throws SQLException {
    try {
      Double d = rowMeta.getNumber( rows.get( currentIndex ), index - 1 );
      if ( d == null ) {
        lastNull = true;
      }
      lastNull = false;
      return d;
    } catch ( Exception e ) {
      throw new SQLException( e );
    }
  }

  @Override
  public double getDouble( String columnName ) throws SQLException {
    return getDouble( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public Array getArray( int arg0 ) throws SQLException {
    throw new SQLException( "Arrays are not supported" );
  }

  @Override
  public Array getArray( String arg0 ) throws SQLException {
    throw new SQLException( "Arrays are not supported" );
  }

  @Override
  public InputStream getAsciiStream( int arg0 ) throws SQLException {
    throw new SQLException( "ASCII streams are not supported" );
  }

  @Override
  public InputStream getAsciiStream( String arg0 ) throws SQLException {
    throw new SQLException( "ASCII streams are not supported" );
  }

  @Override
  public BigDecimal getBigDecimal( int index ) throws SQLException {
    try {
      BigDecimal d = rowMeta.getBigNumber( rows.get( currentIndex ), index - 1 );
      if ( d == null ) {
        lastNull = true;
      }
      lastNull = false;
      return d;
    } catch ( Exception e ) {
      throw new SQLException( e );
    }
  }

  @Override
  public BigDecimal getBigDecimal( String columnName ) throws SQLException {
    return getBigDecimal( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  @Deprecated
  public BigDecimal getBigDecimal( int index, int arg1 ) throws SQLException {
    return getBigDecimal( index );
  }

  @Override
  @Deprecated
  public BigDecimal getBigDecimal( String columnName, int arg1 ) throws SQLException {
    return getBigDecimal( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public InputStream getBinaryStream( int arg0 ) throws SQLException {
    throw new SQLException( "Binary streams are not supported" );
  }

  @Override
  public InputStream getBinaryStream( String arg0 ) throws SQLException {
    throw new SQLException( "Binary streams are not supported" );
  }

  @Override
  public Blob getBlob( int index ) throws SQLException {
    throw new SQLException( "BLOBs are not supported" );
  }

  @Override
  public Blob getBlob( String arg0 ) throws SQLException {
    throw new SQLException( "BLOBs are not supported" );
  }

  @Override
  public boolean getBoolean( int index ) throws SQLException {
    try {
      Boolean b = rowMeta.getBoolean( rows.get( currentIndex ), index - 1 );
      if ( b == null ) {
        lastNull = true;
      }
      lastNull = false;
      return b;
    } catch ( Exception e ) {
      throw new SQLException( e );
    }
  }

  @Override
  public boolean getBoolean( String columnName ) throws SQLException {
    return getBoolean( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public byte getByte( int index ) throws SQLException {
    long l = getLong( index );
    return (byte) l;
  }

  @Override
  public byte getByte( String columnName ) throws SQLException {
    return getByte( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public byte[] getBytes( int index ) throws SQLException {
    try {
      byte[] binary = rowMeta.getBinary( rows.get( currentIndex ), index - 1 );
      if ( binary == null ) {
        lastNull = true;
        return null;
      }
      lastNull = false;
      return binary;
    } catch ( Exception e ) {
      throw new SQLException( e );
    }
  }

  @Override
  public byte[] getBytes( String columnName ) throws SQLException {
    return getBytes( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public Reader getCharacterStream( int arg0 ) throws SQLException {
    throw new SQLException( "Character streams are not supported" );
  }

  @Override
  public Reader getCharacterStream( String arg0 ) throws SQLException {
    throw new SQLException( "Character streams are not supported" );
  }

  @Override
  public Clob getClob( int arg0 ) throws SQLException {
    throw new SQLException( "CLOBs are not supported" );
  }

  @Override
  public Clob getClob( String arg0 ) throws SQLException {
    throw new SQLException( "CLOBs are not supported" );
  }

  @Override
  public float getFloat( int index ) throws SQLException {
    double d = getDouble( index );
    return (float) d;
  }

  @Override
  public float getFloat( String columnName ) throws SQLException {
    double d = getDouble( columnName );
    return (float) d;
  }

  @Override
  public int getInt( int index ) throws SQLException {
    long l = getLong( index );
    return (int) l;
  }

  @Override
  public int getInt( String columnName ) throws SQLException {
    return getInt( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public long getLong( int index ) throws SQLException {
    try {
      Long d = rowMeta.getInteger( rows.get( currentIndex ), index - 1 );
      if ( d == null ) {
        lastNull = true;
      }
      lastNull = false;
      return d;
    } catch ( Exception e ) {
      throw new SQLException( e );
    }
  }

  @Override
  public long getLong( String columnName ) throws SQLException {
    return getLong( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public Reader getNCharacterStream( int arg0 ) throws SQLException {
    throw new SQLException( "NCharacter streams are not supported" );
  }

  @Override
  public Reader getNCharacterStream( String arg0 ) throws SQLException {
    throw new SQLException( "NCharacter streams are not supported" );
  }

  @Override
  public NClob getNClob( int arg0 ) throws SQLException {
    throw new SQLException( "NCLOBs are not supported" );
  }

  @Override
  public NClob getNClob( String arg0 ) throws SQLException {
    throw new SQLException( "NCLOBs are not supported" );
  }

  @Override
  public String getNString( int arg0 ) throws SQLException {
    throw new SQLException( "NStrings are not supported" );
  }

  @Override
  public String getNString( String arg0 ) throws SQLException {
    throw new SQLException( "NStrings are not supported" );
  }

  @Override
  public Object getObject( int index ) throws SQLException {
    return rows.get( currentIndex )[index];
  }

  @Override
  public Object getObject( String columnName ) throws SQLException {
    return getObject( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public Object getObject( int index, Map<String, Class<?>> arg1 ) throws SQLException {
    return getObject( index );
  }

  @Override
  public Object getObject( String columnName, Map<String, Class<?>> arg1 ) throws SQLException {
    return getObject( columnName );
  }

  @Override
  public Ref getRef( int arg0 ) throws SQLException {
    throw new SQLException( "Refs are not supported" );
  }

  @Override
  public Ref getRef( String arg0 ) throws SQLException {
    throw new SQLException( "Refs are not supported" );
  }

  @Override
  public RowId getRowId( int arg0 ) throws SQLException {
    throw new SQLException( "RowIDs are not supported" );
  }

  @Override
  public RowId getRowId( String arg0 ) throws SQLException {
    throw new SQLException( "RowIDs are not supported" );
  }

  @Override
  public SQLXML getSQLXML( int arg0 ) throws SQLException {
    throw new SQLException( "SQLXML is not supported" );
  }

  @Override
  public SQLXML getSQLXML( String arg0 ) throws SQLException {
    throw new SQLException( "SQLXML is not supported" );
  }

  @Override
  public short getShort( int index ) throws SQLException {
    long l = getLong( index );
    return (short) l;
  }

  @Override
  public short getShort( String columnName ) throws SQLException {
    return getShort( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  @Deprecated
  public String getString( int index ) throws SQLException {
    try {
      Object value = rows.get( currentIndex )[ index - 1 ];
      String string = value == null ? null : value.toString();
      lastNull = ( string == null );
      System.out.println( "getString(" + index + ") --> " + string );
      return string;
    } catch ( Exception e ) {
      throw new SQLException( e );
    }
  }

  @Override
  public String getString( String columnName ) throws SQLException {
    return getString( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public Time getTime( int arg0 ) throws SQLException {
    throw new SQLException( "Time is not supported" );
  }

  @Override
  public Time getTime( String arg0 ) throws SQLException {
    throw new SQLException( "Time is not supported" );
  }

  @Override
  public Time getTime( int arg0, Calendar arg1 ) throws SQLException {
    throw new SQLException( "Time is not supported" );
  }

  @Override
  public Time getTime( String arg0, Calendar arg1 ) throws SQLException {
    throw new SQLException( "Time is not supported" );
  }

  @Override
  public Timestamp getTimestamp( int index ) throws SQLException {
    java.util.Date date = getDate( index );
    if ( date == null ) {
      return null;
    }
    return new Timestamp( date.getTime() );
  }

  @Override
  public Timestamp getTimestamp( String columnName ) throws SQLException {
    return getTimestamp( rowMeta.indexOfValue( columnName ) + 1 );
  }

  @Override
  public Timestamp getTimestamp( int index, Calendar arg1 ) throws SQLException {
    return getTimestamp( index );
  }

  @Override
  public Timestamp getTimestamp( String columnName, Calendar arg1 ) throws SQLException {
    return getTimestamp( columnName );
  }

  @Override
  public URL getURL( int arg0 ) throws SQLException {
    throw new SQLException( "URLs are not supported" );
  }

  @Override
  public URL getURL( String arg0 ) throws SQLException {
    throw new SQLException( "URLs are not supported" );
  }

  @Override
  @Deprecated
  public InputStream getUnicodeStream( int arg0 ) throws SQLException {
    throw new SQLException( "Unicode streams are not supported" );
  }

  @Override
  @Deprecated
  public InputStream getUnicodeStream( String arg0 ) throws SQLException {
    throw new SQLException( "Unicode streams are not supported" );
  }

  // Update section below: all not supported...

  @Override
  public void updateArray( int arg0, Array arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateArray( String arg0, Array arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateAsciiStream( int arg0, InputStream arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateAsciiStream( String arg0, InputStream arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateAsciiStream( int arg0, InputStream arg1, int arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateAsciiStream( String arg0, InputStream arg1, int arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateAsciiStream( int arg0, InputStream arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateAsciiStream( String arg0, InputStream arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBigDecimal( int arg0, BigDecimal arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBigDecimal( String arg0, BigDecimal arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBinaryStream( int arg0, InputStream arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBinaryStream( String arg0, InputStream arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBinaryStream( int arg0, InputStream arg1, int arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBinaryStream( String arg0, InputStream arg1, int arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBinaryStream( int arg0, InputStream arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBinaryStream( String arg0, InputStream arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBlob( int arg0, Blob arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBlob( String arg0, Blob arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBlob( int arg0, InputStream arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBlob( String arg0, InputStream arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBlob( int arg0, InputStream arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBlob( String arg0, InputStream arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBoolean( int arg0, boolean arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBoolean( String arg0, boolean arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateByte( int arg0, byte arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateByte( String arg0, byte arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBytes( int arg0, byte[] arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateBytes( String arg0, byte[] arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateCharacterStream( int arg0, Reader arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateCharacterStream( String arg0, Reader arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateCharacterStream( int arg0, Reader arg1, int arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateCharacterStream( String arg0, Reader arg1, int arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateCharacterStream( int arg0, Reader arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateCharacterStream( String arg0, Reader arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateClob( int arg0, Clob arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateClob( String arg0, Clob arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateClob( int arg0, Reader arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateClob( String arg0, Reader arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateClob( int arg0, Reader arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateClob( String arg0, Reader arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateDate( int arg0, Date arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateDate( String arg0, Date arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateDouble( int arg0, double arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateDouble( String arg0, double arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateFloat( int arg0, float arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateFloat( String arg0, float arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateInt( int arg0, int arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateInt( String arg0, int arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateLong( int arg0, long arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateLong( String arg0, long arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNCharacterStream( int arg0, Reader arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNCharacterStream( String arg0, Reader arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNCharacterStream( int arg0, Reader arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNCharacterStream( String arg0, Reader arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNClob( int arg0, NClob arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNClob( String arg0, NClob arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNClob( int arg0, Reader arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNClob( String arg0, Reader arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNClob( int arg0, Reader arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNClob( String arg0, Reader arg1, long arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNString( int arg0, String arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNString( String arg0, String arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  @Deprecated
  public void updateNull( int arg0 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateNull( String arg0 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateObject( int arg0, Object arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateObject( String arg0, Object arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateObject( int arg0, Object arg1, int arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateObject( String arg0, Object arg1, int arg2 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateRef( int arg0, Ref arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateRef( String arg0, Ref arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateRow() throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateRowId( int arg0, RowId arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateRowId( String arg0, RowId arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateSQLXML( int arg0, SQLXML arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateSQLXML( String arg0, SQLXML arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateShort( int arg0, short arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateShort( String arg0, short arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateString( int arg0, String arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateString( String arg0, String arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateTime( int arg0, Time arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateTime( String arg0, Time arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateTimestamp( int arg0, Timestamp arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public void updateTimestamp( String arg0, Timestamp arg1 ) throws SQLException {
    throw new SQLException( "Updates are not supported" );
  }

  @Override
  public boolean isWrapperFor( Class<?> iface ) throws SQLException {
    return false;
  }

  @Override
  public <T> T unwrap( Class<T> iface ) throws SQLException {
    return null;
  }

  @Override
  public int getConcurrency() throws SQLException {
    return ResultSet.CONCUR_READ_ONLY;
  }

  @Override
  public String getCursorName() throws SQLException {
    return "rows";
  }

  @Override
  public int getFetchDirection() throws SQLException {
    return ResultSet.FETCH_FORWARD;
  }

  @Override
  public int getFetchSize() throws SQLException {
    return 1;
  }

  @Override
  public int getHoldability() throws SQLException {
    return ResultSet.HOLD_CURSORS_OVER_COMMIT;
  }

  @Override
  public ResultSetMetaData getMetaData() throws SQLException {
    return new ThinResultSetMetaData( "rows", rowMeta );
  }

  @Override
  public int getRow() throws SQLException {
    return currentIndex;
  }

  @Override
  public Statement getStatement() throws SQLException {
    return null;
  }

  @Override
  public int getType() throws SQLException {
    return ResultSet.TYPE_FORWARD_ONLY;
  }

  @Override
  public SQLWarning getWarnings() throws SQLException {
    return null;
  }

  @Override
  public void insertRow() throws SQLException {
  }

  @Override
  public boolean isAfterLast() throws SQLException {
    return currentIndex >= rows.size();
  }

  @Override
  public boolean isBeforeFirst() throws SQLException {
    return currentIndex < 0;
  }

  @Override
  public boolean isClosed() throws SQLException {
    return false;
  }

  @Override
  public boolean isFirst() throws SQLException {
    return currentIndex == 0;
  }

  @Override
  public boolean isLast() throws SQLException {
    return currentIndex == rows.size() - 1;
  }

  @Override
  public boolean last() throws SQLException {
    currentIndex = rows.size() - 1;
    return false;
  }

  @Override
  public void moveToCurrentRow() throws SQLException {
  }

  @Override
  public void moveToInsertRow() throws SQLException {
  }

  @Override
  public boolean next() throws SQLException {
    currentIndex++;
    boolean result = currentIndex < rows.size();
    System.out.println( "next() --> " + result );
    return result;
  }

  @Override
  public boolean previous() throws SQLException {
    currentIndex--;
    return currentIndex >= 0;
  }

  @Override
  public void refreshRow() throws SQLException {
  }

  @Override
  public boolean relative( int rows ) throws SQLException {
    currentIndex += rows;
    return true;
  }

  @Override
  public boolean rowDeleted() throws SQLException {
    return false;
  }

  @Override
  public boolean rowInserted() throws SQLException {
    return false;
  }

  @Override
  public boolean rowUpdated() throws SQLException {
    return false;
  }

  @Override
  public void setFetchDirection( int direction ) throws SQLException {
  }

  @Override
  public void setFetchSize( int rows ) throws SQLException {
  }

  public <T> T getObject( int columnIndex, Class<T> type ) throws SQLException {
    throw new SQLException( "Method not supported" );
  }

  public <T> T getObject( String columnLabel, Class<T> type ) throws SQLException {
    throw new SQLException( "Method not supported" );
  }

}


text:
package com.liangmayong.base.basic.flow.interfaces;

import com.liangmayong.base.basic.flow.FlowBaseFragment;
import com.liangmayong.base.basic.flow.stack.StackManager;

/**
 * IStack
 *
 * @author LiangMaYong
 * @version 1.0
 */
public interface IFlow {

    /**
     * getLastFragment
     *
     * @return visible
     */
    FlowBaseFragment getLastFragment();

    /**
     * set anim
     *
     * @param nextIn  nextIn
     * @param nextOut nextOut
     * @param quitIn  quitIn
     * @param quitOut quitOut
     */
    void setFlowFragmentAnims(int nextIn, int nextOut, int quitIn, int quitOut);

    /**
     * getStackManager
     *
     * @return StackManager
     */
    StackManager getStackManager();
}


text:
module ActiveRecord
  class Base
    def save!
    end
  end
end

require 'abstract_unit'
require 'active_support/whiny_nil'

class WhinyNilTest < Test::Unit::TestCase
  def test_unchanged
    nil.method_thats_not_in_whiners
  rescue NoMethodError => nme
    assert_match(/nil.method_thats_not_in_whiners/, nme.message)
  end

  def test_active_record
    nil.save!
  rescue NoMethodError => nme
    assert(!(nme.message =~ /nil:NilClass/))
    assert_match(/nil\.save!/, nme.message)
  end

  def test_array
    nil.each
  rescue NoMethodError => nme
    assert(!(nme.message =~ /nil:NilClass/))
    assert_match(/nil\.each/, nme.message)
  end

  def test_id
    nil.id
  rescue RuntimeError => nme
    assert(!(nme.message =~ /nil:NilClass/))
  end
end


text:
/* vim: set sw=4 sts=4 et foldmethod=syntax : */

#include <graph/merge_cliques.hh>

#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/max_cardinality_matching.hpp>
#include <boost/graph/graph_utility.hpp>

auto parasols::merge_cliques(
        const std::function<bool (int, int)> & adjacent, const std::set<int> & clique1, const std::set<int> & clique2) -> std::set<int>
{
    /* health warning: this code is awful, and was just written to see if the
     * idea is worth doing properly. */

    std::set<int> common;
    std::vector<int> a, b;
    std::set_intersection(clique1.begin(), clique1.end(), clique2.begin(), clique2.end(),
            std::inserter(common, common.begin()));
    std::set_difference(clique1.begin(), clique1.end(), clique2.begin(), clique2.end(),
            std::back_inserter(a));
    std::set_difference(clique2.begin(), clique2.end(), clique1.begin(), clique1.end(),
            std::back_inserter(b));

    std::set<int> merged_clique = common;

    boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS> merge_graph(a.size() + b.size());

    for (unsigned i = 0 ; i < a.size() ; ++i)
        for (unsigned j = 0 ; j < b.size() ; ++j)
            if (! adjacent(a[i], b[j])) {
                boost::add_edge(i, a.size() + j, merge_graph);
            }

    std::vector<boost::graph_traits<decltype(merge_graph)>::vertex_descriptor> mate(a.size() + b.size());
    boost::edmonds_maximum_cardinality_matching(merge_graph, &mate[0]);

    std::set<int> matched_vertices;
    std::set<std::pair<int, int> > unmatched_edges;

    for (unsigned i = 0 ; i < a.size() ; ++i)
        for (unsigned j = 0 ; j < b.size() ; ++j)
            if (boost::is_adjacent(merge_graph, i, unsigned(a.size() + j))) {
                unmatched_edges.insert(std::make_pair(i, a.size() + j));
                unmatched_edges.insert(std::make_pair(a.size() + j, i));
            }

    boost::graph_traits<decltype(merge_graph)>::vertex_iterator vi, vi_end;
    for(boost::tie(vi, vi_end) = boost::vertices(merge_graph) ; vi != vi_end ; ++vi)
        if (mate[*vi] != boost::graph_traits<decltype(merge_graph)>::null_vertex()) {
            matched_vertices.insert(*vi);
            matched_vertices.insert(mate[*vi]);
            unmatched_edges.erase(std::make_pair(*vi, mate[*vi]));
        }

    std::set<int> s0, remaining;
    for (unsigned i = 0 ; i < a.size() + b.size() ; ++i)
        if (! matched_vertices.count(i))
            s0.insert(i);
        else
            remaining.insert(i);

    std::set<int> odd, even = s0, all_odd;
    while (! remaining.empty()) {
        /* odd set */
        odd.clear();

        for (auto r = remaining.begin() ; r != remaining.end() ; ) {
            bool add = false;
            for (auto & v : even)
                if (unmatched_edges.count(std::make_pair(*r, v))) {
                    add = true;
                    break;
                }

            if (add) {
                odd.insert(*r);
                remaining.erase(r++);
            }
            else
                ++r;
        }

        if (odd.empty()) {
            odd.insert(*remaining.begin());
            remaining.erase(remaining.begin());
        }

        all_odd.insert(odd.begin(), odd.end());

        /* even set */
        even.clear();

        for (auto & o : odd) {
            even.insert(mate[o]);
            remaining.erase(mate[o]);
        }
    }

    for (unsigned i = 0 ; i < a.size() + b.size() ; ++i)
        if (! all_odd.count(i)) {
            if (i < a.size())
                merged_clique.insert(a[i]);
            else
                merged_clique.insert(b[i - a.size()]);
        }

    return merged_clique;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/CircleIndicator-master.iml" filepath="$PROJECT_DIR$/CircleIndicator-master.iml" />
      <module fileurl="file://$PROJECT_DIR$/LoopingViewPager/LoopingViewPager.iml" filepath="$PROJECT_DIR$/LoopingViewPager/LoopingViewPager.iml" />
      <module fileurl="file://$PROJECT_DIR$/circleindicator/circleindicator.iml" filepath="$PROJECT_DIR$/circleindicator/circleindicator.iml" />
      <module fileurl="file://$PROJECT_DIR$/sample/sample.iml" filepath="$PROJECT_DIR$/sample/sample.iml" />
    </modules>
  </component>
</project>


text:
layout: default
---

# ScalaBridge Workshop

ScalaBridge workshops are intended for people from underrepresented populations who are interested in learning Scala.

**Note: You do not have to be a woman to be underrepresented in tech. Diversity comes in many forms: race, gender, age, religion, culture, sexual orientation, socioeconomic background, etc. If at any point, you feel excluded from any ScalaBridge event, please do not hesitate to reach out to [@ScalaBridge](https://twitter.com/ScalaBridge).**

To read more about the target audiences, please visit [here](/who-can-attend).

## What is a ScalaBridge workshop?
ScalaBridge workshops are usually one-day long events, which will take students through the basics of functional programming in Scala using the Creative Scala tutorial. By the end of the workshop, students will have built several "doodles" using Creative Scala and have a basic understanding of functional programming and Scala fundamentals.

## Why should you organize a ScalaBridge workshop?
One of the best ways to grow the community and to bring diversity into the community is to organize ScalaBridge workshops. To learn more about why diversity is important, please go [here](/why-diversity).

## How to organize a ScalaBridge workshop?
It is not difficult at all to become a workshop organizer. Simply follow the following steps:

1. [ Find A Date for The Workshop (3 months before the workshop date) ](/find-date)
2. [ Invite Mentors (3 months before) ](/invite-mentors)
3. [ Find Sponsorship: Food & Space (3 months before) ](/sponsorship)
4. [ Promote The Event (2/ 3 months before) ](/promote-workshop)
5. [ Event Reminders (1 month before) ](/event-reminders)
6. [ Workshop Day ](/workshop-day)
7. [ Post Workshop (1 day after) ](/post-workshop)

A ScalaBridge workshop can be associated with a conference, or it can happen independently. The recommended time to start the above process for organizing the event is 3 months before the event date.

The above process is recommended, however, not required. You're welcome to follow your own steps if you prefer.

## [Frequently Asked Questions](/faq) about ScalaBridge workshops
Check out the questions that people frequently ask! Feel free to add your questions and answers there!

## Timeline of past ScalaBridge workshops:
Please visit [here](/past-scalabridge-workshops) to view the previous workshops.

## Other Bridge Events Organizing Resources:
- [ScalaBridge Website](http://www.scalabridge.org/)
- [RailsBridge Hosting An Event](http://www.railsbridge.org/help/host)
- [RailsBridge Cookbook](https://github.com/railsbridge/docs/wiki/Cookbook)


text:
<?php

declare(strict_types=1);

namespace Documents;

use DateTimeInterface;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

/** @ODM\File */
class FileWithoutChunkSize
{
    /** @ODM\Id */
    private $id;

    /** @ODM\File\Filename */
    private $filename;

    /** @ODM\File\ChunkSize */
    private $chunkSize;

    /** @ODM\File\Length */
    private $length;

    /** @ODM\File\UploadDate */
    private $uploadDate;

    /** @ODM\File\Metadata(targetDocument=FileMetadata::class) */
    private $metadata;

    public function getId() : ?string
    {
        return $this->id;
    }

    public function getFilename() : ?string
    {
        return $this->filename;
    }

    public function getChunkSize() : ?int
    {
        return $this->chunkSize;
    }

    public function getLength() : ?int
    {
        return $this->length;
    }

    public function getUploadDate() : DateTimeInterface
    {
        return $this->uploadDate;
    }

    public function getMetadata() : ?FileMetadata
    {
        return $this->metadata;
    }

    public function getOrCreateMetadata() : FileMetadata
    {
        if (! $this->metadata) {
            $this->metadata = new FileMetadata();
        }

        return $this->getMetadata();
    }
}