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">

    <parent>
        <groupId>org.wso2.carbon.business-process</groupId>
        <artifactId>attachment-mgt-feature</artifactId>
        <version>4.4.62-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.carbon.attachment.mgt.server.feature</artifactId>
    <packaging>pom</packaging>
    <name>WSO2 Carbon - Attachment Management Server - Core Feature</name>
    <url>http://wso2.org</url>
    <description>This feature contains the core bundles required for Back-end Attachment Management
        Server functionality
    </description>

    <dependencies>
        <dependency>
            <groupId>org.wso2.carbon.business-process</groupId>
            <artifactId>org.wso2.carbon.attachment.mgt</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.business-process</groupId>
            <artifactId>org.wso2.carbon.attachment.mgt.skeleton</artifactId>
        </dependency>
        <dependency>
            <groupId>com.h2database.wso2</groupId>
            <artifactId>h2-database-engine</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>clean-bpel-h2-database</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <delete file="resources/conf/jpadb.h2.db" />
                            </tasks>
                        </configuration>
                    </execution>
                    <execution>
                        <id>1-create-bpel-h2-database</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <path id="h2.classpath">
                                    <path refid="maven.compile.classpath" />
                                </path>

                                <echo message="########### Create Attachment Mgt Database ##############" />

                                <sql driver="org.h2.Driver" url="jdbc:h2:${basedir}/resources/conf/jpadb;create=true" userid="wso2carbon" password="wso2carbon" autocommit="true" onerror="continue">
                                    <classpath>
                                        <path refid="h2.classpath" />
                                    </classpath>
                                    <fileset file="${basedir}/resources/dbscripts/create/h2.sql" />
                                </sql>
                                <echo message="##################### END ############################" />
                                <echo message="********Version of H2: " />
                                <echo>${orbit.version.h2.engine}</echo>
                            </tasks>
                        </configuration>
                    </execution>
                    <execution>
                        <id>clean_target</id>
                        <phase>install</phase>
                        <configuration>
                            <tasks>
                                <delete dir="src/main/resources" />
                                <delete dir="src/main" />
                                <delete dir="src" />
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>2-copy-resources</id>
                        <!--phase>generate-resources</phase-->
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>src/main/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>resources</directory>
                                    <includes>
                                        <include>conf/attachment-management.xml</include>
                                        <include>conf/bps-datasources.xml</include>
                                        <include>conf/jpadb.h2.db</include>
                                        <include>**/*.sql</include>
                                        <include>p2.inf</include>
                                        <include>build.properties</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.wso2.maven</groupId>
                <artifactId>carbon-p2-plugin</artifactId>
                <version>${carbon.p2.plugin.version}</version>
                <executions>
                    <execution>
                        <id>3-p2-feature-generation</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-feature-gen</goal>
                        </goals>
                        <configuration>
                            <id>org.wso2.carbon.attachment.mgt.server</id>
                            <propertiesFile>../../etc/feature.properties</propertiesFile>
                            <adviceFile>
                                <properties>
                                    <propertyDef>org.wso2.carbon.p2.category.type:server
                                    </propertyDef>
                                    <propertyDef>org.eclipse.equinox.p2.type.group:false
                                    </propertyDef>
                                </properties>
                            </adviceFile>
                            <bundles>
                                <bundleDef>
                                    org.wso2.carbon.business-process:org.wso2.carbon.attachment.mgt:${carbon.business-process.version}
                                </bundleDef>
                                <bundleDef>
                                    org.wso2.carbon.business-process:org.wso2.carbon.attachment.mgt.skeleton:${carbon.business-process.version}
                                </bundleDef>
                            </bundles>

                            <importFeatures>
                                <importFeatureDef>
                                    org.wso2.carbon.core.server:compatible:${carbon.kernel.version}
                                </importFeatureDef>
                            </importFeatures>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
package net.wandroid.answer.view;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.ListFragment;
import android.app.LoaderManager;
import android.content.CursorLoader;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.Loader;
import android.content.res.Resources;
import android.database.Cursor;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CursorAdapter;

import com.melnykov.fab.FloatingActionButton;

import net.wandroid.answer.EditActivity;
import net.wandroid.answer.R;
import net.wandroid.answer.providers.ReplyContentProvider;
import net.wandroid.answer.providers.ReplyContract;

/**
 * ListFragment for entries
 */
public class EntryViewListFragment extends ListFragment implements
        LoaderManager.LoaderCallbacks<Cursor>, EntryViewAdapter.IItemSelectedListener {

    public interface IEntryViewListener {
        void onFabClicked();
    }

    private IEntryViewListener mEntryViewListener;

    private static final int LOADER_ID = 0;

    /**
     * 3rd party implementation, see license.txt
     */
    private FloatingActionButton mFab;

    private LoaderManager.LoaderCallbacks<Cursor> mLoaderCallBacks;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.entry_list_view, container, false);
        mFab = (FloatingActionButton) view.findViewById(R.id.fab);
        mFab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mEntryViewListener.onFabClicked();
            }
        });
        return view;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        mFab.attachToListView(getListView());

        EntryViewAdapter adapter = new EntryViewAdapter(getActivity(), null, false, this);

        setListAdapter(adapter);

        getListView().setEmptyView(view.findViewById(R.id.empty));

        mLoaderCallBacks = this;
        LoaderManager manager = getLoaderManager();
        manager.initLoader(LOADER_ID, savedInstanceState, mLoaderCallBacks);
    }

    @Override
    public void onListItemClick(long id) {
        Intent intent = new Intent();
        intent.setClass(getActivity(), EditActivity.class);
        intent.putExtra(EditActivity.ENTRY_DB_ID, id);
        startActivity(intent);
    }

    @Override
    public Loader<Cursor> onCreateLoader(int id, Bundle bundle) {
        if (id == LOADER_ID) {
            return new CursorLoader(getActivity(), ReplyContentProvider.REPLY_CONTENT_URI, null,
                    null, null, null);
        }
        return null;
    }

    @Override
    public void onLoadFinished(Loader<Cursor> loader, Cursor newCursor) {
        ((CursorAdapter) getListAdapter()).swapCursor(newCursor);
    }

    @Override
    public void onLoaderReset(Loader<Cursor> loader) {
        ((CursorAdapter) getListAdapter()).swapCursor(null);
    }

    public void removeAllExpired() {
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        Resources resourses = getResources();
        builder.setMessage(resourses.getString(R.string.entry_view_delete_all_dialog_txt))
                .setPositiveButton(resourses.getString(R.string.yes_no_dialog_positive),
                        new OnClickListener() {

                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                removeAllExpiredEntries(System.currentTimeMillis());
                            }
                        })
                .setNegativeButton(resourses.getString(R.string.yes_no_dialog_negative), null)
                .show();

    }

    private void removeAllExpiredEntries(final long currentTimeMillis) {
        new AsyncTask<Void, Void, Void>() {

            @Override
            protected Void doInBackground(Void... arg) {
                ReplyContract.Reply.removeAllExpiredEntries(currentTimeMillis, getActivity()
                        .getContentResolver());
                return null;
            }

            protected void onPostExecute(Void result) {
            }

            ;
        }.execute();
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        if (activity instanceof IEntryViewListener) {
            mEntryViewListener = (IEntryViewListener) activity;
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        mEntryViewListener = null;
    }
}

