text:
This is a list of object oriented  programming languages that includes their syntax. The list can be used as a reference for the language.

Examples:

Finding out if the given number is greater than or less than 50.

### Java
```java

public class numbers{
public static void num(int in){        // Method with parameter for integer

    if(in > 50){         //Checks the conditional statement if in is greater than 50
        System.out.println("The number is greater that 50");   //if true prints this line
    }else{               //else prints this line
        System.out.println("The number is less than 50");
    }
}
public static void main(String[] args) {
     System.out.println("hello world");
     num(78);         //Method num();
   }

}

//Prints Hello World
//The number is greater that 50

```

### Ruby
```ruby
def num(int= '')                     # Method def
  if int > 50                        # The user inputs a number in num() it checks if the number is greater than 50
    "The number is greater than 50"
  else                               # else the number is less than 50
    "The number is less than 50"
  end
end

 num(78)
 #Prints The number is greater than 50

```

### Javascript
```javascript
function numbers(nums){    //Function contains a nums within its parameters
    if(nums > 50){         //Checks conditional statement if nums is greater than 50
        console.log("This number is greater than 50"); //if so, then the console output prints this message
    }else{
         console.log("This number is less than 50"); //else it prints this console output
    }
}

numbers(78)
//Prints This number is greater than 50

```

### CSharp
```C#

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

namespace Numbers
{
            class Program
            {
                static void Main(string[] args)
                {
                    Console.WriteLine("Enter a Number:");  //Enter the number
                    int num = Convert.ToInt32(Console.ReadLine());  //Converts string to interger from the number input
                    numberGreater(num);  //Calls method numberGreater(int n)
                    Console.WriteLine(num); //prints out the conditional statement result
                    Console.ReadLine();
                }

            public static void numberGreater(int n)
            {
                if (n > 50)
                {
                    Console.WriteLine("The number is greater that 50");
                }
                else {
                    Console.WriteLine("The number is less than 50");
                }
            }
          }
}

```

### Swift

```swift

func numbers(num: Int) -> Int{
    if num > 50 {
        print("The number is greater than 50")
        return num
    }else {
        print("The number is less than 50")
        return num
    }
}

numbers(num: 78)
//Prints The number is greater than 50

```

### Python 3

```python

def num(num1):
     if num1 > 50:
       print("The number is greater than 50")
     else:
      print("The number is less than 50")

num(70)

```


