text:
Are you a seasoned designer finding yourself tasked with designing for the Bootstrap grid, but aren't sure where to start? Do you find yourself limited by developers forcing their preferred front-end framework down the throat of your beautiful designs? Is your design CV riddled with print, but you want to learn to design for the web?

These are questions based on common issues we hear from creative/branding firms, freelance designers, and many others. The goal of this entry is to give you some valuable starting points on the [Bootstrap 3 framework](http://getbootstrap.com/) and show you *how to walk in unison with today's modern developers*.

Bootstrap is easy to learn and holds no limits to your creativity! Their website states "Designed for everyone, everywhere", and they mean it.

### What is Bootstrap?

Bootstrap is a powerful, mobile-first, responsive, front-end framework for building websites. It's built using the holy trinity of web development: CSS, HTML, and JavaScript.

As of this writing, Bootstrap is in version 3.3.4 with version 4.0 on the way.

### Why Developers Love Bootstrap

Developers and designers think very differently, but I don't think it's a waste of time for you to understand why developers love Bootstrap. This will help you communicate with them and understand some of the concepts that they hold near and dear.

* *It's easy to use!* Getting started with Bootstrap is a pretty quick and easy process. And it's flexible: you can use it with Less or CSS, and even Sass (if you download the Sass version).
* *The Grid.* Bootstrap uses a 12-column responsive grid. It even supports nested and offset elements. The grid can be kept responsive, or you can easily change it to a fixed layout.
* *Ready-made components.* Bootstrap has so many ready-made components and resources available. It can significantly speed up your development process. We use it to quickly prototype an idea in the browser without having to bother the visual design experts. We do this by making use of the extremely handy base styles.
* *Base styles.* Bootstrap comes with base styles for a ton of HTML elements you're going to be using anyway. It includes styles for typography, forms, images, and much more. Pre-styled components for dropdowns, nav bars, alerts, and many others come built in to Bootstrap. It so easy!
* *Modular Javascript.* As developers we like to keep thing minified to maximize page load times. This means don't go crazy with a different jQuery library to take care of every feature in an app/website. The JavaScript components built in to Bootstrap can be added or removed at will, making it quick and lightweight to add functionality. It makes it easy to manipulate things like modal windows, tooltips, alerts, and more. We can skip writing scripts all together.
* *Plays well with others.* Bootstrap can also be integrated with a variety of other frameworks and platforms, on both new sites and existing ones. You can even use just specific elements of Bootstrap alongside your existing CSS.
* *Lastly, it's DRY.* That's *D*o not *R*epeat *Y*ourself …meaning don't write the same crappy code over and over to get something to work. Bootstrap keeps everything nicely organized and compact.

### Why Designers Should Love Bootstrap

Here are some reasons why you should care about Bootstrap:

* *Great price:* FREE and open source. No need to convince anyone to get out their wallet.
* *The Grid.* Design in & around any division of a 12-column grid. Also, you can change the number of columns at different screen widths.
* *Rapid development.* See your designs realized in code more quickly than without Bootstrap.
* *Appropriate constraints.* Useful set of constraints you can rely on to account for most devices & browser, yet fully customizable, so you don't have to pull any punches creatively.
* *Focus on design.* Bootstrap takes care of the non-domain specific elements so you don't have to repeat yourself.

Designing with front-end and back-end development in mind is essential to the success of any web project, but for designers it can be difficult to understand what constraints you really need to take into account. Most of the time, if a developer tells you they can't do something, it just means that they personally aren't aware of how to accomplish it. But web development capabilities have come a long way in the last few years and the sky is the limit when it comes to creative expression.

Regardless, we've found that many designers propose "unrealistic" design solutions not because they *must have* things a certain way, but because they really don't know what's possible. If they were aware of a particular constraint or had more models shared with developers for some common ways to approach design problems, they are much more likely to find the most beautiful and functional way to do things.

Becoming familiar with a framework like Bootstrap doesn't mean you have to learn how to code.  *And it doesn't mean you have to pull any punches creatively*, it simply means taking a few extra steps to make life easier for the developers who have to work with your Bootstrap-inspired design down the line. Rather than trying to get developers to speak your language (which will require the freezing of hell and the de-clouding of heaven), you can start speaking their language and then work together to find solutions from that common framework of understanding.

----

Ok let's dig into working with Bootstrap...

### The Grid!

Making the shift to Bootstrap means getting familiar with the responsive grid, understanding the constraints of the framework and taking a mobile-first approach. Designing for Bootstrap does not mean that your creativity will be compromised in any way, or that you'll need to design something that looks unoriginal, bland or generic. Again, *useful constraints — no punches pulled*.

#### Breakpoints/Screen sizes (The Container)

Since Bootstrap's columns are percentage-based (instead of pixel-based) what happens is that the device's screen width determines the overall `container` size. But once you hit 768px wide, the `container` width only goes up incrementally at two more breakpoints.

* `xs` = 320px to 767px (100% container, minus 30px); tiny, right?
* `sm` = 768px to 991px (750px container)
* `md` = 992px - 1199px (970px container)
* `lg` = 1200px and up (1170px container)

It is possible also to override these settings. For example, you could add another even larger breakpoint for people with massive screens. All you have to do is tell the developer what width you want and they can override Bootstrap's defaults.

#### Rows

Every `container` has a `row` in order to create horizontal groups of columns. Within each `row` should be 12 columns. A `row` resets and clears each column group. You can also nest rows (more on this below) to group things deeper.

#### 12 Columns

There are no more than 12 columns in a row. Not all columns must contain visible content. All 12 columns in a row equals 100% of the container width where each column width is percentage-based depending on the container width. If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line.

#### Nested Elements

Nested rows should include a set of columns that add up to 12 or fewer (it is not required that you use all 12 available columns). Rows with column with rows with columns with rows with columns. Freakin' [Inception!](http://en.wikipedia.org/wiki/Inception)

#### Offsets

Offsets increase the left margin of a column by X columns. So you are not limited to started everything left-justified.

For example, when it comes to the magic number `12`, and we're counting columns, we could have a column that spans four, then an offset of four then a column that spans four. The two four-span columns would be equal in width, but would have gap between them of the same width.

spans 4

(offset)

spans 4

Or you can put two four-span columns after a two-span offset, resulting in two centered content areas with equal margin on either side.

(offset)

spans 4

spans 4

(empty)

#### Different numbers of columns at different widths

This is one of the most magical features of Bootstrap. You can specify that on small screens a particular content area will span 10 columns. But then when the screen is medium, that same content area will only span 5 columns, and when large only 2 columns.

It looks like this in the code:

```
	<div class="container">
	  <div class="row">
	    <div class="col-sm-10 col-md-5 col-lg-2">
	      WHOA
	    </div>
	  </div>
	</div>
```

If you're viewing this on a larger screen, you can resize your browser screen width and watch the box below change relative widths.

    WHOA 12 span10 span5 span2 span

### What is "Mobile First" anyway?

A phrase which is as common as your corner Starbucks these days, the idea of mobile-first follows the design philosophy of progressive enhancement. The idea is that you begin designing at the smallest device viewport you wish to support, then add more to the design as you progress up through the viewport widths.

This way, you start with the most important content only, and you add to it as the screen size increases. The user gets a more consistent experience across platforms, as there are no major style changes needed to fit mobile constraints. This idea isn't really specific to Bootstrap, but it should help guide you towards a way to start your designs that will work nicely into a developer's workflow and expectations.

* Start by designing a 320px wide version with content spanning 290px and 15px gutters down both sides.
* The portrait layout tablet mock-up should be 768px (standard iPad portrait width) wide and designed using the Bootstrap grid template.
* Then work your way up to larger sizes.

> You don't have to pull any punches creatively!

#### Here's a handy little reference table for column widths and canvas sizes

  			Extra-small devices
  			Small devices
  			Medium devices
  			Large devices

  			**Devices affected**
  			Mobile phones
  			Tablet, mini-tablet
  			Laptop, small desktop monitors
  			Wide-screen desktop monitors, TV screens

  			1 Column width
  			Fluid
  			63px
  			81px
  			97px

  			2 Column width
  			Fluid
  			125px
  			161px
  			195px

  			3 Column width
  			Fluid
  			185px
  			240px
  			292px

  			4 Column width
  			Fluid
  			243px
  			323px
  			390px

  			5 Column width
  			Fluid
  			312px
  			400px
  			488px

  			6 Column width
  			Fluid
  			367px
  			478px
  			585px

  			7 Column width
  			Fluid
  			424px
  			566px
  			683px

  			8 Column width
  			Fluid
  			499px
  			647px
  			780px

  			9 Column width
  			Fluid
  			548px
  			728px
  			878px

  			10 Column width
  			Fluid
  			615px
  			808px
  			975px

  			11 Column width
  			Fluid
  			648px
  			875px
  			1073px

  			12 Column width
  			Fluid
  			726px
  			964px
  			1174px

  			Design canvas width
  			320px
  			768px
  			1000px
  			1200px

  			Extra full-width image versions to create

  			290px
  			450px
  			750px
  			690px
  			Plus @2x versions of each for retina screens

### What Next?

#### Get Resources

Download these free resources from around the open source community, but specifically by [alterplay](http://alterplay.com).

This UI Kit contains all Bootstrap 3 UI controls in vector format, Glyphicons that come with Bootstrap and lots of bonus UI elements that are perfect for mocking up control and admin panels. There's also a handy grid for Illustrator in here.

[Download Bootstrap Goldmine](https://www.dropbox.com/s/f9blaky8875kg3l/Bootstrap%20Goldmine.zip?dl=1)

#### Commit

Commit to doing your next project in Bootstrap. I'll be here for you.

*Remember: Useful constraints -- you don't have to pull any punches creatively.*

#### Keep in Touch

Why should you listen to me anyway? I'm a co-founder, COO, and front-end developer by trade for [Giant Hat](http://gianthatworks.com/reid), a software development consultancy based out of St. Louis. I cut my development teeth in the early days of Bootstrap and have presented this material to top design firms in the Midwest. Please let me know how I can help you or your creative agency.

Follow me on the Tweets [@reidelliott](http://twitter.com/reidelliott)

Giant Hat at [@GiantHatWorks](http://twitter.com/gianthatworks)


text:
\hypertarget{poolallocator_8cpp}{}\section{/mnt/windows/data/programming/crapengine2/source/core/unittests/source/poolallocator.cpp File Reference}
\label{poolallocator_8cpp}\index{/mnt/windows/data/programming/crapengine2/source/core/unittests/source/poolallocator.\+cpp@{/mnt/windows/data/programming/crapengine2/source/core/unittests/source/poolallocator.\+cpp}}
{\ttfamily \#include $<$iostream$>$}\\*
{\ttfamily \#include \char`\"{}memory/poolallocator.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}Unit\+Test++.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}logger.\+h\char`\"{}}\\*

redpajama_set_name: RedPajamaGithub


text:
df-model-storage
================

[![Build Status](https://travis-ci.org/digitalfondue/df-model-storage.png?branch=master)](https://travis-ci.org/digitalfondue/df-model-storage)

Persist models in the sessionStorage and restore them on page reload (link time).

Under MIT License.

## Download
- Download directly the directive https://raw.githubusercontent.com/digitalfondue/df-model-storage/master/src/df-model-storage.js
- Clone this repository
- A release at: https://github.com/digitalfondue/df-model-storage/releases
- With bower: `$ bower install df-model-storage`

## Requirements
AngularJS and a browser that support sessionStorage.
Please note that some browsers (noticed with safari mobile) in private mode will disable the sessionStorage.

## Use/Examples:

Load the 'dfModelStorage' module in your application. See example/index.html or directly http://digitalfondue.github.io/df-model-storage/

###Persist a single field (using the ngModel directive)

```html
<input type="text" data-ng-model="testValue" data-df-model-storage>
```

###Persist a complex object

```html
<form data-df-model-storage="baseModel">
  <p><input type="text" data-ng-model="baseModel.input1"></p>
  <p><input type="text" data-ng-model="baseModel.input2"></p>
</form>
```

###Prefix the persisted model
As the name of the model will be the key of the serialized object, to avoid clashes you can prefix the model.

```html
<input type="text" data-ng-model="prefixedTestValue" data-df-model-storage data-df-prefix="index">
```

It's valid for the complex object example too:

```html
<form data-df-model-storage="prefixedBaseModel" data-df-prefix="index">
  <p><input type="text" data-ng-model="prefixedBaseModel.input1"></p>
  <p><input type="text" data-ng-model="prefixedBaseModel.input2"></p>
</form>
```

## TODO

Add some kind of minimization.


text:
[![Build status](http://buildfarm.metaborg.org/job/metaborg/job/nabl/job/master/badge/icon)](http://buildfarm.metaborg.org/job/metaborg/job/nabl/job/master/)
<!-- note that the branchname is not automatically updated in this badge -->

# NaBL: A Meta-Language for Declarative Name Binding and Scope Rules

In Spoofax, name bindings are specified in NaBL.
NaBL stands for *Name Binding Language* and the acronym is pronounced 'enable'.
Name binding is specified in terms of
  namespaces,
  binding instances (name declarations),
  bound instances (name references),
  scopes and
  imports.

## Documentation

We maintain the NaBL documentation in [our documentation repository](https://github.com/metaborg/documentation/blob/master/source/langdev/meta/lang/nabl2/index.rst).


text:
require "rails_helper"

feature "Signing in" do
  context "with correct credentials" do
    before :each do
      valid_user = FactoryGirl.create(:user)
      sign_in(valid_user.email, valid_user.password)
    end
  end

  scenario "with invalid credentials" do
    sign_in("hello@example.com", "wrongpassword")
    expect(page).to have_content t("devise.failure.invalid")
  end

  scenario "with an unconfirmed user" do
    unconfirmed_user = FactoryGirl.create(:unconfirmed_user)
    sign_in(unconfirmed_user.email, unconfirmed_user.password)
    expect(page).to have_content t("devise.failure.unconfirmed")
  end

  def sign_in(email, password)
    visit "/users/sign_in"

    within("#new_user") do
      fill_in "Email", with: email
      fill_in "Password", with: password
    end

    click_button "Sign in"
  end
end


text:
ES5Harness.registerTest({

    id: "15.4.4.16-7-b-14",

    path: "TestCases/chapter15/15.4/15.4.4/15.4.4.16/15.4.4.16-7-b-14.js",

    description: "Array.prototype.every - decreasing length of array causes index property not to be visited",

    test: function testcase() {
        var accessed = false;
        function callbackfn(val, idx, obj) {
            accessed = true;
            return idx !== 3;
        }
        var arr = [0, 1, 2, "last"];

        Object.defineProperty(arr, "0", {
            get: function () {
                arr.length = 3;
                return 0;
            },
            configurable: true
        });

        return arr.every(callbackfn) && accessed;
    },

    precondition: function prereq() {
        return fnExists(Array.prototype.every) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays();
    }

});


text:
const normalizeSpatialReference = require('./spatial-reference')
const logWarning = process.env.NODE_ENV !== 'production' && process.env.KOOP_WARNINGS !== 'suppress'
const { getCollectionCrs } = require('./helpers')

function normalizeSourceDataSpatialReference ({ inputCrs, sourceSR, collection } = {}) {
  const sourceDataSpatialReference = inputCrs || sourceSR || getCollectionCrs(collection)
  if (!sourceDataSpatialReference) return { wkid: 4326 }

  const spatialReference = normalizeSpatialReference(sourceDataSpatialReference)

  if (!spatialReference && logWarning) console.log(`WARNING: spatial reference "${sourceDataSpatialReference}" could not be normalized. Defaulting to EPSG:4326.`)

  return spatialReference || { wkid: 4326 }
}

module.exports = normalizeSourceDataSpatialReference


text:
PLEASE NOTE: This document applies to the HEAD of the source tree

If you are using a released version of Kubernetes, you should
refer to the docs that go with that version.

The latest 1.0.x release of this document can be found
[here](http://releases.k8s.io/release-1.0/examples/spark/README.md).

Documentation for other releases can be found at
[releases.k8s.io](http://releases.k8s.io).

--

# Spark example

Following this example, you will create a functional [Apache
Spark](http://spark.apache.org/) cluster using Kubernetes and
[Docker](http://docker.io).

You will setup a Spark master service and a set of
Spark workers using Spark's [standalone mode](http://spark.apache.org/docs/latest/spark-standalone.html).

For the impatient expert, jump straight to the [tl;dr](#tldr)
section.

### Sources

The Docker images are heavily based on https://github.com/mattf/docker-spark

## Step Zero: Prerequisites

This example assumes you have a Kubernetes cluster installed and
running, and that you have installed the ```kubectl``` command line
tool somewhere in your path. Please see the [getting
started](../../docs/getting-started-guides/) for installation
instructions for your platform.

## Step One: Start your Master service

The Master [service](../../docs/user-guide/services.md) is the master service
for a Spark cluster.

Use the
[`examples/spark/spark-master-controller.yaml`](spark-master-controller.yaml)
file to create a
[replication controller](../../docs/user-guide/replication-controller.md)
running the Spark Master service.

```console
$ kubectl create -f examples/spark/spark-master-controller.yaml
replicationcontrollers/spark-master-controller
```

Then, use the
[`examples/spark/spark-master-service.yaml`](spark-master-service.yaml) file to
create a logical service endpoint that Spark workers can use to access the
Master pod.

```console
$ kubectl create -f examples/spark/spark-master-service.yaml
services/spark-master
```

Optionally, you can create a service for the Spark Master WebUI at this point as
well. If you are running on a cloud provider that supports it, this will create
an external load balancer and open a firewall to the Spark Master WebUI on the
cluster. **Note:** With the existing configuration, there is **ABSOLUTELY NO**
authentication on this WebUI. With slightly more work, it would be
straightforward to put an `nginx` proxy in front to password protect it.

```console
$ kubectl create -f examples/spark/spark-webui.yaml
services/spark-webui
```

### Check to see if Master is running and accessible

```console
$ kubectl get pods
NAME                            READY     STATUS    RESTARTS   AGE
spark-master-controller-5u0q5   1/1       Running   0          8m
```

Check logs to see the status of the master. (Use the pod retrieved from the previous output.)

```sh
$ kubectl logs spark-master-controller-5u0q5
starting org.apache.spark.deploy.master.Master, logging to /opt/spark-1.5.1-bin-hadoop2.6/sbin/../logs/spark--org.apache.spark.deploy.master.Master-1-spark-master-controller-g0oao.out
Spark Command: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -cp /opt/spark-1.5.1-bin-hadoop2.6/sbin/../conf/:/opt/spark-1.5.1-bin-hadoop2.6/lib/spark-assembly-1.5.1-hadoop2.6.0.jar:/opt/spark-1.5.1-bin-hadoop2.6/lib/datanucleus-rdbms-3.2.9.jar:/opt/spark-1.5.1-bin-hadoop2.6/lib/datanucleus-core-3.2.10.jar:/opt/spark-1.5.1-bin-hadoop2.6/lib/datanucleus-api-jdo-3.2.6.jar -Xms1g -Xmx1g org.apache.spark.deploy.master.Master --ip spark-master --port 7077 --webui-port 8080
========================================
15/10/27 21:25:05 INFO Master: Registered signal handlers for [TERM, HUP, INT]
15/10/27 21:25:05 INFO SecurityManager: Changing view acls to: root
15/10/27 21:25:05 INFO SecurityManager: Changing modify acls to: root
15/10/27 21:25:05 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(root); users with modify permissions: Set(root)
15/10/27 21:25:06 INFO Slf4jLogger: Slf4jLogger started
15/10/27 21:25:06 INFO Remoting: Starting remoting
15/10/27 21:25:06 INFO Remoting: Remoting started; listening on addresses :[akka.tcp://sparkMaster@spark-master:7077]
15/10/27 21:25:06 INFO Utils: Successfully started service 'sparkMaster' on port 7077.
15/10/27 21:25:07 INFO Master: Starting Spark master at spark://spark-master:7077
15/10/27 21:25:07 INFO Master: Running Spark version 1.5.1
15/10/27 21:25:07 INFO Utils: Successfully started service 'MasterUI' on port 8080.
15/10/27 21:25:07 INFO MasterWebUI: Started MasterWebUI at http://spark-master:8080
15/10/27 21:25:07 INFO Utils: Successfully started service on port 6066.
15/10/27 21:25:07 INFO StandaloneRestServer: Started REST server for submitting applications on port 6066
15/10/27 21:25:07 INFO Master: I have been elected leader! New state: ALIVE
```

If you created the Spark WebUI and waited sufficient time for the load balancer
to be create, the `spark-webui` service should look something like this:

```console
$ kubectl describe services/spark-webui
Name:                   spark-webui
Namespace:              default
Labels:                 <none>
Selector:               component=spark-master
Type:                   LoadBalancer
IP:                     10.0.152.249
LoadBalancer Ingress:   104.197.147.190
Port:                   <unnamed>       8080/TCP
NodePort:               <unnamed>       31141/TCP
Endpoints:              10.244.1.12:8080
Session Affinity:       None
Events: [...]
```

You should now be able to visit `http://104.197.147.190:8080` and see the Spark
Master UI. *Note:* After workers connect, this UI has links to worker Web
UIs. The worker UI links do not work (the links attempt to connect to cluster
IPs).

## Step Two: Start your Spark workers

The Spark workers do the heavy lifting in a Spark cluster. They
provide execution resources and data cache capabilities for your
program.

The Spark workers need the Master service to be running.

Use the [`examples/spark/spark-worker-controller.yaml`](spark-worker-controller.yaml) file to create a
[replication controller](../../docs/user-guide/replication-controller.md) that manages the worker pods.

```console
$ kubectl create -f examples/spark/spark-worker-controller.yaml
```

### Check to see if the workers are running

If you launched the Spark WebUI, your workers should just appear in the UI when
they're ready. (It may take a little bit to pull the images and launch the
pods.) You can also interrogate the status in the following way:

```console
$ kubectl get pods
NAME                            READY     STATUS    RESTARTS   AGE
spark-master-controller-5u0q5   1/1       Running   0          25m
spark-worker-controller-e8otp   1/1       Running   0          6m
spark-worker-controller-fiivl   1/1       Running   0          6m
spark-worker-controller-ytc7o   1/1       Running   0          6m

$ kubectl logs spark-master-controller-5u0q5
[...]
15/10/26 18:20:14 INFO Master: Registering worker 10.244.1.13:53567 with 2 cores, 6.3 GB RAM
15/10/26 18:20:14 INFO Master: Registering worker 10.244.2.7:46195 with 2 cores, 6.3 GB RAM
15/10/26 18:20:14 INFO Master: Registering worker 10.244.3.8:39926 with 2 cores, 6.3 GB RAM
```

## Step Three: Start your Spark driver to launch jobs on your Spark cluster

The Spark driver is used to launch jobs into Spark cluster. You can read more about it in
[Spark architecture](https://spark.apache.org/docs/latest/cluster-overview.html).

```console
$ kubectl create -f examples/spark/spark-driver-controller.yaml
replicationcontrollers/spark-driver-controller
```

The Spark driver needs the Master service to be running.

### Check to see if the driver is running

```console
$ kubectl get pods -lcomponent=spark-driver
NAME                            READY     STATUS    RESTARTS   AGE
spark-driver-controller-vwb9c   1/1       Running   0          1m
```

## Step Four: Do something with the cluster

Use the kubectl exec to connect to Spark driver and run a pipeline.

```console
$ kubectl exec spark-driver-controller-vwb9c -it pyspark
Python 2.7.9 (default, Mar  1 2015, 12:57:24)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /__ / .__/\_,_/_/ /_/\_\   version 1.5.1
      /_/

Using Python version 2.7.9 (default, Mar  1 2015 12:57:24)
SparkContext available as sc, HiveContext available as sqlContext.
>>> sc.textFile("gs://dataflow-samples/shakespeare/*").map(lambda s: len(s.split())).sum()
939193
```

Congratulations, you just counted all of the words in all of the plays of
Shakespeare.

## Result

You now have services and replication controllers for the Spark master, Spark
workers and Spark driver.  You can take this example to the next step and start
using the Apache Spark cluster you just created, see
[Spark documentation](https://spark.apache.org/documentation.html) for more
information.

## tl;dr

```console
kubectl create -f examples/spark/spark-master-controller.yaml
kubectl create -f examples/spark/spark-master-service.yaml
kubectl create -f examples/spark/spark-webui.yaml
kubectl create -f examples/spark/spark-worker-controller.yaml
kubectl create -f examples/spark/spark-driver-controller.yaml
```

After it's setup:

```console
kubectl get pods # Make sure everything is running
kubectl get services spark-webui # Get the IP of the Spark WebUI
kubectl get pods -lcomponent=spark-driver # Get the driver pod to interact with.
```

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/spark/README.md?pixel)]()


text:
ACCEPTED

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

#### Published in
Mycologia 95(3): 431 (2003)

#### Original name
Leptosphaeria bicolor D. Hawksw., W.J. Kaiser & Ndimande, 1979

### Remarks
null


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace InputManagement
{
    /// <summary>
    /// GamePadInput holds the status of this frame's and the previous frame's
    /// GamePadState objects.
    /// </summary>
    public class GamePadInput
    {
        public GamePadState previous;
        public GamePadState current;
        protected PlayerIndex player;

        /// <summary>
        /// Create a new GamepadInput object
        /// </summary>
        /// <param name="player">Which controller you want to watch</param>
        public GamePadInput(PlayerIndex player)
        {
            this.player = player;
            previous = GamePad.GetState(player);
            current = GamePad.GetState(player);

        }

        public GamePadInput()
        {
            this.player = PlayerIndex.One;
            previous = GamePad.GetState(player);
            current = GamePad.GetState(player);
        }

        public bool FramePress(Buttons button)
        {
            bool pressedNow = previous.IsButtonDown(button);
            bool upBefore = current.IsButtonUp(button);
            return pressedNow && upBefore;
        }

        public bool FrameRelease(Buttons button)
        {
            bool upNow = previous.IsButtonUp(button);
            bool pressedBefore = current.IsButtonDown(button);
            return pressedBefore && upNow;
        }

        public bool IsDown(Buttons button)
        {
            return current.IsButtonDown(button);
        }

        public bool IsUp(Buttons button)
        {
            return current.IsButtonDown(button);
        }

        /// <summary>
        /// Call this at the begining of each Update call
        /// </summary>
        public void Update()
        {
            previous = current;
            current = GamePad.GetState(player);
        }
    }
}


text:
using Nwazet.Commerce.Permissions;
using Orchard.Environment.Extensions;
using Orchard.Localization;
using Orchard.Security;
using Orchard.UI.Navigation;

namespace Nwazet.Commerce.Menus {
    [OrchardFeature("Nwazet.Commerce")]
    public class ProductAdminMenu : INavigationProvider {
        public string MenuName {
            get { return "admin"; }
        }

        public ProductAdminMenu() {
            T = NullLocalizer.Instance;
        }

        public Localizer T { get; set; }

        public void GetNavigation(NavigationBuilder builder) {
            builder
                .AddImageSet("nwazet-commerce")
                .Add(item => item
                    .Caption(T("Commerce"))
                    .Position("2")
                    .LinkToFirstChild(false)

                    .Add(subItem => subItem
                        .Caption(T("Products"))
                        .Position("2.3")
                        .Action("List", "ProductAdmin", new { area = "Nwazet.Commerce" })
                        .Permission(CommercePermissions.ManageProducts)
                    )
                );
        }
    }
}


text:
require_relative 'test_helper'

describe "Quit Command" do
  include TestDsl

  it "must quit if user confirmed" do
    Debugger::QuitCommand.any_instance.expects(:exit!)
    enter 'quit', 'y'
    debug_file 'quit'
    check_output_includes "Really quit? (y/n)", interface.confirm_queue
  end

  it "must not quit if user didn't confirm" do
    Debugger::QuitCommand.any_instance.expects(:exit!).never
    enter 'quit', 'n'
    debug_file 'quit'
    check_output_includes "Really quit? (y/n)", interface.confirm_queue
  end

  it "must quit immediatly if used with !" do
    Debugger::QuitCommand.any_instance.expects(:exit!)
    enter 'quit!'
    debug_file 'quit'
    check_output_doesnt_include "Really quit? (y/n)", interface.confirm_queue
  end

  it "must quit immediatly if used with 'unconditionally'" do
    Debugger::QuitCommand.any_instance.expects(:exit!)
    enter 'quit unconditionally'
    debug_file 'quit'
    check_output_doesnt_include "Really quit? (y/n)", interface.confirm_queue
  end

  it "must finalize interface before quitting" do
    Debugger::QuitCommand.any_instance.stubs(:exit!)
    interface.expects(:finalize)
    enter 'quit!'
    debug_file 'quit'
  end

  it "must quit if used 'exit' alias" do
    Debugger::QuitCommand.any_instance.expects(:exit!)
    enter 'exit!'
    debug_file 'quit'
  end

  describe "Post Mortem" do
    it "must work in post-mortem mode"
    0.times do
      Debugger::QuitCommand.any_instance.expects(:exit!)
      enter 'cont', 'exit!'
      debug_file 'post_mortem'
    end
  end

end


text:
from ciscoconfparse import CiscoConfParse
c_cfg = CiscoConfParse("cisco_ipsec.txt")
cryp_map = c_cfg.find_objects(r"^crypto map")

for element in cryp_map:
    print element.text
    for child in element.children:
        print child.text


text:
==============
zypper-minimal
==============
Base element for creating minimal SUSE-based images

This element is incomplete by itself so you probaby want to use it along
with the opensuse-minimal one. It requires 'zypper' to be installed on the
host.

Repositories
------------

This element expects the `ZYPPER_REPOS` variable to be exported by the
operating system element. This variable contains repository mappings in
the following format: `${repo_name}==>${repo_url}`. For example::

 ZYPPER_REPOS="update=>http://download.opensuse.org/update/leap/42.1/oss/ "
 ZYPPER_REPOS+="oss=>http://download.opensuse.org/distribution/leap/42.1/repo/oss/"
 export ZYPPER_REPOS


text:
perooon
=======

Example application by seezoo-framework


text:
describe('Platforms', function() {
  require('./platforms/saucelabs-tunnel')
})


text:
'use strict';

const WebhookMessage = require('./model/v2/activity-incoming').WebhookMessage;
const HistoryDisclosed = require('./events/history-disclosed');
const TopicUpdated = require('./events/topic-updated');
const UserAdded = require('./events/user-added');
const UserRemoved = require('./events/user-removed');
const ContactNotification = require('./events/contact-notification');
const Message = require('./events/message');
const Attachment = require('./events/attachment');
const Enums = require('./model/v2/enums');

/**
 * types of events emitted by the Bot Platform
 *
 * for 'error' type, the associated event object is Error
 * for anything else, the associated event object is inheritor of Event
 */
const EventTypes = {
    Error: 'error',
    PersonalMessage: 'personalMessage',
    GroupMessage: 'groupMessage',
    Message: 'message',
    ThreadBotAdded: 'threadBotAdded',
    ThreadBotRemoved: 'threadBotRemoved',
    ThreadMemberAdded: 'threadAddMember',
    ThreadMemberRemoved: 'threadRemoveMember',
    ThreadTopicUpdate: 'threadTopicUpdated',
    ThreadHistoryDisclosedUpdate: 'threadHistoryDisclosedUpdate',
    ContactAdded: 'contactAdded',
    ContactRemoved: 'contactRemoved',
    Attachment: 'attachment'
};

/**
 * wrapper class around events emitted by the Bot Platform + tiny metadata
 *
 * @property {string} type - event type id, should be one of EventTypes
 * @property {object} event - event object; should be instance of Error for 'error' type, or instance of Event inheritor for everything else
 * @property {string} replyTo - optional; if set, indicates the other party where the eventual response should be submitted to
 */
class WebhookEvent
{
    /**
     *
     * @param type
     * @param eventObject
     * @param replyTo
     */
    constructor(type, eventObject, replyTo)
    {
        this.type = type;
        this.replyTo = replyTo;
        this.eventObject = eventObject;
    }
}

function _isGroupChatEvent(event)
{
    if(event == null || event.to == null) return false;
    return /@thread.skype/.test(event.to);
}

/**
 *  creates a WebhookEvent of error type
 *
 * @param {string} errorText - text of the error to be emitted with the error event

 * @returns {WebhookEvent} WebhookEvent of error type
 */
function fromError(errorText)
{
    return new WebhookEvent(EventTypes.Error, new Error(errorText));
}

/**
 *  creates a WebhookEvent from instantiated event
 *
 * @param {string} type - event type, should be one from EventTypes
 * @param {object} eventObject - instantiated event object
 * @param {string} replyTo - optional, set to eventObject.to by default; identification of the other party used for sending optional response

 * @returns {WebhookEvent} WebhookEvent of appropriate EventType type
 */
function fromData(type, eventObject, replyTo)
{
    if(typeof replyTo == 'undefined' && eventObject != null && eventObject.to != null) replyTo = eventObject.to;
    return new WebhookEvent(type, eventObject, replyTo);
}

/**
 *  converts the incoming Messaging service 'webhook' message into array of events
 *
 * @param {string} botId - configured bot's id (used for distinguishing of contact list events related to the bot-related and the other-party-related)
 * @param {array} requestData - webhook message request received from Messaging service, which should be array of objects

 * @returns {array} array of WebhookEvent instances
 */
function processRequestData(botId, requestData)
{
    let eventsOut = [];
    let message = null;

    try {
        message = new WebhookMessage(requestData);
    }
    catch(err)
    {
        eventsOut.push(fromError(`Incoming webhooks request could not be parsed, error: ${err.message}, request: ${JSON.stringify(requestData)}`));
        return eventsOut;
    }

    let errors = message.validate();
    if(errors.length > 0)
    {
        eventsOut.push(fromError(`Incoming webhooks request was invalid, errors: ${errors}, request: ${JSON.stringify(requestData)}`));
        return eventsOut;
    }

    message.activities.forEach(item => {
        try {
            switch (item.activity) {
            case Enums.IncomingActivityType.ConversationUpdate:
                eventsOut = eventsOut.concat(_convertConversationUpdate(botId, item));
                break;
            case Enums.IncomingActivityType.ContactRelationUpdate:
                eventsOut = eventsOut.concat(_convertContactRelationUpdate(item));
                break;
            case Enums.IncomingActivityType.Message:
                eventsOut = eventsOut.concat(_convertMessage(item));
                break;
            case Enums.IncomingActivityType.Attachment:
                eventsOut = eventsOut.concat(_convertAttachment(item));
                break;
            default:
                eventsOut.push(fromError(`activity type ${item.activity} is unsupported by Messaging service v2`));
            }
        }
        catch(error)
        {
            eventsOut.push(fromError(`failed to convert ${item.activity} to an event, error: ${error.message}`));
        }
    });

    return eventsOut;
}

function _convertConversationUpdate(botId, event)
{
    let eventsOut = [];

    if(event.historyDisclosed != null)
    {
        eventsOut.push(
            fromData(
                EventTypes.ThreadHistoryDisclosedUpdate,
                new HistoryDisclosed({
                    from : event.from,
                    to: event.to,
                    historyDisclosed: event.historyDisclosed,
                    eventTime: event.time
                })));
    }

    if(event.topicName != null)
    {
        eventsOut.push(
            fromData(
                EventTypes.ThreadTopicUpdate,
                new TopicUpdated({
                    from : event.from,
                    to: event.to,
                    topic: event.topicName,
                    eventTime: event.time
                })));
    }

    if(event.membersAdded != null)
    {
        event.membersAdded.forEach(item => {
            eventsOut.push(
                fromData(
                    item.indexOf(botId) != -1 ? EventTypes.ThreadBotAdded : EventTypes.ThreadMemberAdded,
                    new UserAdded({
                        from : event.from,
                        to: event.to,
                        targets: [ item ],
                        eventTime: event.time
                    })));
        });
    }

    if(event.membersRemoved != null)
    {
        event.membersRemoved.forEach(item => {
            eventsOut.push(
                fromData(
                    item.indexOf(botId) != -1 ? EventTypes.ThreadBotRemoved : EventTypes.ThreadMemberRemoved,
                    new UserRemoved({
                        from : event.from,
                        to: event.to,
                        targets: [ item ],
                        eventTime: event.time
                    })));
        });
    }

    return eventsOut;
}

function _convertContactRelationUpdate(event)
{
    let eventsOut = [];

    if (event.action === 'add') {
        eventsOut.push(
            fromData(
                EventTypes.ContactAdded,
                new ContactNotification({
                    from : event.from,
                    to: event.to,
                    action: event.action,
                    fromDisplayName: event.fromDisplayName,
                    eventTime: event.time
                }),
                event.from
        ));
    } else if (event.action === 'remove') {
        eventsOut.push(
            fromData(
                EventTypes.ContactRemoved,
                new ContactNotification({
                    from : event.from,
                    to: event.to,
                    action: event.action,
                    fromDisplayName: event.fromDisplayName,
                    eventTime: event.time
                }),
                event.from
        ));
    }

    return eventsOut;
}

function _convertMessage(event)
{
    let eventsOut = [];

    eventsOut.push(
        fromData(
            EventTypes.Message,
            new Message({
                from : event.from,
                to: event.to,
                content: event.content,
                contentType: 'text',
                messageId: event.id,
                eventTime: event.time
            }),
            null
        ));

    return eventsOut;
}

function _convertAttachment(event)
{
    let eventsOut = [];

    eventsOut.push(
        fromData(
            EventTypes.Attachment,
            new Attachment({
                from : event.from,
                to: event.to,
                name: event.name,
                attachmentType: event.type,
                views: event.views,
                eventTime: event.time,
                id: event.id
            }),
            _isGroupChatEvent(event) ? event.to : event.from
        ));

    return eventsOut;
}

module.exports = { WebhookEvent, processRequestData, fromError, fromData, EventTypes };


text:
package fm.last.moji.tracker;

import java.net.InetSocketAddress;
import java.net.Proxy;
import java.util.Set;

/**
 * Provides usable {@link Tracker} instances for communicating with the MogileFS 'backend'.
 */
public interface TrackerFactory {

  /**
   * Gets a new usable {@link Tracker}.
   *
   * @return A valid tracker.
   * @throws TrackerException If there was a problem obtaining a tracker.
   */
  Tracker getTracker() throws TrackerException;

  /**
   * The host addresses of {@link Tracker Trackers} that this factory may return.
   *
   * @return A set of host addresses.
   */
  Set<InetSocketAddress> getAddresses();

  /**
   * The network proxy used by the {@link Tracker Trackers} returned from this factory.
   *
   * @return The proxy, or {@link Proxy#NO_PROXY NO_PROXY} if no proxy has been set.
   */
  Proxy getProxy();

}


text:
rot = {}
rot.__index = rot

--- Are 2 rotations equal.
-- Note that rot(a) and rot(a + 2 * math.pi) are equal.
-- @tparam rot a
-- @tparam rot b
-- @treturn bool
function rot.__eq(a, b)
    return a.s == b.s and a.c == b.c
end

--- Convert rot to "(s, c)" string.
-- @tparam rot a
-- @treturn string
function rot.__tostring(a)
    return "(" .. a.s .. ", " .. a.c .. ")"
end

--- rot constructor.
-- @number s Angle, in radians
-- @number[opt] c Cosine of angle. If it's specified, then 's' is treated as sine of angle
-- @usage local r = rot(math.pi);
-- @usage local r = rot(math.sin(math.pi), math.cos(math.pi));
-- @function rot
function rot.new(s, c)
    if c ~= nil then
        return setmetatable({ s = s, c = c }, rot)
    else
        return setmetatable({ s = math.sin(s), c = math.cos(s) }, rot)
    end
end

--- Get rot angle.
-- @treturn number Angle in range [-math.pi, math.pi]
function rot:getAngle()
    return math.atan2(self.s, self.c);
end

--- Get x-axis for this rotation.
-- @treturn vec2
function rot:getXAxis()
    return vec2(self.c, self.s);
end

--- Get y-axis for this rotation.
-- @treturn vec2
function rot:getYAxis()
    return vec2(-self.s, self.c);
end

--- Clone the rot.
-- @treturn rot
function rot:clone()
    return rot.new(self.s, self.c)
end

--- Unpack the rot.
-- @treturn number
-- @treturn number
function rot:unpack()
    return self.s, self.c
end

--- Angle sine.
-- @tfield number s

--- Angle cosine.
-- @tfield number c

setmetatable(rot, { __call = function(_, ...) return rot.new(...) end })


text:
<?xml version="1.0" encoding="UTF-8"?>
<testng-results skipped="1" failed="5" total="16" passed="10">
  <reporter-output>
  </reporter-output>
  <suite name="Sample test suite" duration-ms="9000" started-at="2016-01-01T00:00:00Z" finished-at="2016-01-01T00:00:09Z">
    <groups>
    </groups>
    <test name="Surefire test" duration-ms="6675" started-at="2017-02-10T12:58:13Z" finished-at="2017-02-10T12:58:20Z">
      <class name="com.consol.citrus.samples.Test_1_IT">
        <test-method status="PASS" signature="prepareTest()[pri:0, instance:com.consol.citrus.samples.Test_1_IT@50a638b5]" name="prepateTest" is-config="true" duration-ms="1" started-at="2017-02-10T12:00:00Z" finished-at="2017-02-10T12:00:01Z">
          <reporter-output>
          </reporter-output>
        </test-method>
        <test-method status="PASS" signature="test_1()[pri:0, instance:com.consol.citrus.samples.Test_1_IT@50a638b5]" name="test_1" duration-ms="4000" started-at="2017-02-10T12:00:01Z" finished-at="2017-02-10T12:00:05Z">
          <reporter-output>
          </reporter-output>
        </test-method>
      </class>
      <class name="com.consol.citrus.samples.Test_2_IT">
        <test-method status="PASS" signature="test_2()[pri:0, instance:com.consol.citrus.samples.Test_2_IT@50a638b5]" name="test_2" duration-ms="5000" started-at="2017-02-10T12:00:05Z" finished-at="2017-02-10T12:00:10Z">
          <reporter-output>
          </reporter-output>
        </test-method>
      </class>
      <class name="com.consol.citrus.samples.Test_3_IT">
        <test-method status="FAIL" signature="test_3()[pri:0, instance:com.consol.citrus.samples.Test_3_IT@50a638b5]" name="test_3" duration-ms="6000" started-at="2017-02-10T12:00:10Z" finished-at="2017-02-10T12:00:16Z">
          <exception class="com.consol.citrus.exceptions.TestCaseFailedException">
            <message>
              <![CDATA[Test case failed]]>
            </message>
            <full-stacktrace>com.consol.citrus.exceptions.TestCaseFailedException: Test case failed
              Caused by: com.consol.citrus.exceptions.ValidationException: Validation failed: Node value not equal for element 'foo', expected 'true' but was 'false'
              Caused by: java.lang.IllegalArgumentException: Node value not equal for element 'foo', expected 'true' but was 'false'
            </full-stacktrace>
          </exception>
          <reporter-output>
          </reporter-output>
        </test-method>
      </class>
    </test>
  </suite> <!-- Surefire suite -->
</testng-results>


text:
import Image from "next/image";
import Link from "next/link";
import React from "react";
import useSWR from "swr";
import fetcher from "../utils/fetcher";
import ArticleTeaser from "./ArticleTeaser";
import ArticleTeaserSmall from "./ArticleTeaserSmall";

const IndexArticles = ({ posts }) => {
  const { data: wdPosts, error: wdPostsError } = useSWR(
    "/api/wd-posts",
    fetcher
  );

  return (

From the Blog

      {posts?.slice(0, 1).map(({ title, slug, date, abstract, tags }) => (
        <ArticleTeaser
          key={slug}
          title={title}
          date={date}
          slug={slug}
          abstract={abstract}
          tags={tags}
          variant="small"
        />
      ))}

        {posts?.slice(1, 7).map(({ title, date, slug }) => (
          <ArticleTeaserSmall
            key={slug}
            title={title}
            date={date}
            slug={slug}
          />
        ))}

        <Link href="/blog/">
          Read more on my Blog
        </Link>

          <Image
            src="/img/wd.svg"
            alt="Working Draft Logo"
            width={64}
            height={64}
          />

        Working Draft Podcast

Listen to the latest episode of the Working Draft podcast.

        {wdPosts?.map(({ title, url, date }) => (
          <ArticleTeaserSmall
            key={url}
            title={title}
            url={url}
            date={date}
            description={undefined}
          />
        ))}

        <ArticleTeaserSmall
          title="and more…"
          url="https://workingdraft.de/"
          description=""
        />

        <Link href="/podcasting">
          More about my Podcasting
        </Link>

  );
};

export default IndexArticles;


text:
package com.intellij.history.integration;

import com.intellij.history.core.LabelImpl;
import com.intellij.history.core.revisions.ChangeRevision;
import com.intellij.history.core.revisions.Revision;
import com.intellij.history.integration.ui.models.HistoryDialogModel;
import com.intellij.history.integration.ui.models.RevisionItem;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;

import java.util.List;

public class LocalHistoryUtil {

  static int findRevisionIndexToRevert(@NotNull HistoryDialogModel dirHistoryModel, @NotNull LabelImpl label) {
    List<RevisionItem> revs = dirHistoryModel.getRevisions();
    for (int i = 0; i < revs.size(); i++) {
      final RevisionItem rev = revs.get(i);
      if (isLabelRevision(rev, label)) return i;
      //when lvcs model is not constructed yet or is empty then PutLabelChange is created but without label, so we need to scan revisions themselves
      if (isChangeWithId(rev.revision, label.getLabelChangeId())) return i;
    }
    return -1;
  }

  static boolean isLabelRevision(@NotNull RevisionItem rev, @NotNull LabelImpl label) {
    final long targetChangeId = label.getLabelChangeId();
    return ContainerUtil.exists(rev.labels, revision -> isChangeWithId(revision, targetChangeId));
  }

  private static boolean isChangeWithId(@NotNull Revision revision, long targetChangeId) {
    return revision instanceof ChangeRevision && ((ChangeRevision)revision).containsChangeWithId(targetChangeId);
  }
}


text:
package org.apache.hadoop.yarn.server.resourcemanager.amlauncher;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.service.AbstractService;
import org.apache.hadoop.yarn.event.EventHandler;
import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt;

public class ApplicationMasterLauncher extends AbstractService implements
    EventHandler<AMLauncherEvent> {
  private static final Log LOG = LogFactory.getLog(
      ApplicationMasterLauncher.class);
  private final ThreadPoolExecutor launcherPool;
  private LauncherThread launcherHandlingThread;

  private final BlockingQueue<Runnable> masterEvents
    = new LinkedBlockingQueue<Runnable>();

  protected final RMContext context;

  public ApplicationMasterLauncher(RMContext context) {
    super(ApplicationMasterLauncher.class.getName());
    this.context = context;
    this.launcherPool = new ThreadPoolExecutor(10, 10, 1,
        TimeUnit.HOURS, new LinkedBlockingQueue<Runnable>());
    this.launcherHandlingThread = new LauncherThread();
  }

  @Override
  protected void serviceStart() throws Exception {
    launcherHandlingThread.start();
    super.serviceStart();
  }

  protected Runnable createRunnableLauncher(RMAppAttempt application,
      AMLauncherEventType event) {
    Runnable launcher =
        new AMLauncher(context, application, event, getConfig());
    return launcher;
  }

  private void launch(RMAppAttempt application) {
    Runnable launcher = createRunnableLauncher(application,
        AMLauncherEventType.LAUNCH);
    masterEvents.add(launcher);
  }

  @Override
  protected void serviceStop() throws Exception {
    launcherHandlingThread.interrupt();
    try {
      launcherHandlingThread.join();
    } catch (InterruptedException ie) {
      LOG.info(launcherHandlingThread.getName() + " interrupted during join ",
          ie);    }
    launcherPool.shutdown();
  }

  private class LauncherThread extends Thread {

    public LauncherThread() {
      super("ApplicationMaster Launcher");
    }

    @Override
    public void run() {
      while (!this.isInterrupted()) {
        Runnable toLaunch;
        try {
          toLaunch = masterEvents.take();
          launcherPool.execute(toLaunch);
        } catch (InterruptedException e) {
          LOG.warn(this.getClass().getName() + " interrupted. Returning.");
          return;
        }
      }
    }
  }

  private void cleanup(RMAppAttempt application) {
    Runnable launcher = createRunnableLauncher(application, AMLauncherEventType.CLEANUP);
    masterEvents.add(launcher);
  }

  @Override
  public synchronized void  handle(AMLauncherEvent appEvent) {
    AMLauncherEventType event = appEvent.getType();
    RMAppAttempt application = appEvent.getAppAttempt();
    switch (event) {
    case LAUNCH:
      launch(application);
      break;
    case CLEANUP:
      cleanup(application);
    default:
      break;
    }
  }
}


text:
// flow-typed signature: d1b2e98db57131dd1d82f13d87bb778f
// flow-typed version: <<STUB>>/is-plain-object_v^2.0.1/flow_v0.37.1

/**
 * This is an autogenerated libdef stub for:
 *
 *   'is-plain-object'
 *
 * Fill this stub out by replacing all the `any` types.
 *
 * Once filled out, we encourage you to share your work with the
 * community by sending a pull request to:
 * https://github.com/flowtype/flow-typed
 */

declare module 'is-plain-object' {
  declare module.exports: any;
}

/**
 * We include stubs for each file inside this npm package in case you need to
 * require those files directly. Feel free to delete any files that aren't
 * needed.
 */

// Filename aliases
declare module 'is-plain-object/index' {
  declare module.exports: $Exports<'is-plain-object'>;
}
declare module 'is-plain-object/index.js' {
  declare module.exports: $Exports<'is-plain-object'>;
}


text:
/**
 * \file		CommentedParameter.hpp
 * \author		fcaillaud
 * \version 	1.0
 * \date     	2 Avril 2014
 * \brief     	Fichier décrivant la classe CommentedParameter.
 * \details		Classe représentant un paramètre commenté au sein de l'Opt(ion)Getter.
 */

#ifndef OPTGETTER_COMMENTEDPARAMETER
#define OPTGETTER_COMMENTEDPARAMETER

#include "Parameter.hpp"

/**
 * \namespace 	optg
 * \brief 		Nom de domaine tertiaire, partie utilitaire.
 * \todo 		Migrer vers le namespace gu.
 */
namespace optg
{

	/**
	 * \class 	CommentedParameter
	 * \brief 	Classe représentant un paramètre commenté au sein de l'Opt(ion)Getter.
	 */
	class CommentedParameter : public Parameter
	{

		public:

			/**
			 * Constructeur paramétré (pas de constructeur par défaut).
			 * \param 	pValue 	La valeur du paramètre (en chaîne de caractères).
			 * \param 	pType 	Le type du paramètre (PType).
			 * \details	Stocke la valeur du paramètre sous forme de char * mais avec
			 *			la vrai valeur de celui-ci en fonction de son type. Initialise
			 *			le nom et le commentaire à "undefined".
			 */
			CommentedParameter(const char *, PType);

			/**
			 * Constructeur paramétré (pas de constructeur par défaut).
			 * \param 	pValue 		La valeur du paramètre (en chaîne de caractères).
			 * \param 	pType 		Le type du paramètre (PType).
			 * \param 	pName 		Le nom du paramètre.
			 * \param 	pComment 	Le commentaire associé au paramètre.
			 * \details	Stocke la valeur du paramètre sous forme de char * mais avec
			 *			la vrai valeur de celui-ci en fonction de son type.
			 */
			CommentedParameter(const char *, PType, std::string, std::string);

			/**
			 * Destructeur.
			 */
			~CommentedParameter();

			/**
			 * Récupération du nom du paramètre.
			 * \return 	Le nom du paramètre.
			 */
			std::string GetName();

			/**
			 * Récupération du commentaire associé au paramètre.
			 * \return 	le commentaire associé au paramètre.
			 */
			std::string GetComment();

			/**
			 * Affichage du nom (s'il existe), de la valeur et du commentaire (s'il existe) du paramètre.
			 * \todo 	Faire la même chose avec Parameter.
			 */
			void Print();

		private:

			/**
			 * \brief 	Nom du paramètre.
			 */
			std::string mName;

			/**
			 * \brief 	Commentaire associé au paramètre.
			 */
			std::string mComment;

	};

}

#endif


text:
package db

import anorm._
import io.apibuilder.internal.v0.models.{Task, TaskData}
import io.apibuilder.internal.v0.models.json._
import io.apibuilder.api.v0.models.User
import io.flow.postgresql.Query
import javax.inject.{Inject, Named, Singleton}
import org.joda.time.DateTime
import play.api.db._
import play.api.libs.json._
import java.util.UUID

/**
  * A task represents a bit of work that should be completed asynchronously. Example tasks include:
  *
  *   - generating a diff between two versions of a service
  *   - updates a search index for a particular service
  *
  * Tasks provide for the following semantics:
  *   - transactionally record to execute a task
  *   - at least once execution
  *   - near real time execution
  *   - mostly sequential execution of tasks (but not guaranteed)
  *
  * The implementation works by:
  *   - caller inserts a task transactionally
  *   - to trigger real time execution, send a TaskCreated message to
  *     the Main Actor - send this AFTER the transaction commits or the
  *     actor may not see the task
  *   - periodically, the task system picks up tasks that have not
  *     been processed and executes them
  */
@Singleton
class TasksDao @Inject() (
  @NamedDatabase("default") db: Database,
  @Named("main-actor") mainActor: akka.actor.ActorRef
) {

  private[this] val dbHelpers = DbHelpers(db, "tasks")

  private[this] val BaseQuery = Query("""
    select tasks.guid,
           tasks.data::text,
           tasks.number_attempts,
           tasks.last_error
      from tasks
  """)

  val IncrementNumberAttemptsQuery = """
    update tasks
       set number_attempts = number_attempts + 1,
           updated_by_guid = {updated_by_guid}::uuid
     where guid = {guid}::uuid
  """

  val RecordErrorQuery = """
    update tasks
       set last_error = {last_error},
           updated_by_guid = {updated_by_guid}::uuid
     where guid = {guid}::uuid
  """

  private[this] val InsertQuery = """
    insert into tasks
    (guid, data, created_by_guid, updated_by_guid)
    values
    ({guid}::uuid, {data}::json, {created_by_guid}::uuid, {updated_by_guid}::uuid)
  """

  private[this] val PurgeQuery = """
    delete from tasks where guid = {guid}::uuid
  """

  def create(createdBy: User, data: TaskData): UUID = {
    val taskGuid = db.withConnection { implicit c =>
      insert(c, createdBy, data)
    }
    mainActor ! actors.MainActor.Messages.TaskCreated(taskGuid)
    taskGuid
  }

  private[db] def insert(implicit c: java.sql.Connection, createdBy: User, data: TaskData): UUID = {
    val guid = UUID.randomUUID

    SQL(InsertQuery).on(
      Symbol("guid") -> guid,
      Symbol("data") -> Json.toJson(data).toString,
      Symbol("created_by_guid") -> createdBy.guid,
      Symbol("updated_by_guid") -> createdBy.guid
    ).execute()

    guid
  }

  def softDelete(deletedBy: User, task: Task): Unit = {
    dbHelpers.delete(deletedBy, task.guid)
  }

  def purge(deletedBy: User, task: Task): Unit = {
    db.withConnection { implicit c =>
      SQL(PurgeQuery).on(Symbol("guid") -> task.guid).execute()
    }
  }

  def incrementNumberAttempts(user: User, task: Task): Unit = {
    db.withConnection { implicit c =>
      SQL(IncrementNumberAttemptsQuery).on(
        Symbol("guid") -> task.guid,
        Symbol("updated_by_guid") -> user.guid
      ).execute()
    }
  }

  def recordError(user: User, task: Task, error: Throwable): Unit = {
    val sw = new java.io.StringWriter
    error.printStackTrace(new java.io.PrintWriter(sw))
    recordError(user, task, sw.toString)
  }

  def recordError(user: User, task: Task, error: String): Unit = {
    db.withConnection { implicit c =>
      SQL(RecordErrorQuery).on(
        Symbol("guid") -> task.guid,
        Symbol("last_error") -> error,
        Symbol("updated_by_guid") -> user.guid
      ).execute()
    }
  }

  def findByGuid(guid: UUID): Option[Task] = {
    findAll(guid = Some(guid), limit = 1).headOption
  }

  def findAll(
    guid: Option[UUID] = None,
    nOrFewerAttempts: Option[Long] = None,
    nOrMoreAttempts: Option[Long] = None,
    createdOnOrBefore: Option[DateTime] = None,
    createdOnOrAfter: Option[DateTime] = None,
    isDeleted: Option[Boolean] = Some(false),
    deletedAtLeastNDaysAgo: Option[Long] = None,
    limit: Long = 25,
    offset: Long = 0
  ): Seq[Task] = {
    deletedAtLeastNDaysAgo.foreach { _ =>
      isDeleted match {
        case None | Some(true) => // no-op
        case Some(false) => sys.error("When filtering by deletedAtLeastNDaysAgo, you must also set isDeleted")
      }
    }

    db.withConnection { implicit c =>
      BaseQuery.
        equals("tasks.guid", guid).
        lessThanOrEquals("tasks.number_attempts", nOrFewerAttempts).
        greaterThanOrEquals("tasks.number_attempts", nOrMoreAttempts).
        lessThanOrEquals("tasks.created_at", createdOnOrBefore).
        greaterThanOrEquals("tasks.created_at", createdOnOrAfter).
        and(isDeleted.map {
          Filters.isDeleted("tasks", _)
        }).
        lessThanOrEquals("tasks.deleted_at", deletedAtLeastNDaysAgo.map(days => DateTime.now.minusDays(days.toInt))).
        orderBy("tasks.number_attempts, tasks.created_at").
        limit(limit).
        offset(offset).
        anormSql().as(
        parser().*
      )
    }
  }

  private[this] def parser(): RowParser[Task] = {
    SqlParser.get[UUID]("guid") ~
    SqlParser.str("data") ~
    SqlParser.long("number_attempts") ~
    SqlParser.str("last_error").? map {
      case guid ~ data ~ numberAttempts ~ lastError => {
        Task(
          guid = guid,
          data = Json.parse(data).as[TaskData],
          numberAttempts = numberAttempts,
          lastError = lastError
        )
      }
    }
  }

}


text:
<?php

namespace phpseclib\Math\BigInteger\Engines\BCMath;

use phpseclib\Math\BigInteger\Engines\BCMath;

/**
 * Sliding Window Exponentiation Engine
 *
 * @package PHP
 * @author  Jim Wigginton <terrafrost@php.net>
 * @access  public
 */
abstract class Base extends BCMath
{
    /**#@+
     * @access private
    */
    /**
     * Cache constants
     *
     * $cache[self::VARIABLE] tells us whether or not the cached data is still valid.
     */
    const VARIABLE = 0;
    /**
     * $cache[self::DATA] contains the cached data.
     */
    const DATA = 1;
    /**#@-*/

    /**
     * Test for engine validity
     *
     * @return bool
     */
    public static function isValidEngine()
    {
        return static::class != __CLASS__;
    }

    /**
     * Performs modular exponentiation.
     *
     * @param \phpseclib\Math\BigInteger\Engines\BCMath $x
     * @param \phpseclib\Math\BigInteger\Engines\BCMath $e
     * @param \phpseclib\Math\BigInteger\Engines\BCMath $n
     * @param string $class
     * @return \phpseclib\Math\BigInteger\Engines\BCMath
     */
    protected static function powModHelper(BCMath $x, BCMath $e, BCMath $n, $class)
    {
        if (empty($e->value)) {
            $temp = new $class();
            $temp->value = '1';
            return $x->normalize($temp);
        }

        return $x->normalize(static::slidingWindow($x, $e, $n, $class));
    }

    /**
     * Modular reduction preparation
     *
     * @param string $x
     * @param string $n
     * @param string $class
     * @see self::slidingWindow()
     * @return string
     */
    protected static function prepareReduce($x, $n, $class)
    {
        return static::reduce($x, $n);
    }

    /**
     * Modular multiply
     *
     * @param string $x
     * @param string $y
     * @param string $n
     * @param string $class
     * @see self::slidingWindow()
     * @return string
     */
    protected static function multiplyReduce($x, $y, $n, $class)
    {
        return static::reduce(bcmul($x, $y), $n);
    }

    /**
     * Modular square
     *
     * @param string $x
     * @param string $n
     * @param string $class
     * @see self::slidingWindow()
     * @return string
     */
    protected static function squareReduce($x, $n, $class)
    {
        return static::reduce(bcmul($x, $x), $n);
    }
}


text:
package org.socraticgrid.hl7.services.eps.clients.pspublicationintervention;

import static org.junit.Assert.*;

import org.junit.Test;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:Test-PublicationIntervention.xml" })
@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)

public class PSPublicationInterventionServiceTest {
	@Autowired
	private ApplicationContext applicationContext;

	@Autowired
	@InjectMocks
	private PSPublicationInterventionService service;

	//@Mock(name = "dlvMgr")
	///DeliveryManager deliveryMgr;
	//@Mock(name = "msgMgr")
	//MessageManager mockMsgMgr;

	@Before
	public void setUp() {
		MockitoAnnotations.initMocks(this);
	}

	@Test
	public void test() {
		//fail("Not yet implemented");
	}

}


text:
@-webkit-keyframes ngdialog-fadeout {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes ngdialog-fadeout {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@-webkit-keyframes ngdialog-fadein {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes ngdialog-fadein {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.ngdialog {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.ngdialog *,
.ngdialog *:before,
.ngdialog *:after {
  -webkit-box-sizing: inherit;
  -moz-box-sizing: inherit;
  box-sizing: inherit;
}

.ngdialog {
  position: fixed;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 10000;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.ngdialog.ngdialog-disabled-animation * {
  -webkit-animation: none !important;
  animation: none !important;
}

.ngdialog-overlay {
  position: fixed;
  background: rgba(0, 0, 0, 0.4);
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  -webkit-backface-visibility: hidden;
  -webkit-animation: ngdialog-fadein 0.5s;
  animation: ngdialog-fadein 0.5s;
}

.ngdialog.ngdialog-closing .ngdialog-overlay {
  -webkit-backface-visibility: hidden;
  -webkit-animation: ngdialog-fadeout 0.5s;
  animation: ngdialog-fadeout 0.5s;
}

.ngdialog-content {
  background: white;
  -webkit-backface-visibility: hidden;
  -webkit-animation: ngdialog-fadein 0.5s;
  animation: ngdialog-fadein 0.5s;
}

.ngdialog.ngdialog-closing .ngdialog-content {
  -webkit-backface-visibility: hidden;
  -webkit-animation: ngdialog-fadeout 0.5s;
  animation: ngdialog-fadeout 0.5s;
}

.ngdialog-close:before {
  font-family: 'Helvetica', Arial, sans-serif;
  content: '\00D7';
  cursor: pointer;
}

html.ngdialog-open,
body.ngdialog-open {
  overflow: hidden;
}


text:
package com.jeff.chaser.models.graph

import com.jeff.chaser.models.graph.MarkerType.MarkerType

class Marker(var mkType:MarkerType, var dist:Float, var from:Option[Node], var visited:Boolean)


text:
require 'spec_helper'
require 'rack/test'
require 'split/dashboard'

describe Split::Dashboard do
  include Rack::Test::Methods

  def app
    @app ||= Split::Dashboard
  end

  before(:each) { Split.redis.flushall }

  it "should respond to /" do
    get '/'
    last_response.should be_ok
  end

  it "should reset an experiment" do
    experiment = Split::Experiment.find_or_create('link_color', 'blue', 'red')

    red = Split::Alternative.new('red', 'link_color')
    blue = Split::Alternative.new('blue', 'link_color')
    red.participant_count = 5
    blue.participant_count = 6

    post '/reset/link_color'

    last_response.should be_redirect

    new_red_count = Split::Alternative.new('red', 'link_color').participant_count
    new_blue_count = Split::Alternative.new('blue', 'link_color').participant_count

    new_blue_count.should eql(0)
    new_red_count.should eql(0)
  end

  it "should delete an experiment" do
    experiment = Split::Experiment.find_or_create('link_color', 'blue', 'red')
    delete '/link_color'
    last_response.should be_redirect
    Split::Experiment.find('link_color').should be_nil
  end

  it "should mark an alternative as the winner" do
    experiment = Split::Experiment.find_or_create('link_color', 'blue', 'red')
    experiment.winner.should be_nil

    post '/link_color', :alternative => 'red'

    last_response.should be_redirect
    experiment.winner.name.should eql('red')
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Nat. Tijdschr. Nederl. Ind. 5: 71 (1923)

#### Original name
Pleurotus corticatus var. aesculi Naveau

### Remarks
null


text:
Android-MessagesListView
========================

An Android library to easily display a list of messages.

![android-facade-screenshot-1.png](https://raw.githubusercontent.com/Ruenzuo/res/master/android-messageslistview-screenshot-1.png)
![android-facade-screenshot-2.png](https://raw.githubusercontent.com/Ruenzuo/res/master/android-messageslistview-screenshot-2.png)

Usage:
======

_For a working implementation of this project see the `example/` folder._

1. Declare `MessagesListView` on your layout file.

```xml
<com.ruenzuo.messageslistview.widget.MessagesListView
    android:id="@+id/messageListView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
```

2. Create a `Message` model collection, containing all the messages you want to display.

3. On your activity `onCreate` method (or `onCreateView`for a fragment), setup the `MessageAdapter` as follows:

```java
MessagesListView messageListView = (MessagesListView) findViewById(R.id.messageListView);
MessageAdapter messageAdapter = new MessageAdapter(this, 0);
messageAdapter.addAll(messages);
messageListView.setAdapter(messageAdapter);
```

Including In Your Project:
==========================

Android-MessagesListView is presented as an Android library project. A standalone JAR is not possible due to the theming capabilities offered by the indicator widgets.

You can include this project by referencing it as a library project.

Credits:
========

API is inspired by [JSQMessagesViewController](https://github.com/jessesquires/JSQMessagesViewController), a similar library available on iOS.

License
=======

    The MIT License (MIT)

    Copyright (c) 2014 Renzo Crisóstomo

    Permission is hereby granted, free of charge, to any person obtaining a copy of
    this software and associated documentation files (the "Software"), to deal in
    the Software without restriction, including without limitation the rights to
    use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
    the Software, and to permit persons to whom the Software is furnished to do so,
    subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
    FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
    COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
    IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
package wa.xare.core.node;

import java.util.HashMap;
import java.util.Map;

public enum NodeType {

  ENDPOINT("endpoint"),
  LOGGER("logger"),
  SPLITTER("splitter"),
  FILTER("filter"),
  CHOICE("choice");

  private String name;

  private static Map<String, NodeType> map;

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

  static {
    map = new HashMap<>();
    for (NodeType nt : NodeType.values()) {
      map.put(nt.name, nt);
    }
  }

  public static NodeType getNodeType(String name) {
    if (map.containsKey(name)) {
      return map.get(name);
    }
    throw new IllegalArgumentException("node type is not known: " + name);
  }

  public String getName() {
    return name;
  }

}


text:
void ReleaseCollection(TRI_vocbase_col_t const* collection);

////////////////////////////////////////////////////////////////////////////////
/// @brief convert a collection info into a TRI_vocbase_col_t
////////////////////////////////////////////////////////////////////////////////

TRI_vocbase_col_t* CoordinatorCollection(TRI_vocbase_t* vocbase,
                                         arangodb::CollectionInfo const& ci);

///////////////////////////////////////////////////////////////////////////////
/// @brief check if a name belongs to a collection
////////////////////////////////////////////////////////////////////////////////

bool EqualCollection(arangodb::CollectionNameResolver const* resolver,
                     std::string const& collectionName,
                     TRI_vocbase_col_t const* collection);

////////////////////////////////////////////////////////////////////////////////
/// @brief wraps a TRI_vocbase_col_t
////////////////////////////////////////////////////////////////////////////////

v8::Handle<v8::Object> WrapCollection(v8::Isolate* isolate,
                                      TRI_vocbase_col_t const* collection);

void TRI_InitV8collection(v8::Handle<v8::Context> context, TRI_server_t* server,
                          TRI_vocbase_t* vocbase, size_t const threadNumber,
                          TRI_v8_global_t* v8g, v8::Isolate* isolate,
                          v8::Handle<v8::ObjectTemplate> ArangoDBNS);

#endif


text:
from time import strftime
import os

NAME = "OsuScraper"
VERSION = "v0.6"
logging = True
run_time = strftime("%d-%m-%Y %H:%M:%S")
cwd = os.getcwd()
save_location = cwd + os.sep + "songs"
skip_names = ("approach circle", "click.mp3", "rhythm.mp3", "your turn.mp3",
			  "slider.mp3", "click and hold.mp3", "follow.mp3",
			  "reverse arrow", "hit the sliders",
			  "drag in circles", "thats it", "hitnormal", "hitwhistle",
			  "slidertick", "awpbad", "awpgood", "bad result", "good result",
			  "hit circle", "hit the sliders.mp3", "sectionfail", "sectionpass",
			  "wind.mp3", "spinner", "next one", "thats it",
			  "failsound", "applause", "hitfinish", "readys.mp3", "menuback",
			  "menuclick", "menuhit", "combobreak", "comboburst", "hitclap")


text:
<!DOCTYPE html>

        <meta charset="<?php bloginfo( 'charset' ); ?>">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="profile" href="http://gmpg.org/xfn/11">
        <link rel="pingback" href="">
        <link href="/fsf/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="/fsf/css/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
        <link href="/fsf/css/main.css" rel="stylesheet" type="text/css" />

	<title> About : Imaginairing.com </title>

			    	<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#header-menus-navbar-toggle">
				        Toggle navigation

			      	</button>
			      	Home

			                    	About

			                        	Like Imaginairing on Facebook

			                        	Follow Imaginairing on Twitter

			                        	Add Imaginairing to your circles on Google+

			                        	Listen to our sounds on Soundcloud

			                        	Subscribe to our RSS feed

			                        	Subscribe to our email newsletter

About

				January 01, 2015

					~ David Lartey

 imaginaire / ɪˈmadʒɪˈnɛː / n [C] someone who is extremely rich in imagination.

 imaginairing /ɪˈmadʒɪˈnɛːrɪŋ/ the action or process of becoming an imaginaire.

Hello, thanks for visiting this website. I welcome you to Imaginairing.com. Let me tell you a few things about this site.

To be good at anything, one has to practice. This is the ideology behind this site. Anna loves to write and wants to be a better writer, so she needs a place to practice, a place to refine her talents. So she'll be sharing a new short story every other week.

Every story will have an eBook and an audio recording of Anna reading the story. These will be available as free downloads.

The best way not to miss any story is by subscribing to our email newsletter and/or our RSS feeds. You'll receive all new stories right in your inbox. You can also follow us on Facebook, Twitter, Google+ and Souncloud.

We want to make this site better everyday and your feedback plays an important role if  we'll archive that. We've provided a comments section at the end of each story and you can contact us if that wouldn't do.

If you enjoy this site, don't forget to tell a friend. We'll be more than grateful.

 About Anna

My name is Anna Tiokor Lartey. I come from Prampram, Greater-Accra, Ghana. I was born in 1996 in Bonny Island, Rivers State, Nigeria.
I am studying Graphic Design as I prepare to go to the university.
I like music, telling stories and reading a lot, especially novels.
I am inspired by reading, my environment and my experiences. These are also my sources for ideas.

 About David

I am Anna's brother, a software programmer. I love reading too but I haven't read a lot of fiction, hopefully Imaginairing would rekindle my love for the world of fiction.

I maintain this site, so Anna can concentrate on writing better stories.

I have a place on the Internet where I think out loud too.

 Colophon

The site is made possible by the following:
Flassgee; Oswald, Crimson Text, Gentium Book Basic; Audible; Libre Office; Scribus; etc

				 Comments

				 Share:

				Please enable JavaScript to view the comments powered by Disqus.

Join our newsletter and we'll send you every new story.

					<form action="//imaginairing.us7.list-manage.com/subscribe/post?u=a21e18a4887cf29cc9c9e8e71&id=c53251446f"
							method="POST" target="_blank" class="form-inline" role="form">

	                                <input name="NAME" type="text" class="form-control" placeholder="Your Name *" id="name"
	                                	required data-validation-required-message="Please enter your name."
	                                >

	                                <input name="EMAIL" type="email" class="form-control" placeholder="Your Email Address *"
	                                	id="email" required data-validation-required-message="Please enter your name."
	                                >

	                            	<button type="submit" class="btn btn-xl">Join</button>
	                            	<input type="hidden" value="html" name="EMAILTYPE" >
	                            	<input type="hidden" name="b_a21e18a4887cf29cc9c9e8e71_c53251446f" tabindex="-1" value="">

					</form>

									Imaginaring © 2015

                                Built with ♥


text:
import { Node } from "./node";
import { ITreeWidget } from "./itree_widget";

export default class KeyHandler {
    private static LEFT = 37;
    private static UP = 38;
    private static RIGHT = 39;
    private static DOWN = 40;

    private tree_widget: ITreeWidget;

    constructor(tree_widget: ITreeWidget) {
        this.tree_widget = tree_widget;

        if (tree_widget.options.keyboardSupport) {
            $(document).on("keydown.jqtree", $.proxy(this.handleKeyDown, this));
        }
    }

    public deinit() {
        $(document).off("keydown.jqtree");
    }

    public moveDown() {
        const node = this.tree_widget.getSelectedNode();

        if (node) {
            return this.selectNode(node.getNextNode());
        } else {
            return false;
        }
    }

    public moveUp() {
        const node = this.tree_widget.getSelectedNode();

        if (node) {
            return this.selectNode(node.getPreviousNode());
        } else {
            return false;
        }
    }

    public moveRight() {
        const node = this.tree_widget.getSelectedNode();

        if (!node) {
            return true;
        } else if (!node.isFolder()) {
            return true;
        } else {
            // folder node
            if (node.is_open) {
                // Right moves to the first child of an open node
                return this.selectNode(node.getNextNode());
            } else {
                // Right expands a closed node
                this.tree_widget.openNode(node);
                return false;
            }
        }
    }

    public moveLeft() {
        const node = this.tree_widget.getSelectedNode();

        if (!node) {
            return true;
        } else if (node.isFolder() && node.is_open) {
            // Left on an open node closes the node
            this.tree_widget.closeNode(node);
            return false;
        } else {
            // Left on a closed or end node moves focus to the node's parent
            return this.selectNode(node.getParent());
        }
    }

    public handleKeyDown(e: JQueryEventObject) {
        if (!this.canHandleKeyboard()) {
            return true;
        } else {
            const key = e.which;

            switch (key) {
                case KeyHandler.DOWN:
                    return this.moveDown();

                case KeyHandler.UP:
                    return this.moveUp();

                case KeyHandler.RIGHT:
                    return this.moveRight();

                case KeyHandler.LEFT:
                    return this.moveLeft();

                default:
                    return true;
            }
        }
    }

    public selectNode(node: Node | null) {
        if (!node) {
            return true;
        } else {
            this.tree_widget.selectNode(node);

            if (
                this.tree_widget.scroll_handler &&
                !this.tree_widget.scroll_handler.isScrolledIntoView(
                    $(node.element).find(".jqtree-element")
                )
            ) {
                this.tree_widget.scrollToNode(node);
            }

            return false;
        }
    }

    private canHandleKeyboard(): boolean {
        return (
            this.tree_widget.options.keyboardSupport &&
            this.isFocusOnTree() &&
            this.tree_widget.getSelectedNode() != null
        );
    }

    private isFocusOnTree(): boolean {
        const active_element = document.activeElement;

        return (
            active_element &&
            active_element.tagName === "SPAN" &&
            this.tree_widget._containsElement(active_element)
        );
    }
}


text:
#ifndef __itkGeneralToBSplineDisplacementFieldFilter_h
#define __itkGeneralToBSplineDisplacementFieldFilter_h

#include "itkImageToImageFilter.h"

#include "itkBSplineScatteredDataPointSetToImageFilter.h"
#include "itkPointSet.h"

namespace itk
{
template <class TInputImage, class TOutputImage = TInputImage>
class GeneralToBSplineDisplacementFieldFilter :
  public ImageToImageFilter<TInputImage, TOutputImage>
{
public:
  /** Standard class typedefs. */
  typedef GeneralToBSplineDisplacementFieldFilter Self;
  typedef ImageToImageFilter<
      TInputImage,
      TOutputImage>           Superclass;

  typedef SmartPointer<Self>       Pointer;
  typedef SmartPointer<const Self> ConstPointer;

  /** Method for creation through the object factory. */
  itkNewMacro( Self );

  /** Extract dimension from input and output image. */
  itkStaticConstMacro( ImageDimension, unsigned int,
                       TInputImage::ImageDimension );

  /** Convenient typedefs for simplifying declarations. */
  typedef TInputImage  InputImageType;
  typedef TOutputImage OutputImageType;

  typedef typename InputImageType::PixelType  InputPixelType;
  typedef typename OutputImageType::PixelType OutputPixelType;

  typedef typename InputPixelType::ValueType InputPixelComponentType;

  typedef InputPixelType                  VectorType;
  typedef InputPixelComponentType         RealType;
  typedef Image<RealType, ImageDimension> RealImageType;

  typedef PointSet<InputPixelType,
                   itkGetStaticConstMacro( ImageDimension )>   PointSetType;
  typedef BSplineScatteredDataPointSetToImageFilter
    <PointSetType, OutputImageType>             BSplineFilterType;
  typedef typename BSplineFilterType::ArrayType ArrayType;

//  itkSetMacro( ConfidenceImage, RealImageType );
//  itkGetConstMacro( ConfidenceImage, RealImageType );

  itkSetMacro( NumberOfControlPoints, ArrayType );
  itkGetConstMacro( NumberOfControlPoints, ArrayType );

  itkSetMacro( NumberOfLevels, unsigned int );
  itkGetConstMacro( NumberOfLevels, unsigned int );

  itkSetMacro( SplineOrder, unsigned int );
  itkGetConstMacro( SplineOrder, unsigned int );

  itkSetMacro( IgnorePixelValue, InputPixelType );
  itkGetConstMacro( IgnorePixelValue, InputPixelType );
protected:

  GeneralToBSplineDisplacementFieldFilter();
  virtual ~GeneralToBSplineDisplacementFieldFilter();

  void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;

  void GenerateData() ITK_OVERRIDE;

private:
//   typename RealImageType::Pointer              m_ConfidenceImage;

  InputPixelType m_IgnorePixelValue;
  unsigned int   m_NumberOfLevels;
  unsigned int   m_SplineOrder;
  ArrayType      m_NumberOfControlPoints;
};
} // end namespace itk

#ifndef ITK_MANUAL_INSTANTIATION
#include "itkGeneralToBSplineDisplacementFieldFilter.hxx"
#endif

#endif


text:
package org.ohdsi.utilities.collections;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class OneToManyList<K, V> {
	private Map<K, List<V>>	map	= new HashMap<K, List<V>>();

	public void put(K key, V value) {
		List<V> list = map.get(key);
		if (list == null) {
			list = new ArrayList<V>();
			map.put(key, list);
		}
		list.add(value);
	}

	public void putAll(OneToManyList<K, V> other) {
		for (Map.Entry<K, List<V>> entry : other.map.entrySet())
			for (V value : entry.getValue())
				put(entry.getKey(), value);
	}

	public void putAll(K key, Collection<V> values) {
		for (V value : values)
			put(key, value);
	}

	public List<V> get(K key) {
		List<V> list = map.get(key);
		if (list == null)
			return Collections.emptyList();
		else
			return list;
	}

	public Set<K> keySet() {
		return map.keySet();
	}

	public Collection<List<V>> values() {
		return map.values();
	}

	public List<V> remove(K key) {
		return map.remove(key);
	}

	public void clear() {
		map.clear();
	}

	public int size() {
		int size = 0;
		for (List<V> value : map.values())
			size += value.size();
		return size;
	}

}


text:
<link href="polaris/custom.css?v=1.0.2" rel="stylesheet">
  <link href="polaris/all.css?v=1.0.2" rel="stylesheet">

Polaris skin

Live

                  <input tabindex="21" type="checkbox" id="polaris-checkbox-1">
                  Checkbox 1

                  <input tabindex="22" type="checkbox" id="polaris-checkbox-2" checked>
                  Checkbox 2

                  <input type="checkbox" id="polaris-checkbox-disabled" disabled>
                  Disabled

                  <input type="checkbox" id="polaris-checkbox-disabled-checked" checked disabled>
                  Disabled & checked

                  <input tabindex="23" type="radio" id="polaris-radio-1" name="polaris-radio">
                  Radio button 1

                  <input tabindex="24" type="radio" id="polaris-radio-2" name="polaris-radio" checked>
                  Radio button 2

                  <input type="radio" id="polaris-radio-disabled" disabled>
                  Disabled

                  <input type="radio" id="polaris-radio-disabled-checked" checked disabled>
                  Disabled & checked

States

                  Normal

                  Hover

                  Checked

                  Disabled

                  Disabled & checked


text:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Groups extends Admin_Controller {

	//--------------------------------------------------------------------

	public function __construct()
	{
		parent::__construct();

		$this->auth->restrict('Banner.Content.View');
		$this->load->model('banner_group_model', null, true);
		$this->load->model('banner_model');
		$this->lang->load('banner_group');

		Assets::add_css('flick/jquery-ui-1.8.13.custom.css');
		Assets::add_js('jquery-ui-1.8.8.min.js');

		Template::set_block('sub_nav', 'groups/_sub_nav');
	}

	//--------------------------------------------------------------------

	/*
		Method: index()

		Displays a list of form data.
	*/
	public function index()
	{

		// Deleting anything?
		if ($action = $this->input->post('delete'))
		{
			if ($action == 'Delete')
			{
				$checked = $this->input->post('checked');

				if (is_array($checked) && count($checked))
				{
					$result = FALSE;
					foreach ($checked as $pid)
					{
						$result = $this->banner_group_model->delete($pid);
					}

					if ($result)
					{
						Template::set_message(count($checked) .' '. lang('banner_delete_success'), 'success');
					}
					else
					{
						Template::set_message(lang('banner_delete_failure') . $this->banner_group_model->error, 'error');
					}
				}
				else
				{
					Template::set_message(lang('banner_delete_error') . $this->banner_group_model->error, 'error');
				}
			}
		}

        $records = $this->banner_group_model->find_all();

		Template::set('records', $records);
		Template::set_view('groups/index');
		Template::set('toolbar_title', 'Manage Banner Group');
		Template::render();
	}

	//--------------------------------------------------------------------

	/*
		Method: create()

		Creates a Banner object.
	*/
	public function create()
	{
		$this->auth->restrict('Banner.Content.Create');

        if ($this->input->post('submit'))
		{
			if ($insert_id = $this->save_banner_group())
			{
				// Log the activity
				$this->activity_model->log_activity($this->current_user->id, lang('banner_act_create_record').': ' . $insert_id . ' : ' . $this->input->ip_address(), 'banner');

				Template::set_message(lang('banner_create_success'), 'success');
				Template::redirect(SITE_AREA .'/content/banner/groups');
			}
			else
			{
				Template::set_message(lang('banner_create_failure') . $this->banner_group_model->error, 'error');
			}
		}
		Assets::add_module_js('banner', 'banner.js');

        Assets::add_css(array	(
														Template::theme_url('css/jquery.ui.datepicker.css'),
														Template::theme_url('css/jquery-iframedialog.css'),
														Template::theme_url('css/jquery/jquery.plugin.chosen.css'),
														Template::theme_url('css/jquery/jquery.tagsinput.css'),
													),
										'screen');

		Assets::add_module_css('banner', 'banner.css');

        Assets::add_js(	array	(
														Template::theme_url('js/jquery-ui-1.8.13.min.js'),
														Template::theme_url('js/jquery-iframedialog.js'),
														Template::theme_url('js/admin.js'),
														Template::theme_url('js/jquery/jquery.plugin.chosen.js'),
														Template::theme_url('js/jquery/jquery.plugin.livequery.js'),
														Template::theme_url('js/jquery/jquery.tagsinput.min.js'),
														Template::theme_url('js/editors/ckeditor/ckeditor.js'),
														Template::theme_url('js/editors/ckeditor/adapters/jquery.js'),
														Template::theme_url('js/my_wysiwyg.js'),
													),
										'external',
										true
									);

		Template::set_view('groups/create');
		Template::set('toolbar_title', lang('banner_create') . ' Banner Group');
		Template::render();
	}

	//--------------------------------------------------------------------

	/*
		Method: edit()

		Allows editing of Banner data.
	*/
	public function edit()
	{
		$this->auth->restrict('Banner.Content.Edit');

		$id = $this->uri->segment(6);

		if (empty($id))
		{
			Template::set_message(lang('banner_invalid_id'), 'error');
			redirect(SITE_AREA .'/content/banner/groups');
		}

		if ($this->input->post('submit'))
		{
			if ($this->save_banner_group('update', $id))
			{
				// Log the activity
				$this->activity_model->log_activity($this->current_user->id, lang('banner_act_edit_record').': ' . $id . ' : ' . $this->input->ip_address(), 'banner');

				Template::set_message(lang('banner_edit_success'), 'success');
                redirect(SITE_AREA .'/content/banner/groups');
			}
			else
			{
				Template::set_message(lang('banner_edit_failure') . $this->banner_group_model->error, 'error');
			}
		}

		Template::set('banner', $this->banner_group_model->find($id));

        Assets::add_module_js('banner', 'banner.js');

        Assets::add_css(array	(
														Template::theme_url('css/jquery.ui.datepicker.css'),
														Template::theme_url('css/jquery-iframedialog.css'),
														Template::theme_url('css/jquery/jquery.plugin.chosen.css'),
														Template::theme_url('css/jquery/jquery.tagsinput.css'),
													),
										'screen');

		Assets::add_module_css('banner', 'banner.css');

        Assets::add_js(	array	(
														Template::theme_url('js/jquery-ui-1.8.13.min.js'),
														Template::theme_url('js/jquery-iframedialog.js'),
														Template::theme_url('js/admin.js'),
														Template::theme_url('js/jquery/jquery.plugin.chosen.js'),
														Template::theme_url('js/jquery/jquery.plugin.livequery.js'),
														Template::theme_url('js/jquery/jquery.tagsinput.min.js'),
														Template::theme_url('js/editors/ckeditor/ckeditor.js'),
														Template::theme_url('js/editors/ckeditor/adapters/jquery.js'),
														Template::theme_url('js/my_wysiwyg.js'),
													),
										'external',
										true
									);

		Template::set_view('groups/edit');
		Template::set('toolbar_title', lang('banner_edit') . ' Banner Group');
		Template::render();
	}

	//--------------------------------------------------------------------

	/*
		Method: delete()

		Allows deleting of Banner data.
	*/
	public function delete()
	{
		$this->auth->restrict('Banner.Content.Delete');

		$id = $this->uri->segment(6);

		if (!empty($id))
		{

			if ($this->banner_group_model->delete($id))
			{
				// Log the activity
				$this->activity_model->log_activity($this->current_user->id, lang('banner_act_delete_record').': ' . $id . ' : ' . $this->input->ip_address(), 'banner');

                // Delete all banner in the group
				$this->banner_model->delete_where(array('banner.group_id' => $id));

				Template::set_message(lang('banner_delete_success'), 'success');
			} else
			{
				Template::set_message(lang('banner_delete_failure') . $this->banner_group_model->error, 'error');
			}
		}

		redirect(SITE_AREA .'/content/banner/groups');
	}

	//--------------------------------------------------------------------

	//--------------------------------------------------------------------
	// !PRIVATE METHODS
	//--------------------------------------------------------------------

	/*
		Method: save_banner()

		Does the actual validation and saving of form data.

		Parameters:
			$type	- Either "insert" or "update"
			$id		- The ID of the record to update. Not needed for inserts.

		Returns:
			An INT id for successful inserts. If updating, returns TRUE on success.
			Otherwise, returns FALSE.
	*/
	private function save_banner_group($type='insert', $id=0)
	{
		if ($type == 'update') {
			$_POST['id'] = $id;
		}

		$this->form_validation->set_rules('title','Title','required|trim|xss_clean|max_length[30]');
		$this->form_validation->set_rules('abbr','Abbreviation','required|trim|xss_clean|max_length[20]');

        $this->form_validation->set_error_delimiters('<p>', '</p>');

		if ($this->form_validation->run() === FALSE)
		{
			return FALSE;
		}

		// make sure we only pass in the fields we want

		$data = array();
		$data['title']        = $this->input->post('title');
		$data['abbr']         = $this->input->post('abbr');

		if ($type == 'insert')
		{
			$id = $this->banner_group_model->insert($data);

			if (is_numeric($id))
			{
				$return = $id;
			}
            else
			{
				$return = FALSE;
			}
		}
		else if ($type == 'update')
		{
			$return = $this->banner_group_model->update($id, $data);
		}

		return $return;
	}

	//--------------------------------------------------------------------

}


text:
class UserController < ApplicationController
  before_action :authenicate_user!

end