redpajama_set_name: RedPajamaGithub


text:
from __future__ import absolute_import, division, print_function
__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}

DOCUMENTATION = '''
---
module: gitlab_group
short_description: Creates/updates/deletes GitLab Groups
description:
  - When the group does not exist in GitLab, it will be created.
  - When the group does exist and state=absent, the group will be deleted.
version_added: "2.1"
author:
  - Werner Dijkerman (@dj-wasabi)
  - Guillaume Martinez (@Lunik)
requirements:
  - python >= 2.7
  - python-gitlab python module
extends_documentation_fragment:
    - auth_basic
options:
  server_url:
    description:
      - The URL of the GitLab server, with protocol (i.e. http or https).
    required: true
    type: str
  login_user:
    description:
      - GitLab user name.
    type: str
  login_password:
    description:
      - GitLab password for login_user
    type: str
  api_token:
    description:
      - GitLab token for logging in.
    type: str
    aliases:
      - login_token
  name:
    description:
      - Name of the group you want to create.
    required: true
    type: str
  path:
    description:
      - The path of the group you want to create, this will be server_url/group_path
      - If not supplied, the group_name will be used.
    type: str
  description:
    description:
      - A description for the group.
    version_added: "2.7"
    type: str
  state:
    description:
      - create or delete group.
      - Possible values are present and absent.
    default: present
    type: str
    choices: ["present", "absent"]
  parent:
    description:
      - Allow to create subgroups
      - Id or Full path of parent group in the form of group/name
    version_added: "2.8"
    type: str
  visibility:
    description:
      - Default visibility of the group
    version_added: "2.8"
    choices: ["private", "internal", "public"]
    default: private
    type: str
'''

EXAMPLES = '''
- name: "Delete GitLab Group"
  gitlab_group:
    api_url: https://gitlab.example.com/
    api_token: "{{ access_token }}"
    validate_certs: False
    name: my_first_group
    state: absent

- name: "Create GitLab Group"
  gitlab_group:
    api_url: https://gitlab.example.com/
    validate_certs: True
    api_usersername: dj-wasabi
    api_password: "MySecretPassword"
    name: my_first_group
    path: my_first_group
    state: present

# The group will by created at https://gitlab.dj-wasabi.local/super_parent/parent/my_first_group
- name: "Create GitLab SubGroup"
  gitlab_group:
    api_url: https://gitlab.example.com/
    validate_certs: True
    api_usersername: dj-wasabi
    api_password: "MySecretPassword"
    name: my_first_group
    path: my_first_group
    state: present
    parent: "super_parent/parent"
'''

RETURN = '''
msg:
  description: Success or failure message
  returned: always
  type: str
  sample: "Success"

result:
  description: json parsed response from the server
  returned: always
  type: dict

error:
  description: the error message returned by the GitLab API
  returned: failed
  type: str
  sample: "400: path is already in use"

group:
  description: API object
  returned: always
  type: dict
'''

import os
import traceback

GITLAB_IMP_ERR = None
try:
    import gitlab
    HAS_GITLAB_PACKAGE = True
except Exception:
    GITLAB_IMP_ERR = traceback.format_exc()
    HAS_GITLAB_PACKAGE = False

from ansible.module_utils.api import basic_auth_argument_spec
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible.module_utils._text import to_native

from ansible.module_utils.gitlab import findGroup

class GitLabGroup(object):
    def __init__(self, module, gitlab_instance):
        self._module = module
        self._gitlab = gitlab_instance
        self.groupObject = None

    '''
    @param group Group object
    '''
    def getGroupId(self, group):
        if group is not None:
            return group.id
        return None

    '''
    @param name Name of the group
    @param parent Parent group full path
    @param options Group options
    '''
    def createOrUpdateGroup(self, name, parent, options):
        changed = False

        # Because we have already call userExists in main()
        if self.groupObject is None:
            parent_id = self.getGroupId(parent)

            group = self.createGroup({
                'name': name,
                'path': options['path'],
                'parent_id': parent_id,
                'visibility': options['visibility']})
            changed = True
        else:
            changed, group = self.updateGroup(self.groupObject, {
                'name': name,
                'description': options['description'],
                'visibility': options['visibility']})

        self.groupObject = group
        if changed:
            if self._module.check_mode:
                self._module.exit_json(changed=True, msg="Successfully created or updated the group %s" % name)

            try:
                group.save()
            except Exception as e:
                self._module.fail_json(msg="Failed to update group: %s " % e)
            return True
        else:
            return False

    '''
    @param arguments Attributs of the group
    '''
    def createGroup(self, arguments):
        if self._module.check_mode:
            return True

        try:
            group = self._gitlab.groups.create(arguments)
        except (gitlab.exceptions.GitlabCreateError) as e:
            self._module.fail_json(msg="Failed to create group: %s " % to_native(e))

        return group

    '''
    @param group Group Object
    @param arguments Attributs of the group
    '''
    def updateGroup(self, group, arguments):
        changed = False

        for arg_key, arg_value in arguments.items():
            if arguments[arg_key] is not None:
                if getattr(group, arg_key) != arguments[arg_key]:
                    setattr(group, arg_key, arguments[arg_key])
                    changed = True

        return (changed, group)

    def deleteGroup(self):
        group = self.groupObject

        if len(group.projects.list()) >= 1:
            self._module.fail_json(
                msg="There are still projects in this group. These needs to be moved or deleted before this group can be removed.")
        else:
            if self._module.check_mode:
                return True

            try:
                group.delete()
            except Exception as e:
                self._module.fail_json(msg="Failed to delete group: %s " % to_native(e))

    '''
    @param name Name of the groupe
    @param full_path Complete path of the Group including parent group path. <parent_path>/<group_path>
    '''
    def existsGroup(self, project_identifier):
        # When group/user exists, object will be stored in self.groupObject.
        group = findGroup(self._gitlab, project_identifier)
        if group:
            self.groupObject = group
            return True
        return False