text:
[![Code Health](https://landscape.io/github/birkbeckOLH/annotran/master/landscape.svg?style=flat)](https://landscape.io/github/birkbeckOLH/annotran/master) [![Latest Version](https://img.shields.io/badge/python-2.7-blue.svg)]() [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/birkbeckOLH/annotran/blob/master/LICENSE)

#annotran

## About

Annotran is an extension to the hypothesis annotation framework that allows users to translate web pages themselves and to view other users' translations. It is developed at the [Open Library of Humanities](https://about.openlibhums.org) and was funded by the Andrew W. Mellon Foundation. A [public alpha version is now available](https://annotran.openlibhums.org) to use (but with no guarantee that the server will always be up or that translations will not be deleted).

## Quirks

Annotran does not work well on extremely dynamic pages. If the web page that you are translating changes substantially, then it is likely that your translation will break.

## Development

This project is built as an extension to the hypothesis annotation framework: https://hypothes.is/. If you would like to join us in development efforts, or wish to run your own server, you can set up your development environment in the following way. Please note these instructions for Ubuntu 14.04.

Download the source code:
```
git clone https://github.com/birkbeckOLH/annotran.git
```
Download the hypothes.is version 0.8.14:
```
git clone https://github.com/hypothesis/h.git
cd h
git reset --hard v0.8.14
```
Install `h` by refering to its documentation on how to install it. Search for this document in project files: ../h/docs/hacking/install.rst. In addition to the Docker containers there, you will also need nsqd. The full set of container installs are:

```
docker run -d --name postgres -p 5432:5432 postgres
docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 nickstenning/elasticsearch-icu
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 --hostname rabbit rabbitmq:3-management
docker run -d --name redis -p 6379:6379 redis
docker run -d --name nsqd -p 4150:4150 -p 4151:4151 nsqio/nsq /nsqd
```

If you want to be able to easily monitor the emails that annotran/hypothes.is sends in your development environment, then you may wish to use the following command:

```
docker exec nsqd nsq_tail --topic email --nsqd-tcp-address localhost:4150
```

This can be important as account sign-up confirmation links are sent by email.

Create a Python virtual environment. Refer to the documentation on how to create virtual environments: http://docs.python-guide.org/en/latest/dev/virtualenvs/

Run the following commands to install hypothes.is into your virtual environment:
```
cd ..
cd annotran
sudo apt-get install -y --no-install-recommends  ruby-compass build-essential     git     libevent-dev     libffi-dev     libfontconfig     libpq-dev     python-dev     python-pip     python-virtualenv nodejs npm
pip install -r requirements.txt
pip install setuptools --upgrade
sudo ln -s /usr/bin/nodejs /usr/bin/node
make dev
```

###Steps performed to extend and overwrite hypothes.is

1. Boot system. Since the annotran package has been installed into the same Python environment as the hypothes.is application, it is possibile to start the hypothes.is application from annotran. To do so, place a version of h's pyramid configuration inside annotran.

2. When extending Pyramid application (see documentation on how to do that: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/extending.html), it is necessary to override views, routes and static assets (http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/assets.html#assets-chapter). To extend hypothes.is UI code, there are following steps performed:
	- There is assets.yaml file in annotran that is a copy of the same file from hypothes.is. Paths for assets that are overwritten in annotran are appropriately updated within this file.
	- Assets are overwritten by invoking config.override_asset(..) method.
	- Javascript is overwritten using Angular dependency injection. h/static/scripts/app.coffee is required from the main module within the annotran.

3. In app.py we replace a set of hypothesis functions using Python monkey patching. The replacement functions are in replacements.py.

4. To override Angular directives, add the directive file in static/scripts/directive and then edit apps.js to add an app decorator that selects the override directive.

###Understanding the different components and languages used by hypothes.is and overridden by annotran
Hypothesis uses multiple technologies:

* Pyramid for URL routing and setting handling
* The Python files (.py) in the project are part of the Pyramid framework's handling
* SQLAlchemy is used by the python files to read from and write to a PostgresSQL database and can be accessed by the python components
* An elasticsearch instance is used to store annotations themselves and can be accessed by the python components
* Annotator.js provides the core annotation functions
* A set of coffeescript and javascript files (.coffee and .js) extend Annotator.js and provide the hypothes.is sidebar and plugins to the document we are annotating
* Some javascript files make calls to the Pyramid framework's server-side python scripts (see above) and load database values in the client (see session.js for example)
* An event bubbling framework exists within the javascript files that can be fired and extended

##How to contribute

Tasks under development are available to investigate under the issues. You can also join in the discussion over there.

redpajama_set_name: RedPajamaGithub


text:
package annis.sqlgen;

import annis.service.objects.AnnisBinaryMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

public class MetaByteHelper implements ResultSetExtractor<List<AnnisBinaryMetaData>>
{

  private static final org.slf4j.Logger log = LoggerFactory.getLogger(MetaByteHelper.class);

  private static final int[] ARG_TYPES = new int [] {
    Types.VARCHAR, Types.VARCHAR
  };

  public static final String SQL =
        "SELECT\n"
      + "  filename, title, mime_type, sub.name as corpus_name\n"
      + "FROM media_files, corpus AS sub, corpus AS top \n"
      + "WHERE\n"
      + "  top.top_level = true AND\n"
      + "  top.name = ? AND\n"
      + "  sub.name = ? AND\n"
      + "  sub.pre >= top.pre AND sub.post <= top.post AND\n"
      + "  sub.id = corpus_ref";
  ;

  public static int[] getArgTypes()
  {
    return Arrays.copyOf(ARG_TYPES, ARG_TYPES.length);
  }

  public Object[] getArgs(String toplevelCorpusName, String corpusName)
  {
    return new Object[]
    {
      toplevelCorpusName, corpusName
    };

  }

  @Override
  public List<AnnisBinaryMetaData> extractData(ResultSet rs) throws
    DataAccessException
  {
    List<AnnisBinaryMetaData> result = new LinkedList<AnnisBinaryMetaData>();
    try
    {
      while (rs.next())
      {
        AnnisBinaryMetaData ab = new AnnisBinaryMetaData();
        ab.setLocalFileName(rs.getString("filename"));
        ab.setFileName(rs.getString("title"));
        ab.setCorpusName(rs.getString("corpus_name"));
        ab.setMimeType(rs.getString("mime_type"));

        result.add(ab);
      }
    }
    catch (SQLException ex)
    {
      log.error(null, ex);
    }

    return result;
  }

}


text:
FixedSizeGridLayout::FixedSizeGridLayout(QWidget *parent, int hSpacing, int vSpacing)
	: QLayout(parent), m_hSpace(hSpacing), m_vSpace(vSpacing), m_fixedWidth(150)
{}

FixedSizeGridLayout::FixedSizeGridLayout(int hSpacing, int vSpacing)
	: m_hSpace(hSpacing), m_vSpace(vSpacing), m_fixedWidth(150)
{}

FixedSizeGridLayout::~FixedSizeGridLayout()
{
	QLayoutItem *item;
	while ((item = takeAt(0)) != nullptr) {
		delete item;
	}
}

void FixedSizeGridLayout::setFixedWidth(int width)
{
	m_fixedWidth = width;
	invalidate();
}

void FixedSizeGridLayout::addItem(QLayoutItem *item)
{
	m_items.append(item);
	invalidate();
}

void FixedSizeGridLayout::insertItem(int index, QLayoutItem *item)
{
	if (index < 0) {
		index = m_items.count();
	}

	m_items.insert(index, item);
	invalidate();
}

void FixedSizeGridLayout::insertWidget(int index, QWidget *widget)
{
	addChildWidget(widget);
	insertItem(index, new QWidgetItemV2(widget));
}

int FixedSizeGridLayout::count() const
{
	return m_items.size();
}

QLayoutItem *FixedSizeGridLayout::itemAt(int index) const
{
	return m_items.value(index);
}

QLayoutItem *FixedSizeGridLayout::takeAt(int index)
{
	if (index >= 0 && index < m_items.size()) {
		auto item = m_items.takeAt(index);
		invalidate();
		return item;
	}

	return nullptr;
}

int FixedSizeGridLayout::horizontalSpacing() const
{
	return m_hSpace >= 0
		? m_hSpace
		: smartSpacing(QStyle::PM_LayoutHorizontalSpacing);
}

int FixedSizeGridLayout::verticalSpacing() const
{
	return m_vSpace >= 0
		? m_vSpace
		: smartSpacing(QStyle::PM_LayoutVerticalSpacing);
}

Qt::Orientations FixedSizeGridLayout::expandingDirections() const
{
	return Qt::Horizontal | Qt::Vertical;
}

bool FixedSizeGridLayout::hasHeightForWidth() const
{
	return true;
}

int FixedSizeGridLayout::heightForWidth(int width) const
{
	return doLayout(QRect(0, 0, width, 0), true);
}

QSize FixedSizeGridLayout::minimumSize() const
{
	QSize size;
	for (QLayoutItem *item : m_items) {
		size = size.expandedTo(item->minimumSize());
	}

	const auto margins = contentsMargins();
	size += QSize(margins.left() + margins.right(), margins.top() + margins.bottom());
	return size;
}

QSize FixedSizeGridLayout::sizeHint() const
{
	return minimumSize();
}

void FixedSizeGridLayout::setGeometry(const QRect &rect)
{
	QLayout::setGeometry(rect);
	doLayout(rect, false);
}

int FixedSizeGridLayout::doLayout(QRect rect, bool testOnly) const
{
	int left, top, right, bottom;
	getContentsMargins(&left, &top, &right, &bottom);
	QRect effectiveRect = rect.adjusted(+left, +top, -right, -bottom);
	int x = effectiveRect.x();
	int y = effectiveRect.y();
	int w = effectiveRect.width();

	int lineHeight = 0;
	for (QLayoutItem *item : m_items) {
		int spaceX = widgetSpacing(horizontalSpacing(), item->widget(), Qt::Horizontal);
		int spaceY = widgetSpacing(verticalSpacing(), item->widget(), Qt::Vertical);

		const int nbElements = qMax(1, (w + spaceX) / (m_fixedWidth + spaceX));
		const int totalSpace = w - (m_fixedWidth * nbElements);
		spaceX = qMax(spaceX, totalSpace / qMax(1, nbElements - 1));

		int nextX = x + item->sizeHint().width() + spaceX;
		if (nextX - spaceX - 1 > effectiveRect.right() && lineHeight > 0) {
			x = effectiveRect.x();
			y = y + lineHeight + spaceY;
			nextX = x + item->sizeHint().width() + spaceX;
			lineHeight = 0;
		}

		if (!testOnly) {
			item->setGeometry(QRect(QPoint(x, y), item->sizeHint()));
		}

		x = nextX;
		lineHeight = qMax(lineHeight, item->sizeHint().height());
	}
	return y + lineHeight - rect.y() + bottom;
}

int FixedSizeGridLayout::smartSpacing(QStyle::PixelMetric pm) const
{
	QObject *parent = this->parent();
	if (parent == nullptr) {
		return -1;
	}

	if (parent->isWidgetType()) {
		auto *pw = dynamic_cast<QWidget*>(parent);
		if (pw != nullptr) {
			return pw->style()->pixelMetric(pm, nullptr, pw);
		}
	}

	return dynamic_cast<QLayout*>(parent)->spacing();
}

int FixedSizeGridLayout::widgetSpacing(int spacing, QWidget *widget, Qt::Orientation orientation) const
{
	if (spacing >= 0) {
		return spacing;
	}

	const QSizePolicy::ControlType controlType = widget->sizePolicy().controlType();
	return widget->style()->layoutSpacing(controlType, controlType, orientation);
}


text:
#!/bin/bash -x
sleep 30

# Configuring repo for future updates
sudo apt-get update
sudo debconf-set-selections <<< 'postfix postfix/mailname string your.hostname.com'
sudo debconf-set-selections <<< 'postfix postfix/main_mailer_type string "Internet Site"'
sudo apt-get install -y curl openssh-server ca-certificates postfix libatomic1
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

# Downloading package from S3 bucket
curl -o gitlab.deb "$DOWNLOAD_URL"
# Explicitly passing EXTERNAL_URL to prevent automatic EC2 IP detection.
sudo EXTERNAL_URL="http://gitlab.example.com" dpkg -i gitlab.deb
sudo rm gitlab.deb

# Set install type to aws
echo "gitlab-aws-ami" | sudo tee /opt/gitlab/embedded/service/gitlab-rails/INSTALLATION_TYPE > /dev/null

# Cleanup
sudo rm -rf /var/lib/apt/lists/*
sudo find /root/.*history /home/*/.*history -exec rm -f {} \;
sudo rm -f /home/ubuntu/.ssh/authorized_keys /root/.ssh/authorized_keys

sudo mv ~/ami-startup-script.sh /var/lib/cloud/scripts/per-instance/gitlab
sudo chmod +x /var/lib/cloud/scripts/per-instance/gitlab


text:
package org.apache.pulsar.client.api.schema;

import org.apache.pulsar.common.schema.SchemaType;

/**
 * This is an abstraction over the logical value that is store into a Message.
 * Pulsar decodes the payload of the Message using the Schema that is configured for the topic.
 */
public interface GenericObject {

    /**
     * Return the schema tyoe.
     *
     * @return the schema type
     * @throws UnsupportedOperationException if this feature is not implemented
     * @see SchemaType#BYTES when the topic has no schema information
     * @see SchemaType#STRING
     * @see SchemaType#AVRO
     * @see SchemaType#PROTOBUF_NATIVE
     * @see SchemaType#JSON
     */
    SchemaType getSchemaType();

    /**
     * Return the internal native representation of the Object,
     * like a AVRO GenericRecord, a String or a byte[].
     *
     * @return the decoded object
     * @throws UnsupportedOperationException if the operation is not supported
     */
    Object getNativeObject();
}


text:
module RTunnel
end

require 'rtunnel/core.rb'
require 'rtunnel/io_extensions.rb'
require 'rtunnel/socket_factory.rb'
require 'rtunnel/frame_protocol.rb'

require 'rtunnel/commands.rb'
require 'rtunnel/command_processor.rb'
require 'rtunnel/command_protocol.rb'
require 'rtunnel/connection_id.rb'
require 'rtunnel/crypto.rb'

require 'rtunnel/client.rb'
require 'rtunnel/leak.rb'
require 'rtunnel/server.rb'

require 'rtunnel/rtunnel_client_cmd.rb'
require 'rtunnel/rtunnel_server_cmd.rb'


text:
package com.github.javaparser;

import java.util.List;
import java.util.Optional;

import static com.github.javaparser.utils.Utils.assertNotNull;
import static java.util.Collections.singletonList;

import static com.github.javaparser.utils.Utils.EOL;

/**
 * Thrown when parsing problems occur during parsing with the static methods on JavaParser.
 */
public class ParseProblemException extends RuntimeException {
    /**
     * The problems that were encountered during parsing
     */
    private final List<Problem> problems;

    ParseProblemException(List<Problem> problems) {
        super(createMessage(assertNotNull(problems)));
        this.problems = problems;
    }

    ParseProblemException(Throwable throwable) {
        this(singletonList(new Problem(throwable.getMessage(), Optional.empty(), Optional.of(throwable))));
    }

    private static String createMessage(List<Problem> problems) {
        StringBuilder message = new StringBuilder();
        for(Problem problem: problems){
            message.append(problem.toString()).append(EOL);
        }
        return message.toString();
    }

    public List<Problem> getProblems() {
        return problems;
    }
}


text:
var masterPass = function(resp) {
	if (resp) {
		if (resp.payPassWalletIndicator) {
			this.payPassWalletIndicator = resp.payPassWalletIndicator;
		}
		if (resp.authenticationMethod) {
			this.authenticationMethod = resp.authenticationMethod;
		}
		if (resp.cardEnrollmentMethod) {
			this.cardEnrollmentMethod = resp.cardEnrollmentMethod;
		}
		if (resp.masterCardAssignedId) {
			this.masterCardAssignedId = resp.masterCardAssignedId;
		}
	}
};

masterPass.prototype.setCardEnrollmentMethod = function(cardEnrollmentMethod) {
	this.cardEnrollmentMethod = cardEnrollmentMethod;
};

masterPass.prototype.getCardEnrollmentMethod = function() {
	return this.cardEnrollmentMethod;
};

masterPass.prototype.setMasterCardAssignedId = function(masterCardAssignedId) {
	this.masterCardAssignedId = masterCardAssignedId;
};

masterPass.prototype.getMasterCardAssignedId = function() {
	return this.masterCardAssignedId;
};

masterPass.prototype.setPayPassWalletIndicator = function(payPassWalletIndicator) {
	this.payPassWalletIndicator = payPassWalletIndicator;
};

masterPass.prototype.getPayPassWalletIndicator = function() {
	return this.payPassWalletIndicator;
};

masterPass.prototype.setAuthenticationMethod = function(authenticationMethod) {
	this.authenticationMethod = authenticationMethod;
};

masterPass.prototype.getAuthenticationMethod = function() {
	return this.authenticationMethod;
};

module.exports = masterPass;


text:
<?php

use kartik\detail\DetailView;

/* @var $this yii\web\View */
/* @var $model frontend\models\ProjectMainFiles */
?>
<div class="project-main-files-view">

       <?php
    echo DetailView::widget([
        'model'=>$model,
        'condensed'=>true,
        'hover'=>true,
        'bootstrap'=>true,
       // 'mode'=>DetailView::MODE_VIEW,
        'attributes' => [
            [
                'label' => 'File Size',
                'value' => $model->size,
                'labelColOptions' => ['style' => 'text-align: left; width: 20%'],
                'valueColOptions'=> ['style'=>'width:65%; text-align: center;']
            ],
            [
                'label' => 'File Extension',
                'value' => $model->ext,
                'labelColOptions' => ['style' => 'text-align: left; width: 20%'],
                'valueColOptions'=> ['style'=>'width:65%; text-align: center;']
            ],
            [
                'label' => 'Created At',
                'value' => $model->createdAt,
                'labelColOptions' => ['style' => 'text-align: left;; width: 20%'],
                'valueColOptions'=> ['style'=>'width:65%; text-align: center;']
            ],
            [
                'label' => 'Updated At',
                'value' => $model->updatedAt,
                'labelColOptions' => ['style' => 'text-align: left; width: 20%'],
                'valueColOptions'=> ['style'=>'width:65%; text-align: center;']
            ]
        ],
    ]);
?>
</div>


text:
package com.cortez.samples.javaee7angular.data;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@XmlRootElement
public class Bairros implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "IDBAI")
    @SequenceGenerator(name = "IDBAI", sequenceName = "SEQ_BAIRROS", allocationSize = 1)
    @Column(name = "idbai")
    private Long id;

    @Column(name = "DESCRIBAI", length = 60)
    private String descricao;

    @Column(name = "STATUSBAI", length = 1)
    private String statusBai;

    public Long getId() {
        return id;
    }

    public void setId(final Long id) {
        this.id = id;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(final String descricao) {
        this.descricao = descricao;
    }

    public String getStatusBai() {
        return statusBai;
    }

    public void setStatusBai(final String statusBai) {
        this.statusBai = statusBai;
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }

}


text:
package org.openforis.collect.command;

import org.openforis.idm.model.RealRange;

public class UpdateRealRangeAttributeCommand extends UpdateAttributeCommand<RealRange> {

	private static final long serialVersionUID = 1L;
}


text:
git-pr-release
==============

Creates a "release pull request", whose body consists of features list or
pull requests that are to be released into production. It's especially useful for QA and
pre-release checks. `git-pr-release` automatically collect pull requests
merged into master branch and generates the content of the release
pull request.

![Screenshot](https://cloud.githubusercontent.com/assets/113420/3147184/61bf2eec-ea53-11e3-835b-50d63ed11b39.png)

Suitable for branching strategy like below (similar to git-flow):

 * Feature branches are first merged into "staging" (or release, development)
   branch.
 * Then the staging branch is merged into "production" branch, which is for
   production release.

Configuration
-------------

All configuration are taken using `git config`. You can write these variables
in file `.git-pr-release` (instead of `.git/config` or `~/.gitconfig`) to share project-wise configuration to other
collaborators.

### `pr-release.token`

Token for GitHub API.

If not set, you will be asked to input username/password for one time only,
and this configuration variable will be stored.

You can specify this value by `GIT_PR_RELEASE_TOKEN` environment variable.

### `pr-release.branch.production`

The branch name that is deployed in production environment.

You can specify this value by `GIT_PR_RELEASE_BRANCH_PRODUCTION` environment variable.

Default value: `master`.

### `pr-release.branch.staging`

The branch name that the feature branches are merged into and is going to be
merged into the "production" branch.

You can specify this value by `GIT_PR_RELEASE_BRANCH_STAGING` environment variable.

Default value: `staging`.

### `pr-release.template`

The template file path (relative to the workidir top) for pull requests
created. Its first line is used for the PR title, the rest for the body. This
is an ERB template.

You can specify this value by `GIT_PR_RELEASE_TEMPLATE` environment variable.

If not specified, the content below is used as the template (embedded in the code):

```erb
Release <%= Time.now %>
<% pull_requests.each do |pr| -%>
<%=  pr.to_checklist_item %>
<% end -%>
```

### `pr-release.labels`

The labels list for adding to pull requests created.
This value should be comma-separated strings.

You can specify this value by `GIT_PR_RELEASE_LABELS` environment variable.

If not specified, any labels will not be added for PRs.

Errors and exit statuses
------------------------

### No pull requests to be released

exit status is 1.

### Failed to create a new pull request

exit status is 2.

### Failed to update a pull request

exit status is 3.

### Failed to add labels

exit status is 4.

Author
------

motemen <motemen@gmail.com>, original in-house version written by @hitode909.


text:
require 'abstract_unit'

class CognitoUserPoolClientTest < Minitest::Test
  def test_normal
    template = <<-EOS
_cognito_user_pool_client "test", ref_pool: "test"
    EOS
    act_template = run_client_as_json(template)
    exp_template = <<-EOS
{
  "TestUserPoolClient": {
    "Type": "AWS::Cognito::UserPoolClient",
    "Properties": {
      "ClientName": {
        "Fn::Join": [
          "-",
          [
            {
              "Ref": "Service"
            },
            "test"
          ]
        ]
      },
      "GenerateSecret": "false",
      "RefreshTokenValidity": "30",
      "UserPoolId": {
        "Ref": "TestUserPool"
      }
    }
  }
}
    EOS
    assert_equal exp_template.chomp, act_template
  end
end


text:
<?php

class ColorizableElement extends Eloquent {
	protected $guarded = array();
	protected $table = 'colorizableElements';
	protected $hidden = array('css_id','of_id','of_type');

	public static $rules = array(
		'css_id' => 'required',
		'name' => 'required'
	);

	public $timestamps = false;

	/**
	 * This will get either product or the gallery item
	 *
	 */
	public function colorizable() {
		return $this->morphTo('of');
	}

	public function colors() {
        return $this->morphToMany('Color', 'colorable','colorable');
    }

}


text:
class AddPerishableTokenToUsers < ActiveRecord::Migration
  def change
    add_column :users, :perishable_token, :string, :null => false, :default => ''
    add_index :users, :perishable_token
  end
end


text:
package com.github.dockerjava.core.command;

import static com.google.common.base.Preconditions.checkNotNull;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;

import com.github.dockerjava.api.command.BuildImageCmd;
import com.github.dockerjava.api.model.AuthConfigurations;
import com.github.dockerjava.api.model.BuildResponseItem;
import com.github.dockerjava.core.FilePathUtil;
import com.github.dockerjava.core.dockerfile.Dockerfile;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import javax.annotation.CheckForNull;

/**
 *
 * Build an image from Dockerfile.
 *
 */
public class BuildImageCmdImpl extends AbstrAsyncDockerCmd<BuildImageCmd, BuildResponseItem> implements BuildImageCmd {

    @CheckForNull
    private InputStream tarInputStream;

    @CheckForNull
    private String tag;

    private boolean noCache;

    private boolean remove = true;

    private boolean quiet;

    private boolean pull;

    @CheckForNull
    private AuthConfigurations buildAuthConfigs;

    @CheckForNull
    private File dockerFile;

    @CheckForNull
    private File baseDirectory;

    @CheckForNull
    private String cpusetcpus;

    @CheckForNull
    private Long memory;

    @CheckForNull
    private String cpushares;

    @CheckForNull
    private Boolean forcerm;

    @CheckForNull
    private Long memswap;

    @CheckForNull
    private URI remote;

    public BuildImageCmdImpl(BuildImageCmd.Exec exec) {
        super(exec);
    }

    public BuildImageCmdImpl(BuildImageCmd.Exec exec, File dockerFileOrFolder) {
        super(exec);
        checkNotNull(dockerFileOrFolder, "dockerFolder is null");

        if (dockerFileOrFolder.isDirectory()) {
            withBaseDirectory(dockerFileOrFolder);
            withDockerfile(new File(dockerFileOrFolder, "Dockerfile"));
        } else {
            withDockerfile(dockerFileOrFolder);
        }
    }

    public BuildImageCmdImpl(BuildImageCmd.Exec exec, InputStream tarInputStream) {
        super(exec);
        checkNotNull(tarInputStream, "tarInputStream is null");
        withTarInputStream(tarInputStream);
    }

    // getters API

    @Override
    public String getTag() {
        return tag;
    }

    @Override
    public URI getRemote() {
        return remote;
    }

    @Override
    public boolean hasNoCacheEnabled() {
        return noCache;
    }

    @Override
    public boolean hasRemoveEnabled() {
        return remove;
    }

    @Override
    public boolean isForcerm() {
        return forcerm != null && forcerm;
    }

    @Override
    public Boolean getForcerm() {
        return forcerm;
    }

    @Override
    public boolean isQuiet() {
        return quiet;
    }

    @Override
    public boolean hasPullEnabled() {
        return pull;
    }

    @Override
    public String getPathToDockerfile() {
        if (baseDirectory != null && dockerFile != null) {
            return FilePathUtil.relativize(baseDirectory, dockerFile);
        } else {
            return null;
        }
    }

    @Override
    public Long getMemory() {
        return memory;
    }

    @Override
    public Long getMemswap() {
        return memswap;
    }

    @Override
    public String getCpushares() {
        return cpushares;
    }

    @Override
    public String getCpusetcpus() {
        return cpusetcpus;
    }

    // getter lib specific

    @Override
    public AuthConfigurations getBuildAuthConfigs() {
        return buildAuthConfigs;
    }

    @Override
    public InputStream getTarInputStream() {
        return tarInputStream;
    }

    // setters

    @Override
    public BuildImageCmdImpl withTag(String tag) {
        checkNotNull(tag, "Tag is null");
        this.tag = tag;
        return this;
    }

    @Override
    public BuildImageCmd withRemote(URI remote) {
        this.remote = remote;
        return this;
    }

    @Override
    public BuildImageCmdImpl withNoCache() {
        return withNoCache(true);
    }

    @Override
    public BuildImageCmdImpl withNoCache(boolean noCache) {
        this.noCache = noCache;
        return this;
    }

    @Override
    public BuildImageCmdImpl withRemove() {
        return withRemove(true);
    }

    @Override
    public BuildImageCmdImpl withRemove(boolean rm) {
        this.remove = rm;
        return this;
    }

    @Override
    public BuildImageCmd withForcerm() {
        return withForcerm(true);
    }

    @Override
    public BuildImageCmd withForcerm(Boolean forcerm) {
        this.forcerm = forcerm;
        return this;
    }

    @Override
    public BuildImageCmdImpl withQuiet() {
        return withQuiet(true);
    }

    @Override
    public BuildImageCmdImpl withQuiet(boolean quiet) {
        this.quiet = quiet;
        return this;
    }

    @Override
    public BuildImageCmdImpl withPull() {
        return withPull(true);
    }

    @Override
    public BuildImageCmdImpl withPull(boolean pull) {
        this.pull = pull;
        return this;
    }

    @Override
    public BuildImageCmd withMemory(long memory) {
        this.memory = memory;
        return this;
    }

    @Override
    public BuildImageCmd withMemswap(long memswap) {
        this.memswap = memswap;
        return this;
    }

    @Override
    public BuildImageCmd withCpushares(String cpushares) {
        this.cpushares = cpushares;
        return this;
    }

    @Override
    public BuildImageCmd withCpusetcpus(String cpusetcpus) {
        this.cpusetcpus = cpusetcpus;
        return this;
    }

    // lib specific

    @Override
    public BuildImageCmd withBaseDirectory(File baseDirectory) {
        this.baseDirectory = baseDirectory;
        return this;
    }

    @Override
    public BuildImageCmdImpl withDockerfile(File dockerfile) {
        checkNotNull(dockerfile);
        if (!dockerfile.exists())
            throw new IllegalArgumentException("Dockerfile does not exist");
        if (!dockerfile.isFile())
            throw new IllegalArgumentException("Not a directory");

        if (baseDirectory == null)
            withBaseDirectory(dockerfile.getParentFile());

        this.dockerFile = dockerfile;

        try {
            withTarInputStream(new Dockerfile(dockerfile).parse().buildDockerFolderTar(baseDirectory));
        } catch (IOException e) {
            // we just created the file this should never happen.
            throw new RuntimeException(e);
        }
        return this;
    }

    @Override
    public BuildImageCmdImpl withTarInputStream(InputStream tarInputStream) {
        checkNotNull(tarInputStream, "tarInputStream is null");
        this.tarInputStream = tarInputStream;
        return this;
    }

    @Override
    public BuildImageCmd withBuildAuthConfigs(AuthConfigurations authConfigs) {
        checkNotNull(authConfigs, "authConfig is null");
        this.buildAuthConfigs = authConfigs;
        return this;
    }

    @Override
    public void close() {
        super.close();

        try {
            tarInputStream.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this, ToStringStyle.SIMPLE_STYLE);
    }
}


text:
/**
 *
 * Install:
 *      npm install browser-sync
 *
 * Run:
 *      node <yourfile.js>
 *
 * This example will create a server using https using the default information & use the `app` directory as the root
 *
 */

"use strict";

var browserSync = require("browser-sync").create();

browserSync.init({
    server: "test/fixtures",
    watch: true
});


text:
/**
 * Model classes for FigShare API version 1.0. All the classes in this package are
 * immutable and thread-safe.
 *
 * @since 0.1
 */
package org.biouno.figshare.v1.model;


text:
"""
#  @package   coursera2012
#  @author    Rolf Hemmerling <hemmerling@gmx.net>
#  @version   1.00
#  @date      2015-01-01
#  @copyright Apache License, Version 2.0
#
#  Implementation of the game
#  "Asteroids"
#  for the Coursera course
#  "An Introduction to Interactive Programming in Python"
#
#  Copyright 2012-2015 Rolf Hemmerling
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
"""

# import modules
import unittest
from simplegui import Canvas
from asteroids import ImageInfo
from asteroids import Ship
from asteroids import Sprite
from asteroids import AsteroidsGame

#from asteroids import ship_image

ship_image = None

class ImageInfo_getCenterTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        center = [1,1]
        size = 1
        self.imageinfo = ImageInfo(center, size)

    def testGetCenter(self):
        center = [1,1]
        self.imageinfo.center = center
        assert self.imageinfo.get_center() == center, 'ImageInfo.get_center() does not provide the right return value'

class ImageInfo_getSizeTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        center = [1,1]
        size = 1
        self.imageinfo = ImageInfo(center, size)

    def testGetSize(self):
        size = 1
        self.imageinfo.size = size
        assert self.imageinfo.get_size() == size, 'ImageInfo.get_size() does not provide the right return value'

class ImageInfo_getRadiusTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        center = [1,1]
        size = 1
        self.imageinfo = ImageInfo(center, size)

    def testGetRadius(self):
        radius = 1
        self.imageinfo.radius = radius
        assert self.imageinfo.get_radius() == radius, 'ImageInfo.get_radius() does not provide the right return value'

class ImageInfo_getLifespanTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        center = [1,1]
        size = 1
        self.imageinfo = ImageInfo(center, size)

    def testGetLifespan(self):
        lifespan = 1
        self.imageinfo.lifespan = lifespan
        assert self.imageinfo.get_lifespan() == lifespan, 'ImageInfo.get_radius() does not provide the right return value'

class ImageInfo_getAnimatedTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        center = [1,1]
        size = 1
        self.imageinfo = ImageInfo(center, size)

    def testGetAnimated(self):
        animated = False
        self.imageinfo.lifespan = animated
        assert self.imageinfo.get_animated() == animated, 'ImageInfo.get_animated() does not provide the right return value'

class Ship_drawTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        global ship_image
        self.asteroids = AsteroidsGame()
        self.asteroids.init()
        pos = [1,1]
        vel = [1,1]
        angle = 0
        image = ship_image

        center = [1,1]
        size = 1
        info = ImageInfo(center, size)

        self.ship = Ship( pos, vel, angle, image, info)

    def testDraw(self):
        canvas = Canvas()
        self.ship.pos = [1,1]
        self.ship.radius = 0
        assert self.ship.draw(canvas) == None, 'Ship.draw() does not provide the right return value'

class Ship_updateTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        global ship_image
        self.asteroids = AsteroidsGame()
        self.asteroids.init()
        pos = [1,1]
        vel = [1,1]
        angle = 0
        image = ship_image

        center = [1,1]
        size = 1
        info = ImageInfo(center, size)

        self.ship = Ship( pos, vel, angle, image, info)

    def testUpdate(self):
        assert self.ship.update() == None, 'Ship.draw() does not provide the right return value'

class Sprite_drawTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        pos =[0,0]
        vel = [0,0]
        ang = 0.0
        ang_vel= [0,0]
        image = None

        center = [1,1]
        size = 1
        info = ImageInfo(center, size)

        self.sprite = Sprite(pos, vel, ang, ang_vel, image, info)

    def testDraw(self):
        canvas = Canvas()
        assert self.sprite.draw(canvas) == None, 'Sprite.draw() does not provide the right return value'

class Sprite_updateTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        pos =[0,0]
        vel = [0,0]
        ang = 0.0
        ang_vel= [0,0]
        image = None

        center = [1,1]
        size = 1
        info = ImageInfo(center, size)

        self.sprite = Sprite(pos, vel, ang, ang_vel, image, info)

    def testUpdate(self):
        assert self.sprite.update() == None, 'Sprite.update() does not provide the right return value'

class AsteroidsGame_initTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        self.asteroids = AsteroidsGame()

    def testInit(self):
        assert self.asteroids.init() == None, 'AsteroidsGame.init() does not provide the right return value'

class AsteroidsGame_angleToVectorTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        self.asteroids = AsteroidsGame()

    def testAngle_ToVector(self):
        vector = [1, 0]
        assert self.spaceship.angle_to_vector(0) == vector, 'AsteroidsGame.angle_to_vector() does not provide the right return value'

class AsteroidsGame_distTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        self.asteroids = AsteroidsGame()

    def testDist(self):
        a = [0, 1]
        b = [0, 0]
        dist = 1
        assert self.asteroids.dist(a,b) == dist, 'AsteroidsGame.init() does not provide the right return value'

class AsteroidsGame_drawTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        self.asteroids = AsteroidsGame()
        self.asteroids.init()

    def testDraw(self):
        canvas = Canvas()
        assert self.asteroids.draw(canvas) == None, 'AsteroidsGame.draw() does not provide the right return value'

class AsteroidsGame_rockSpawnerTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        self.asteroids = AsteroidsGame()

    def testRockSpawner(self):
        assert self.asteroids.rock_spawner() == None, 'AsteroidsGame.rock_spawner() does not provide the right return value'

class AsteroidsGame_mainTest(unittest.TestCase):

    def setUp(self):
        """Call before every test case."""
        self.asteroids = AsteroidsGame()

    def testMain(self):
        assert self.asteroids.main() == None, 'AsteroidsGame.main() does not provide the right return value'

# run all tests
if __name__ == "__main__":
    try:
        unittest.main()
    except SystemExit as inst:
        if inst.args[0] is True: # raised by sys.exit(True) when tests failed
            raise


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Elemental | Software</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/admin.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Lato:300' rel='stylesheet' type='text/css'>

                ELEMENTAL

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    Toggle navigation

                </button>

                         Outlook

                         Word

                         Excel

                         Access

                         IRA Practice

          Courses

Business Communication

Hardware

Software

Web Development

                        Back to Top

                        FAQ

                        External Resources

Microsoft Outlook

Prepare for the MOS: Microsoft Outlook Word 2013 exam

                <button type="button" class="btn btn-primary">Back to Top</button>

                           Understanding Outlook is an important skill, since most communication happens through email. To learn more about a Microsoft certification, click  here.

Microsoft Word

Prepare for the MOS: Microsoft Office Word 2013 exam

                <button type="button" class="btn btn-primary">Back to Top</button>

                           You THINK you understand Word. So does everyone else. Prove your skills and obtain the official title of Specialist with this certification.

Microsoft Excel

Prepare for the MOS: Microsoft Office Excel 2013 exam

                <button type="button" class="btn btn-primary">Back to Top</button>

                           Perhaps the most useful and powerful MS Office skill to have. Take your time to understand  functions, pivot tables,  and formatting. Click  here to check out the certification.

Microsoft Access

Prepare for the MOS: Microsoft Office Access 2013 exam

                <button type="button" class="btn btn-primary">Back to Top</button>

                            It's not as difficult as it looks. Practice with relationships, queries,  and Excel integration. Click  here to check out the certification.

IRA Practice

Are you ready?

                <button type="button" class="btn btn-primary">Back to Top</button>

                            Can you:

Set up Mail Merge in Word?

Insert Track Changes in Word?

Create a Pivot Table in Excel?

Format Pivot Tables in Excel?

Set up Conditional Formatting?

Use and explain a PMT and IF function?

Draw Relationships between Objects in Access?

Create a Query?

Import Excel data to Access?

If you can answer YES to all of these, you'll do fine.
Good Luck!


text:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>active-pillar-108215</application>
    <version>1</version>
    <threadsafe>true</threadsafe>
</appengine-web-app>


text:
"""
kombu.exceptions
================

Exceptions.

:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.

"""
from __future__ import absolute_import

import socket

__all__ = ["NotBoundError", "MessageStateError", "TimeoutError",
           "LimitExceeded", "ConnectionLimitExceeded",
           "ChannelLimitExceeded", "StdChannelError", "VersionMismatch",
           "SerializerNotInstalled"]

TimeoutError = socket.timeout

class NotBoundError(Exception):
    """Trying to call channel dependent method on unbound entity."""
    pass

class MessageStateError(Exception):
    """The message has already been acknowledged."""
    pass

class LimitExceeded(Exception):
    """Limit exceeded."""
    pass

class ConnectionLimitExceeded(LimitExceeded):
    """Maximum number of simultaneous connections exceeded."""
    pass

class ChannelLimitExceeded(LimitExceeded):
    """Maximum number of simultaneous channels exceeded."""
    pass

class StdChannelError(Exception):
    pass

class VersionMismatch(Exception):
    pass

class SerializerNotInstalled(StandardError):
    """Support for the requested serialization type is not installed"""
    pass


text:
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;

import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;

public class GameOfLife extends PApplet {

/**
 * A Processing implementation of Game of Life
 * By Joan Soler-Adillon
 *
 * Press SPACE BAR to pause and change the cell's values with the mouse
 * On pause, click to activate/deactivate cells
 * Press R to randomly reset the cells' grid
 * Press C to clear the cells' grid
 *
 * The original Game of Life was created by John Conway in 1970.
 */

// Size of cells
int cellSize = 5;

// How likely for a cell to be alive at start (in percentage)
float probabilityOfAliveAtStart = 15;

// Variables for timer
int interval = 100;
int lastRecordedTime = 0;

// Colors for active/inactive cells
int alive = color(0, 200, 0);
int dead = color(0);

// Array of cells
int[][] cells;
// Buffer to record the state of the cells and use this while changing the others in the interations
int[][] cellsBuffer;

// Pause
boolean pause = false;

public void setup() {
  size (640, 360);

  // Instantiate arrays
  cells = new int[width/cellSize][height/cellSize];
  cellsBuffer = new int[width/cellSize][height/cellSize];

  // This stroke will draw the background grid
  stroke(48);

  noSmooth();

  // Initialization of cells
  for (int x=0; x<width/cellSize; x++) {
    for (int y=0; y<height/cellSize; y++) {
      float state = random (100);
      if (state > probabilityOfAliveAtStart) {
        state = 0;
      }
      else {
        state = 1;
      }
      cells[x][y] = PApplet.parseInt(state); // Save state of each cell
    }
  }
  background(0); // Fill in black in case cells don't cover all the windows
}

public void draw() {

  //Draw grid
  for (int x=0; x<width/cellSize; x++) {
    for (int y=0; y<height/cellSize; y++) {
      if (cells[x][y]==1) {
        fill(alive); // If alive
      }
      else {
        fill(dead); // If dead
      }
      rect (x*cellSize, y*cellSize, cellSize, cellSize);
    }
  }
  // Iterate if timer ticks
  if (millis()-lastRecordedTime>interval) {
    if (!pause) {
      iteration();
      lastRecordedTime = millis();
    }
  }

  // Create  new cells manually on pause
  if (pause && mousePressed) {
    // Map and avoid out of bound errors
    int xCellOver = PApplet.parseInt(map(mouseX, 0, width, 0, width/cellSize));
    xCellOver = constrain(xCellOver, 0, width/cellSize-1);
    int yCellOver = PApplet.parseInt(map(mouseY, 0, height, 0, height/cellSize));
    yCellOver = constrain(yCellOver, 0, height/cellSize-1);

    // Check against cells in buffer
    if (cellsBuffer[xCellOver][yCellOver]==1) { // Cell is alive
      cells[xCellOver][yCellOver]=0; // Kill
      fill(dead); // Fill with kill color
    }
    else { // Cell is dead
      cells[xCellOver][yCellOver]=1; // Make alive
      fill(alive); // Fill alive color
    }
  }
  else if (pause && !mousePressed) { // And then save to buffer once mouse goes up
    // Save cells to buffer (so we opeate with one array keeping the other intact)
    for (int x=0; x<width/cellSize; x++) {
      for (int y=0; y<height/cellSize; y++) {
        cellsBuffer[x][y] = cells[x][y];
      }
    }
  }
}

public void iteration() { // When the clock ticks
  // Save cells to buffer (so we opeate with one array keeping the other intact)
  for (int x=0; x<width/cellSize; x++) {
    for (int y=0; y<height/cellSize; y++) {
      cellsBuffer[x][y] = cells[x][y];
    }
  }

  // Visit each cell:
  for (int x=0; x<width/cellSize; x++) {
    for (int y=0; y<height/cellSize; y++) {
      // And visit all the neighbours of each cell
      int neighbours = 0; // We'll count the neighbours
      for (int xx=x-1; xx<=x+1;xx++) {
        for (int yy=y-1; yy<=y+1;yy++) {
          if (((xx>=0)&&(xx<width/cellSize))&&((yy>=0)&&(yy<height/cellSize))) { // Make sure you are not out of bounds
            if (!((xx==x)&&(yy==y))) { // Make sure to to check against self
              if (cellsBuffer[xx][yy]==1){
                neighbours ++; // Check alive neighbours and count them
              }
            } // End of if
          } // End of if
        } // End of yy loop
      } //End of xx loop
      // We've checked the neigbours: apply rules!
      if (cellsBuffer[x][y]==1) { // The cell is alive: kill it if necessary
        if (neighbours < 2 || neighbours > 3) {
          cells[x][y] = 0; // Die unless it has 2 or 3 neighbours
        }
      }
      else { // The cell is dead: make it live if necessary
        if (neighbours == 3 ) {
          cells[x][y] = 1; // Only if it has 3 neighbours
        }
      } // End of if
    } // End of y loop
  } // End of x loop
} // End of function

public void keyPressed() {
  if (key=='r' || key == 'R') {
    // Restart: reinitialization of cells
    for (int x=0; x<width/cellSize; x++) {
      for (int y=0; y<height/cellSize; y++) {
        float state = random (100);
        if (state > probabilityOfAliveAtStart) {
          state = 0;
        }
        else {
          state = 1;
        }
        cells[x][y] = PApplet.parseInt(state); // Save state of each cell
      }
    }
  }
  if (key==' ') { // On/off of pause
    pause = !pause;
  }
  if (key=='c' || key == 'C') { // Clear all
    for (int x=0; x<width/cellSize; x++) {
      for (int y=0; y<height/cellSize; y++) {
        cells[x][y] = 0; // Save all to zero
      }
    }
  }
}

  static public void main(String[] passedArgs) {
    String[] appletArgs = new String[] { "GameOfLife" };
    if (passedArgs != null) {
      PApplet.main(concat(appletArgs, passedArgs));
    } else {
      PApplet.main(appletArgs);
    }
  }
}


text:
We're using go on the backend, and vue on the front. Using mongo for the database.
Just need to bang out the basic CRUD functions first, don't bother with spreadsheet view.

## Reference: Things Chosen
* [The NewStack: Building an App with Go](https://thenewstack.io/make-a-restful-json-api-go/)
* [How to Build a Microservice in MongoDB with Go](http://goinbigdata.com/how-to-build-microservice-with-mongodb-in-golang/)
* [Vue practical examples](https://tutorialzine.com/2016/03/5-practical-examples-for-learning-vue-js)
* [REST, Go, Gorilla](https://medium.com/@maumribeiro/a-fullstack-epic-part-i-a-rest-api-in-go-accessing-mongo-db-608b46e969cd)

### Database Related
* [MongoDB tutorial](https://www.youtube.com/watch?v=pWbMrx5rVBE)
* [mgo simple example](http://www.jancarloviray.com/blog/go-mongodb-simple-example/)
* [Mongo / mgo samples](https://gist.github.com/ardan-bkennedy/9198289)

### Testing Related
* [Golang unit testing tips](https://medium.com/@matryer/5-simple-tips-and-tricks-for-writing-unit-tests-in-golang-619653f90742}

## Under Evaluation
* [Vue Admin Panel](https://github.com/vue-bulma/vue-admin)

## Reference: Alternatives Reviewed
* [Alternative to Gorilla: REST services made easy in go with go-restful](https://github.com/emicklei/go-restful)
* [go-restful example](http://ernestmicklei.com/2012/11/go-restful-first-working-example/)

Log
---
TEST LOG ENTRY

#### Mon Aug 21 14:34:55 2017
Next thing is to handle ErrNotFound conditions.

#### Mon Aug 21 12:32:29 2017
Done. OK - Moving the crud code from the unit test into a dao object.

Stories
---
### Load applications from excel sheets
ok - what we're dealing with here - getting shit loaded into mongodb from excel.
ok - the basics are working.

### GET applications via REST service
ok - want to pull the data from the database, test with a curl call.
ok - we can do it now. returns a list from the database.

POST applications
DELETE applications
PUT applications

### View applications
ok - we want to do this with vue. get from REST call, make pretty

Search applications

GET ci
POST ci
DELETE ci
PUT ci


text:
<?php

namespace BoomCMS\Tests\FileInfo;

use BoomCMS\FileInfo\Facade as FileInfo;
use BoomCMS\Tests\AbstractTestCase;
use Symfony\Component\HttpFoundation\File\File;

abstract class BaseDriverTest extends AbstractTestCase
{
    protected function getInfo($filename)
    {
        $path = realpath(__DIR__."/../files/$filename");
        $file = new File($path);
        $info = FileInfo::create($file);

        return $info;
    }
}


text:
package taskcontroller

import (
	"testing"

	"github.com/ccremer/clustercode/pkg/api/v1alpha1"
	"github.com/ccremer/clustercode/pkg/internal/types"
	"github.com/stretchr/testify/assert"
	batchv1 "k8s.io/api/batch/v1"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/api/resource"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/utils/pointer"
)

func Test_createClustercodeJobDefinition(t *testing.T) {
	tests := map[string]struct {
		givenJob    *batchv1.Job
		givenTask   *v1alpha1.Task
		expectedJob *batchv1.Job
	}{
		"GivenNoTemplate_ThenExpectDefaultJobSpec": {
			givenJob: &batchv1.Job{},
			givenTask: &v1alpha1.Task{
				Spec: v1alpha1.TaskSpec{
					Encode: v1alpha1.EncodeSpec{},
					Storage: v1alpha1.StorageSpec{
						SourcePvc: v1alpha1.VolumeRef{
							ClaimName: "source-claim"}}}},
			expectedJob: &batchv1.Job{
				Spec: batchv1.JobSpec{
					BackoffLimit: pointer.Int32(0),
					Template: corev1.PodTemplateSpec{
						Spec: corev1.PodSpec{
							InitContainers: []corev1.Container{},
							RestartPolicy:  corev1.RestartPolicyNever,
							Containers: []corev1.Container{{
								Name:  "clustercode",
								Image: "image:tag",
								Args:  []string{"arg1"},
								VolumeMounts: []corev1.VolumeMount{{
									Name:      "source",
									MountPath: "/clustercode/source",
								}}}},
							Volumes: []corev1.Volume{{
								Name: "source",
								VolumeSource: corev1.VolumeSource{
									PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
										ClaimName: "source-claim"}}}},
						},
					},
				},
			},
		},
		"GivenPodTemplate_WhenTemplateIsAdditive_ThenExpectDefaultJobSpecWithAdditions": {
			givenJob: &batchv1.Job{},
			givenTask: &v1alpha1.Task{
				Spec: v1alpha1.TaskSpec{
					Encode: v1alpha1.EncodeSpec{
						PodTemplate: v1alpha1.PodTemplate{
							Volumes: []corev1.Volume{{
								Name: "extra",
								VolumeSource: corev1.VolumeSource{
									HostPath: &corev1.HostPathVolumeSource{Path: "/path"}}}},
							Containers: []v1alpha1.ContainerTemplate{{
								Name:    "sidecar",
								Image:   "registry.com/repo/image:tag",
								Command: []string{"command"},
								Args:    []string{"args"},
								EnvFrom: []corev1.EnvFromSource{{
									ConfigMapRef: &corev1.ConfigMapEnvSource{LocalObjectReference: corev1.LocalObjectReference{Name: "configmap"}}}},
								Env: []corev1.EnvVar{{
									Name: "ENV_VAR", Value: "value"}},
								ImagePullPolicy: "",
								VolumeMounts: []corev1.VolumeMount{{
									Name:      "extraVolume",
									MountPath: "/extra/mount"}},
								Resources: corev1.ResourceRequirements{
									Requests: map[corev1.ResourceName]resource.Quantity{
										"memory": resource.MustParse("1G")}},
								SecurityContext: &corev1.SecurityContext{
									RunAsUser: pointer.Int64(33)}}},
						},
					},
					Storage: v1alpha1.StorageSpec{
						SourcePvc: v1alpha1.VolumeRef{
							ClaimName: "source-claim"}}}},
			expectedJob: &batchv1.Job{
				Spec: batchv1.JobSpec{
					BackoffLimit: pointer.Int32(0),
					Template: corev1.PodTemplateSpec{
						Spec: corev1.PodSpec{
							InitContainers: []corev1.Container{},
							RestartPolicy:  corev1.RestartPolicyNever,
							Containers: []corev1.Container{
								{
									Name:    "sidecar",
									Image:   "registry.com/repo/image:tag",
									Command: []string{"command"},
									Args:    []string{"args"},
									EnvFrom: []corev1.EnvFromSource{{
										ConfigMapRef: &corev1.ConfigMapEnvSource{LocalObjectReference: corev1.LocalObjectReference{Name: "configmap"}}}},
									Env: []corev1.EnvVar{{
										Name: "ENV_VAR", Value: "value"}},
									ImagePullPolicy: "",
									VolumeMounts: []corev1.VolumeMount{{
										Name:      "extraVolume",
										MountPath: "/extra/mount"}},
									Resources: corev1.ResourceRequirements{
										Requests: map[corev1.ResourceName]resource.Quantity{
											"memory": resource.MustParse("1G")}},
									SecurityContext: &corev1.SecurityContext{
										RunAsUser: pointer.Int64(33)},
								},
								{
									Name:  "clustercode",
									Args:  []string{"arg1"},
									Image: "image:tag",
									VolumeMounts: []corev1.VolumeMount{{
										Name:      "source",
										MountPath: "/clustercode/source"}},
								},
							},
							Volumes: []corev1.Volume{
								{
									Name: "extra",
									VolumeSource: corev1.VolumeSource{
										HostPath: &corev1.HostPathVolumeSource{Path: "/path"}},
								},
								{
									Name: "source",
									VolumeSource: corev1.VolumeSource{
										PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
											ClaimName: "source-claim"}},
								},
							},
						},
					},
				}},
		},
		"GivenPodTemplate_WhenTemplateIsOverwriting_ThenExpectDefaultJobSpecWithMergedProperties": {
			givenJob: &batchv1.Job{},
			givenTask: &v1alpha1.Task{
				Spec: v1alpha1.TaskSpec{
					Encode: v1alpha1.EncodeSpec{
						PodTemplate: v1alpha1.PodTemplate{
							Metadata: &v1alpha1.PodMetadata{
								Labels: map[string]string{"key": "value"}},
							Volumes: []corev1.Volume{{
								Name: "source",
								VolumeSource: corev1.VolumeSource{
									HostPath: &corev1.HostPathVolumeSource{Path: "/path"}}}},
							Containers: []v1alpha1.ContainerTemplate{{
								Name:            "clustercode",
								Image:           "registry.com/repo/image:tag", // custom image won't be set
								ImagePullPolicy: corev1.PullAlways,
								Env: []corev1.EnvVar{{ // let's add an env var
									Name: "ENV_VAR", Value: "value"}},
								SecurityContext: &corev1.SecurityContext{
									RunAsUser: pointer.Int64(33)},
							}}},
					}}},
			expectedJob: &batchv1.Job{
				Spec: batchv1.JobSpec{
					BackoffLimit: pointer.Int32(0),
					Template: corev1.PodTemplateSpec{
						ObjectMeta: metav1.ObjectMeta{
							Labels: map[string]string{"key": "value"}},
						Spec: corev1.PodSpec{
							InitContainers: []corev1.Container{},
							RestartPolicy:  corev1.RestartPolicyNever,
							Containers: []corev1.Container{{
								Name:            "clustercode",
								Image:           "image:tag",
								ImagePullPolicy: corev1.PullAlways,
								Args:            []string{"arg1"},
								Env: []corev1.EnvVar{{
									Name: "ENV_VAR", Value: "value"}},
								VolumeMounts: []corev1.VolumeMount{{
									Name:      "source",
									MountPath: "/clustercode/source"}},
								SecurityContext: &corev1.SecurityContext{
									RunAsUser: pointer.Int64(33)}}},
							Volumes: []corev1.Volume{{
								Name: "source",
								VolumeSource: corev1.VolumeSource{
									HostPath: &corev1.HostPathVolumeSource{Path: "/path"}}}},
						},
					},
				},
			},
		},
	}
	for name, tt := range tests {
		t.Run(name, func(t *testing.T) {
			createClustercodeJobDefinition(tt.givenJob, tt.givenTask, TaskOpts{
				template:    tt.givenTask.Spec.Encode.PodTemplate,
				image:       "image:tag",
				args:        []string{"arg1"},
				jobType:     types.JobTypeSplit,
				mountSource: true,
			})
			assert.Equal(t, tt.expectedJob.Spec, tt.givenJob.Spec)
		})
	}
}


text:
//// [parserMemberAccessorDeclaration6.ts]
class C {
  set 0(i) { }
}

//// [parserMemberAccessorDeclaration6.js]
var C = /** @class */ (function () {
    function C() {
    }
    Object.defineProperty(C.prototype, 0, {
        set: function (i) { },
        enumerable: false,
        configurable: true
    });
    return C;
}());


text:
'use strict';

const bo = require( '../../../source/index.js' );
const Model = bo.ModelComposer;

const BlanketOrderItemView = require( './blanket-order-item-view.js' );

const BlanketOrderItemsView = new Model( 'BlanketOrderItemsView' )
  .readOnlyChildCollection()
  // --- Collection elements
  .itemType( BlanketOrderItemView )
  // --- Build model class
  .compose();

module.exports = BlanketOrderItemsView;


text:
export * from './components/Address';
export * from './components/Apps';
export * from './components/Badge';
export * from './components/Box';
export * from './components/Breadcrumb';
export * from './components/Button';
export * from './components/Card';
export * from './components/Circle';
export * from './components/Code';
export * from './components/Compositions';
export * from './components/Copyable';
export * from './components/Dashboard';
export * from './components/Debug';
export * from './components/Details';
export * from './components/Dropdown';
export * from './components/Filters';
export * from './components/Flag';
export * from './components/Flex';
export * from './components/Form';
export * from './components/Funnel';
export * from './components/Gallery';
export * from './components/Grid';
export * from './components/Guide';
export * from './components/Headline';
export * from './components/HeroUnit';
export * from './components/Highlight';
export * from './components/Hint';
export * from './components/Icon';
export * from './components/Info';
export * from './components/InlineList';
export * from './components/Kpi';
export * from './components/Line';
export * from './components/List';
export * from './components/Lookup';
export * from './components/Media';
export * from './components/Message';
export * from './components/Modal';
export * from './components/Nav';
export * from './components/Page';
export * from './components/Pagination';
export * from './components/Paragraph';
export * from './components/Progress';
export * from './components/Pull';
export * from './components/Resource';
export * from './components/Sidebar';
export * from './components/Spacing';
export * from './components/Spinner';
export * from './components/Table';
export * from './components/Tabs';
export * from './components/Tag';
export * from './components/Text';
export * from './components/Thumbnail';
export * from './components/Timeline';
export * from './components/Tooltip';
export * from './components/Transfer';
export * from './components/Tree';
export * from './components/Wizard';
export * from './components/Wrapper';
export * from './components/Wundery';
export * from './utils';


text:
using FluentAssertions;
using LogShark.Plugins.Vizportal;
using LogShark.Tests.Plugins.Helpers;
using Microsoft.Extensions.Logging.Abstractions;
using System;
using System.Collections.Generic;
using System.Linq;
using LogShark.Shared;
using LogShark.Shared.LogReading.Containers;
using Xunit;

namespace LogShark.Tests.Plugins
{
    public class VizportalPluginTests : InvariantCultureTestsBase
    {
        private static readonly LogFileInfo TestLogFileInfo = new LogFileInfo("vizportal-0.log", @"vizportal/vizportal-0.log", "node1", DateTime.MinValue);

        [Fact]
        public void BadInput()
        {
            var processingNotificationsCollector = new ProcessingNotificationsCollector(10);
            var testWriterFactory = new TestWriterFactory();
            using (var plugin = new VizportalPlugin())
            {
                plugin.Configure(testWriterFactory, null, processingNotificationsCollector, new NullLoggerFactory());

                var wrongContentFormat = new LogLine(new ReadLogLineResult(123, 1234), TestLogFileInfo);
                var nullContent = new LogLine(new ReadLogLineResult(123, null), TestLogFileInfo);
                var wrongContent = new LogLine(new ReadLogLineResult(123, "I am not a log line!"), TestLogFileInfo);

                plugin.ProcessLogLine(wrongContentFormat, LogType.VizportalJava);
                plugin.ProcessLogLine(nullContent, LogType.VizportalJava);
                plugin.ProcessLogLine(wrongContent, LogType.VizportalJava);

                plugin.CompleteProcessing();
            }

            testWriterFactory.AssertAllWritersAreDisposedAndEmpty(1);
            processingNotificationsCollector.TotalErrorsReported.Should().Be(3);
        }

        [Fact]
        public void RunTestCases()
        {
            var testWriterFactory = new TestWriterFactory();
            using (var plugin = new VizportalPlugin())
            {
                plugin.Configure(testWriterFactory, null, null, new NullLoggerFactory());

                foreach (var testCase in _testCases)
                {
                    var logLine = testCase.GetLogLine();
                    plugin.ProcessLogLine(logLine, LogType.VizportalJava);
                }

                plugin.CompleteProcessing();
            }

            var expectedOutput = _testCases.Select(testCase => testCase.ExpectedOutput).ToList();
            var testWriter = testWriterFactory.GetOneWriterAndVerifyOthersAreEmptyAndDisposed<VizportalEvent>("VizportalEvents", 1);
            testWriter.ReceivedObjects.Should().BeEquivalentTo(expectedOutput);
        }

        private readonly List<PluginTestCase> _testCases = new List<PluginTestCase>
        {
            new PluginTestCase // random line from test logs
            {
                LogContents = @"2018-07-12 17:13:42.835 -0700 (-,-,-,W0futr2lVgac7tY08X1vpwAAA90,0:-12ed38f9:16490d16613:-7fe1) catalina-exec-1 vizportal: INFO  com.tableausoftware.app.vizportal.LoggingInterceptor - Request received: /v1/getSessionInfo",
                LogFileInfo = TestLogFileInfo,
                LineNumber = 1,
                ExpectedOutput = new
                {
                    Class = "com.tableausoftware.app.vizportal.LoggingInterceptor",
                    FileName = "vizportal-0.log",
                    FilePath = @"vizportal/vizportal-0.log",
                    LineNumber = 1,
                    Message = @"Request received: /v1/getSessionInfo",
                    RequestId = "W0futr2lVgac7tY08X1vpwAAA90",
                    SessionId = "-",
                    Severity = "INFO",
                    Site = "-",
                    Timestamp = DateTime.Parse("2018-07-12 17:13:42.835"),
                    User = "-",
                    Worker = "node1"
                }
            }
        };
    }
}


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

    <string name="app_name">Coins</string>
    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
    <string name="title_activity_edit_btc">Edit Quantity</string>
    <string name="updated_just_now">Updated just now</string>
    <string name="updated_never">Never updated</string>
    <string name="updating">Updating…</string>
    <string name="no_network">No Internet connection.</string>
    <string name="updated_format">Updated %s</string>
    <string name="title_activity_currency_picker">Pick Currency</string>

</resources>


text:
package com.hazelcast.client.impl.protocol.task;

import com.hazelcast.spi.impl.PartitionSpecificRunnable;

/**
 * Interface for all client message tasks to implement
 */
public interface MessageTask extends PartitionSpecificRunnable {
}


text:
function ChartMaker_BookRDates() {
    var options = {
        url_data: '/chrt-book-rdates-data'
      , prepareForChart: prepareForChart
      , $cont: $('#cont-chart-general')
      , formInit: undefined
      , trackFormatter: trackFormatter
      , xTickFormatter: xTickFormatter
      , yTickFormatter: yTickFormatter
    };

    new ChartMaker(options).run();

    /*
         { stats:
             [{ rdate: date
              , rcount: integer
              }
             ]
         }

       \/ \/ \/

         { stats: [[rdate],[rcount]] }

     */

    function prepareForChart(beBookData) {
        var stats = beBookData.stats;
        var hasData = stats.length > 0;

        if(!hasData)
            return undefined;
        else {
            var xs_dates = [];
            var xs_unixDates = [];
            var ys = [];
            var stat;
            var lastX = undefined;

            var zoomStartPos = undefined;
            var zoomEndPos   = undefined;

            for(var i = 0; i < stats.length; i++) {
                stat = stats[i];
                var rdate = moment(stat.rdate);
                var rdate_end = moment(rdate);
                rdate_end.add('d', 1);
                rdate_end.subtract('s', 1);
                var yesterday = undefined;

                if(lastX === undefined) {
                    var     yesterday = moment(rdate)
                      , abitYesterday = moment(rdate)
                      ;
                    yesterday.subtract('d', 1);
                    abitYesterday.subtract('s', 1);
                    xs_dates.push(yesterday);
                    xs_dates.push(abitYesterday);
                    ys.push(0);
                    ys.push(0);
                } else if(moment(rdate).format('YYYYMMDD') !== moment(lastX).add('d', 1).format('YYYYMMDD')) {
                    var lastX_nextDay = moment(lastX)
                      , abitYesterday = moment(rdate)
                      ;
                    lastX_nextDay.add('d', 1);
                    abitYesterday.subtract('s', 1);
                    xs_dates.push(lastX_nextDay);
                    xs_dates.push(abitYesterday);
                    ys.push(0);
                    ys.push(0);
                }

                xs_dates.push(rdate);
                xs_dates.push(rdate_end);
                ys.push(stat.rcount);
                ys.push(stat.rcount);

                lastX = rdate;

                if(zoomStartPos === undefined && stat.rcount > 0) {
                    if(yesterday === undefined) {
                        yesterday = moment(rdate);
                        yesterday.subtract('d', 1);
                    }
                    zoomStartPos = yesterday;
                }
            }

            var today = moment();

            if(lastX < today) {
                var afterLastX = moment(lastX);
                afterLastX.add('d', 1);

                if(afterLastX < today) {
                    xs_dates.push(afterLastX)
                    ys.push(0);
                    xs_dates.push(today);
                    ys.push(0);

                }
            }

            var mToday = moment(today)
              , mLastX = moment(lastX)
              , mZoomStartPos = moment(zoomStartPos)
              , dOverall   = mToday.diff(mZoomStartPos, 'd')
              , dWithLastX = mLastX.diff(mZoomStartPos, 'd')
              , zoomDX = Math.round(dWithLastX < dOverall*0.3 ? dWithLastX : dWithLastX * 0.3)
              ;
            zoomEndPos = mZoomStartPos.add('d', zoomDX)

            xs_unixDates = _.map(xs_dates, function(date){
                return date.unix();
            });
            zoomStartPos = zoomStartPos.unix();
            zoomEndPos   = zoomEndPos  .unix();

            var flags = [];
            var firstDate = xs_dates[0]
              , lastDate  = xs_dates[xs_dates.length - 1]
              ;
            if(lastDate.diff(firstDate, 'M') <= 6) {
                var itMoment = firstDate;
                itMoment.date(1);
                itMoment.add('M', 1);
                while(itMoment.isBefore(lastDate)) {
                    flags.push({x: itMoment.unix(), content: itMoment.format('DD MMM YYYY')});
                    itMoment.add('M', 1);
                }
            } else {
                var itMoment = firstDate;
                itMoment.day(1);
                var month = itMoment.month() + 1;
                month = month + 4 - (month % 4);
                month = month - 1;
                itMoment.month(month);
                itMoment.date(1);
                while(itMoment.isBefore(lastDate)) {
                    flags.push({x: itMoment.unix(), content: itMoment.format('DD MMM YYYY')});
                    itMoment.add('M', 4);
                }
            }

            var ret = {
                stats: [xs_unixDates,ys]
              , flags: flags
              , zoomStartPos: zoomStartPos
              , zoomEndPos: zoomEndPos
            };

            return ret;
        }
    }

    function trackFormatter(envHit, preparedChartData) {
        var hint = '';
        var idxHeading = undefined;

        hint += 'Reads date: ' + moment.unix(envHit.x).format('YYYY-MM-DD') + '<br/>';
        hint += 'Reads count: ' + parseInt(envHit.y);

        return hint;
    }
    function xTickFormatter(x) {
        return moment.unix(x).format('YYYY-MM-DD');
    }
    function yTickFormatter(n) {
        if(n - Math.floor(n) < 0.0001)
            return Math.floor(n);
        else return '';
    }
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v12/resources/recommendation.proto

namespace Google\Ads\GoogleAds\V12\Resources;

if (false) {
    /**
     * This class is deprecated. Use Google\Ads\GoogleAds\V12\Resources\Recommendation\RecommendationMetrics instead.
     * @deprecated
     */
    class Recommendation_RecommendationMetrics {}
}
class_exists(Recommendation\RecommendationMetrics::class);
@trigger_error('Google\Ads\GoogleAds\V12\Resources\Recommendation_RecommendationMetrics is deprecated and will be removed in the next major release. Use Google\Ads\GoogleAds\V12\Resources\Recommendation\RecommendationMetrics instead', E_USER_DEPRECATED);


text:
module.exports = function(babel) {
  const t = babel.types;

  function moriMethod(name) {
    let expr = t.memberExpression(
      t.identifier('mori'),
      t.identifier(name)
    );

    expr.isInner = true;
    return expr;
  }

  return {
    visitor: {
      ArrayExpression: function(path) {
        path.replaceWith(
          t.callExpression(
            moriMethod('vector'),
            path.node.elements
          )
        );
      },
      ObjectExpression: function(path) {
        let props = [];

        path.node.properties.forEach(function(prop) {
          props.push(
            t.stringLiteral(prop.key.name),
            prop.value
          );
        });

        path.replaceWith(
          t.callExpression(
            moriMethod('hashMap'),
            props
          )
        );
      },
      AssignmentExpression: function(path) {
        let props = [
          path.node.left.object,
          t.stringLiteral(path.node.left.property.name),
          path.node.right
        ];

        path.replaceWith(
          t.callExpression(
            moriMethod('assign'),
            props
          )
        );
      },
      MemberExpression: function(path) {
        if (path.node.isInner) return; // escape moriMethod call
        if (t.isAssignmentExpression(path.parent) || t.isCallExpression(path.parent)) return;

        path.replaceWith(
          t.callExpression(
            moriMethod('get'), [
              path.node.object,
              t.stringLiteral(path.node.property.name)
            ]
          )
        );
      },
      CallExpression(path) {
        const callee = path.node.callee;

        if (t.isMemberExpression(callee)) {
          if (callee.isInner) return; // escape moriMethod call

          path.replaceWith(
            t.callExpression(
              moriMethod('call'), [
                callee.object,
                callee.property,
                ...path.node.arguments
              ]
            )
          );

        } else {
          path.replaceWith(
            t.callExpression(
              moriMethod('call'), [
                callee,
                ...path.node.arguments
              ]
            )
          );
        }
      }
    }
  };
};


text:
(function () {
    'use strict';

    angular
        .module('contactMessageModule')
        .factory('contactMessageDataService', contactMessageDataService);

    contactMessageDataService.$inject = ['$http'];

    function contactMessageDataService($http) {
        var service = {
            getDataLookup: getDataLookup,
            saveData: saveData
        };

        return service;

        function getDataLookup() {
            return $http({
                url: 'http://localhost:24218/api/lookupdata',
                method:'GET'
            });
        }

        function saveData(dataToSave) {
            return $http({
                url: 'http://localhost:24218/api/contactMessages',
                method: 'POST',
                data: dataToSave
            });
        }
    }
})();


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.alexstyl.specialdates"
    android:installLocation="internalOnly">

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />

    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="18" />

    <!-- The BLUETOOTH permission is used for mixpanel-->
    <uses-permission android:name="android.permission.BLUETOOTH" />

    <uses-permission android:name="com.android.vending.BILLING" />

    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />

    <application
        android:name="com.alexstyl.specialdates.MementoApplication"
        android:allowBackup="true"
        android:exported="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/localised_app_name">

        <activity android:name="com.alexstyl.specialdates.home.HomeActivity" />

        <!-- Activity alias used so that we can modify the UpcomingEventsActivity file without worrying about the name -->
        <activity-alias
            android:name="com.alexstyl.specialdates.ui.activity.MainActivity"
            android:targetActivity=".home.HomeActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity-alias>

        <activity
            android:name="com.alexstyl.specialdates.search.SearchActivity"
            android:parentActivityName="com.alexstyl.specialdates.home.HomeActivity"
            android:windowSoftInputMode="stateVisible|adjustResize">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.alexstyl.specialdates.home.HomeActivity" />
        </activity>

        <activity
            android:name=".settings.DailyReminderActivity"
            android:exported="true"
            android:label="@string/daily_reminder"
            android:launchMode="singleInstance"
            android:parentActivityName=".home.HomeActivity">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".home.HomeActivity" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
            </intent-filter>
        </activity>

        <activity
            android:name="com.alexstyl.specialdates.addevent.AddEventActivity"
            android:exported="true"
            android:label="@string/add_event_title"
            android:parentActivityName="com.alexstyl.specialdates.home.HomeActivity"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="stateHidden">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.alexstyl.specialdates.home.HomeActivity" />
        </activity>

        <activity
            android:name="com.alexstyl.specialdates.support.RateDialog"
            android:label="@string/support_app"
            android:noHistory="true"
            android:parentActivityName="com.alexstyl.specialdates.home.HomeActivity"
            android:theme="@style/Theme.Dayslight.DialogNoTitle">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.alexstyl.specialdates.home.HomeActivity" />
        </activity>

        <activity
            android:name=".upcoming.widget.today.UpcomingWidgetConfigureActivity"
            android:label="@string/Configure_widget"
            android:noHistory="true"
            android:theme="@style/Theme.Memento.Wallpaper">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>

        <activity
            android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
            android:theme="@style/Base.Theme.AppCompat" />

        <activity android:name=".permissions.ContactPermissionActivity" />

        <activity
            android:name=".donate.DonateActivity"
            android:label="@string/donate_welcome"
            android:parentActivityName=".home.HomeActivity"
            android:theme="@style/Theme.Donate" />

        <activity
            android:name=".facebook.login.FacebookLogInActivity"
            android:label="@string/title_facebook_log_in" />

        <activity
            android:name=".facebook.FacebookProfileActivity"
            android:label="@string/title_facebook_profile" />

        <activity
            android:name=".person.PersonActivity"
            android:parentActivityName=".home.HomeActivity">

            <intent-filter>
                <action android:name="com.android.contacts.action.QUICK_CONTACT" />
                <action android:name="android.provider.action.QUICK_CONTACT" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="vnd.android.cursor.item/contact" />
                <data android:mimeType="vnd.android.cursor.item/person" />
            </intent-filter>

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="vnd.android.cursor.item/person" />
                <data android:mimeType="vnd.android.cursor.item/contact" />
                <data android:mimeType="vnd.android.cursor.item/raw_contact" />
            </intent-filter>

            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".home.HomeActivity" />
        </activity>

        <activity
            android:name=".events.namedays.activity.NamedaysOnADayActivity"
            android:parentActivityName=".home.HomeActivity">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".home.HomeActivity" />
        </activity>

        <activity android:name=".dailyreminder.actions.PersonActionsActivity" />

        <activity android:name=".upcoming.widget.list.WidgetRouterActivity" />
        <!-- Services -->

        <service
            android:name="com.alexstyl.specialdates.wear.WearSyncService"
            android:exported="false" />

        <receiver android:name="com.alexstyl.specialdates.DeviceConfigurationUpdatedReceiver">
            <intent-filter>
                <action android:name="android.intent.action.LOCALE_CHANGED" />
            </intent-filter>
        </receiver>

        <receiver android:name="com.alexstyl.specialdates.receiver.BootCompleteReceiver">
            <intent-filter>
                <action android:name="android.intent.action.TIME_SET" />
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>

        <receiver
            android:name=".upcoming.widget.today.TodayAppWidgetProvider"
            android:label="@string/widget_upcoming_title_simple">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/widget_info_upcoming_events_simple" />
        </receiver>

        <receiver
            android:name=".upcoming.widget.list.UpcomingEventsScrollingAppWidgetProvider"
            android:label="@string/widget_upcoming_title_list">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/widget_info_upcoming_events_list" />
        </receiver>

        <service
            android:name=".upcoming.widget.list.UpcomingEventsRemoteViewService"
            android:permission="android.permission.BIND_REMOTEVIEWS" />

        <service
            android:name=".facebook.friendimport.FacebookFriendsIntentService"
            android:label="@string/title_facebook_friends_import" />

        <meta-data
            android:name="io.fabric.ApiKey"
            android:value="${crashlyticsApiKey}" />

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="${fileProvider}"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>
    </application>

</manifest>


text:
package it.reply.utils.web.ws.rest.apiencoding.decode;

import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.Response.StatusType;

import com.google.common.reflect.TypeParameter;
import com.google.common.reflect.TypeToken;

import com.fasterxml.jackson.databind.JavaType;
import it.reply.utils.json.JsonUtility;
import it.reply.utils.web.ws.rest.apiencoding.MappingException;
import it.reply.utils.web.ws.rest.apiencoding.NoMappingModelFoundException;
import it.reply.utils.web.ws.rest.apiencoding.RestMessage;
import it.reply.utils.web.ws.rest.apiencoding.ServerErrorResponseException;

import java.io.IOException;

public abstract class SimpleRestResponseDecoder<APIResponseType> extends
BaseRestResponseDecoder<BaseRestResponseResult<APIResponseType, String>, APIResponseType>
{

  protected boolean checkMediaType;

  public SimpleRestResponseDecoder(boolean checkMediaType) {
    super();
    this.checkMediaType = checkMediaType;
  }

  public SimpleRestResponseDecoder() {
    this(true);
  }

  private TypeToken<APIResponseType> type = new TypeToken<APIResponseType>(getClass()) {
    private static final long serialVersionUID = 1L;
  };

  protected TypeToken<APIResponseType> getType() {
    return type;
  }

  /**
   * Allows to set the correct type for a generic that are not resolvable through reflection because
   * of the erasure (i.e. the generic is a method type variable)
   *
   *

   * RestResponseResult{@code<List<REPRESENTATION_TYPE>>} result = getRestClient().getRequest(URL, null,
   *     null, null, new SimpleRestResponseDecoder{@code<List<REPRESENTATION_TYPE>>}() {
   *     }.where(new TypeParameter{@code<REPRESENTATION_TYPE>}() {
   *     }, new TypeToken{@code<REPRESENTATION_TYPE>}(ActualRepresentationClass.class)), null);
   *

   */
  public <X> SimpleRestResponseDecoder<APIResponseType> where(TypeParameter<X> typeParam,
      TypeToken<X> typeArg) {
    this.type = type.where(typeParam, typeArg);
    return this;
  }

  /**
   * Allows to set the correct type for a generic that are not resolvable through reflection because
   * of the erasure (i.e. the generic is a method type variable)
   *
   *

   * RestResponseResult{@code<List<REPRESENTATION_TYPE>>} result = getRestClient().getRequest(URL, null,
   *     null, null, new SimpleRestResponseDecoder{@code<List<REPRESENTATION_TYPE>>}() {
   *     }.where(new TypeParameter{@code<REPRESENTATION_TYPE>}() {
   *     }, ActualRepresentationClass.class), null);
   *

   */
  public <X> SimpleRestResponseDecoder<APIResponseType> where(TypeParameter<X> typeParam,
      Class<X> typeArg) {
    this.type = type.where(typeParam, typeArg);
    return this;
  }

  @Override
  public RestResponseDecodeStrategy<String> getDefaultDecodeStrategy() {
    throw new UnsupportedOperationException("RestResponseDecodeStrategy are not supported");
  }

  @Override
  public void setDefaultDecodeStrategy(RestResponseDecodeStrategy<String> defaultDecodeStrategy) {
    throw new UnsupportedOperationException("RestResponseDecodeStrategy are not supported");
  }

  @Override
  public BaseRestResponseResult<APIResponseType, String> decode(RestMessage<String> msg, RestResponseDecodeStrategy<String> strategy)
      throws NoMappingModelFoundException, MappingException, ServerErrorResponseException {
    if (strategy != null) {
      throw new UnsupportedOperationException("RestResponseDecodeStrategy are not supported");
    } else {
      return decode(msg);
    }
  }

  @Override
  public BaseRestResponseResult<APIResponseType, String> decode(RestMessage<String> msg)
      throws NoMappingModelFoundException, MappingException, ServerErrorResponseException {

    StatusType status = Status.fromStatusCode(msg.getHttpStatusCode());
    JavaType mappingClass = JsonUtility.getJavaType(getType());

    APIResponseType result = null;
    if (msg.getBody() != null)
    {
      if (checkMediaType) {
        checkMediaType(msg);
      }
      try {
        result = JsonUtility.deserializeJson(msg.getBody(), mappingClass);
      } catch (IOException e) {
        throw new MappingException(e.getMessage(), e, msg);
      }
    }
    return new BaseRestResponseResult<APIResponseType, String>(status, result, mappingClass, msg);
  }
}


text:
<?php

use yii\db\Migration;

class m160706_092333_AddUsersTable extends Migration
{
    public function up()
    {
        $this->createTable('users', [
            'id' => $this->primaryKey(),
            'username' => $this->string(50)->notNull()->unique(),
            'password' => $this->string(100)->notNull(),
            'auth_key' => $this->string(100),
            'access_token' =>$this->string(100),
            'first_name' => $this->string(100)->notNull(),
            'last_name' => $this->string(100)->notNull(),
            'email' => $this->string(100)->notNull(),
            'telephone' => $this->string(30),
            'photo_id'=> $this->integer()
        ], 'COLLATE utf8_general_ci');

        $this->addForeignKey('fk_users_photo_id_to_photos_id', 'users', 'photo_id', 'photos', 'id', 'CASCADE');
    }

    public function down()
    {
        $this->dropForeignKey('fk_users_photo_id_to_photos_id', 'users');
        $this->dropTable('users');
    }
}


text:
APPNAME = newspring-public
VERSION = 1.0

ZIP_EXCLUDE= -x xml/* -x artwork/*

include ../app.mk