text:
[![Build Status](https://travis-ci.com/mar10/wsgidav.svg?branch=master)](https://app.travis-ci.com/github/mar10/wsgidav)
[![Latest Version](https://img.shields.io/pypi/v/wsgidav.svg)](https://pypi.python.org/pypi/WsgiDAV/)
[![License](https://img.shields.io/pypi/l/wsgidav.svg)](https://github.com/mar10/wsgidav/blob/master/LICENSE)
[![Documentation Status](https://readthedocs.org/projects/wsgidav/badge/?version=latest)](http://wsgidav.readthedocs.io/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Released with: Yabs](https://img.shields.io/badge/released%20with-yabs-yellowgreen)](https://github.com/mar10/yabs)
[![StackOverflow: WsgiDAV](https://img.shields.io/badge/StackOverflow-WsgiDAV-blue.svg)](https://stackoverflow.com/questions/tagged/WsgiDAV)

[![Edit online in vscode.dev](https://img.shields.io/badge/--007ACC?logo=visual%20studio%20code&logoColor=ffffff) Open in Visual Studio Code (experimental)](https://open.vscode.dev/mar10/wsgidav)

A generic and extendable [WebDAV](http://www.ietf.org/rfc/rfc4918.txt) server
written in Python and based on [WSGI](http://www.python.org/dev/peps/pep-3333/).

Main features:

  - WsgiDAV is a stand-alone WebDAV server with SSL support, that can be
    installed and run as Python command line script on Linux, OSX, and Windows:

    ```
    $ pip install wsgidav cheroot
    $ wsgidav --host=0.0.0.0 --port=80 --root=/tmp --auth=anonymous
    Running without configuration file.
    10:54:16.597 - INFO    : WsgiDAV/4.0.0-a1 Python/3.9.1 macOS-12.0.1-x86_64-i386-64bit
    10:54:16.598 - INFO    : Registered DAV providers by route:
    10:54:16.598 - INFO    :   - '/:dir_browser': FilesystemProvider for path '/Users/martin/prj/git/wsgidav/wsgidav/dir_browser/htdocs' (Read-Only) (anonymous)
    10:54:16.599 - INFO    :   - '/': FilesystemProvider for path '/tmp' (Read-Write) (anonymous)
    10:54:16.599 - WARNING : Basic authentication is enabled: It is highly recommended to enable SSL.
    10:54:16.599 - WARNING : Share '/' will allow anonymous write access.
    10:54:16.813 - INFO    : Running WsgiDAV/4.0.0-a1 Cheroot/8.5.2 Python 3.9.1
    10:54:16.813 - INFO    : Serving on http://0.0.0.0:80 ...
    ```
    Run `wsgidav --help` for a list of available options.

  - python-pam is needed if using pam-login on Linux or OSX:
    ```
    $ pip install python-pam
    $ wsgidav --host=0.0.0.0 --port=8080 --root=/tmp --auth=pam-login
    ```

  - **Note:** Windows users may prefer the
    [MSI Installer](https://github.com/mar10/wsgidav/releases/latest)
    (see Assets section).

  - WebDAV is a superset of HTTP, so WsgiDAV is also a performant, multi-threaded
    web server with SSL support.

  - WsgiDAV is also a Python library that implements the WSGI protocol and can
	  be run behind any WSGI compliant web server.

  - WsgiDAV is implemented as a configurable stack of WSGI middleware
    applications.

    Its open architecture allows to extend the functionality and integrate
    WebDAV services into your project.

  	Typical use cases are:
  	- Expose data structures as virtual, editable file systems.
  	- Allow online editing of MS Office documents.

## Status

[![Latest Version](https://img.shields.io/pypi/v/wsgidav.svg)](https://pypi.python.org/pypi/WsgiDAV/)
See the ([change log](https://github.com/mar10/wsgidav/blob/master/CHANGELOG.md)) for details.

**Note:** Release 4.0 introduces some refactorings and breaking changes.

  See the ([change log](https://github.com/mar10/wsgidav/blob/master/CHANGELOG.md)) for details.

## More info

  * [Read The Docs](http://wsgidav.rtfd.org) for details.
  * [Discussion Group](https://github.com/mar10/wsgidav/discussions)
  * [Stackoverflow](http://stackoverflow.com/questions/tagged/wsgidav)

## Credits

Contributors:

  * WsgiDAV is a [refactored version](https://github.com/mar10/wsgidav/blob/master/docs/source/changelog04.md)
    of [PyFileServer 0.2](https://github.com/cwho/pyfileserver),
    Copyright (c) 2005 Ho Chun Wei.

    Chun gave his approval to change the license from LGPL to MIT-License for
    this project.
  * <https://github.com/mar10/wsgidav/contributors>
  * Markus Majer for providing the logo (a mixture of the international
    maritime signal flag for 'W (Whiskey)' and a dove.)

Any kind of feedback is very welcome!

Have fun  :-)

Martin


text:
.class Landroid/support/v4/widget/SearchViewCompatHoneycomb;
.super Ljava/lang/Object;
.source "SearchViewCompatHoneycomb.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/support/v4/widget/SearchViewCompatHoneycomb$OnQueryTextListenerCompatBridge;,
        Landroid/support/v4/widget/SearchViewCompatHoneycomb$OnCloseListenerCompatBridge;
    }
.end annotation

# direct methods
.method constructor <init>()V
    .locals 0

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

    return-void
.end method

.method public static getQuery(Landroid/view/View;)Ljava/lang/CharSequence;
    .locals 1
    .param p0, "searchView"    # Landroid/view/View;

    .prologue
    .line 84
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Landroid/view/View;
    invoke-virtual {p0}, Landroid/widget/SearchView;->getQuery()Ljava/lang/CharSequence;

    move-result-object v0

    return-object v0
.end method

.method public static isIconified(Landroid/view/View;)Z
    .locals 1
    .param p0, "searchView"    # Landroid/view/View;

    .prologue
    .line 100
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Landroid/view/View;
    invoke-virtual {p0}, Landroid/widget/SearchView;->isIconified()Z

    move-result v0

    return v0
.end method

.method public static isQueryRefinementEnabled(Landroid/view/View;)Z
    .locals 1
    .param p0, "searchView"    # Landroid/view/View;

    .prologue
    .line 116
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Landroid/view/View;
    invoke-virtual {p0}, Landroid/widget/SearchView;->isQueryRefinementEnabled()Z

    move-result v0

    return v0
.end method

.method public static isSubmitButtonEnabled(Landroid/view/View;)Z
    .locals 1
    .param p0, "searchView"    # Landroid/view/View;

    .prologue
    .line 108
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Landroid/view/View;
    invoke-virtual {p0}, Landroid/widget/SearchView;->isSubmitButtonEnabled()Z

    move-result v0

    return v0
.end method

.method public static newOnCloseListener(Landroid/support/v4/widget/SearchViewCompatHoneycomb$OnCloseListenerCompatBridge;)Ljava/lang/Object;
    .locals 1
    .param p0, "listener"    # Landroid/support/v4/widget/SearchViewCompatHoneycomb$OnCloseListenerCompatBridge;

    .prologue
    .line 71
    new-instance v0, Landroid/support/v4/widget/SearchViewCompatHoneycomb$2;

    invoke-direct {v0, p0}, Landroid/support/v4/widget/SearchViewCompatHoneycomb$2;-><init>(Landroid/support/v4/widget/SearchViewCompatHoneycomb$OnCloseListenerCompatBridge;)V

    return-object v0
.end method

.method public static newOnQueryTextListener(Landroid/support/v4/widget/SearchViewCompatHoneycomb$OnQueryTextListenerCompatBridge;)Ljava/lang/Object;
    .locals 1
    .param p0, "listener"    # Landroid/support/v4/widget/SearchViewCompatHoneycomb$OnQueryTextListenerCompatBridge;

    .prologue
    .line 53
    new-instance v0, Landroid/support/v4/widget/SearchViewCompatHoneycomb$1;

    invoke-direct {v0, p0}, Landroid/support/v4/widget/SearchViewCompatHoneycomb$1;-><init>(Landroid/support/v4/widget/SearchViewCompatHoneycomb$OnQueryTextListenerCompatBridge;)V

    return-object v0
.end method

.method public static newSearchView(Landroid/content/Context;)Landroid/view/View;
    .locals 1
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 42
    new-instance v0, Landroid/widget/SearchView;

    invoke-direct {v0, p0}, Landroid/widget/SearchView;-><init>(Landroid/content/Context;)V

    return-object v0
.end method

.method public static setIconified(Landroid/view/View;Z)V
    .locals 0
    .param p0, "searchView"    # Landroid/view/View;
    .param p1, "iconify"    # Z

    .prologue
    .line 96
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Landroid/view/View;
    invoke-virtual {p0, p1}, Landroid/widget/SearchView;->setIconified(Z)V

    .line 95
    return-void
.end method

.method public static setMaxWidth(Landroid/view/View;I)V
    .locals 0
    .param p0, "searchView"    # Landroid/view/View;
    .param p1, "maxpixels"    # I

    .prologue
    .line 120
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Landroid/view/View;
    invoke-virtual {p0, p1}, Landroid/widget/SearchView;->setMaxWidth(I)V

    .line 119
    return-void
.end method

.method public static setOnCloseListener(Ljava/lang/Object;Ljava/lang/Object;)V
    .locals 0
    .param p0, "searchView"    # Ljava/lang/Object;
    .param p1, "listener"    # Ljava/lang/Object;

    .prologue
    .line 80
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Ljava/lang/Object;
    check-cast p1, Landroid/widget/SearchView$OnCloseListener;

    .end local p1    # "listener":Ljava/lang/Object;
    invoke-virtual {p0, p1}, Landroid/widget/SearchView;->setOnCloseListener(Landroid/widget/SearchView$OnCloseListener;)V

    .line 79
    return-void
.end method

.method public static setOnQueryTextListener(Ljava/lang/Object;Ljava/lang/Object;)V
    .locals 0
    .param p0, "searchView"    # Ljava/lang/Object;
    .param p1, "listener"    # Ljava/lang/Object;

    .prologue
    .line 67
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Ljava/lang/Object;
    check-cast p1, Landroid/widget/SearchView$OnQueryTextListener;

    .end local p1    # "listener":Ljava/lang/Object;
    invoke-virtual {p0, p1}, Landroid/widget/SearchView;->setOnQueryTextListener(Landroid/widget/SearchView$OnQueryTextListener;)V

    .line 66
    return-void
.end method

.method public static setQuery(Landroid/view/View;Ljava/lang/CharSequence;Z)V
    .locals 0
    .param p0, "searchView"    # Landroid/view/View;
    .param p1, "query"    # Ljava/lang/CharSequence;
    .param p2, "submit"    # Z

    .prologue
    .line 88
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Landroid/view/View;
    invoke-virtual {p0, p1, p2}, Landroid/widget/SearchView;->setQuery(Ljava/lang/CharSequence;Z)V

    .line 87
    return-void
.end method

.method public static setQueryHint(Landroid/view/View;Ljava/lang/CharSequence;)V
    .locals 0
    .param p0, "searchView"    # Landroid/view/View;
    .param p1, "hint"    # Ljava/lang/CharSequence;

    .prologue
    .line 92
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Landroid/view/View;
    invoke-virtual {p0, p1}, Landroid/widget/SearchView;->setQueryHint(Ljava/lang/CharSequence;)V

    .line 91
    return-void
.end method

.method public static setQueryRefinementEnabled(Landroid/view/View;Z)V
    .locals 0
    .param p0, "searchView"    # Landroid/view/View;
    .param p1, "enable"    # Z

    .prologue
    .line 112
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Landroid/view/View;
    invoke-virtual {p0, p1}, Landroid/widget/SearchView;->setQueryRefinementEnabled(Z)V

    .line 111
    return-void
.end method

.method public static setSearchableInfo(Landroid/view/View;Landroid/content/ComponentName;)V
    .locals 4
    .param p0, "searchView"    # Landroid/view/View;
    .param p1, "searchableComponent"    # Landroid/content/ComponentName;

    .prologue
    move-object v1, p0

    .line 46
    check-cast v1, Landroid/widget/SearchView;

    .line 48
    .local v1, "sv":Landroid/widget/SearchView;
    invoke-virtual {v1}, Landroid/widget/SearchView;->getContext()Landroid/content/Context;

    move-result-object v2

    const-string/jumbo v3, "search"

    invoke-virtual {v2, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    .line 47
    check-cast v0, Landroid/app/SearchManager;

    .line 49
    .local v0, "searchManager":Landroid/app/SearchManager;
    invoke-virtual {v0, p1}, Landroid/app/SearchManager;->getSearchableInfo(Landroid/content/ComponentName;)Landroid/app/SearchableInfo;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/SearchView;->setSearchableInfo(Landroid/app/SearchableInfo;)V

    .line 45
    return-void
.end method

.method public static setSubmitButtonEnabled(Landroid/view/View;Z)V
    .locals 0
    .param p0, "searchView"    # Landroid/view/View;
    .param p1, "enabled"    # Z

    .prologue
    .line 104
    check-cast p0, Landroid/widget/SearchView;

    .end local p0    # "searchView":Landroid/view/View;
    invoke-virtual {p0, p1}, Landroid/widget/SearchView;->setSubmitButtonEnabled(Z)V

    .line 103
    return-void
.end method

redpajama_set_name: RedPajamaGithub


text:
function lock(isLocked) {
    lock.base.call(this);
    this._isLocked = isLocked || false;
}
lock.prototype = {
    isLocked: function(){ return this.get("isLocked"); },
    lock: function() { this._isLocked = true; return this; },
    unlock: function() { this._isLocked = false; return this; }
};
$.Class.extend(lock, $.Class);
$.lock = function(isLocked){return new lock(isLocked);};


text:
import React, {Component, PropTypes} from 'react';
import { connect } from 'react-redux';
import { pushState } from 'redux-router';
import {user_login} from '../actions/auth';
import styles from './Form.css';
import CSSModules from 'react-css-modules';

@CSSModules(styles)
class UserLogin extends Component {
    render() {
        const {dispatch, is_login, is_pending, token, user} = this.props;
        return (
             <form styleName="form">
               <fieldset>
                 <legend>Login</legend>

                   Username
                   <input id="username" type="text" ref="username" styleName="input" />

                   Password
                   <input id="password" type="password" ref="password" styleName="input" />

                 <button type="submit"
                         styleName="formButton"
                         disabled={is_pending}
                         onClick={e => this.handleClick(e)}>Login</button>
               </fieldset>
             </form>
        );
    }

    componentWillMount() {
        const {dispatch, is_login} = this.props;
        if (is_login) {
            dispatch(pushState({}, '/'));
        }
    }

    handleClick(e) {
        e.preventDefault();
        const nameNode = this.refs.username;
        const passNode = this.refs.password;

        const username = (nameNode.value || '').trim();
        const password = (passNode.value || '').trim();

        const { dispatch } = this.props;

        dispatch(user_login(username, password));
    }
}

UserLogin.propTypes = {
    is_login: PropTypes.bool.isRequired,
    is_pending: PropTypes.bool.isRequired,
    token: PropTypes.string.isRequired,
    user: PropTypes.shape({
        name: PropTypes.string.isRequired
    }),
};

function select(state) {
    return {
        is_login: state.auth.is_login,
        is_pending: state.auth.login_pending,
        token: state.auth.access_token,
        user: state.auth.user,
    };
}

export default connect(select)(UserLogin);


text:
@interface SelectionActionStartViewController : UIViewController

@property (weak, nonatomic) IBOutlet ClockButton *currentTimeBtn;
@property (weak, nonatomic) IBOutlet ClockButton *nextTimeBtn;
@property (weak, nonatomic) IBOutlet UILabel *startTimeLabel;

- (IBAction)selectStartTime:(ClockButton *)sender;

@end


text:
from reduction import Reduction
from polynomial import Polynomial
#import xlsxwriter
import os
from collections import defaultdict
import sys, getopt

def recoverfile(saved, readed):
    if not os.path.exists(saved):
        return True, []
    f = open(saved,'r')
    if(not os.stat(saved).st_size==0):
        pols = []
        pols_done = []
        for line in readed:
            pol = Polynomial(line)
            pols.append(pol)
        for line in f:
            line = line.replace("[","")
            line = line.replace("]","")
            spl = line.split(',')
            p = ""
            for i in xrange(0,len(spl)-1):
                p = p + " + x^" + str(spl[i].replace(" ",""))
            p = p + " + 1"
            p = p.replace("+","",1)
            #print p
            pol_ = Polynomial(p)
            pols_done.append(pol_)

        pols_set = set(pols)
        pols_set_done = set(pols_done)
        result = pols_set - pols_set_done
        return False, list(result)
    else:
        return True, []

def main(argv):
    inputfile = ''
    outputfile = ''
    debug = False
    try:
        opts, args = getopt.getopt(argv,"hi:o:d",["ifile=","ofile="])
    except getopt.GetoptError:
        print 'single.py -i <inputfile> -o <outputfile>'
        sys.exit(2)
    for opt, arg in opts:
        if opt == '-h':
            print 'single.py -i <inputfile> -o <outputfile> -d for debug'
            sys.exit()
        elif opt in ("-d", "--debug"):
            debug = True
        elif opt in ("-i", "--ifile"):
            inputfile = arg
        elif opt in ("-o", "--ofile"):
            outputfile = arg

    try:
        fi = open(inputfile,"r")
        fl = open(outputfile,"a")
    except IOError:
        print 'main.py -i <inputfile> -o <outputfile>'
        sys.exit(2)
    l = []
    pols = []
    files = [inputfile]
    for fileName in files:
        save = outputfile
        f = open(fileName,'r')

        #read, pols = recoverfile(save, f)
        if True:
            for line in f:
                try:
                    pol = Polynomial(line)
                    pols.append(pol)
                except Exception as e:
                    print line
                    sys.exit(2)
    result = defaultdict(list)
    print len(pols)
    for pol in pols:
        if len(pol.coefs()) > 1:
            red = Reduction(debug)
            count = red.reduction(pol.coefs())
            result =  str(pol.coefs()) + ":" + str(count)
            print result
            fl.write(result + "\n")

if __name__ == '__main__':
    main(sys.argv[1:])


text:
from __future__ import print_function, division

import xml.etree.ElementTree as ET
import pickle

import imgaug as ia
from imgaug import augmenters as iaa
from imgaug import parameters as iap
import numpy as np
from scipy import ndimage, misc
from skimage import data
import matplotlib.pyplot as plt
from matplotlib import gridspec
import six
import six.moves as sm
import re
import os
from os import listdir, getcwd
from os.path import join
import cv2
import glob
from collections import defaultdict
import PIL.Image
import itertools

try:
    from cStringIO import StringIO as BytesIO
except ImportError:
    from io import BytesIO

np.random.seed(44)
ia.seed(44)

IMAGES_DIR = "myhand" #"myhand"

def main():
    list = glob.glob('/home/lee/Documents/carDB/2/*.jpg')
    for i in range(len(list)):
        #draw_single_sequential_images(list[i],i)
        draw_per_augmenter_images(list[i],i)

def draw_single_sequential_images(img_path,idx):
    ia.seed(44)
    image = ndimage.imread(img_path)
    #image = ia.quokka_square(size=(128, 128))

    sometimes = lambda aug: iaa.Sometimes(0.5, aug)
    seq = iaa.Sequential(
        [
            # apply the following augmenters to most images
            iaa.Fliplr(0.5), # horizontally flip 50% of all images
            # crop images by -5% to 10% of their height/width
            sometimes(iaa.Affine(
                scale={"x": (0.125, 0.75), "y": (0.125, 0.75)}, # scale images to 80-120% of their size, individually per axis
                translate_percent={"x": (-0.25, 0.25), "y": (-0.25, 0.25)}, # translate by -20 to +20 percent (per axis)
                rotate=(-30, 30), # rotate by -45 to +45 degrees
                shear=(-25, 25), # shear by -16 to +16 degrees
                order=[0, 1], # use nearest neighbour or bilinear interpolation (fast)
                # use any of scikit-image's warping modes (see 2nd image from the top for examples)
            )),
            # execute 0 to 5 of the following (less important) augmenters per image
            # don't execute all of them, as that would often be way too strong
            iaa.SomeOf((0, 5),
                [
                    iaa.OneOf([
                        iaa.GaussianBlur((1, 2.0)), # blur images with a sigma between 0 and 3.0
                    ]),
                    iaa.Sharpen(alpha=(1.0, 1.0), lightness=(0.75, 1.5)), # sharpen images
                    iaa.AdditiveGaussianNoise(loc=0, scale=(0.05, 0.1*255), per_channel=0.5), # add gaussian noise to images
                    iaa.Add((-10, 10), per_channel=0.5), # change brightness of images (by -10 to 10 of original value)
                    iaa.AddToHueAndSaturation((-20, 20)), # change hue and saturation
                    # either change the brightness of the whole image (sometimes
                    # per channel) or change the brightness of subareas
                    iaa.OneOf([
                        iaa.Multiply((0.5, 1.5), per_channel=0.5),
                    ]),
                    iaa.ContrastNormalization((0.5, 2.0), per_channel=0.5), # improve or worsen the contrast

                    sometimes(iaa.PiecewiseAffine(scale=(0.01, 0.05))), # sometimes move parts of the image around
                    sometimes(iaa.PerspectiveTransform(scale=(0.05, 0.1)))
                ],
                random_order=True
            )
        ],
        random_order=True
    )

    #grid = seq.draw_grid(image, cols=8, rows=8)
    #misc.imsave("examples_grid.jpg", grid)

    images = [image] * 10
    #TODO : convert xml to txt and read it in yolo format and replace the x, y coordinates with them.
    keypoints = [ia.Keypoint(x=34, y=15), ia.Keypoint(x=85, y=13), ia.Keypoint(x=63, y=73)]  # left ear, right ear, mouth

    keypointsList=[keypoints] * 10
    aug_det = seq.to_deterministic()
    images_aug = aug_det.augment_images(images)

    row_keypoints = []
    image_keypoints = []
    for idx in range(len(keypointsList)):
        onImageKeypoints = [ia.KeypointsOnImage(keypointsList[idx], shape = image.shape)]
        keypoints_aug = aug_det.augment_keypoints(onImageKeypoints)
        row_keypoints.append(keypoints_aug[0])

    for image, keypoints in zip(images_aug, row_keypoints):
        image_keypoints.append(keypoints.draw_on_image(image, size=5))

    for i, image_aug in enumerate(image_keypoints):
        misc.imsave("image_%05d_%06d.jpg" % (idx,i), image_aug)

def draw_per_augmenter_images(img_path,idx):
    print("[draw_per_augmenter_images] Loading image...")
    #res=ndimage.imread(img_path)
    #image = np.reshape(res,[1,res.shape[0],res.shape[1],3])
    image = ndimage.imread(img_path)
    image2=image
    print(img_path)
    xmlPath = img_path.replace('.jpg','.xml')

    tree = ET.parse(xmlPath)
    root = tree.getroot()
    size = root.find('size')
    filename=root.find('filename').text
    img_w = int(size.find('width').text)
    img_h = int(size.find('height').text)
    objects = root.findall('object')
    keypoints = []
    onImageKeypoints = []

    for i in range(len(objects)):
        bndboxObj = objects[i].find('bndbox')
        xmin=int(bndboxObj.find('xmin').text)
        ymin=int(bndboxObj.find('ymin').text)
        xmax=int(bndboxObj.find('xmax').text)
        ymax=int(bndboxObj.find('ymax').text)
        keypoints.append([ia.Keypoint(x=xmin,y=ymin), ia.Keypoint(x=xmin,y=ymax), ia.Keypoint(x=xmax,y=ymin), ia.Keypoint(x=xmax,y=ymax)])
    keypoints = list(itertools.chain.from_iterable(keypoints))
    onImageKeypoints.append(ia.KeypointsOnImage(keypoints, shape=image.shape))
    print("[draw_per_augmenter_images] Initializing...")
    sometimes = lambda aug: iaa.Sometimes(0.5, aug)
    seq = iaa.Sequential([
        # apply the following augmenters to most images
        iaa.Fliplr(0.5),  # horizontally flip 50% of all images
        # crop images by -5% to 10% of their height/width
        sometimes(iaa.CropAndPad(
            percent=(0.1, 0.2),
            pad_mode=ia.ALL,
            pad_cval=(0, 255)
        )),
        sometimes(iaa.Affine(
            scale={"x": (0.5, 1.0), "y": (0.5, 1.0)},  # scale images to 80-120% of their size, individually per axis
            translate_percent={"x": (-0.2, 0.2), "y": (-0.2, 0.2)},  # translate by -20 to +20 percent (per axis)
            rotate=(-15, 15),  # rotate by -45 to +45 degrees
            order=[0],  # use nearest neighbour or bilinear interpolation (fast)
            cval=(0, 255),  # if mode is constant, use a cval between 0 and 255
            mode='edge'  # use any of scikit-image's warping modes (see 2nd image from the top for examples)
        )),
        # execute 0 to 5 of the following (less important) augmenters per image
        # don't execute all of them, as that would often be way too strong
        iaa.SomeOf((0, 5),
                   [
                       iaa.OneOf([
                           iaa.GaussianBlur((0, 3.0)),  # blur images with a sigma between 0 and 3.0
                           iaa.AverageBlur(k=(2, 7)),  # blur image using local means with kernel sizes between 2 and 7
                           iaa.MedianBlur(k=(3, 11)),
                           # blur image using local medians with kernel sizes between 2 and 7
                       ]),
                       iaa.Sharpen(alpha=(1.0), lightness=(0.75, 1.5)),  # sharpen images
                       iaa.Emboss(alpha=(1.0), strength=(0.5, 1.0)),  # emboss images
                       iaa.AdditiveGaussianNoise(loc=0, scale=(0.0, 0.05 * 255), per_channel=0.5),
                       # add gaussian noise to images
                       iaa.OneOf([
                           iaa.Dropout((0.03, 0.1), per_channel=0.5),  # randomly remove up to 10% of the pixels
                           iaa.CoarseDropout((0.03, 0.15), size_percent=(0.2, 0.3), per_channel=0.2),
                       ]),
                       iaa.Add((-10, 10), per_channel=0.5),
                       # change brightness of images (by -10 to 10 of original value)
                       iaa.AddToHueAndSaturation((-20, 20)),  # change hue and saturation
                       # either change the brightness of the whole image (sometimes
                       # per channel) or change the brightness of subareas
                       iaa.OneOf([
                           iaa.Multiply((0.5, 1.5), per_channel=0.5),
                           iaa.FrequencyNoiseAlpha(
                               exponent=(-4, 0),
                               first=iaa.Multiply((0.5, 1.5), per_channel=True),
                               second=iaa.ContrastNormalization((0.5, 2.0))
                           )
                       ]),
                       iaa.ContrastNormalization((0.5, 2.0), per_channel=0.5),  # improve or worsen the contrast
                       # move pixels locally around (with random strengths)
                       sometimes(iaa.PiecewiseAffine(scale=(0.01, 0.04))),  # sometimes move parts of the image around
                       sometimes(iaa.PerspectiveTransform(scale=(0.01, 0.1)))
                   ],
                   random_order=True
                   )
    ],
        random_order=True
    )

    for aug_count in range(100):
        print("Augmenting...")
        seq_det = seq.to_deterministic()
        # augment keypoints and images
        images_aug = seq_det.augment_images([image])
        keypoints_aug = seq_det.augment_keypoints(onImageKeypoints)
        print("Augmented...")
        m = 0
        for image_aug, keypoint_aug in zip(images_aug, keypoints_aug):
            m += 1
            boxCount = 0
            for i in range(len(objects)):
                bndboxObj = objects[i].find('bndbox')
                newXmin = min(int(keypoint_aug.keypoints[4 * boxCount].x), int(keypoint_aug.keypoints[3 + 4 * boxCount].x))
                newYmin = min(int(keypoint_aug.keypoints[4 * boxCount].y), int(keypoint_aug.keypoints[3 + 4 * boxCount].y))
                newXmax = max(int(keypoint_aug.keypoints[4 * boxCount].x), int(keypoint_aug.keypoints[3 + 4 * boxCount].x))
                newYmax = max(int(keypoint_aug.keypoints[4 * boxCount].y), int(keypoint_aug.keypoints[3 + 4 * boxCount].y))

                bndboxObj.find('xmin').text = newXmin.__str__()
                bndboxObj.find('xmax').text = newXmax.__str__()
                bndboxObj.find('ymin').text = newYmin.__str__()
                bndboxObj.find('ymax').text = newYmax.__str__()

                #try:
                #    cv2.rectangle(image, (int(newXmin ), int(newYmin )), (int(newXmax ), int(newYmax )), (0, 255, 0), 25)
                #except:
                #    image = image.transpose((1, 2, 0)).astype(np.uint8).copy()
                #    cv2.rectangle(image, (int(newXmin), int(newYmin)), (int(newXmax), int(newYmax)), (0, 255, 0), 25)
                #    image = image.transpose((2, 0, 1)).astype(np.uint8).copy()
                boxCount += 1
                #image=cv2.resize(image, None, fx=0.25, fy=0.25, interpolation=cv2.INTER_AREA)
                #cv2.imshow('test2', image)
                #cv2.waitKey(1000)
                filename_=filename.replace('.jpg','')
            tree.write("annotations/%s_%02d_%02d_%02d.xml" % (filename_,aug_count,m,boxCount))
            misc.imsave("images/%s_%02d_%02d_%02d.jpg" % (filename_,aug_count,m, boxCount), image_aug)

def compress_to_jpg(image, quality=75):
    quality = quality if quality is not None else 75
    im = PIL.Image.fromarray(image)
    out = BytesIO()
    im.save(out, format="JPEG", quality=quality)
    jpg_string = out.getvalue()
    out.close()
    return jpg_string

def decompress_jpg(image_compressed):
    img_compressed_buffer = BytesIO()
    img_compressed_buffer.write(image_compressed)
    img = ndimage.imread(img_compressed_buffer, mode="RGB")
    img_compressed_buffer.close()
    return img

def arrdiff(arr1, arr2):
    nb_cells = np.prod(arr2.shape)
    d_avg = np.sum(np.power(np.abs(arr1.astype(np.float64) - arr2.astype(np.float64)), 2)) / nb_cells
    return d_avg

def save(fp, image, quality=75):
    image_jpg = compress_to_jpg(image, quality=quality)
    image_jpg_decompressed = decompress_jpg(image_jpg)

    # If the image file already exists and is (practically) identical,
    # then don't save it again to avoid polluting the repository with tons
    # of image updates.
    # Not that we have to compare here the results AFTER jpg compression
    # and then decompression. Otherwise we compare two images of which
    # image (1) has never been compressed while image (2) was compressed and
    # then decompressed.
    if os.path.isfile(fp):
        image_saved = ndimage.imread(fp, mode="RGB")
        #print("arrdiff", arrdiff(image_jpg_decompressed, image_saved))
        same_shape = (image_jpg_decompressed.shape == image_saved.shape)
        d_avg = arrdiff(image_jpg_decompressed, image_saved) if same_shape else -1
        if same_shape and d_avg <= 1.0:
            print("[INFO] Did not save image '%s', because the already saved image is basically identical (d_avg=%.8f)" % (fp, d_avg,))
            return
        else:
            print("[INFO] Saving image '%s'..." % (fp,))

    with open(fp, "w") as f:
        f.write(image_jpg)

if __name__ == "__main__":
    main()


text:
<?php

namespace Drupal\language\Plugin\migrate\source\d6;

use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;

/**
 * Drupal 6 i18n node settings from database.
 *
 * For available configuration keys, refer to the parent classes.
 *
 * @see \Drupal\migrate\Plugin\migrate\source\SqlBase
 * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBas
 *
 * @MigrateSource(
 *   id = "d6_language_content_settings",
 *   source_module = "locale"
 * )
 */
class LanguageContentSettings extends DrupalSqlBase {

  /**
   * {@inheritdoc}
   */
  public function query() {
    return $this->select('node_type', 't')
      ->fields('t', [
        'type',
      ]);
  }

  /**
   * {@inheritdoc}
   */
  public function fields() {
    $fields = [
      'type' => $this->t('Type'),
      'language_content_type' => $this->t('Multilingual support.'),
      'i18n_lock_node' => $this->t('Lock language.'),
    ];
    return $fields;
  }

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    $type = $row->getSourceProperty('type');
    $row->setSourceProperty('language_content_type', $this->variableGet('language_content_type_' . $type, NULL));
    $row->setSourceProperty('i18n_lock_node', $this->variableGet('i18n_lock_node_' . $type, 0));
    return parent::prepareRow($row);
  }

  /**
   * {@inheritdoc}
   */
  public function getIds() {
    $ids['type']['type'] = 'string';
    return $ids;
  }

}


text:
package com.noveogroup.clap.rest.exception;

import com.noveogroup.clap.exception.ClapAuthenticationException;
import com.noveogroup.clap.model.response.ClapResponse;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;

/**
 * @author Andrey Sokolov
 */
public class ClapAuthExceptionMapper extends BaseAuthExceptionMapper
        implements ExceptionMapper<ClapAuthenticationException> {
    @Override
    public Response toResponse(final ClapAuthenticationException e) {
        final ClapResponse clapResponse = new ClapResponse();
        fillResponse(clapResponse, e);
        return Response.status(Response.Status.FORBIDDEN)
                .entity(clapResponse)
                .type(MediaType.APPLICATION_JSON_TYPE).build();
    }
}


text:
function Get-ECSBucketBilling {
    [CmdletBinding(DefaultParameterSetName = '1')]
    Param
    (
        [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName='1')]
        [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName='2')]
        [string]$Namespace,
        [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName='1')]
        [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName='2')]
        [alias('name')][string]$Bucketname,
        [Parameter(Mandatory=$true,ParameterSetName='2',HelpMessage="Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes")]
        [ValidatePattern('(?# Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes)([0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T(2[0-3]|[01][0-9]):([0-5][05]))')]
        $start_time,
        [Parameter(Mandatory=$true,ParameterSetName='2',HelpMessage="Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes")]
        [ValidatePattern('(?# Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes)([0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T(2[0-3]|[01][0-9]):([0-5][05]))')]
        $end_time,
        [Parameter(Mandatory=$false,HelpMessage="enter Size unit, valid Values are 'KB','MB' or default 'GB'")][ValidateSet('KB','MB','GB')]$sizeunit = "GB"
    )
    Begin
    {
    switch ($PsCmdlet.ParameterSetName)
        {
            1
            {
                $billing = "info?sizeunit=$sizeunit"
                $Expandproperty = "bucket_billing_info"
            }
            2
            {
                $billing = "sample?start_time=$($start_time)&end_time=$($end_time)&sizeunit=$sizeunit"
                $Expandproperty = "bucket_billing_sample"
            }
        }
    $Myself = $MyInvocation.MyCommand.Name.Substring(7)
    $class = "object/billing/buckets"
    $Excludeproperty = "id"
    $ContentType = "application/json"
    $Method = "Get"
    }
    Process
    {
    $Uri = "$ECSbaseurl/$class/$Namespace/$Bucketname/$Billing"
    try
        {
        Write-Verbose $Uri
        Invoke-RestMethod -Uri $Uri -Headers $ECSAuthHeaders -Method $Method -ContentType $ContentType  | Select-Object  -ExpandProperty $Expandproperty
        }
    catch
        {
        Get-ECSWebException -ExceptionMessage $_
        #$_.Exception.Message
        break
        }
    }
    End
    {

    }
}

function Get-ECSNamespaceBilling {
    [CmdletBinding(DefaultParameterSetName = '1')]
    Param
    (
        [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName='1')]
        [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName='2')]
        [string]$Namespace,
        [Parameter(Mandatory=$true,ParameterSetName='2',HelpMessage="Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes")]
        [ValidatePattern('(?# Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes)([0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T(2[0-3]|[01][0-9]):([0-5][05]))')]
        $start_time,
        [Parameter(Mandatory=$true,ParameterSetName='2',HelpMessage="Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes")]
        [ValidatePattern('(?# Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes)([0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T(2[0-3]|[01][0-9]):([0-5][05]))')]
        $end_time,
        [Parameter(Mandatory=$false,HelpMessage="enter Size unit, valid Values are 'KB','MB' or default 'GB'")][ValidateSet('KB','MB','GB')]$sizeunit = "GB"
    )
    Begin
    {
        switch ($PsCmdlet.ParameterSetName)
        {
            1
            {
                $billing = "info?sizeunit=$sizeunit"
                $Expandproperty = "namespace_billing_info"
            }
            2
            {
                $billing = "sample?start_time=$($start_time)&end_time=$($end_time)&sizeunit=$sizeunit"
                $Expandproperty = "namespace_billing_sample"
            }
        }
    $Myself = $MyInvocation.MyCommand.Name.Substring(7)
    $class = "object/billing/namespace"
    $Excludeproperty = "id"
    $ContentType = "application/json"
    $Method = "Get"
    }
    Process
    {
    $Uri = "$ECSbaseurl/$class/$Namespace/$Billing"
    try
        {
        Write-Verbose $Uri
        Invoke-RestMethod -Uri $Uri -Headers $ECSAuthHeaders -Method $Method -ContentType $ContentType  | Select-Object  -ExpandProperty $Expandproperty
        }
    catch
        {
        Get-ECSWebException -ExceptionMessage $_
        #$_.Exception.Message
        break
        }
    }
    End
    {

    }
}

##Get Bucket Billing Info
##POST /object/billing/buckets/{namespace}/info

function Get-ECSBucketBillingList {
    [CmdletBinding(DefaultParameterSetName = '1')]
    Param
    (
        [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName='1')]
        [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName='2')]
        [string]$Namespace,
        [Parameter(Mandatory=$true,ParameterSetName='1')]
        [Parameter(Mandatory=$true,ParameterSetName='2')]
        [alias('name')][string[]]$Bucketlist,
        [Parameter(Mandatory=$true,ParameterSetName='2',HelpMessage="Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes")]
        [ValidatePattern('(?# Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes)([0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T(2[0-3]|[01][0-9]):([0-5][05]))')]
        $start_time,
        [Parameter(Mandatory=$true,ParameterSetName='2',HelpMessage="Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes")]
        [ValidatePattern('(?# Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes)([0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T(2[0-3]|[01][0-9]):([0-5][05]))')]
        $end_time,
        [Parameter(Mandatory=$false,HelpMessage="enter Size unit, valid Values are 'KB','MB' or default 'GB'")][ValidateSet('KB','MB','GB')]$sizeunit = "GB"
    )
    Begin
    {
    switch ($PsCmdlet.ParameterSetName)
        {
            1
            {
                $billing = "info.json?sizeunit=$sizeunit"
                $Expandproperty = "bucket_billing_infos"
            }
            2
            {
                $billing = "sample.json?start_time=$($start_time)&end_time=$($end_time)&sizeunit=$sizeunit"
                $Expandproperty = "bucket_billing_sample_infos"
            }
        }
    $Myself = $MyInvocation.MyCommand.Name.Substring(7)
    $class = "object/billing/buckets"
    $Excludeproperty = "id"
    $ContentType = "application/json"
    $Method = "POST"
    }
    Process
    {

    $body = @{id = @($Bucketlist)} | ConvertTo-Json
    $Uri = "$ECSbaseurl/$class/$Namespace/$Billing"
    try
        {
        Write-Verbose $Uri
        Invoke-RestMethod -Uri $Uri -Headers $ECSAuthHeaders -Method $Method -ContentType $ContentType -Body $body| Select-Object  -ExpandProperty $Expandproperty
        }
    catch
        {
        Get-ECSWebException -ExceptionMessage $_
        #$_.Exception.Message
        break
        }
    }
    End
    {

    }
}

function Get-ECSNamespaceBillingList {
    [CmdletBinding(DefaultParameterSetName = '1')]
    Param
    (
        [Parameter(Mandatory=$true,ParameterSetName='1')]
        [Parameter(Mandatory=$true,ParameterSetName='2')]
        [string[]]$NamespaceList,
        [Parameter(Mandatory=$true,ParameterSetName='2',HelpMessage="Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes")]
        [ValidatePattern('(?# Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes)([0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T(2[0-3]|[01][0-9]):([0-5][05]))')]
        $start_time,
        [Parameter(Mandatory=$true,ParameterSetName='2',HelpMessage="Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes")]
        [ValidatePattern('(?# Please enter in format YYYY-MM-DDTHH:MM, ex.  2015-01-16T22:20 in a multiple of 5 Minutes)([0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T(2[0-3]|[01][0-9]):([0-5][05]))')]
        $end_time,
        [Parameter(Mandatory=$false,HelpMessage="enter Size unit, valid Values are 'KB','MB' or default 'GB'")][ValidateSet('KB','MB','GB')]$sizeunit = "GB",
        [switch]$bucketdetails
    )
    Begin
    {
        switch ($PsCmdlet.ParameterSetName)
        {
            1
            {
                $billing = "info?include_bucket_detail=$($bucketdetails.ispresent.tostring())&sizeunit=$sizeunit"
                $Expandproperty = "namespace_billing_infos"
                #3/object/billing/namespace/info?include_bucket_detail=true&sizeunit=KB
            }
            2
            {
                $billing = "sample?include_bucket_detail=$($bucketdetails.ispresent.tostring())&start_time=$($start_time)&end_time=$($end_time)&sizeunit=$sizeunit"
                $Expandproperty = "namespace_billing_sample_infos"
            }
        }
    $Myself = $MyInvocation.MyCommand.Name.Substring(7)
    $class = "object/billing/namespace"
    $Excludeproperty = "id"
    $ContentType = "application/json"
    $Method = "POST"
    }
    Process
    {
    $body = @{id = @($NamespaceList)} | ConvertTo-Json
    $Uri = "$ECSbaseurl/$class/$Namespace/$Billing"
    try
        {
        Write-Verbose $Uri
        Invoke-RestMethod -Uri $Uri -Headers $ECSAuthHeaders -Method $Method -ContentType $ContentType -Body $body | Select-Object  -ExpandProperty $Expandproperty | Select-Object  -ExpandProperty ($Expandproperty -replace ".$")
        }
    catch
        {
        Get-ECSWebException -ExceptionMessage $_
        #$_.Exception.Message
        break
        }
    }
    End
    {

    }
}


text:
{% extends 'base.html' %}
{% load staticfiles %}

{% block body %}

Questions

        {% if errors %}

          {% for e in errors %}

{{ e }}

          {% endfor %}

        {% endif %}
          <button id="add-question" class="btn btn-primary">Add</button>
          <form method="post" action="{% url 'quizzes:edit_questions' quiz_id %}" id="questions-form" role="form">
          {% csrf_token %}

                Question
                <button class="btn btn-danger btn-xs pull-right">Delete</button>
                <input type="text" class="form-control question-input">

            <input type="hidden" name="questions" id="questions-input">
            <button type="submit" id="submit-questions" class="btn btn-success pull-right">Submit</button>
          </form>

{% endblock %}

{% block extra_script %}

{% endblock %}


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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Ruzzie.Caching")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("D Crafting")]
[assembly: AssemblyProduct("Ruzzie.Caching")]
[assembly: AssemblyCopyright("Copyright © Dorus Verhoeckx 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: InternalsVisibleTo("Ruzzie.Caching.UnitTests")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]


text:
<?xml version="1.0" encoding="UTF-8"?>
<workingSetManager>
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1412437436393_0" label="Window Working Set" name="Aggregate for window 1412437436391"/>
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1412632628751_1" label="Window Working Set" name="Aggregate for window 1412632628751"/>
</workingSetManager>


text:
# SocialAlloy
This repository contains a clone of the Episerver Alloy sample application, which has been extended to demonstrate the features of Episerver Social. The goals for this project are twofold:

* To provide a simple application demonstrating Episerver Social features and capabilities
* To provide developers looking to get started with Episerver Social with a helpful point of reference

## Getting Started
An Episerver Social account is required to run this application. If you do not have an Episerver Social account, please contact your Episerver account manager.

### Setup
* Run the setup script with Powershell: `.\src\Scripts\Setup.ps1`
  * This script will copy the site's database and assets into the appropriate locations.
* Open the SocialAlloy.sln in Visual Studio
* Open the web.config and update the `episerver.social` configuration section with your account information.
  * For more information on how to configure Episerver Social, [please visit our Getting Connected guide](http://world.episerver.com/documentation/developer-guides/social/social_platform-overview/Installing-Episerver-Social/#GettingConnected).

### Running the Application
* Build the application in Visual Studio 2015
  * This operation will restore the necessary NuGet packages dependencies.
* Launch the application from Visual Studio 2015
  * With debugging (F5)
  * Without debugging (CTRL+F5)

## What's Inside?
### Blocks
Many of the Social features demonstrated in this application are implemented using Episerver blocks.  Episerver blocks are available for the following Episerver Social features:

#### Comments
The **CommentBlock** allows visitors to contribute comments to the page on which it resides. (A visitor may contribute comments anonymously or as a logged in user.) The block will display the most recent comments that have been contributed for that page. The maximum number of items displayed by the block are configurable via the CommentDisplayMax property of the block (default = 20).

If the **CommentBlock** is configured to send activities (which is the default behavior), it will publish an activity to the Social Activity Streams system when a comment is contributed to the page. A record of this activity will appear in the activity feed of user's that have subscribed to the page. (See "Activity Streams" below for more information.)

#### Ratings
The **RatingBlock** allows a logged in user to rate the page on which it resides. (A user may only rate the page once.) The block also displays the accumulated rating statistics for the page.

If the **RatingBlock** is configured to send activities (which is the default behavior), it will publish an activity to the Social Activity Streams system when a rating is submitted by the logged in user. A record of this activity will appear in the activity feed of user's that have subscribed to the page. (See "Activity Streams" below for more information.)

#### Groups
The **GroupCreationBlock** allows a user to create a new group. A group creator can optionally require that new members are moderated before being allowed to join the group.

The **GroupAdmissionBlock** allows users to require membership into a specific group. The block is configured by specifying the name of the group to which it applies. If the associated group is not configured for moderation, a user submitting a request will be added to the group. If the associated group has been configured for moderation, membership requests will be entered into a workflow for review. (To view requests under moderation, see "Moderation UI" below for more information.)

The **MembershipDisplayBlock** allows users to see the members that have joined a group. The block is configured by specifying the name of the group to which it applies. If the associated group has been configured for membership moderation only approved member requests will be displayed in the block. (To view requests that are pending approval, see "Moderation UI" below for more information.)

The **Moderation UI** allows a user to moderate requests to join a group. The page can be found by navigating to the following page within the site: http://*host*:*port*/Moderation. From this page, a user can select a group, which has been configured for moderation, and view the membership requests that have been submitted for it. The user is presented with actions that allow them to move that request through the workflow.  If a request is approved, the requesting user will be added as a member of the group.

#### Activity Streams

The **SubscriptionBlock** allows a logged in user to subscribe to and unsubscribe from the page on which it resides. A user will accumulate a feed of activities from the pages to which they are subscribed. (See "FeedBlock" below for information on displaying a feed.) When a user unsubscribes from a page, activities generated by that page will no longer be added to the user's feed.

The **FeedBlock** displays a record of activities occurring on pages to which the currently logged in user is subscribed. The block will display feed items representing the most recent activities that have occurred. The maximum number of items displayed by the block are configurable via the FeedDisplayMax property of the block (default = 20).

#### Block Configuration
To configure an Episerver Social feature block in a page do the following:

* Login to the SocialAlloy CMS edit panel
* Create a new block and select the "**<feature>** Block"
* Tweak any configuration in the block properties
* Publish the block
* Go to the page where the block functionality is desired
* Add/drag the block anywhere in the page
* Publish the modified page
* Viewing the page in the frontend should allow the use of that block's social feature

For implementation details of each of the Episerver Social blocks see the [source code](https://github.com/episerver/SocialAlloy/tree/master/src/EPiServer.SocialAlloy.Web/Social).

### Pages
#### Reseller Community Page

The **CommunityPage** represents a digital community which can be created for resellers of the Alloy platform. The page allows members of the reseller team to join the community. Site visitors can also comment on and rate the community page. Site users may subscribe to their favorite reseller communities and monitor a feed of activities from their personal profile.

## Developer Reference
Developers looking to get started with Episerver Social will find the [repository implementations](https://github.com/episerver/SocialAlloy/tree/master/src/EPiServer.SocialAlloy.Web/Social/Repositories) as the primary point of interaction between the application and the Episerver Social framework.

## Disclaimer
This website was assembled to serve as a demonstration and has not been tested for production use.

## More Information
For detailed information on how to implement social content solutions with Episerver Social, [please visit Episerver World](http://world.episerver.com/documentation/developer-guides/social/).

## Forum
Have questions, feature requests, or implementations that you'd like to share? Join the community on the [Episerver developer forum](http://world.episerver.com/forum/developer-forum/episerver-social/).

## Issues
If you encounter a problem, please [open a new issue](https://github.com/episerver/SocialAlloy/issues/new).

## Contributions
Please see our [contributing guidelines](https://github.com/episerver/SocialAlloy/blob/master/CONTRIBUTING).


text:
<!doctype html>

<title>Reference for img wide-viewBox.svg; overflow:hidden; -o-object-fit:none; -o-object-position:100% center</title>
<link rel="stylesheet" href="../../support/reftests.css">


text:
FROM ubuntu:14.04
MAINTAINER Yegor Bugayenko <yegor@teamed.io>
LABEL Description="This is the default image for Rultor.com" Vendor="Rultor.com" Version="1.0"
WORKDIR /tmp

ENV DEBIAN_FRONTEND=noninteractive

# UTF-8 locale
RUN locale-gen en_US en_US.UTF-8
RUN dpkg-reconfigure locales
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# Basic Linux tools
RUN apt-get update
RUN apt-get install -y wget bcrypt curl
RUN apt-get install -y unzip zip
RUN apt-get install -y gnupg gnupg2
RUN apt-get install -y jq
RUN apt-get install -y bsdmainutils
RUN apt-get install -y libxml2-utils
RUN apt-get install -y build-essential
RUN apt-get install -y automake autoconf

# Git 2.0
RUN apt-get install -y software-properties-common python-software-properties
RUN add-apt-repository ppa:git-core/ppa
RUN apt-get update
RUN apt-get install -y git git-core

# SSH Daemon
RUN apt-get install -y ssh && \
  mkdir /var/run/sshd && \
  chmod 0755 /var/run/sshd

# Ruby
RUN apt-get update && apt-get install -y libmagic-dev=1:5.14-2ubuntu3.3 \
    zlib1g-dev=1:1.2.8.dfsg-1ubuntu1
RUN apt-add-repository ppa:brightbox/ruby-ng
RUN apt-get update && apt-get install -y ruby2.2=2.2.4-1bbox1~trusty1 \
    ruby2.2-dev=2.2.4-1bbox1~trusty1
RUN gem update && gem install nokogiri:1.6.7.2 && gem install bundler:1.11.2

# PHP
RUN apt-get install -y php5 php5-dev php-pear
RUN curl --silent --show-error https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
RUN mkdir jsl && \
  wget --quiet http://www.javascriptlint.com/download/jsl-0.3.0-src.tar.gz && \
  tar xzf jsl-0.3.0-src.tar.gz && \
  cd jsl-0.3.0/src && \
  make -f Makefile.ref && \
  mv Linux_All_DBG.OBJ/jsl /usr/local/bin && \
  cd .. && \
  rm -rf jsl
# RUN pecl install xdebug-beta && \
#   echo "zend_extension=xdebug.so" > /etc/php5/cli/conf.d/xdebug.ini
# Java
RUN apt-get install -y default-jdk

# LaTeX
RUN apt-get install -y texlive-latex-extra
RUN apt-get install -y xzdec
RUN tlmgr init-usertree
RUN tlmgr install helvetic
RUN tlmgr install psnfss

# PhantomJS
RUN apt-get install -y phantomjs

# S3cmd for AWS S3 integration
RUN apt-get install -y s3cmd

# NodeJS
RUN apt-get install -y nodejs npm
RUN sudo npm install -g npm
RUN ln -s /usr/bin/nodejs /usr/bin/node

# Maven
ENV MAVEN_VERSION 3.3.9
ENV M2_HOME "/usr/local/apache-maven/apache-maven-${MAVEN_VERSION}"
RUN wget --quiet "http://mirror.dkd.de/apache/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" && \
  mkdir -p /usr/local/apache-maven && \
  mv "apache-maven-${MAVEN_VERSION}-bin.tar.gz" /usr/local/apache-maven && \
  tar xzvf "/usr/local/apache-maven/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -C /usr/local/apache-maven/ && \
  update-alternatives --install /usr/bin/mvn mvn "${M2_HOME}/bin/mvn" 1 && \
  update-alternatives --config mvn

RUN gem install jekyll:2.4.0

ENV MAVEN_OPTS "-Xms512m -Xmx2g"
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
COPY settings.xml /root/.m2/settings.xml
RUN git clone https://github.com/yegor256/rultor.git --depth=1
RUN cd rultor && \
  mvn clean install -Pqulice && \
  cd .. && \
  rm -rf rultor

# Clean up
RUN rm -rf /tmp/*
RUN rm -rf /root/.ssh


text:
package br.com.caelum.vraptor.mydvds.user;

import org.junit.Test;

import br.com.caelum.vraptor.mydvds.IntegrationTestCase;

/**
 * Integration tests for dvds registration and searching
 *
 * @author Lucas Cavalcanti
 *
 */
public class DvdsRegistrationTest extends IntegrationTestCase {

	@Test
	public void registeringAnInvalidDvd() throws Exception {
		loginAs("vraptorguy")
			.fillRegisterDvdForm()
				.withTitle("")
				.withDescription("")
				.andSend();
		assertContainsErrors();
	}
	@Test
	public void registeringAValidDvd() throws Exception {
		loginAs("vraptorguy")
			.fillRegisterDvdForm()
				.withTitle("A Song")
				.withDescription("You should listen to this")
				.andSend();
		assertContainsMessage("A Song dvd added");
	}
}


text:
<?php

/**
 * Description of EmployeePrintInterfaceBuilderComponents
 *
 * @author hans.prins
 */

class EmployeePrintInterfaceBuilderComponents
{
    static function getPrintLink($employeeId)
    {
        $html = '';
        if (EmployeePrintService::isPrintAllowed()) {
            $html .= InterfaceBuilder::iconLink('print_employee_' . $employeeId,
                                                TXT_UCF('PRINT'),
                                                'xajax_public_employeePrint__displayPrintOptions(' . $employeeId . ');',
                                                ICON_PRINT);

        }
        return $html;
    }
}

?>


text:
package me.lordethan.cryton.ui;

import java.util.List;

import org.lwjgl.opengl.Drawable;
import org.lwjgl.opengl.GL11;

import me.lordethan.cryton.Cryton;
import me.lordethan.cryton.module.Category;
import me.lordethan.cryton.module.Module;
import me.lordethan.cryton.utils.RenderUtils;
import me.lordethan.cryton.utils.Wrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.passive.EntitySquid;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.MathHelper;

public class GuiIngameHook{

	public static void StartHud(){
			Hud();
	}

	public static void Hud(){
		Wrapper.fu_default.drawString(Cryton.getClient_Name() + " Version:" + Cryton.getClient_Vesion(), 1, 1, 0xffffffff);
		renderArrayList();
		Cryton.theClient.getGuiManager().renderPinned();
		Cryton.theClient.getGuiManager().update();
	}

	private static void renderArrayList(){
		int yCount = 15;
		for(Module m : Cryton.theClient.moduleManager.activeModules){
			m.onRender();

			if(m.getState() && !m.isCategory(Category.GUI)){
				Wrapper.fu_default.drawString(m.getName(), 5, yCount, m.getColor());
				yCount +=10;
			}
		}
	}

}


text:
package generated

var SetLabelsShort = `The ` + "`" + `set-labels` + "`" + ` function adds a list of labels to all resources. It's a common
practice to add a set of labels for all the resources in a package. Kubernetes
has some [recommended labels].

For example, labels can be used in the following scenarios:

- Identify the KRM resources by querying their labels.
- Set labels for all resources within a package (e.g. environment=staging).`
var SetLabelsLong = `
There are 2 kinds of ` + "`" + `functionConfig` + "`" + ` supported by this function:

- ` + "`" + `ConfigMap` + "`" + `
- A custom resource of kind ` + "`" + `SetLabels` + "`" + `

To use a ` + "`" + `ConfigMap` + "`" + ` as the ` + "`" + `functionConfig` + "`" + `, the desired labels must be
specified in the ` + "`" + `data` + "`" + ` field.

To add 2 labels ` + "`" + `color: orange` + "`" + ` and ` + "`" + `fruit: apple` + "`" + ` to all resources, we use the
following ` + "`" + `functionConfig` + "`" + `:

  apiVersion: v1
  kind: ConfigMap
  metadata:
    name: my-config
  data:
    color: orange
    fruit: apple

To use a ` + "`" + `SetLabels` + "`" + ` custom resource as the ` + "`" + `functionConfig` + "`" + `, the desired labels
must be specified in the ` + "`" + `labels` + "`" + ` field.

To add 2 labels ` + "`" + `color: orange` + "`" + ` and ` + "`" + `fruit: apple` + "`" + ` to all built-in resources, we use the
following ` + "`" + `functionConfig` + "`" + `:

  apiVersion: fn.kpt.dev/v1alpha1
  kind: SetLabels
  metadata:
    name: my-config
  labels:
    color: orange
    fruit: apple
`


text:
package org.adligo.tests4j.run.remote;

import org.adligo.tests4j.models.shared.metadata.I_TrialRunMetadata;
import org.adligo.tests4j.models.shared.results.I_PhaseState;
import org.adligo.tests4j.models.shared.results.I_TrialResult;
import org.adligo.tests4j.models.shared.results.I_TrialRunResult;
import org.adligo.tests4j.run.api.Tests4J;
import org.adligo.tests4j.run.io.I_CharacterInputStream;
import org.adligo.tests4j.run.io.UTF8_InputStream;
import org.adligo.tests4j.run.remote.socket_api.AfterShutdownHandler;
import org.adligo.tests4j.run.remote.socket_api.I_AfterMessageHandler;
import org.adligo.tests4j.run.remote.socket_api.Tests4J_Commands;
import org.adligo.tests4j.run.remote.socket_api.Tests4J_SocketMessage;
import org.adligo.tests4j.shared.common.DefaultSystem;
import org.adligo.tests4j.shared.common.I_System;
import org.adligo.tests4j.shared.common.StringMethods;
import org.adligo.tests4j.shared.en.Tests4J_EnglishConstants;
import org.adligo.tests4j.shared.output.DefaultLog;
import org.adligo.tests4j.shared.output.I_Tests4J_Log;
import org.adligo.tests4j.shared.xml.XML_Builder;
import org.adligo.tests4j.system.shared.api.I_Tests4J_Controls;
import org.adligo.tests4j.system.shared.api.I_Tests4J_Listener;
import org.adligo.tests4j.system.shared.api.I_Tests4J_Params;
import org.adligo.tests4j.system.shared.api.I_Tests4J_RemoteInfo;
import org.adligo.tests4j.system.shared.api.Tests4J_Params;
import org.adligo.tests4j.system.shared.api.Tests4J_RemoteInfo;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;

public class Tests4J_SocketServerRunner implements I_Tests4J_Listener {
	private BlockingQueue<Tests4J_SocketMessage> messages = new ArrayBlockingQueue<>(100);
	private Map<Tests4J_SocketMessage, I_AfterMessageHandler> afterMessageTransportHandlers =
			new ConcurrentHashMap<Tests4J_SocketMessage, I_AfterMessageHandler>();
	private static I_Tests4J_Log logger;
	private OutputStream out;
	private InputStream in;
	private Tests4J_Commands lastCommnadSent;
	protected AtomicBoolean connected = new AtomicBoolean(false);
	private I_Tests4J_RemoteInfo info;
	private I_CharacterInputStream utf8In;
	private RemoteMessageReader reader;
	private ServerSocket serverSocket;
	private Socket clientSocket;
	private AfterShutdownHandler afterShutdownHandler;
	private ExecutorService listenerService;
	private I_Tests4J_Controls controlls;
	private I_System system_;

	public static void main(String [] args) {
		//note these lines will never be testable as it runs System.exit(0);
		Tests4J_SocketServerRunner runner = new Tests4J_SocketServerRunner();

		runner.main(args, new DefaultSystem());
	}

	public void main(String[] args, I_System pSystem) {
		Integer port = null;
		String authCode = "";
		logger = new DefaultLog( pSystem, Tests4J_EnglishConstants.ENGLISH, null);

		for (int i = 0; i < args.length; i++) {
			if("-port".equalsIgnoreCase(args[i])) { //$NON-NLS-1$
				if (args.length > i +1) {
					port= Integer.parseInt(args[i+1]);
					i++;
				}
			}
			if("-authCode".equalsIgnoreCase(args[i])) { //$NON-NLS-1$
				if (args.length > i +1) {
					authCode = args[i+1];
					i++;
				}
			}
		}

		if (port == null) {
			if (logger.isLogEnabled(Tests4J_SocketServerRunner.class)) {
				logger.log("Tests4J_SocketServerRunner: Port is null exiting.");
			}
			return;
		}
		if (StringMethods.isEmpty(authCode)) {
			if (logger.isLogEnabled(Tests4J_SocketServerRunner.class)) {
				logger.log("Tests4J_SocketServerRunner: AuthCode is empty exiting.");
			}
			return;
		}
		try {
			InetAddress localhost = InetAddress.getLocalHost();
			info = new Tests4J_RemoteInfo(Tests4J_EnglishConstants.ENGLISH, localhost.getHostName(), port, authCode);
			startup(pSystem);
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	public void startup() {

		//startup(Tests4J_System.SYSTEM);
	}

	public void startup(I_System pSystem) {

		afterShutdownHandler = new AfterShutdownHandler(pSystem);

		start();

	}

	/**
	 * shuts down the listener service
	 */
	void stop() {
		listenerService.shutdownNow();
	}
	/**
	 * starts listening to the connection
	 */
	void start() {
		//todo get the Tests4J_ThreadFactory here
	  //listenerService = Executors.newFixedThreadPool(1, factory);
		listenerService.execute(new Runnable() {

			@Override
			public void run() {
				try {
					int port = info.getPort();
					InetAddress localhost = InetAddress.getLocalHost();
					if (logger.isLogEnabled(Tests4J_SocketServerRunner.class)) {
						logger.log("Tests4J_SocketServerRunner: Starting SocketServer on " + info.getHost() + " " + port);
					}

					serverSocket = new ServerSocket(port, 3, localhost);
				    clientSocket = serverSocket.accept();
				    out = clientSocket.getOutputStream();
				    in = clientSocket.getInputStream();
				    utf8In = new UTF8_InputStream(in);
				    reader = new RemoteMessageReader(utf8In);

				    if (logger.isLogEnabled(Tests4J_SocketServerRunner.class)) {
						logger.log("Tests4J_SocketServerRunner: SocketServer on " + localhost + " " + port + " started");
					}
				} catch (IOException x) {
					logger.onThrowable(x);
					shutdown();
					return;
				}
				while (true) {
					try {
						if (messages.size() == 0) {
							acceptMessage();
						} else {
							Tests4J_SocketMessage message = messages.take();
							transportMessage(message);
							acceptMessage();
						}
					} catch (IOException x) {
						logger.onThrowable(x);
						return;
					} catch (InterruptedException e) {
						logger.onThrowable(e);
						return;
					}
				}
			}
		});
	}

	void acceptMessage() throws IOException {
		String content = reader.read();
		if (!StringMethods.isEmpty(content)) {
			if (logger.isLogEnabled(Tests4J_SocketServerRunner.class)) {
				logger.log("Tests4J_SocketServerRunner: in acceptMessage read line with message;\n" + content);
			}
			Tests4J_SocketMessage message = new Tests4J_SocketMessage(content);
			processIncomingMessage(message);
		}
	}

	void shutdown() {
		stop();
		if (out != null) {
			try {
				out.close();
			} catch (IOException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		}
		if (in != null) {
			try {
				in.close();
			} catch (IOException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		}
		this.connected.set(false);

		if (clientSocket != null) {
			try {
				clientSocket.close();
			} catch (IOException x) {
				x.printStackTrace();
			}
		}
		if (serverSocket != null) {
			try {
				serverSocket.close();
			} catch (IOException x) {
				x.printStackTrace();
			}
		}
		//Tests4J_System.exitJvm(0);
	}
	@Override
	public void onMetadataCalculated(I_TrialRunMetadata metadata) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onStartingTrial(String trialName) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onStartingTest(String trialName, String testName) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onTestCompleted(String trialName, String testName,
			boolean passed) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onTrialCompleted(I_TrialResult result) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onRunCompleted(I_TrialRunResult result) {
		// TODO Auto-generated method stub

	}

	void processIncomingMessage(Tests4J_SocketMessage message) {
		Tests4J_Commands cmd = message.getCommand();
		if (logger.isLogEnabled(Tests4J_SocketServerRunner.class)) {
			logger.log("Tests4J_SocketServerRunner: received command " + cmd);
		}
		String authCode = info.getAuthCode();

		if (cmd == Tests4J_Commands.CONNECT) {
			if (connected.get()) {
				send(new Tests4J_SocketMessage(
						Tests4J_Commands.ACK,
						"Already Connected to another client!"));
				return;
			}
			String messagePayload = message.getPayload();
			String version = message.getVersion();
			if (!"1.0".equals(version)) {
				send(new Tests4J_SocketMessage(
						Tests4J_Commands.ACK,
						version  + " version not known!"));
				return;
			}
			if (!authCode.equals(messagePayload)) {
				send(new Tests4J_SocketMessage(
						Tests4J_Commands.ACK,
						"AuthCode mismatch!"));
				return;
			} else {
				send(new Tests4J_SocketMessage(
						Tests4J_Commands.ACK,
						Tests4J_Commands.CONNECT));
				return;
			}
		} else {
			String messageAuthCode = message.getAuthCode();

			if (!authCode.equals(messageAuthCode)) {
				send(new Tests4J_SocketMessage(
						Tests4J_Commands.ACK,
						"authCode mistmatch!"));
			} else {
				switch (cmd) {
					case RUN:
						String xml = message.getPayload();
						Tests4J_Params params = new Tests4J_Params();
						//params.setReporter(reporter);
						controlls = Tests4J.run(params);
						send(new Tests4J_SocketMessage(
								Tests4J_Commands.ACK,
								Tests4J_Commands.RUN));
						break;
					case SHUTDOWN:
						if (controlls != null) {
							controlls.shutdown();
						}
						send(new Tests4J_SocketMessage(
								Tests4J_Commands.ACK,
								Tests4J_Commands.SHUTDOWN), afterShutdownHandler);
					default:
				}
			}
		}
	}

	public void send(Tests4J_SocketMessage message) {
		messages.add(message);
	}

	public void send(Tests4J_SocketMessage message, I_AfterMessageHandler handler) {
		afterMessageTransportHandlers.put(message, handler);
		messages.add(message);
	}

	void transportMessage(Tests4J_SocketMessage p) throws IOException {
		if (logger.isLogEnabled(Tests4J_SocketServerRunner.class)) {
			logger.log("sending command " + p.getCommand());
		}
		lastCommnadSent = p.getCommand();
		XML_Builder builder = new XML_Builder();
		p.toXml(builder);
		String message = builder.toXmlString();
		out.write(message.getBytes());
		out.flush();
		I_AfterMessageHandler handler = afterMessageTransportHandlers.get(message);
		if (handler != null) {
			handler.afterMessageTransported();
		}
	}

	public boolean isConnected() {
		return connected.get();
	}

	public I_Tests4J_Log getLogger() {
		return logger;
	}

	@SuppressWarnings("null")
	public void setReporter(I_Tests4J_Log p) {
		if (p == null) {
			//throw a NPE
			p.hashCode();
		} else {
			logger = p;
		}
	}

	public Tests4J_Commands getLastCommnadSent() {
		return lastCommnadSent;
	}

	@Override
	public void onProgress(I_PhaseState info) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onProccessStateChange(I_PhaseState info) {
		// TODO Auto-generated method stub

	}

  @Override
  public void onStartingSetup(I_Tests4J_Params params) {
    // TODO Auto-generated method stub

  }

}


text:
layout: post
title: Week 4
---

Namaste,

Into the third week of Object Oriented Programming. Highlights of the week:
1. Project Voting.
2. Jain Festival.

This week we started our second project involving the Australian Voting system. The system is very unique based with voters voting for candidates according to their preference. Since this is our second project, we are going to work in a team of two for the rest of the semester. Though are partners will keep changing for each project.

My partner on this project is Lyee Chong. We met in the lab while working on the first project. We are incorporating the pair programming techniques that we've been reading about. In the beginning we decided what objects we will need for the project and what will the attributes of each object will be. We have worked on it twice until now and  we have been able get a basic solution working until now.

I follow Jainism and the past whole week my festival, Samvatsari, was going on. We pray and celebrate the enlightenment of our twenty four thirthankars (God).

Tip of the Week: CNS career fair! I am pumped and hopeful that I can get an internship for this summer. Do not have a resume that is more tahn a page long. Be precise and concies. Also for the interview round be well versed with Data Structures and Algorithms.

Shukriya,
Kaivan


text:
package org.opencb.opencga.core.models.clinical;

import org.opencb.opencga.core.models.sample.Sample;

public class SampleParams {
    private String id;

    public SampleParams() {
    }

    public SampleParams(String id) {
        this.id = id;
    }

    public static SampleParams of(Sample sample) {
        return new SampleParams(sample.getId());
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("SampleParams{");
        sb.append("id='").append(id).append('\'');
        sb.append('}');
        return sb.toString();
    }

    public String getId() {
        return id;
    }

    public SampleParams setId(String id) {
        this.id = id;
        return this;
    }
}


text:
/* 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.
 */
package org.activiti.cdi.impl;

import java.util.EmptyStackException;

import org.activiti.cdi.annotation.BusinessProcessScoped;
import org.activiti.cdi.impl.context.BusinessProcessAssociationManager;
import org.activiti.cdi.impl.context.CachingBeanStore;
import org.activiti.cdi.impl.util.ProgrammaticBeanLookup;
import org.activiti.engine.impl.context.Context;
import org.activiti.engine.impl.delegate.DelegateInvocation;
import org.activiti.engine.impl.interceptor.DelegateInterceptor;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;

/**
 * This flushes any process variables and {@link BusinessProcessScoped
 * @BusinessProcessScoped} beans after a call to delegate code returns.
 *
 * @author Daniel Meyer
 */
public class CdiProcessVariableFlushingDelegateInterceptor implements DelegateInterceptor {

  public void handleInvocation(DelegateInvocation invocation) throws Exception {

    invocation.proceed();

    ExecutionEntity execution = null;
    try {
      execution = Context.getExecutionContext().getExecution();
    } catch (EmptyStackException e) {
      // silently ignore, not called in the context of an execution.
      return;
    }
    CachingBeanStore beanStore = getAssociationManager().getBeanStore();
    execution.setVariables(beanStore.getAllAndClear());

  }

  protected BusinessProcessAssociationManager getAssociationManager() {
    return ProgrammaticBeanLookup.lookup(BusinessProcessAssociationManager.class);
  }

}


text:
<?php

namespace LoopAnime\CommentsBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use LoopAnime\AppBundle\Entity\BaseEntity;
use LoopAnime\UsersBundle\Entity\Users;

/**
 * Comments
 *
 * @ORM\Table("comments")
 * @ORM\Entity(repositoryClass="LoopAnime\CommentsBundle\Entity\CommentsRepository")
 */
class Comments extends BaseEntity
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id_comment", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var integer
     *
     * @ORM\ManyToOne(targetEntity="LoopAnime\ShowsBundle\Entity\AnimesEpisodes")
     * @ORM\JoinColumn(name="id_episode", referencedColumnName="id_episode")
     */
    private $episode;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="create_time", type="datetime")
     */
    private $createTime;

    /**
     * @var string
     *
     * @ORM\Column(name="comment_title", type="string", length=255)
     */
    private $commentTitle;

    /**
     * @var string
     *
     * @ORM\Column(name="comment", type="string", length=255)
     */
    private $comment;

    /**
     * @var integer
     *
     * @ORM\Column(name="ratingCount", type="integer")
     */
    private $ratingCount;

    /**
     * @var integer
     *
     * @ORM\Column(name="ratingUp", type="integer")
     */
    private $ratingUp;

    /**
     * @var string
     *
     * @ORM\Column(name="ratingDown", type="integer")
     */
    private $ratingDown;

    /**
     * @var Users
     *
     * @ORM\ManyToOne(targetEntity="LoopAnime\UsersBundle\Entity\Users")
     * @ORM\JoinColumn(name="id_user", referencedColumnName="id_user")
     */
    protected $user;

    public function __construct()
    {
        $this->createTime = new \DateTime("now");
        $this->ratingUp = 0;
        $this->ratingDown = 0;
        $this->ratingCount = 0;
    }

    /**
     * @return int
     */
    public function getEpisode()
    {
        return $this->episode;
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set idEpisode
     *
     * @param integer $episode
     * @return Comments
     */
    public function setEpisode($episode)
    {
        $this->episode = $episode;

        return $this;
    }

    /**
     * Set idUser
     *
     * @param Users $user
     * @return Comments
     */
    public function setUser(Users $user)
    {
        $this->user = $user;
        return $this;
    }

    /**
     * Set createTime
     *
     * @param \DateTime $createTime
     * @return Comments
     */
    public function setCreateTime($createTime)
    {
        $this->createTime = $createTime;

        return $this;
    }

    /**
     * Get createTime
     *
     * @return \DateTime
     */
    public function getCreateTime()
    {
        return $this->createTime;
    }

    /**
     * Set commentTitle
     *
     * @param string $commentTitle
     * @return Comments
     */
    public function setCommentTitle($commentTitle)
    {
        $this->commentTitle = $commentTitle;

        return $this;
    }

    /**
     * Get commentTitle
     *
     * @return string
     */
    public function getCommentTitle()
    {
        return $this->commentTitle;
    }

    /**
     * Set comment
     *
     * @param string $comment
     * @return Comments
     */
    public function setComment($comment)
    {
        $this->comment = $comment;

        return $this;
    }

    /**
     * Get comment
     *
     * @return string
     */
    public function getComment()
    {
        return $this->comment;
    }

    /**
     * Set ratingCount
     *
     * @param integer $ratingCount
     * @return Comments
     */
    public function setRatingCount($ratingCount)
    {
        $this->ratingCount = $ratingCount;

        return $this;
    }

    /**
     * Get ratingCount
     *
     * @return integer
     */
    public function getRatingCount()
    {
        return $this->ratingCount;
    }

    /**
     * Set ratingUp
     *
     * @param integer $ratingUp
     * @return Comments
     */
    public function setRatingUp($ratingUp)
    {
        $this->ratingUp = $ratingUp;

        return $this;
    }

    /**
     * Get ratingUp
     *
     * @return integer
     */
    public function getRatingUp()
    {
        return $this->ratingUp;
    }

    /**
     * Set ratingDown
     *
     * @param string $ratingDown
     * @return Comments
     */
    public function setRatingDown($ratingDown)
    {
        $this->ratingDown = $ratingDown;

        return $this;
    }

    /**
     * Get ratingDown
     *
     * @return string
     */
    public function getRatingDown()
    {
        return $this->ratingDown;
    }

    public function getUser()
    {
        return $this->user;
    }
}


text:
const stringify = AFRAME.utils.coordinates.stringify;
import TWEEN from 'tween.js';

export class NoteHead {

	constructor( palette, shape ) {
		this.palette = palette;
		this.shape = shape;

        this.shader = THREE.BallShader;
        this.uniforms = THREE.UniformsUtils.clone( this.shader.uniforms );
        this.material = new THREE.ShaderMaterial({
        	uniforms: this.uniforms,
        	vertexShader: this.shader.vertexShader,
        	fragmentShader: this.shader.fragmentShader
        });

        this.mesh = new THREE.Mesh( this.geometry, this.material );
	}

	setTone( value ) {

		this.tone = value;
        this.scale = ( 1 - this.tone / ( this.palette.totalNotes() - 1 ) ) * 2 + 1;
        this.mesh.scale.set( this.scale, this.scale, this.scale );

		setTimeout( () => {
			let textureId = Math.floor( this.tone / this.palette.noteCount() );
			let textureOrder = this.tone % this.palette.noteCount();
			let textureData = ["circles","squares","triangles"][textureId];
			this.palette.shapePalette( textureData )[ textureOrder ].setUniforms( this.material );
			this.palette.colorPalette()[ this.tone ].setUniforms( this.material );
	        let texture134 = this.palette.textureSprite134( textureId );
	        let texture567 = this.palette.textureSprite567( textureId );
	        texture134.needsUpdate = true;
	        texture567.needsUpdate = true;

	        this.material.uniforms.map134.value = texture134;
	        this.material.uniforms.map567.value = texture567;
	        this.material.uniforms.lightPosition.value.copy( this.lightPosition );
		},0);
	}
	highlight( event ) {
		this.material.uniforms.brightnessAmount.value = 0.2;
	}
	unHighlight( event ) {
		this.material.uniforms.brightnessAmount.value = 0.0;
	}
	hit( event, timeMs ) {
		// Cancel tween if it already exists
        if ( this.hitTween ) {
            this.hitTween.stop();
        }
        this.hitPosition = event.detail.controllerPosition;
        this.offsetPosition = this.mesh.getWorldPosition();

        if(this.hitPosition) {
            this.offsetPosition.sub(this.hitPosition);
        }

        this.hitVelocity = (event.detail.velocity===0) ? 1 : event.detail.velocity;

        this.hitTween = new TWEEN.Tween( { t: this.hitVelocity } )
            .to( { t: 0 }, timeMs )
			.easing( TWEEN.Easing.Elastic.Out )
            .delay( event.detail.delay * 1000 )
			.onUpdate( (t) => {
				this.updateHitTween( t );
            })
			.onComplete( () => {
                this.updateHitTween( 1 );
            });
        this.hitTween.start();

		this.hitFrameTween = new TWEEN.Tween( { t: 0 } )
            .to( { t: 1 }, timeMs*1.25 )
			.easing( TWEEN.Easing.Linear.None )
            .delay( event.detail.delay * 1000 )
			.onUpdate( (t) => {
				this.material.uniforms.spriteIndex.value = Math.floor( t * 32 );
            })
			.onComplete( () => {
				this.material.uniforms.spriteIndex.value = Math.floor( 1 * 32 );
            });
        this.hitFrameTween.start();

	}

	updateHitTween( t ) {
		let s = ( 1 - t ) * this.hitVelocity + this.scale;
        this.mesh.scale.set( s, s, s );
		this.material.uniforms.activeAmount.value = 1 - t;
        if(this.hitPosition) {
            let p = ( 1 - t );
            this.mesh.position.x = this.offsetPosition.x*p*this.hitVelocity;
            this.mesh.position.y = this.offsetPosition.y*p*this.hitVelocity;
        }
	}

	get geometry() { }
	get rotation() { }
}


text:
<?php

namespace Drupal\workbench_moderation\Event;

use Drupal\Core\Entity\ContentEntityInterface;
use Symfony\Component\EventDispatcher\Event;

/**
 * @see \Drupal\workbench_moderation\ModerationStateEvents
 */
class WorkbenchModerationTransitionEvent extends Event {

  /**
   * The entity which was changed.
   *
   * @var \Drupal\Core\Entity\ContentEntityInterface
   */
  protected $entity;

  /**
   * @var string
   */
  protected $stateBefore;

  /**
   * @var string
   */
  protected $stateAfter;

  /**
   * Creates a new WorkbenchModerationTransitionEvent instance.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   The entity which was changed.
   * @param string $state_before
   *   The state before the transition.
   * @param string $state_after
   *   The state after the transition.
   */
  public function __construct(ContentEntityInterface $entity, $state_before, $state_after) {
    $this->entity = $entity;
    $this->stateBefore = $state_before;
    $this->stateAfter = $state_after;
  }

  /**
   * Returns the changed entity.
   *
   * @return \Drupal\Core\Entity\ContentEntityInterface
   */
  public function getEntity() {
    return $this->entity;
  }

  /**
   * @return string
   */
  public function getStateBefore() {
    return $this->stateBefore;
  }

  /**
   * @return string
   */
  public function getStateAfter() {
    return $this->stateAfter;
  }

}


text:
void GCIT::checkSensors() {
  int i, j;
  Module *m;
  Connector *c;

  for (i = 0; i < MAX_MODULES; i++) {
    m = modules[i];
    if (m) {
      for (j = 1; j <= MODULE_MAX_CONNECTORS; j++) { // connectors start at 1!
        c = m->getConnector(j);
        if (c) {
          if (c->type == ConnectorType::sensorNotify) {
            ((ConnectorSensorNotify *)c->control)->update();
          }
        }
      }
    }
  }
}

// Sensor Connector
// allow fcnPin=17, to use A0 analog read

ConnectorSensor::ConnectorSensor(Connector *c, int fPin, int sPin) {
  parent = c;
  fcnPin = fPin;
  statusPin = sPin;
  if (fcnPin != UNDEFINED_FPIN) {
    if (fcnPin == A0) {
      pinMode(fcnPin, INPUT);
    } else if (fcnPin != 16) {
      pinMode(fcnPin, INPUT_PULLUP);
    } else {
      pinMode(fcnPin, INPUT_PULLDOWN_16);
    }
  }
  if (statusPin != UNDEFINED_SPIN) {
    pinMode(statusPin, OUTPUT);
  }
  if (fcnPin == A0) {
    state = analogRead(fcnPin);
  } else {
    state = digitalRead(fcnPin);
  }
}

unsigned int ConnectorSensor::getState() {
  if (fcnPin == A0) {
    state = analogRead(fcnPin);
  } else {
    state = digitalRead(fcnPin);
  }
  flashStatus();
  return state;
}

// Sensor-Notify Connector

ConnectorSensorNotify::ConnectorSensorNotify(Connector *c, int fPin, int sPin) {
  parent = c;
  timer = millis();
  interval = 60000;
  fcnPin = fPin;
  statusPin = sPin;
  if (fcnPin != UNDEFINED_FPIN) {
    if (fcnPin == A0) {
      pinMode(fcnPin, INPUT);
    } else if (fcnPin != 16) {
      pinMode(fcnPin, INPUT_PULLUP);
    } else {
      pinMode(fcnPin, INPUT_PULLDOWN_16);
    }
  }
  if (statusPin != UNDEFINED_SPIN) {
    pinMode(statusPin, OUTPUT);
  }
  if (fcnPin == A0) {
    state = analogRead(fcnPin);
  } else {
    state = digitalRead(fcnPin);
  }
}

void ConnectorSensorNotify::setInterval(unsigned long ms) {
  interval = ms;
}

void ConnectorSensorNotify::update() {
  unsigned int prevState = state;

  if (fcnPin != UNDEFINED_FPIN) {
    if (fcnPin == A0) {
      state = analogRead(fcnPin);
    } else {
      state = digitalRead(fcnPin);
    }

    if ((state != prevState) || ((interval != 0) && (millis() >= timer + interval))) {
      parent->parent->parent->sensorNotify(this); // connector control->connector->module->gc; callback would be nicer
      timer = millis();
    }
  }
}

// Relay Connector
// state is logical state; negative fcnPin inverts physical reads/writes

ConnectorRelay::ConnectorRelay(Connector *c, int fPin, int sPin) {
  parent = c;
  fcnPin = fPin;
  statusPin = sPin;
  state = 0;
  if (fcnPin != UNDEFINED_FPIN) {
    if (fcnPin > 0) {
      pinMode(fcnPin, OUTPUT);
      digitalWrite(fcnPin, state);
    } else {
      pinMode(-fcnPin, OUTPUT);
      digitalWrite(-fcnPin, 1 - state);
    }
  }
  if (statusPin != UNDEFINED_SPIN) {
    pinMode(statusPin, OUTPUT);
  }
}

void ConnectorRelay::setState(unsigned int s) {
  if (s != 0) {
    state = 1;
  } else {
    state = 0;
  }
  if (fcnPin != UNDEFINED_FPIN) {
    if (fcnPin > 0) {
      digitalWrite(fcnPin, state);
    } else {
      digitalWrite(-fcnPin, 1 - state);
    }
  }
}

unsigned int ConnectorRelay::getState() {
  flashStatus();
  return state;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.stepstone.sonar.plugin</groupId>
    <artifactId>sonar-coldfusion-plugin</artifactId>
    <packaging>sonar-plugin</packaging>
    <version>2.1.1</version>

    <name>SonarQube Coldfusion Plugin</name>
    <description>Enables scanning of ColdFusion source files</description>
    <url>https://github.com/stepstone-tech/sonar-coldfusion</url>

    <organization>
        <name>StepStone GmbH</name>
        <url>http://www.stepstone.com/</url>
    </organization>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>git@github.com:stepstone-tech/sonar-coldfusion.git</connection>
        <developerConnection>git@github.com:stepstone-tech/sonar-coldfusion.git</developerConnection>
        <url>https://github.com/stepstone-tech/sonar-coldfusion</url>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/stepstone-tech/sonar-coldfusion/issues</url>
    </issueManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <sonar.version>7.6</sonar.version>
        <cflint.version>1.5.0</cflint.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.10.19</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.11.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.sonarsource.sslr-squid-bridge</groupId>
            <artifactId>sslr-squid-bridge</artifactId>
            <version>2.7.0.377</version>
            <exclusions>
                <exclusion>
                    <artifactId>sonar-plugin-api</artifactId>
                    <groupId>org.sonarsource.sonarqube</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- This will be the server API-->
        <dependency>
            <groupId>org.sonarsource.sonarqube</groupId>
            <artifactId>sonar-plugin-api</artifactId>
            <version>${sonar.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>
                <artifactId>sonar-packaging-maven-plugin</artifactId>
                <version>1.18.0.372</version>
                <extensions>true</extensions>
                <configuration>
                    <pluginClass>com.stepstone.sonar.plugin.coldfusion.ColdFusionPlugin</pluginClass>
                    <pluginName>ColdFusion</pluginName>
                    <pluginDescription>CFLint ${cflint.version} Plugin for Sonarqube</pluginDescription>
                    <pluginSourcesUrl>https://github.com/stepstone-tech/sonar-coldfusion</pluginSourcesUrl>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
                <executions>
                    <execution>
                        <id>include-cflint</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.github.cflint</groupId>
                                    <artifactId>CFLint</artifactId>
                                    <version>${cflint.version}</version>
                                    <classifier>all</classifier>
                                    <destFileName>cflint.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.outputDirectory}/META-INF/runner</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>de.jutzig</groupId>
                <artifactId>github-release-plugin</artifactId>
                <version>1.3.0</version>
                <configuration>
                    <description>Sonarqube Coldfusion Plugin release</description>
                    <releaseName>${project.version}</releaseName>
                    <tag>${project.version}</tag>
                    <fileSets>
                        <fileSet>
                            <directory>${project.build.directory}</directory>
                            <includes>
                                <include>${project.artifactId}*.jar</include>
                            </includes>
                        </fileSet>
                    </fileSets>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
        <id>sonar</id>
        <properties>
            <sonar.projectKey>stepstone-tech_sonar-coldfusion</sonar.projectKey>
            <sonar.organization>stepstone-tech</sonar.organization>
            <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        </properties>
        <build>
            <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.sonarsource.scanner.maven</groupId>
                            <artifactId>sonar-maven-plugin</artifactId>
                            <version>3.6.0.1398</version>
                        </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.3</version>
                        </plugin>
                    </plugins>
                </pluginManagement>
            <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                <execution>
                    <goals>
                    <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <execution>
                    <id>report</id>
                    <goals>
                    <goal>report</goal>
                    </goals>
                </execution>
                </executions>
            </plugin>
            </plugins>
        </build>
        </profile>
    </profiles>
</project>


text:
// STL Includes
#include <string>

// SQLite3 Includes
#include "sqlite3/sqlite3.h"

class SQLdb
{
	protected:
		// Properties
		sqlite3 *db;					// Database connection
		sqlite3_stmt *res;		// Results from a query

		const char *tail;			// ?Haven't figure out what this does?

		const char *sqliteErrorMsg;			// Holds an sqlite error
		int status;									// Store the sqlite error codes

	public:
		// Methods
		SQLdb();

		bool connect(std::string DBFILE);	// Establish a connection to a database

		bool query(std::string SQL);				// Query the database

		bool table_exists(std::string TABLE_NAME);	// Determine whether or a not a table exists

		bool fetch_row();	// Move through the rows within a result

		std::string column(int COLUMN_INDEX);	// Return a string with the value of the the column
		std::string column(std::string COLUMN_NAME);	// Return a string with the value of the the column

		bool close();
};