def deprecation_warning(module):
    deprecated_aliases = ['login_token']

    module.deprecate("Aliases \'{aliases}\' are deprecated".format(aliases='\', \''.join(deprecated_aliases)), "2.10")

def main():
    argument_spec = basic_auth_argument_spec()
    argument_spec.update(dict(
        server_url=dict(type='str', required=True, removed_in_version="2.10"),
        login_user=dict(type='str', no_log=True, removed_in_version="2.10"),
        login_password=dict(type='str', no_log=True, removed_in_version="2.10"),
        api_token=dict(type='str', no_log=True, aliases=["login_token"]),
        name=dict(type='str', required=True),
        path=dict(type='str'),
        description=dict(type='str'),
        state=dict(type='str', default="present", choices=["absent", "present"]),
        parent=dict(type='str'),
        visibility=dict(type='str', default="private", choices=["internal", "private", "public"]),
    ))

    module = AnsibleModule(
        argument_spec=argument_spec,
        mutually_exclusive=[
            ['api_url', 'server_url'],
            ['api_username', 'login_user'],
            ['api_password', 'login_password'],
            ['api_username', 'api_token'],
            ['api_password', 'api_token'],
            ['login_user', 'login_token'],
            ['login_password', 'login_token']
        ],
        required_together=[
            ['api_username', 'api_password'],
            ['login_user', 'login_password'],
        ],
        required_one_of=[
            ['api_username', 'api_token', 'login_user', 'login_token']
        ],
        supports_check_mode=True,
    )

    deprecation_warning(module)

    server_url = module.params['server_url']
    login_user = module.params['login_user']
    login_password = module.params['login_password']

    api_url = module.params['api_url']
    validate_certs = module.params['validate_certs']
    api_user = module.params['api_username']
    api_password = module.params['api_password']

    gitlab_url = server_url if api_url is None else api_url
    gitlab_user = login_user if api_user is None else api_user
    gitlab_password = login_password if api_password is None else api_password
    gitlab_token = module.params['api_token']

    group_name = module.params['name']
    group_path = module.params['path']
    description = module.params['description']
    state = module.params['state']
    parent_identifier = module.params['parent']
    group_visibility = module.params['visibility']

    if not HAS_GITLAB_PACKAGE:
        module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR)

    try:
        gitlab_instance = gitlab.Gitlab(url=gitlab_url, ssl_verify=validate_certs, email=gitlab_user, password=gitlab_password,
                                        private_token=gitlab_token, api_version=4)
        gitlab_instance.auth()
    except (gitlab.exceptions.GitlabAuthenticationError, gitlab.exceptions.GitlabGetError) as e:
        module.fail_json(msg="Failed to connect to GitLab server: %s" % to_native(e))
    except (gitlab.exceptions.GitlabHttpError) as e:
        module.fail_json(msg="Failed to connect to GitLab server: %s. \
            GitLab remove Session API now that private tokens are removed from user API endpoints since version 10.2" % to_native(e))

    # Define default group_path based on group_name
    if group_path is None:
        group_path = group_name.replace(" ", "_")

    gitlab_group = GitLabGroup(module, gitlab_instance)

    parent_group = None
    if parent_identifier:
        parent_group = findGroup(gitlab_instance, parent_identifier)
        if not parent_group:
            module.fail_json(msg="Failed create GitLab group: Parent group doesn't exists")

        group_exists = gitlab_group.existsGroup(parent_group.full_path + '/' + group_path)
    else:
        group_exists = gitlab_group.existsGroup(group_path)

    if state == 'absent':
        if group_exists:
            gitlab_group.deleteGroup()
            module.exit_json(changed=True, msg="Successfully deleted group %s" % group_name)
        else:
            module.exit_json(changed=False, msg="Group deleted or does not exists")

    if state == 'present':
        if gitlab_group.createOrUpdateGroup(group_name, parent_group, {
                                            "path": group_path,
                                            "description": description,
                                            "visibility": group_visibility}):
            module.exit_json(changed=True, msg="Successfully created or updated the group %s" % group_name, group=gitlab_group.groupObject._attrs)
        else:
            module.exit_json(changed=False, msg="No need to update the group %s" % group_name, group=gitlab_group.groupObject._attrs)

if __name__ == '__main__':
    main()


text:
package org.apache.lucene.store.jdbc.dialect;

/**
 * A H2 dialect.
 *
 * @author kimchy
 */
public class H2Dialect extends Dialect {

    public boolean supportsForUpdate() {
        return false;
    }

    public String getForUpdateString() {
        return "";
    }

    public boolean supportTransactionalScopedBlobs() {
        return true;
    }

    public boolean supportsIfExistsAfterTableName() {
        return true;
    }

    public String getVarcharType(int length) {
        return "varchar(" + length + ")";
    }

    public String getBlobType(long length) {
        return "blob";
    }

    public String getNumberType() {
        return "integer";
    }

    public String getTimestampType() {
        return "timestamp";
    }

    public String getCurrentTimestampFunction() {
        return "current_timestamp()";
    }

    public String getBitType() {
        return "bit";
    }
}


text:
# Task Scheduling

- [Introduction](#introduction)
- [Defining Schedules](#defining-schedules)
    - [Scheduling Artisan Commands](#scheduling-artisan-commands)
    - [Scheduling Queued Jobs](#scheduling-queued-jobs)
    - [Scheduling Shell Commands](#scheduling-shell-commands)
    - [Schedule Frequency Options](#schedule-frequency-options)
    - [Timezones](#timezones)
    - [Preventing Task Overlaps](#preventing-task-overlaps)
    - [Running Tasks On One Server](#running-tasks-on-one-server)
    - [Background Tasks](#background-tasks)
    - [Maintenance Mode](#maintenance-mode)
- [Running The Scheduler](#running-the-scheduler)
    - [Running The Scheduler Locally](#running-the-scheduler-locally)
- [Task Output](#task-output)
- [Task Hooks](#task-hooks)
- [Events](#events)

## Introduction

In the past, you may have written a cron configuration entry for each task you needed to schedule on your server. However, this can quickly become a pain because your task schedule is no longer in source control and you must SSH into your server to view your existing cron entries or add additional entries.

Laravel's command scheduler offers a fresh approach to managing scheduled tasks on your server. The scheduler allows you to fluently and expressively define your command schedule within your Laravel application itself. When using the scheduler, only a single cron entry is needed on your server. Your task schedule is defined in the `app/Console/Kernel.php` file's `schedule` method. To help you get started, a simple example is defined within the method.

## Defining Schedules

You may define all of your scheduled tasks in the `schedule` method of your application's `App\Console\Kernel` class. To get started, let's take a look at an example. In this example, we will schedule a closure to be called every day at midnight. Within the closure we will execute a database query to clear a table:

    <?php

    namespace App\Console;

    use Illuminate\Console\Scheduling\Schedule;
    use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
    use Illuminate\Support\Facades\DB;

    class Kernel extends ConsoleKernel
    {
        /**
         * Define the application's command schedule.
         *
         * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
         * @return void
         */
        protected function schedule(Schedule $schedule)
        {
            $schedule->call(function () {
                DB::table('recent_users')->delete();
            })->daily();
        }
    }

In addition to scheduling using closures, you may also schedule [invokable objects](https://secure.php.net/manual/en/language.oop5.magic.php#object.invoke). Invokable objects are simple PHP classes that contain an `__invoke` method:

    $schedule->call(new DeleteRecentUsers)->daily();

If you would like to view an overview of your scheduled tasks and the next time they are scheduled to run, you may use the `schedule:list` Artisan command:

```bash
php artisan schedule:list
```

### Scheduling Artisan Commands

In addition to scheduling closures, you may also schedule [Artisan commands](/docs/{{version}}/artisan) and system commands. For example, you may use the `command` method to schedule an Artisan command using either the command's name or class.

When scheduling Artisan commands using the command's class name, you may pass an array of additional command-line arguments that should be provided to the command when it is invoked:

    use App\Console\Commands\SendEmailsCommand;

    $schedule->command('emails:send Taylor --force')->daily();

    $schedule->command(SendEmailsCommand::class, ['Taylor', '--force'])->daily();

### Scheduling Queued Jobs

The `job` method may be used to schedule a [queued job](/docs/{{version}}/queues). This method provides a convenient way to schedule queued jobs without using the `call` method to define closures to queue the job:

    use App\Jobs\Heartbeat;

    $schedule->job(new Heartbeat)->everyFiveMinutes();

Optional second and third arguments may be provided to the `job` method which specifies the queue name and queue connection that should be used to queue the job:

    use App\Jobs\Heartbeat;

    // Dispatch the job to the "heartbeats" queue on the "sqs" connection...
    $schedule->job(new Heartbeat, 'heartbeats', 'sqs')->everyFiveMinutes();

### Scheduling Shell Commands

The `exec` method may be used to issue a command to the operating system:

    $schedule->exec('node /home/forge/script.js')->daily();

### Schedule Frequency Options

We've already seen a few examples of how you may configure a task to run at specified intervals. However, there are many more task schedule frequencies that you may assign to a task:

Method  | Description
------------- | -------------
`->cron('* * * * *');`  |  Run the task on a custom cron schedule
`->everyMinute();`  |  Run the task every minute
`->everyTwoMinutes();`  |  Run the task every two minutes
`->everyThreeMinutes();`  |  Run the task every three minutes
`->everyFourMinutes();`  |  Run the task every four minutes
`->everyFiveMinutes();`  |  Run the task every five minutes
`->everyTenMinutes();`  |  Run the task every ten minutes
`->everyFifteenMinutes();`  |  Run the task every fifteen minutes
`->everyThirtyMinutes();`  |  Run the task every thirty minutes
`->hourly();`  |  Run the task every hour
`->hourlyAt(17);`  |  Run the task every hour at 17 minutes past the hour
`->everyOddHour();`  |  Run the task every odd hour
`->everyTwoHours();`  |  Run the task every two hours
`->everyThreeHours();`  |  Run the task every three hours
`->everyFourHours();`  |  Run the task every four hours
`->everySixHours();`  |  Run the task every six hours
`->daily();`  |  Run the task every day at midnight
`->dailyAt('13:00');`  |  Run the task every day at 13:00
`->twiceDaily(1, 13);`  |  Run the task daily at 1:00 & 13:00
`->twiceDailyAt(1, 13, 15);`  |  Run the task daily at 1:15 & 13:15
`->weekly();`  |  Run the task every Sunday at 00:00
`->weeklyOn(1, '8:00');`  |  Run the task every week on Monday at 8:00
`->monthly();`  |  Run the task on the first day of every month at 00:00
`->monthlyOn(4, '15:00');`  |  Run the task every month on the 4th at 15:00
`->twiceMonthly(1, 16, '13:00');`  |  Run the task monthly on the 1st and 16th at 13:00
`->lastDayOfMonth('15:00');` | Run the task on the last day of the month at 15:00
`->quarterly();` |  Run the task on the first day of every quarter at 00:00
`->quarterlyOn(4, '14:00');` |  Run the task every quarter on the 4th at 14:00
`->yearly();`  |  Run the task on the first day of every year at 00:00
`->yearlyOn(6, 1, '17:00');`  |  Run the task every year on June 1st at 17:00
`->timezone('America/New_York');` | Set the timezone for the task

These methods may be combined with additional constraints to create even more finely tuned schedules that only run on certain days of the week. For example, you may schedule a command to run weekly on Monday:

    // Run once per week on Monday at 1 PM...
    $schedule->call(function () {
        //
    })->weekly()->mondays()->at('13:00');

    // Run hourly from 8 AM to 5 PM on weekdays...
    $schedule->command('foo')
              ->weekdays()
              ->hourly()
              ->timezone('America/Chicago')
              ->between('8:00', '17:00');

A list of additional schedule constraints may be found below:

Method  | Description
------------- | -------------
`->weekdays();`  |  Limit the task to weekdays
`->weekends();`  |  Limit the task to weekends
`->sundays();`  |  Limit the task to Sunday
`->mondays();`  |  Limit the task to Monday
`->tuesdays();`  |  Limit the task to Tuesday
`->wednesdays();`  |  Limit the task to Wednesday
`->thursdays();`  |  Limit the task to Thursday
`->fridays();`  |  Limit the task to Friday
`->saturdays();`  |  Limit the task to Saturday
`->days(array\|mixed);`  |  Limit the task to specific days
`->between($startTime, $endTime);`  |  Limit the task to run between start and end times
`->unlessBetween($startTime, $endTime);`  |  Limit the task to not run between start and end times
`->when(Closure);`  |  Limit the task based on a truth test
`->environments($env);`  |  Limit the task to specific environments

#### Day Constraints

The `days` method may be used to limit the execution of a task to specific days of the week. For example, you may schedule a command to run hourly on Sundays and Wednesdays:

    $schedule->command('emails:send')
                    ->hourly()
                    ->days([0, 3]);

Alternatively, you may use the constants available on the `Illuminate\Console\Scheduling\Schedule` class when defining the days on which a task should run:

    use Illuminate\Console\Scheduling\Schedule;

    $schedule->command('emails:send')
                    ->hourly()
                    ->days([Schedule::SUNDAY, Schedule::WEDNESDAY]);

#### Between Time Constraints

The `between` method may be used to limit the execution of a task based on the time of day:

    $schedule->command('emails:send')
                        ->hourly()
                        ->between('7:00', '22:00');

Similarly, the `unlessBetween` method can be used to exclude the execution of a task for a period of time:

    $schedule->command('emails:send')
                        ->hourly()
                        ->unlessBetween('23:00', '4:00');

#### Truth Test Constraints

The `when` method may be used to limit the execution of a task based on the result of a given truth test. In other words, if the given closure returns `true`, the task will execute as long as no other constraining conditions prevent the task from running:

    $schedule->command('emails:send')->daily()->when(function () {
        return true;
    });

The `skip` method may be seen as the inverse of `when`. If the `skip` method returns `true`, the scheduled task will not be executed:

    $schedule->command('emails:send')->daily()->skip(function () {
        return true;
    });

When using chained `when` methods, the scheduled command will only execute if all `when` conditions return `true`.

#### Environment Constraints

The `environments` method may be used to execute tasks only on the given environments (as defined by the `APP_ENV` [environment variable](/docs/{{version}}/configuration#environment-configuration)):

    $schedule->command('emails:send')
                ->daily()
                ->environments(['staging', 'production']);

### Timezones

Using the `timezone` method, you may specify that a scheduled task's time should be interpreted within a given timezone:

    $schedule->command('report:generate')
             ->timezone('America/New_York')
             ->at('2:00')

If you are repeatedly assigning the same timezone to all of your scheduled tasks, you may wish to define a `scheduleTimezone` method in your `App\Console\Kernel` class. This method should return the default timezone that should be assigned to all scheduled tasks:

    /**
     * Get the timezone that should be used by default for scheduled events.
     *
     * @return \DateTimeZone|string|null
     */
    protected function scheduleTimezone()
    {
        return 'America/Chicago';
    }

> **Warning**
> Remember that some timezones utilize daylight savings time. When daylight saving time changes occur, your scheduled task may run twice or even not run at all. For this reason, we recommend avoiding timezone scheduling when possible.

### Preventing Task Overlaps

By default, scheduled tasks will be run even if the previous instance of the task is still running. To prevent this, you may use the `withoutOverlapping` method:

    $schedule->command('emails:send')->withoutOverlapping();

In this example, the `emails:send` [Artisan command](/docs/{{version}}/artisan) will be run every minute if it is not already running. The `withoutOverlapping` method is especially useful if you have tasks that vary drastically in their execution time, preventing you from predicting exactly how long a given task will take.

If needed, you may specify how many minutes must pass before the "without overlapping" lock expires. By default, the lock will expire after 24 hours:

    $schedule->command('emails:send')->withoutOverlapping(10);

Behind the scenes, the `withoutOverlapping` method utilizes your application's [cache](/docs/{{version}}/cache) to obtain locks. If necessary, you can clear these cache locks using the `schedule:clear-cache` Artisan command. This is typically only necessary if a task becomes stuck due to an unexpected server problem.

### Running Tasks On One Server

> **Warning**
> To utilize this feature, your application must be using the `database`, `memcached`, `dynamodb`, or `redis` cache driver as your application's default cache driver. In addition, all servers must be communicating with the same central cache server.

If your application's scheduler is running on multiple servers, you may limit a scheduled job to only execute on a single server. For instance, assume you have a scheduled task that generates a new report every Friday night. If the task scheduler is running on three worker servers, the scheduled task will run on all three servers and generate the report three times. Not good!

To indicate that the task should run on only one server, use the `onOneServer` method when defining the scheduled task. The first server to obtain the task will secure an atomic lock on the job to prevent other servers from running the same task at the same time:

    $schedule->command('report:generate')
                    ->fridays()
                    ->at('17:00')
                    ->onOneServer();

#### Naming Single Server Jobs

Sometimes you may need to schedule the same job to be dispatched with different parameters, while still instructing Laravel to run each permutation of the job on a single server. To accomplish this, you may assign each schedule definition a unique name via the `name` method:

```php
$schedule->job(new CheckUptime('https://laravel.com'))
            ->name('check_uptime:laravel.com')
            ->everyFiveMinutes()
            ->onOneServer();

$schedule->job(new CheckUptime('https://vapor.laravel.com'))
            ->name('check_uptime:vapor.laravel.com')
            ->everyFiveMinutes()
            ->onOneServer();
```

### Background Tasks

By default, multiple tasks scheduled at the same time will execute sequentially based on the order they are defined in your `schedule` method. If you have long-running tasks, this may cause subsequent tasks to start much later than anticipated. If you would like to run tasks in the background so that they may all run simultaneously, you may use the `runInBackground` method:

    $schedule->command('analytics:report')
             ->daily()
             ->runInBackground();

> **Warning**
> The `runInBackground` method may only be used when scheduling tasks via the `command` and `exec` methods.

### Maintenance Mode

Your application's scheduled tasks will not run when the application is in [maintenance mode](/docs/{{version}}/configuration#maintenance-mode), since we don't want your tasks to interfere with any unfinished maintenance you may be performing on your server. However, if you would like to force a task to run even in maintenance mode, you may call the `evenInMaintenanceMode` method when defining the task:

    $schedule->command('emails:send')->evenInMaintenanceMode();

## Running The Scheduler

Now that we have learned how to define scheduled tasks, let's discuss how to actually run them on our server. The `schedule:run` Artisan command will evaluate all of your scheduled tasks and determine if they need to run based on the server's current time.

So, when using Laravel's scheduler, we only need to add a single cron configuration entry to our server that runs the `schedule:run` command every minute. If you do not know how to add cron entries to your server, consider using a service such as [Laravel Forge](https://forge.laravel.com) which can manage the cron entries for you:

```shell
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
```

## Running The Scheduler Locally

Typically, you would not add a scheduler cron entry to your local development machine. Instead, you may use the `schedule:work` Artisan command. This command will run in the foreground and invoke the scheduler every minute until you terminate the command:

```shell
php artisan schedule:work
```

## Task Output

The Laravel scheduler provides several convenient methods for working with the output generated by scheduled tasks. First, using the `sendOutputTo` method, you may send the output to a file for later inspection:

    $schedule->command('emails:send')
             ->daily()
             ->sendOutputTo($filePath);

If you would like to append the output to a given file, you may use the `appendOutputTo` method:

    $schedule->command('emails:send')
             ->daily()
             ->appendOutputTo($filePath);

Using the `emailOutputTo` method, you may email the output to an email address of your choice. Before emailing the output of a task, you should configure Laravel's [email services](/docs/{{version}}/mail):

    $schedule->command('report:generate')
             ->daily()
             ->sendOutputTo($filePath)
             ->emailOutputTo('taylor@example.com');

If you only want to email the output if the scheduled Artisan or system command terminates with a non-zero exit code, use the `emailOutputOnFailure` method:

    $schedule->command('report:generate')
             ->daily()
             ->emailOutputOnFailure('taylor@example.com');

> **Warning**
> The `emailOutputTo`, `emailOutputOnFailure`, `sendOutputTo`, and `appendOutputTo` methods are exclusive to the `command` and `exec` methods.

## Task Hooks

Using the `before` and `after` methods, you may specify code to be executed before and after the scheduled task is executed:

    $schedule->command('emails:send')
             ->daily()
             ->before(function () {
                 // The task is about to execute...
             })
             ->after(function () {
                 // The task has executed...
             });

The `onSuccess` and `onFailure` methods allow you to specify code to be executed if the scheduled task succeeds or fails. A failure indicates that the scheduled Artisan or system command terminated with a non-zero exit code:

    $schedule->command('emails:send')
             ->daily()
             ->onSuccess(function () {
                 // The task succeeded...
             })
             ->onFailure(function () {
                 // The task failed...
             });

If output is available from your command, you may access it in your `after`, `onSuccess` or `onFailure` hooks by type-hinting an `Illuminate\Support\Stringable` instance as the `$output` argument of your hook's closure definition:

    use Illuminate\Support\Stringable;

    $schedule->command('emails:send')
             ->daily()
             ->onSuccess(function (Stringable $output) {
                 // The task succeeded...
             })
             ->onFailure(function (Stringable $output) {
                 // The task failed...
             });

#### Pinging URLs

Using the `pingBefore` and `thenPing` methods, the scheduler can automatically ping a given URL before or after a task is executed. This method is useful for notifying an external service, such as [Envoyer](https://envoyer.io), that your scheduled task is beginning or has finished execution:

    $schedule->command('emails:send')
             ->daily()
             ->pingBefore($url)
             ->thenPing($url);

The `pingBeforeIf` and `thenPingIf` methods may be used to ping a given URL only if a given condition is `true`:

    $schedule->command('emails:send')
             ->daily()
             ->pingBeforeIf($condition, $url)
             ->thenPingIf($condition, $url);

The `pingOnSuccess` and `pingOnFailure` methods may be used to ping a given URL only if the task succeeds or fails. A failure indicates that the scheduled Artisan or system command terminated with a non-zero exit code:

    $schedule->command('emails:send')
             ->daily()
             ->pingOnSuccess($successUrl)
             ->pingOnFailure($failureUrl);

All of the ping methods require the Guzzle HTTP library. Guzzle is typically installed in all new Laravel projects by default, but, you may manually install Guzzle into your project using the Composer package manager if it has been accidentally removed:

```shell
composer require guzzlehttp/guzzle
```

## Events

If needed, you may listen to [events](/docs/{{version}}/events) dispatched by the scheduler. Typically, event listener mappings will be defined within your application's `App\Providers\EventServiceProvider` class:

    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        'Illuminate\Console\Events\ScheduledTaskStarting' => [
            'App\Listeners\LogScheduledTaskStarting',
        ],

        'Illuminate\Console\Events\ScheduledTaskFinished' => [
            'App\Listeners\LogScheduledTaskFinished',
        ],

        'Illuminate\Console\Events\ScheduledBackgroundTaskFinished' => [
            'App\Listeners\LogScheduledBackgroundTaskFinished',
        ],

        'Illuminate\Console\Events\ScheduledTaskSkipped' => [
            'App\Listeners\LogScheduledTaskSkipped',
        ],

        'Illuminate\Console\Events\ScheduledTaskFailed' => [
            'App\Listeners\LogScheduledTaskFailed',
        ],
    ];


text:
SELECT 'DROP TABLE ' || T.TABLE_NAME || ' CASCADE CONSTRAINTS ' || CHR(10) || '/'
FROM USER_TABLES T
ORDER BY TABLE_NAME
/


text:
extern "C" {
#include <SFPattern.h>
}

#include "PatternCache.h"

using namespace Tehreer;

PatternCache::PatternCache()
{
}

void PatternCache::put(const PatternKey &key, SFPatternRef pattern)
{
    m_mutex.lock();

    m_patterns[key] = PatternValue(SFPatternRetain(pattern), &SFPatternRelease);

    m_mutex.unlock();
}

SFPatternRef PatternCache::get(const PatternKey &key)
{
    SFPatternRef pattern = nullptr;

    m_mutex.lock();

    auto pair = m_patterns.find(key);
    if (pair != m_patterns.end()) {
        pattern = pair->second.get();
    }

    m_mutex.unlock();

    return pattern;
}


text:
					  Open Challenges

					  Accepted Challenges

					  Challenges I've Made

					 <button type="button" class="btn btn-primary" id="createChallenge" ng-click="goToChallengeCreator()">Create a Challenge!</button>

					Search: <input ng-model="searchText" placeholder = "Challenge Type/Name/Keywords">

									Type
									Name
									Location
									Start Date
									End Date
									Register

									{{challenge.challengeType}}
									{{challenge.name}}
									Worldwide
									{{player.country}}
									{{challenge.startDate}}
									{{challenge.endDate}}
									<button class="btn btn-danger" style="width: 100px" ng-click="goToRegistration(challenge.challenge_id)"> Register</button>

										<button ng-controller = "PathController" id="resume" ng-click="goToRegistration(challenge.challenge_id)" style="width: 100px" class="btn btn-info">Resume!</button>

								Search: <input ng-model="searchText" placeholder = "Challenge Type/Name/Keywords">

										Type
										Name
										Location
										StartDate
										EndDate
										Status
										Submitted Message

										{{Acceptedchallenge.challengeType}}
										{{Acceptedchallenge.name}}
										Worldwide
										{{player.country}}
										{{Acceptedchallenge.startDate}}
										{{Acceptedchallenge.endDate}}
										<input type="image" ng-click="goToRegistration(Acceptedchallenge.challenge_id)"  ng-src="img/challenge/privateButtonUnlocked_on.png"/>

												<button ng-controller = "PathController" id="resume" ng-click="goToRegistration(Acceptedchallenge.challenge_id)" class="btn btn-info">Resume!</button>

										{{Acceptedchallenge.playerFeedback}}
										You have not submitted any messages!

								Search: <input ng-model="searchText" placeholder = "Challenge Type/Name/Keywords">

									Type
									Name
									Location
									Start Date
									End Date
									Review
									Share

									{{myChallenge.challengeType}}
									{{myChallenge.name}}
									World Wide
									{{player.country}}
									{{myChallenge.startDate}}
									{{myChallenge.endDate}}

											<button class="btn btn-warning" a data-target="#statsModal" role="button" data-toggle="modal" ng-click="goToChallengeStats(myChallenge.challenge_id)">Stats</button>
											<button class="btn btn-danger" a data-target="#tab2create" ng-click="goToChallengeEdit(myChallenge.challenge_id)">Edit</button>

									<button class="btn btn-info" ng-click="shareURL(myChallenge)">Share</button>

Share the Challenge Link:

						{{challengeURL}}

						<button name="gotit" class="btn btn-primary">Ok</button>


text:
#import <Foundation/Foundation.h>

#import <ComponentKit/CKComponentLayout.h>
#import <ComponentKit/CKFlexboxComponent.h>
#import <RenderCore/CKOptional.h>
#import <RenderCore/CKVariant.h>

#import <vector>

@protocol CKInspectableView;
@class SKComponentLayoutWrapper;
@class SKComponentMountedView;

// RC::Variant does not support Objective-C types unless they are boxed:
struct SKLeafViewChild {
  UIView* view;
};
struct SKMountedViewChild {
  SKComponentMountedView* view;
};

/**
 The children of a SKComponentLayoutWrapper may be:
 - A single leaf view, which may have UIView children of its own.
 - A single non-leaf view, if the component created a view; its children will be
   the component's child components.
 - An array of SKComponentLayoutWrappers, if the component did not create a
   view.
 */
using SKComponentLayoutWrapperChildren = CK::Variant<
    SKLeafViewChild,
    SKMountedViewChild,
    std::vector<SKComponentLayoutWrapper*>>;

@interface SKComponentLayoutWrapper : NSObject

@property(nonatomic, weak, readonly) CKComponent* component;
@property(nonatomic, readonly) NSString* identifier;
@property(nonatomic, readonly) CGSize size;
@property(nonatomic, readonly) CGPoint position;
@property(nonatomic, readonly) SKComponentLayoutWrapperChildren children;
@property(nonatomic, weak, readonly) id<CKInspectableView> rootNode;
/** CK::none for components that are not the child of a CKFlexboxComponent. */
@property(nonatomic, readonly) CK::Optional<CKFlexboxComponentChild>
    flexboxChild;

+ (instancetype)newFromRoot:(id<CKInspectableView>)root
                  parentKey:(NSString*)parentKey;

@end


text:
package edu.usc.softarch.disco.selection.optimizing;

//JDK imports
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

//DISCO imports
import edu.usc.softarch.disco.connector.dcp.DistributionConnectorProfile;

/**
 * @author rezam
 * @version $Revision$
 *
 * <p>
 * A data structure representing the objective function for a index-based
 * connector selection
 * </p>.
 */
public class OptimizingObjectiveFunction {

  /* our log stream */
  private final static Logger LOG = Logger.getLogger(OptimizingObjectiveFunction
      .class.getName());

  private float coefConsistency = 0;

  private float coefEfficiency = 0;

  private float coefDependability = 0;

  private float coefScalability = 0;

  public OptimizingObjectiveFunction(float coefConsistency,
      float coefEfficiency, float coefDependability, float coefScalability) {
    this.coefConsistency = coefConsistency;
    this.coefDependability = coefDependability;
    this.coefEfficiency = coefEfficiency;
    this.coefScalability = coefScalability;
  }

  public float calculateOverallIndex(float indexConsistency,
      float indexEfficiency, float indexDependability, float indexScalability) {
    float overallIndex = coefConsistency * indexConsistency + coefDependability
        * indexDependability + coefEfficiency * indexEfficiency
        + coefScalability * indexScalability;
    return overallIndex;
  }

  public ConnectorPerformanceIndex optimizeObjective(
      List<String> freeVars, DistributionConnectorProfile dcp,
      CompetencyFunctionRepository repo, float baseCoefConsistency,
      float baseCoefEfficiency, float baseCoefDependability,
      float baseCoefScalability) {
    float optimizedIndex = 0;

    int nvar = freeVars.size();
    double[] startpt = new double[nvar];
    double[] endpt = new double[nvar];
    CompetencyFunction[] functionsConsistency = new CompetencyFunction[nvar];
    CompetencyFunction[] functionsDependability = new CompetencyFunction[nvar];
    CompetencyFunction[] functionsEfficiency = new CompetencyFunction[nvar];
    CompetencyFunction[] functionsScalability = new CompetencyFunction[nvar];

    // populate startpt
    float mulCoef = baseCoefConsistency * coefConsistency;
    String varForStartPt = CompetencyFunction.VAR_CONSISTENCY;
    float tmpCoef = baseCoefDependability * coefDependability;
    if (tmpCoef > mulCoef) {
      mulCoef = tmpCoef;
      varForStartPt = CompetencyFunction.VAR_DEPENDABILITY;
    }
    tmpCoef = baseCoefEfficiency * coefEfficiency;
    if (tmpCoef > mulCoef) {
      mulCoef = tmpCoef;
      varForStartPt = CompetencyFunction.VAR_EFFICIENCY;
    }
    tmpCoef = baseCoefScalability * coefScalability;
    if (tmpCoef > mulCoef) {
      mulCoef = tmpCoef;
      varForStartPt = CompetencyFunction.VAR_SCALABILITY;
    }

    for (int i = 0; i < nvar; i++) {
      CompetencyFunction func = repo.getCompetencyFunction(dcp,
          freeVars.get(i), varForStartPt);

      if(func == null){
        LOG.log(Level.WARNING, "No competency function present for: DCP: ["+dcp.getConnectorName()+"]: " +
        "var: ["+freeVars.get(i)+"] start pt var: ["+varForStartPt+"]");
        startpt[i] = 0;
      }
      else startpt[i] = func.getXofMaximum();

      // convert to logarithmic scale
      if (startpt[i] == 0) {
        startpt[i] = -100;
      } else {
        startpt[i] = Math.log10(startpt[i]);
      }
    }

    // populate function vectors
    for (int i = 0; i < nvar; i++) {
      functionsConsistency[i] = repo.getCompetencyFunction(dcp,
          freeVars.get(i), CompetencyFunction.VAR_CONSISTENCY);
      functionsDependability[i] = repo.getCompetencyFunction(dcp, freeVars
          .get(i), CompetencyFunction.VAR_DEPENDABILITY);
      functionsEfficiency[i] = repo.getCompetencyFunction(dcp, freeVars.get(i),
          CompetencyFunction.VAR_EFFICIENCY);
      functionsScalability[i] = repo.getCompetencyFunction(dcp,
          freeVars.get(i), CompetencyFunction.VAR_SCALABILITY);
    }

    Solver solver = new Solver(nvar, startpt, endpt, functionsConsistency,
        functionsDependability, functionsEfficiency, functionsEfficiency,
        baseCoefConsistency * coefConsistency, baseCoefDependability
            * coefDependability, baseCoefEfficiency * coefEfficiency,
        baseCoefScalability * coefScalability);

    LOG.log(Level.FINE, "Optimizing for " + dcp);
    optimizedIndex = (float) solver.solve();
    LOG.log(Level.FINE, "Optimum value " + optimizedIndex + " achieved on:");
    for (int i = 0; i < nvar; i++)
      LOG.log(Level.FINE, freeVars.get(i) + " = " + Math.pow(10, endpt[i]));

    ConnectorPerformanceIndex connectorPerformance = new ConnectorPerformanceIndex(
        dcp.getConnectorName(), optimizedIndex);
    return connectorPerformance;
  }

}


text: require "houston/support_form"


text:
vagrant ssh puppet -c "sudo ln -s /openstack /etc/puppet/modules; \
sudo ln -s /openstack/examples/hiera.yaml /etc/puppet/hiera.yaml; \
sudo mkdir -p /etc/puppet/hieradata; \
sudo ln -s /openstack/examples/allinone.yaml /etc/puppet/hieradata/common.yaml; \
sudo pkill -f puppet;"
vagrant ssh puppet -c "sudo su - root -c 'puppet master'"


text:
package client

import "fmt"

// Indicates that a Name can't be bound to Path
type ErrNegBinding struct {
	Name string
}

func (e *ErrNegBinding) Error() string {
	return fmt.Sprint("Neg:", e.Name)
}

// Indicates that a Path resolution is still pending
type ErrResolutionPending struct {
	Path string
}

func (e *ErrResolutionPending) Error() string {
	return fmt.Sprint("Pending:", e.Path)
}


text:
Alignment::Alignment(std::list<AlignedFragment*> &Fragments) :Fragments(Fragments)
{
}

Alignment::~Alignment()
{
}

// returns all fragments in an alignment
std::list<AlignedFragment*>* Alignment::getAllFragments()
{
	return &Fragments;
}

// returns a fragment with a given ID
AlignedFragment& Alignment::FragmentAt(int id)
{
	for (AlignedFragment *A : Fragments)
		if (A->getId() == id)
			return *A;

	throw std::runtime_error("Index out of range");
}

// removes first fragment
AlignedFragment *Alignment::PopFirst()
{
	AlignedFragment *first = Fragments.front();
	Fragments.pop_front();
	return first;
}

// adds fragment to the back of the fragments list
void Alignment::AddFragment(AlignedFragment* fragment)
{
	Fragments.push_back(fragment);
}

// returns the number of fragments
int Alignment::getSize()
{
	return Fragments.size();
}


text:
package org.apache.giraph.types;

import org.apache.hadoop.io.DoubleWritable;

/**
 * Converts Floats to DoubleWritables
 */
public class FloatToDoubleWritableWrapper
    implements WritableWrapper<DoubleWritable, Float> {
  @Override
  public void wrap(Float javaValue, DoubleWritable writableValue) {
    writableValue.set(javaValue.doubleValue());
  }
}