text:
package com.red.alert.ui.localization.rtl;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Build;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

import com.red.alert.config.Logging;
import com.red.alert.utils.localization.Localization;

public class RTLSupport {
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
    public static void mirrorActionBar(Activity activity) {
        // Hebrew only
        if (!Localization.isHebrewLocale(activity)) {
            return;
        }

        // Must be Jellybean or newer
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            // Set RTL layout direction
            activity.getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
        }
    }

    @SuppressLint("NewApi")
    public static void mirrorDialog(Dialog dialog, Context context) {
        // Hebrew only
        if (!Localization.isHebrewLocale(context)) {
            return;
        }

        try {
            // Get message text view
            TextView message = (TextView) dialog.findViewById(android.R.id.message);

            // Defy gravity
            if (message != null) {
                message.setGravity(Gravity.RIGHT);
            }

            // Get the title of text view
            TextView title = (TextView) dialog.findViewById(context.getResources().getIdentifier("alertTitle", "id", "android"));

            // Defy gravity
            title.setGravity(Gravity.RIGHT);

            // Get list view (may not exist)
            ListView listView = (ListView) dialog.findViewById(context.getResources().getIdentifier("select_dialog_listview", "id", "android"));

            // Check if list & set RTL mode
            if (listView != null) {
                listView.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
            }

            // Get title's parent layout
            LinearLayout parent = ((LinearLayout) title.getParent());

            // Get layout params
            LinearLayout.LayoutParams originalParams = (LinearLayout.LayoutParams) parent.getLayoutParams();

            // Set width to WRAP_CONTENT
            originalParams.width = LinearLayout.LayoutParams.WRAP_CONTENT;

            // Defy gravity
            originalParams.gravity = Gravity.RIGHT | Gravity.CENTER_VERTICAL;

            // Set layout params
            parent.setLayoutParams(originalParams);
        }
        catch (Exception exc) {
            // Log failure to logcat
            Log.d(Logging.TAG, "RTL failed", exc);
        }
    }
}


text:
package cn.djd.basekit.base.adapter;

import android.content.Context;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class BaseViewHolder {
    /**
     *
保存小控件的集合

     */
    private SparseArray<View> mViews = new SparseArray<View>();
    /**
     *
保存布局view的集合

     */
    private SparseArray<View> mConvertViews = new SparseArray<View>();
    /**
     *
当前下标

     */
    private int mPosition;
    /**
     *
单个布局view

     */
    private View mConvertView;
    /**
     *
layoutId

     */
    protected int mLayoutId;
    /**
     *
上下文

     */
    protected Context mContext;

    public BaseViewHolder(Context context, int position, ViewGroup parent, int layoutId) {
        mConvertView = mConvertViews.get(layoutId);
        mPosition = position;
        mContext = context;
        mLayoutId = layoutId;
        if (mConvertView == null) {
            mConvertView = LayoutInflater.from(context).inflate(layoutId, parent, false);
            mConvertViews.put(layoutId, mConvertView);
            mConvertView.setTag(this);
        }
    }

    public BaseViewHolder() {
    }

    /**
     * 获取BaseViewHolder实例
     *
     * @param context  上下文
     * @param position 位置
     * @param parent   viewGroup
     * @param layoutId 对应的布局Id
     * @return BaseViewHolder实例
     */
    public <T extends BaseViewHolder> T get(Context context, int position, View convertView, ViewGroup parent, int layoutId) {
        if (convertView == null) {
            return (T) new BaseViewHolder(context, position, parent, layoutId);
        } else {
            BaseViewHolder mHolder = (BaseViewHolder) convertView.getTag();
            if (mHolder.mLayoutId != layoutId) {
                return (T) new BaseViewHolder(context, position, parent, layoutId);
            }
            mHolder.setPosition(position);
            return (T) mHolder;
        }
    }

    /**
     * 获取viewId对应的控件
     *
     * @param viewId
     * @param <T>
     * @return
     */
    @SuppressWarnings("unchecked")
    public <T extends View> T getView(int viewId) {
        View view = mViews.get(viewId);
        if (view == null) {
            view = mConvertView.findViewById(viewId);
            mViews.put(viewId, view);
        }
        return (T) view;
    }

    /**
     * 当没有指定到时候,返回队列中的第一个
     *
     * @return
     */
    public View getConvertView() {
        return mConvertViews.valueAt(0);
    }

    /**
     * 返回队列中指定layoutId对应的view
     *
     * @param layoutId
     * @return
     */
    public View getConvertView(int layoutId) {
        return mConvertViews.get(layoutId);
    }

    public void setPosition(int mPosition) {
        this.mPosition = mPosition;
    }

    public int getLayoutId() {
        return mLayoutId;
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace ScotlandsMountains.Import.Files;

internal static class FileStreams
{
    public static Stream HillCsvZip => GetFileStream("hillcsv.zip");

    private static Stream GetFileStream(string fileName)
    {
        return typeof(FileStreams).Assembly.GetManifestResourceStream($"{typeof(FileStreams).Namespace}.{fileName}")!;
    }
}


text:
package com.czt.simpleleakcanary.library;

import android.util.Log;

import java.lang.ref.ReferenceQueue;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.Executor;

/**
 * Created by chentong on 12/5/15.
 * mail:chentong.think@gmail.com
 */
public class RefWatcher {

    private final Set<String> retainedKeys = new CopyOnWriteArraySet<>();
    private final Executor watchExecutor = new AndroidWatchExecutor();
    private final ReferenceQueue<Object> queue = new ReferenceQueue<>();

    public void watch(Object object) {
        String key = UUID.randomUUID().toString();
        retainedKeys.add(key);

        final KeyedWeakReference reference = new KeyedWeakReference(object, key, queue);

        watchExecutor.execute(new Runnable() {
            @Override
            public void run() {
                ensureGone(reference);
            }
        });
    }

    private void ensureGone(KeyedWeakReference reference) {
        removeWeaklyReachableReferences();
        if (gone(reference)) {
            return;
        }

        GcTrigger.DEFAULT.runGc();
        removeWeaklyReachableReferences();

        if (!gone(reference)) {
            String name = reference.get().getClass().getName();
            Log.i("MemoryLeak", "class:" + name);
        }
    }

    private boolean gone(KeyedWeakReference reference) {
        return !retainedKeys.contains(reference.getKey());
    }

    private void removeWeaklyReachableReferences() {
        // WeakReferences are enqueued as soon as the object to which they point to becomes weakly
        // reachable. This is before finalization or garbage collection has actually happened.
        KeyedWeakReference ref;
        while ((ref = (KeyedWeakReference) queue.poll()) != null) {
            retainedKeys.remove(ref.getKey());
        }
    }
}


text:
package sort

func DoSelectionSort(input []int) []int {
	return sort(input, 0, len(input))
}

func sort(input []int, start, end int) []int {
	if start < (end-1) {
		smallestNum := input[start]
		for idx := (start+1); idx < end; idx++ {
			if input[idx] < smallestNum {
				input[start] = input[idx]
				input[idx] = smallestNum
				smallestNum = input[start]
			}
		}
		sort(input, start+1, end)
	}
	return input
}


text:
Get metrics using the command line utility `smartctl` for S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology) storage devices. SMART is a monitoring system included in computer hard disk drives (HDDs) and solid-state drives (SSDs) that detects and reports on various indicators of drive reliability, with the intent of enabling the anticipation of hardware failures.
See smartmontools (https://www.smartmontools.org/).

SMART information is separated between different measurements: `smart_device` is used for general information, while `smart_attribute` stores the detailed attribute information if `attributes = true` is enabled in the plugin configuration.

If no devices are specified, the plugin will scan for SMART devices via the following command:

```
smartctl --scan
```

Metrics will be reported from the following `smartctl` command:

```
smartctl --info --attributes --health -n <nocheck> --format=brief <device>
```

This plugin supports _smartmontools_ version 5.41 and above, but v. 5.41 and v. 5.42
might require setting `nocheck`, see the comment in the sample configuration.
Also, NVMe capabilities were introduced in version 6.5.

To enable SMART on a storage device run:

```
smartctl -s on <device>
```
## NVMe vendor specific attributes

For NVMe disk type, plugin can use command line utility `nvme-cli`. It has a feature
to easy access a vendor specific attributes.
This plugin supports nmve-cli version 1.5 and above (https://github.com/linux-nvme/nvme-cli).
In case of `nvme-cli` absence NVMe vendor specific metrics will not be obtained.

Vendor specific SMART metrics for NVMe disks may be reported from the following `nvme` command:

```
nvme <vendor> smart-log-add <device>
```

Note that vendor plugins for `nvme-cli` could require different naming convention and report format.

To see installed plugin extensions, depended on the nvme-cli version, look at the bottom of:
```
nvme help
```

To gather disk vendor id (vid) `id-ctrl` could be used:
```
nvme id-ctrl <device>
```
Association between a vid and company can be found there: https://pcisig.com/membership/member-companies.

Devices affiliation to being NVMe or non NVMe will be determined thanks to:
```
smartctl --scan
```
and:
```
smartctl --scan -d nvme
```

## Configuration

```toml
# Read metrics from storage devices supporting S.M.A.R.T.
[[inputs.smart]]
    ## Optionally specify the path to the smartctl executable
    # path_smartctl = "/usr/bin/smartctl"

    ## Optionally specify the path to the nvme-cli executable
    # path_nvme = "/usr/bin/nvme"

    ## Optionally specify if vendor specific attributes should be propagated for NVMe disk case
    ## ["auto-on"] - automatically find and enable additional vendor specific disk info
    ## ["vendor1", "vendor2", ...] - e.g. "Intel" enable additional Intel specific disk info
    # enable_extensions = ["auto-on"]

    ## On most platforms used cli utilities requires root access.
    ## Setting 'use_sudo' to true will make use of sudo to run smartctl or nvme-cli.
    ## Sudo must be configured to allow the telegraf user to run smartctl or nvme-cli
    ## without a password.
    # use_sudo = false

    ## Skip checking disks in this power mode. Defaults to
    ## "standby" to not wake up disks that have stopped rotating.
    ## See --nocheck in the man pages for smartctl.
    ## smartctl version 5.41 and 5.42 have faulty detection of
    ## power mode and might require changing this value to
    ## "never" depending on your disks.
    # nocheck = "standby"

    ## Gather all returned S.M.A.R.T. attribute metrics and the detailed
    ## information from each drive into the 'smart_attribute' measurement.
    # attributes = false

    ## Optionally specify devices to exclude from reporting if disks auto-discovery is performed.
    # excludes = [ "/dev/pass6" ]

    ## Optionally specify devices and device type, if unset
    ## a scan (smartctl --scan and smartctl --scan -d nvme) for S.M.A.R.T. devices will be done
    ## and all found will be included except for the excluded in excludes.
    # devices = [ "/dev/ada0 -d atacam", "/dev/nvme0"]

    ## Timeout for the cli command to complete.
    # timeout = "30s"
```

## Permissions

It's important to note that this plugin references smartctl and nvme-cli, which may require additional permissions to execute successfully.
Depending on the user/group permissions of the telegraf user executing this plugin, you may need to use sudo.

You will need the following in your telegraf config:
```toml
[[inputs.smart]]
  use_sudo = true
```

You will also need to update your sudoers file:
```bash
$ visudo
# For smartctl add the following lines:
Cmnd_Alias SMARTCTL = /usr/bin/smartctl
telegraf  ALL=(ALL) NOPASSWD: SMARTCTL
Defaults!SMARTCTL !logfile, !syslog, !pam_session

# For nvme-cli add the following lines:
Cmnd_Alias NVME = /path/to/nvme
telegraf  ALL=(ALL) NOPASSWD: NVME
Defaults!NVME !logfile, !syslog, !pam_session
```
To run smartctl or nvme with `sudo` wrapper script can be created. `path_smartctl` or
`path_nvme` in the configuration should be set to execute this script.

## Metrics

- smart_device:
  - tags:
    - capacity
    - device
    - enabled
    - model
    - serial_no
    - wwn
  - fields:
    - exit_status
    - health_ok
    - read_error_rate
    - seek_error
    - temp_c
    - udma_crc_errors

- smart_attribute:
  - tags:
    - capacity
    - device
    - enabled
    - fail
    - flags
    - id
    - model
    - name
    - serial_no
    - wwn
  - fields:
    - exit_status
    - raw_value
    - threshold
    - value
    - worst

#### Flags

The interpretation of the tag `flags` is:
 - `K` auto-keep
 - `C` event count
 - `R` error rate
 - `S` speed/performance
 - `O` updated online
 - `P` prefailure warning

#### Exit Status

The `exit_status` field captures the exit status of the used cli utilities command which
is defined by a bitmask. For the interpretation of the bitmask see the man page for
smartctl or nvme-cli.

## Device Names
Device names, e.g., `/dev/sda`, are *not persistent*, and may be
subject to change across reboots or system changes. Instead, you can use the
*World Wide Name* (WWN) or serial number to identify devices. On Linux block
devices can be referenced by the WWN in the following location:
`/dev/disk/by-id/`.
## Troubleshooting
If you expect to see more SMART metrics than this plugin shows, be sure to use a proper version
of smartctl or nvme-cli utility which has the functionality to gather desired data. Also, check
your device capability because not every SMART metrics are mandatory.
For example the number of temperature sensors depends on the device specification.

If this plugin is not working as expected for your SMART enabled device,
please run these commands and include the output in a bug report:

For non NVMe devices (from smartctl version >= 7.0 this will also return NVMe devices by default):
```
smartctl --scan
```
For NVMe devices:
```
smartctl --scan -d nvme
```
Run the following command replacing your configuration setting for NOCHECK and
the DEVICE (name of the device could be taken from the previous command):
```
smartctl --info --health --attributes --tolerance=verypermissive --nocheck NOCHECK --format=brief -d DEVICE
```
If you try to gather vendor specific metrics, please provide this commad
and replace vendor and device to match your case:
```
nvme VENDOR smart-log-add DEVICE
```
## Example SMART Plugin Outputs
```
smart_device,enabled=Enabled,host=mbpro.local,device=rdisk0,model=APPLE\ SSD\ SM0512F,serial_no=S1K5NYCD964433,wwn=5002538655584d30,capacity=500277790720 udma_crc_errors=0i,exit_status=0i,health_ok=true,read_error_rate=0i,temp_c=40i 1502536854000000000
smart_attribute,capacity=500277790720,device=rdisk0,enabled=Enabled,fail=-,flags=-O-RC-,host=mbpro.local,id=199,model=APPLE\ SSD\ SM0512F,name=UDMA_CRC_Error_Count,serial_no=S1K5NYCD964433,wwn=5002538655584d30 exit_status=0i,raw_value=0i,threshold=0i,value=200i,worst=200i 1502536854000000000
smart_attribute,capacity=500277790720,device=rdisk0,enabled=Enabled,fail=-,flags=-O---K,host=mbpro.local,id=199,model=APPLE\ SSD\ SM0512F,name=Unknown_SSD_Attribute,serial_no=S1K5NYCD964433,wwn=5002538655584d30 exit_status=0i,raw_value=0i,threshold=0i,value=100i,worst=100i 1502536854000000000
```


text:
data Item = Banana | Club | Shield | Armor | Sord | Star
	deriving (Show, Eq, Ord, Bounded)

type Baggage = [Item]

data Stage = Fork Stage Stage | Goal Item deriving Show

point :: Item -> Integer
point Banana = 10
point Club = 20
point Shield = 50
point Armor = 80
point Sord = 100
point Star = 200

baggage1, baggage2, baggage3 :: Baggage
baggage1 = [Banana, Armor, Star, Sord]
baggage2 = [Club, Armor, Shield, Star, Star]
baggage3 = [Shield, Sord, Star]

stage1, stage2, stage3 :: Stage
stage1 = Fork
	(Fork (Goal Club) (Goal Sord))
	(Fork (Goal Shield) (Goal Club))

stage2 = Fork
	(Fork
		(Goal Banana)
		(Fork
			(Goal Shield)
			(Goal Banana)))
	(Fork
		(Goal Star)
		(Goal Sord))

stage3 = Fork
	(Goal Shield)
	(Fork
		(Fork
			(Goal Armor)
			(Goal Shield))
		(Goal Shield))

yourItems :: Baggage -> Integer
yourItems (_ : is) = 1 + yourItems is
yourItems [] = 0

yourPoint :: Baggage -> Integer
yourPoint (i : is) = point i + yourPoint is
yourPoint [] = 100

yours :: (Item -> b -> b) -> b -> Baggage -> b
yours op v (i : is) = i `op` yours op v is
yours _ v [] = v

fyours :: (Item -> (b -> b)) -> Baggage -> (b -> b)
fyours op (i : is) = op i . fyours op is
fyours _ [] = id

doesStarExist :: Stage -> Bool -> Bool
doesStarExist (Fork l r) = doesStarExist l . doesStarExist r
doesStarExist (Goal Star) = const True
doesStarExist (Goal _) = id

stageItems :: Stage -> Integer -> Integer
stageItems (Fork l r) = stageItems l . stageItems r
stageItems (Goal _) = (1 +)

stagePoint :: Stage -> Integer -> Integer
stagePoint (Fork l r) = stagePoint l . stagePoint r
stagePoint (Goal i) = (point i +)

bestItem :: Stage -> Item -> Item
bestItem (Fork l r) = bestItem l . bestItem r
bestItem (Goal i) = (i `max`)

worstItem :: Stage -> Item -> Item
worstItem (Fork l r) = worstItem l . worstItem r
worstItem (Goal i) = (i `min`)

stages :: (Item -> b -> b) -> Stage -> b -> b
stages op (Fork l r) = stages op l . stages op r
stages op (Goal i) = (i `op`)

data BinTree a = Node (BinTree a) (BinTree a) | Leaf a deriving Show

type Stage' = BinTree Item

tffoldr :: (a -> b -> b) -> BinTree a -> b -> b
tffoldr op (Node l r) = tffoldr op l . tffoldr op r
tffoldr op (Leaf x) = (x `op`)

instance Foldable BinTree where
	foldMap f (Node l r) = foldMap f l `mappend` foldMap f r
	foldMap f (Leaf x) = f x

btStage1 :: Stage'
btStage1 = Node
	(Node
		(Leaf Banana)
		(Node
			(Leaf Shield)
			(Leaf Banana)))
	(Node
		(Leaf Star)
		(Leaf Sord))

yourItems' :: Baggage -> Int
yourItems' = length

stageItems' :: Stage' -> Int
stageItems' = length

yourPoint' :: Baggage -> Integer
yourPoint' = foldr ((+) . point) 100

stagePoint' :: Stage' -> Integer
stagePoint' = foldr ((+) . point) 0

doesStarExist' :: Stage' -> Bool
doesStarExist' = (Star `elem`)

bestItem' :: Stage' -> Item
bestItem' = maximum

worstItem' :: Stage' -> Item
worstItem' = minimum


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>StorageProxyTest</title>
<meta name="date" content="2015-05-16">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.cassandra.service

Class StorageProxyTest

java.lang.Object

org.apache.cassandra.service.StorageProxyTest

public class StorageProxyTest
extends java.lang.Object

Constructor Summary

Constructors

Constructor and Description

StorageProxyTest()

Method Summary

Methods

Modifier and Type
Method and Description

static void
beforeClass()

void
testGRR()

void
testGRRExact()

void
testGRRExactBounds()

void
testGRRWrapped()

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StorageProxyTest

public StorageProxyTest()

Method Detail

beforeClass

public static void beforeClass()
                        throws java.lang.Throwable

Throws:

java.lang.Throwable

testGRR

public void testGRR()
             throws java.lang.Throwable

Throws:

java.lang.Throwable

testGRRExact

public void testGRRExact()
                  throws java.lang.Throwable

Throws:

java.lang.Throwable

testGRRWrapped

public void testGRRWrapped()
                    throws java.lang.Throwable

Throws:

java.lang.Throwable

testGRRExactBounds

public void testGRRExactBounds()
                        throws java.lang.Throwable

Throws:

java.lang.Throwable

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
require 'acceptance_helper'

describe API::V1::UsersController, type: :request do
  resource I18n.t('doc.users.resource') do
    include HttpAuthHelper

    before(:each) do
      disable_http_basic_authentication(API::V1::UsersController)
    end

    header 'Accept',       'application/json'
    header 'Content-Type', 'application/json'

    let!(:david) { FactoryBot.create(:user, :david) }
    let!(:user) do
      User.create!(
        email:      'user@example.com',
        password:   'changeme',
        name:       'John',
        last_name:  'Doe',
        role:       :admin,
        company:    'Example Corporation',
        department: 'Administrators',
        api_token:  'RENEWMEPLEASE',
        blocked:    false,
        external:   false
      )
    end

    get '/api/users?page_size=:page_size&page=:page' do
      parameter :page_size,
                I18n.t('doc.common.parameters.page_size'),
                {I18n.t('doc.common.parameters.default') => 25}
      parameter :page,
                I18n.t('doc.common.parameters.page'),
                {I18n.t('doc.common.parameters.default') => 1}

      example_request I18n.t('doc.common.cases.list'),
                      page_size: 1, page: 2 do
        expect(status).to eq(200)
        expect(JSON(response_body)).to eq(
          'users' => [
            {
              'email'       => 'demo@example.com',
              'name'        => 'David',
              'last_name'   => 'Jones',
              'middle_name' => nil,
              'company'     => 'Example Corporation',
              'department'  => 'Demonstrations',
              'role'        => 'user',
              'blocked'     => false,
              'external'    => false
            }
          ]
        )
      end
    end

    get '/api/users/:email' do
      parameter :email, I18n.t('doc.users.parameters.email'), required: true

      let(:email) { 'demo@example.com' }

      example_request I18n.t('doc.common.cases.show') do
        expect(status).to eq(200)
        expect(JSON(response_body)).to eq(
          'user' => {
            'email'       => 'demo@example.com',
            'name'        => 'David',
            'last_name'   => 'Jones',
            'middle_name' => nil,
            'company'     => 'Example Corporation',
            'department'  => 'Demonstrations',
            'role'        => 'user',
            'blocked'     => false,
            'external'    => false
          }
        )
      end
    end

    put '/api/users/:email' do
      parameter :email,              I18n.t('doc.users.parameters.email'),              required: true
      parameter :name,               I18n.t('doc.users.parameters.first_name'),         scope: :user
      parameter :middle_name,        I18n.t('doc.users.parameters.middle_name'),        scope: :user
      parameter :last_name,          I18n.t('doc.users.parameters.last_name'),          scope: :user
      parameter :role,               I18n.t('doc.users.parameters.user_role'),          scope: :user
      parameter :company,            I18n.t('doc.users.parameters.company'),            scope: :user
      parameter :department,         I18n.t('doc.users.parameters.department'),         scope: :user
      parameter :blocked,            I18n.t('doc.users.parameters.blocked'),            scope: :user
      parameter :external,           I18n.t('doc.users.parameters.external'),           scope: :user
      parameter :password_salt,      I18n.t('doc.users.parameters.password_salt'),      scope: :user
      parameter :encrypted_password, I18n.t('doc.users.parameters.encrypted_password'), scope: :user

      let(:middle_name)        { 'Jay' }
      let(:email)              { 'demo@example.com' }
      let(:blocked)            { true }
      let(:external)           { true }
      let(:password_salt)      { 'U0N9NNPINLPAKK9ABVBO9CALOA4OSZXB' }
      let(:encrypted_password) { '3f338baf4c2b847d8e81fda3f4bd982aecb3f568' }
      let(:raw_post)           { params.to_json }

      example_request I18n.t('doc.common.cases.update') do
        updated_user = User.find_by_email(email)
        expect(status).to eq(200)
        expect(JSON(response_body)).to eq(
          'user' => {
            'email'       => 'demo@example.com',
            'name'        => 'David',
            'last_name'   => 'Jones',
            'middle_name' => 'Jay',
            'company'     => 'Example Corporation',
            'department'  => 'Demonstrations',
            'role'        => 'user',
            'blocked'     => true,
            'external'    => true
          }
        )
        expect(updated_user.middle_name).to eq(middle_name)
      end
    end

    post '/api/users' do
      parameter :email,         I18n.t('doc.users.parameters.email'),              required: true, scope: :user
      parameter :name,          I18n.t('doc.users.parameters.first_name'),         required: true, scope: :user
      parameter :middle_name,   I18n.t('doc.users.parameters.middle_name'),        scope: :user
      parameter :last_name,     I18n.t('doc.users.parameters.last_name'),          required: true, scope: :user
      parameter :role,          I18n.t('doc.users.parameters.user_role'), {:scope                                         => :user,
                                                                           I18n.t('doc.common.parameters.allowed_values') => User.roles_list.join(', '),
                                                                           I18n.t('doc.common.parameters.default')        => 'user'}
      parameter :company,       I18n.t('doc.users.parameters.company'),            required: true, scope: :user
      parameter :department,    I18n.t('doc.users.parameters.department'),         required: true, scope: :user
      parameter :password,      I18n.t('doc.users.parameters.password'),           required: true, scope: :user
      parameter :password_salt, I18n.t('doc.users.parameters.password_salt'),      required: true, scope: :user
      parameter :password_salt, I18n.t('doc.users.parameters.encrypted_password'), required: true, scope: :user

      let(:raw_post)           { params.to_json }
      let(:email)              { 's.collins@example.com' }
      let(:name)               { 'Stan' }
      let(:middle_name)        { 'Kay' }
      let(:last_name)          { 'Collins' }
      let(:role)               { 'admin' }
      let(:company)            { 'LLC Tools' }
      let(:department)         { 'Administrators' }
      let(:password)           { 'changeme' }
      let(:password_salt)      { 'U0N9NNPINLPAKK9ABVBO9CALOA4OSZXB' }
      let(:encrypted_password) { '3f338baf4c2b847d8e81fda3f4bd982aecb3f568' }

      example_request I18n.t('doc.common.cases.create') do
        expect(status).to eq(201)
        expect(JSON(response_body)).to eq(
          'user' => {
            'email'       => 's.collins@example.com',
            'name'        => 'Stan',
            'last_name'   => 'Collins',
            'middle_name' => 'Kay',
            'company'     => 'LLC Tools',
            'department'  => 'Administrators',
            'role'        => 'admin',
            'blocked'     => false,
            'external'    => false
          }
        )
      end
    end

    delete '/api/users/:email' do
      parameter :email, I18n.t('doc.users.parameters.email'), required: true

      let(:email) { 'demo@example.com' }

      example_request I18n.t('doc.common.cases.delete') do
        expect(status).to eq(204)
        expect(User.find_by_email(email)).to be_nil
      end
    end
  end
end


text:
package jp.gr.java_conf.kgd.library.cool.jsfml.application.scene.data;

import jp.gr.java_conf.kgd.library.cool.jsfml.application.scene.transition.ITransition;

public interface ITransitionsData
extends IConstTransitionsData
{
	void setOutTransition(ITransition transition);
	void setInTransition(ITransition transition);

	void setTransitionCrossed(boolean flag);
	void setTransitionInterval(int interval);
}


text:
Introduction
============
Appirater is a class that you can drop into any Windows or Windows Phone app that will help remind your users to review your app on the Store.  The code is released under the MIT/X11, so feel free to
modify and share your changes with the world.

The source is based on [Appirater for Monotouch].

How to
======

* Declare an object of type `Appirater` in your `App.xaml.cs`.
* Initialize it in `App()` constructor after `Window.Current.Activate()` (`new Appirater("<your app name>", bool debug)`).
* Customize behaviors using `.Settings` property.
* Call `.AppLaunched(true)` at the next line.
* Call `.AppEnteredForeground(true)` in your `Window.Current.Activated` event handler.
* (Optional) Call `.UserDidSignificantEvent(true)` when the user does something 'significant' in the app.

N.B.
======
In a Windows 10 app, the AppId property is the alphanumeric sequence at the end of the Store URL.

Install
=======
You can install the library via [NuGet]:

Install-Package [Appirater]
------------------------------

[Appirater for monotouch]:https://github.com/chebum/Appirater-for-MonoTouch
[NuGet]:http://nuget.org/
[Appirater]:http://nuget.org/packages/Appirater


text:
using System;
using paramore.brighter.commandprocessor;
using paramore.brighter.commandprocessor.logging.Attributes;
using paramore.brighter.commandprocessor.Logging;
using paramore.brighter.commandprocessor.policy.Attributes;
using Tasks.Adapters.DataAccess;
using Tasks.Model;
using Tasks.Ports.Commands;
using Tasks.Ports.Events;

namespace Tasks.Ports.Handlers
{
    public class CompleteTaskCommandHandler : RequestHandler<CompleteTaskCommand>
    {
        private readonly ITasksDAO _tasksDAO;
        private readonly IAmACommandProcessor _commandProcessor;

        public CompleteTaskCommandHandler(ITasksDAO tasksDAO, IAmACommandProcessor commandProcessor)
            : this(tasksDAO, commandProcessor, LogProvider.For<CompleteTaskCommandHandler>())
        { }

        public CompleteTaskCommandHandler(ITasksDAO tasksDAO, IAmACommandProcessor commandProcessor, ILog logger)
            : base(logger)
        {
            _tasksDAO = tasksDAO;
            _commandProcessor = commandProcessor;
        }

        [RequestLogging(step: 1, timing: HandlerTiming.Before)]
        [Validation(step: 2, timing: HandlerTiming.Before)]
        [UsePolicy(CommandProcessor.RETRYPOLICY, step: 3)]
        public override CompleteTaskCommand Handle(CompleteTaskCommand completeTaskCommand)
        {
            using (var scope = _tasksDAO.BeginTransaction())
            {
                Task task = _tasksDAO.FindById(completeTaskCommand.TaskId);
                if (task != null)
                {
                    task.CompletionDate = completeTaskCommand.CompletionDate;
                    _tasksDAO.Update(task);
                    scope.Commit();
                }
                else
                {
                    throw new ArgumentOutOfRangeException("completeTaskCommand", completeTaskCommand, "Could not find the task to complete");
                }
            }

            _commandProcessor.Post(new TaskCompletedEvent(completeTaskCommand.Id, completeTaskCommand.TaskId, completeTaskCommand.CompletionDate));

            return base.Handle(completeTaskCommand);
        }
    }
}


text:
<?php defined('SYSPATH') or die('No direct script access.');

class Kohana_Cache_Wincache extends Cache {

	/**
	 * Check for existence of the wincache extension This method cannot be invoked externally. The driver must
	 * be instantiated using the `Cache::instance()` method.
	 *
	 * @param  array     configuration
	 * @throws Cache_Exception
	 */
	protected function __construct(array $config)
	{
		if ( ! extension_loaded('wincache'))
		{
			throw new Cache_Exception('PHP wincache extension is not available.');
		}

		parent::__construct($config);
	}

	/**
	 * Retrieve a cached value entry by id.
	 *
	 *     // Retrieve cache entry from wincache group
	 *     $data = Cache::instance('wincache')->get('foo');
	 *
	 *     // Retrieve cache entry from wincache group and return 'bar' if miss
	 *     $data = Cache::instance('wincache')->get('foo', 'bar');
	 *
	 * @param   string   id of cache to entry
	 * @param   string   default value to return if cache miss
	 * @return  mixed
	 * @throws  Cache_Exception
	 */
	public function get($id, $default = NULL)
	{

    // for ProfilerToolbar
    ProfilerToolbar::cacheLog('get',array_search($this,Cache::$instances),$id);
    // /for ProfilerToolbar
		$data = wincache_ucache_get($this->_sanitize_id($id), $success);

		return $success ? $data : $default;
	}

	/**
	 * Set a value to cache with id and lifetime
	 *
	 *     $data = 'bar';
	 *
	 *     // Set 'bar' to 'foo' in wincache group, using default expiry
	 *     Cache::instance('wincache')->set('foo', $data);
	 *
	 *     // Set 'bar' to 'foo' in wincache group for 30 seconds
	 *     Cache::instance('wincache')->set('foo', $data, 30);
	 *
	 * @param   string   id of cache entry
	 * @param   string   data to set to cache
	 * @param   integer  lifetime in seconds
	 * @return  boolean
	 */
	public function set($id, $data, $lifetime = NULL)
	{
		if ($lifetime === NULL)
		{
			$lifetime = Arr::get($this->_config, 'default_expire', Cache::DEFAULT_EXPIRE);
		}

    // for ProfilerToolbar
    ProfilerToolbar::cacheLog('set',array_search($this,Cache::$instances),$id,$lifetime);
    // /for ProfilerToolbar

		return wincache_ucache_set($this->_sanitize_id($id), $data, $lifetime);
	}

	/**
	 * Delete a cache entry based on id
	 *
	 *     // Delete 'foo' entry from the wincache group
	 *     Cache::instance('wincache')->delete('foo');
	 *
	 * @param   string   id to remove from cache
	 * @return  boolean
	 */
	public function delete($id)
	{
    // for ProfilerToolbar
    ProfilerToolbar::cacheLog('del',array_search($this,Cache::$instances),$id);
    // /for ProfilerToolbar
		return wincache_ucache_delete($this->_sanitize_id($id));
	}

	/**
	 * Delete all cache entries.
	 *
	 * Beware of using this method when
	 * using shared memory cache systems, as it will wipe every
	 * entry within the system for all clients.
	 *
	 *     // Delete all cache entries in the wincache group
	 *     Cache::instance('wincache')->delete_all();
	 *
	 * @return  boolean
	 */
	public function delete_all()
	{
		return wincache_ucache_clear();
	}
}


text:
@echo off
setlocal
set curdir=%~dp0

:repeat

echo %1
set /a count=%count%+1
set props=%props% -PdefinitionFile.%count%=%1

if "%~2"=="" goto end
shift
goto repeat
:end

call gradle generateForm %props%

pause

@echo on


text:
/*************************************************************************/
/*  flow_container.h                                                     */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#ifndef FLOW_CONTAINER_H
#define FLOW_CONTAINER_H

#include "scene/gui/container.h"

class FlowContainer : public Container {
	GDCLASS(FlowContainer, Container);

private:
	int cached_size;
	int cached_line_count;

	bool vertical;

	void _resort();

protected:
	void _notification(int p_what);

	static void _bind_methods();

public:
	int get_line_count() const;

	virtual Size2 get_minimum_size() const;

	FlowContainer(bool p_vertical = false);
};

class HFlowContainer : public FlowContainer {
	GDCLASS(HFlowContainer, FlowContainer);

public:
	HFlowContainer() :
			FlowContainer(false) {}
};

class VFlowContainer : public FlowContainer {
	GDCLASS(VFlowContainer, FlowContainer);

public:
	VFlowContainer() :
			FlowContainer(true) {}
};

#endif // FLOW_CONTAINER_H


text:
Coral is a C++11 foundation and network library.

Coral is mainly based on Facebook folly library, but is restructured and customized with some extensions.

## Dependencies

Coral requires gcc 4.8+ / clang 3.3+ and a version of boost compiled with C++11 support.

Coral is built with CMake 2.8.8+, so you also need to install cmake.

### Debian 8

Coral is full tested on Debian 8.  Please install the dependencies below:

Required:

- libboost-all-dev (required 1.51.0+)
- libdouble-conversion-dev
- libgflags-dev
- libgoogle-glog-dev
- libevent-dev
- libssl-dev

Optional:

- libjemalloc-dev
- libicu-dev
- liblz4-dev
- liblzma-dev
- libonig-dev (prefer https://github.com/k-takata/Onigmo)
- libsnappy-dev
- zlib1g-dev

Test:

- libgtest-dev
- google-mock

Test is also optional, if not installed, test step is just skipped.  Installation of gtest and gmock requires some more steps, for example of gtest (gmock is similar):

```
# cd /usr/src/gtest/
# mkdir build && cd build
# cmake ..
# make
# cp libgtest* /usr/local/lib/
# cd .. && rm -r build
```

### Mac OS X

Coral is also compiled pass on Mac OS X.

On Mac, you can install the requirements with Homwbrew or MacPorts, or manually.

### Other Linux distributions

Coral should be compatible on other Linux.  For dependencies refer Debian.

## Installation

By cmake, it's simple:

```
$ mkdir build && cd build
$ cmake ..
$ make
# make install
```


text:
package org.simpleframework.xml.core;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

/**
 * The FieldContact object is used to act as a contact
 * for a field within an object. This allows a value to be set on an
 * object field during deserialization and acquired from the same
 * field during serialization.
 *
 * @author Niall Gallagher
 *
 * @see org.simpleframework.xml.core.FieldScanner
 */
class FieldContact implements Contact {

   /**
    * This is the label that marks the field within the object.
    */
   private Annotation label;

   /**
    * This represents the field within the schema class object.
    */
   private Field field;

   /**
    * This is the name for this contact as taken from the field.
    */
   private String name;

   /**
    * This is the modifiers for the field that this represents.
    */
   private int modifier;

   /**
    * Constructor for the FieldContact object. This is
    * used as a point of contact for a field within a schema class.
    * Values can be read and written directly to the field with this.
    *
    * @param field this is the field that is the point of contact
    * @param label this is the annotation that is used by the field
    */
   public FieldContact(Field field, Annotation label) {
      this.modifier = field.getModifiers();
      this.label = label;
      this.field = field;
   }

   /**
    * This is used to determine if the annotated contact is for a
    * read only variable. A read only variable is a field that
    * can be set from within the constructor such as a blank final
    * variable. It can also be a method with no set counterpart.
    *
    * @return this returns true if the contact is a constant one
    */
   public boolean isReadOnly() {
      return !isStatic() && isFinal();
   }

   /**
    * This is used to determine if the annotated contact is for a
    * static field or method. A static field or method is one that
    * contains the "static" keyword. Any static final fields will
    * be read only and does not require any matching annotation.
    *
    * @return this returns true if the contact is a static one
    */
   public boolean isStatic() {
      return Modifier.isStatic(modifier);
   }

   /**
    * This is used to identify annotated methods are fields that
    * can not be modified. Such field will require that there is
    * a constructor that can have the value injected in to it.
    *
    * @return this returns true if the field or method is final
    */
   public boolean isFinal() {
      return Modifier.isFinal(modifier);
   }

   /**
    * This will provide the contact type. The contact type is the
    * class that is to be set and get on the object. This represents
    * the return type for the get and the parameter for the set.
    *
    * @return this returns the type that this contact represents
    */
   public Class getType() {
      return field.getType();
   }

   /**
    * This provides the dependent class for the contact. This will
    * actually represent a generic type for the actual type. For
    * contacts that use a Collection type this will
    * be the generic type parameter for that collection.
    *
    * @return this returns the dependent type for the contact
    */
   public Class getDependent() {
      return Reflector.getDependent(field);
   }

   /**
    * This provides the dependent classes for the contact. This will
    * typically represent a generic types for the actual type. For
    * contacts that use a Map type this will be the
    * generic type parameter for that map type declaration.
    *
    * @return this returns the dependent type for the contact
    */
   public Class[] getDependents() {
      return Reflector.getDependents(field);
   }

   /**
    * This is used to acquire the name of the field. This will return
    * the name of the field which can then be used to determine the
    * XML attribute or element the contact represents. This ensures
    * that the name provided string is internalized for performance.
    *
    *  @return this returns the name of the field represented
    */
   public String getName() {
      if(name == null) {
         name = getName(field);
      }
      return name;
   }

   /**
    * This is used to acquire the name of the field such that it is
    * an internalized string. Internalization of the contact name
    * ensures that comparisons can be made to annotation names with
    * a simple reference comparison rather than a string comparison.
    *
    * @param field the field to acquire the internalized name from
    *
    * @return this returns the name of the string, internalized
    */
   private String getName(Field field) {
      String name = field.getName();

      if(name != null) {
         name = name.intern();
      }
      return name;
   }

   /**
    * This is the annotation associated with the point of contact.
    * This will be an XML annotation that describes how the contact
    * should be serialized and deserialized from the object.
    *
    * @return this provides the annotation associated with this
    */
   public Annotation getAnnotation() {
      return label;
   }

   /**
    * This is the annotation associated with the point of contact.
    * This will be an XML annotation that describes how the contact
    * should be serialized and deserialized from the object.
    *
    * @param type this is the type of the annotation to acquire
    *
    * @return this provides the annotation associated with this
    */
   public <T extends Annotation> T getAnnotation(Class<T> type) {
      if(type == label.annotationType()) {
         return (T) label;
      }
      return field.getAnnotation(type);
   }

   /**
    * This is used to set the specified value on the provided object.
    * The value provided must be an instance of the contact class so
    * that it can be set without a runtime class compatibility error.
    *
    * @param source this is the object to set the value on
    * @param value this is the value that is to be set on the object
    */
   public void set(Object source, Object value) throws Exception {
      if(!isFinal()) {
         field.set(source, value);
      }
   }

   /**
    * This is used to get the specified value on the provided object.
    * The value returned from this method will be an instance of the
    * contact class type. If the returned object is of a different
    * type then the serialization process will fail.
    *
    * @param source this is the object to acquire the value from
    *
    * @return this is the value that is acquired from the object
    */
   public Object get(Object source) throws Exception {
      return field.get(source);
   }

   /**
    * This is used to describe the contact as it exists within the
    * owning class. It is used to provide error messages that can
    * be used to debug issues that occur when processing a contact.
    * The string provided is the generic field string.
    *
    * @return this returns a string representation of the contact
    */
   public String toString() {
      return String.format("field '%s' %s", getName(), field.toString());
   }
}


text:
import java.util.Scanner;

class Alimento {
    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        System.out.println("\nDigite o Alimento (Vegetariano, Peixe, Frango ou Carne): ");
        String alimento = in.nextLine();
        System.out.println("\nDigite a Bebida (Chá, Refri Diet, Suco de melancia ou Suco de Laranja): ");
        String bebida = in.nextLine();
        System.out.println("\nDigite a Sobremesa (Abacaxi, Sorvete, Sorvete Diet ou Mousse): ");
        String sobremesa = in.nextLine();
        int calorias = 350;
        int caloriasbebida = 100;
        int caloriassobremesa = 200;
	    if (alimento.toLowerCase().equals("vegetariano")) calorias = 180;
	    else if (alimento.toLowerCase().equals("peixe")) calorias = 230;
	    else if (alimento.toLowerCase().equals("frango")) calorias = 250;
	    if (bebida.toLowerCase().equals("chá")) caloriasbebida = 20;
	    else if (bebida.toLowerCase().equals("refri diet")) caloriasbebida = 65;
	    else if (bebida.toLowerCase().equals("suco de melancia")) caloriasbebida = 70;
	    if (sobremesa.toLowerCase().equals("abacaxi")) caloriassobremesa = 75;
	    else if (sobremesa.toLowerCase().equals("sorvete")) caloriassobremesa = 170;
	    else if (sobremesa.toLowerCase().equals("sorvete diet")) caloriassobremesa = 110;
	    int resultado = calorias + caloriasbebida + caloriassobremesa;
	    System.out.println("Total de Calorias da Refeição: " + resultado);
	}
}

//https://pt.stackoverflow.com/q/55367/101


text:
/**
*============================================================================
*  The Ohio State University Research Foundation, Emory University,
*  the University of Minnesota Supercomputing Institute
*
*  Distributed under the OSI-approved BSD 3-Clause License.
*  See http://ncip.github.com/cagrid-grid-incubation/LICENSE.txt for details.
*============================================================================
**/
/**
*============================================================================
*============================================================================
**/
/**
 */
package edu.emory.cci.cqlCsm;

import java.util.Arrays;
import java.util.regex.Pattern;

/**
 * Instances of this class are used to describe CSM filters that may be
 * associated with a class. The information in a filter can be used to add
 * restriction to a query so as to limit what it returns to only values that a
 * user is authorized to see.
 *

 * A filter contains the name of the class to which it applies. There is an
 * attribute name. The existence of the filter implies that instances of the
 * class to which the filter applies may only be accessed if the user has a
 * non-empty list of values associated with the attribute and the object to
 * which the attribute is associated has one of the value in the list.
 *

 * A filter also has a possibly empty list of associations. This list of
 * associations describes the relationship between the class and the attribute.
 * If the list is empty then the attribute is associated the the same class as
 * the filter. Otherwise, the attribute is associated with the class at the
 * other end of the association path.
 *

 * The elements of the association path are role names attached to associations.
 * The role names are presumed to uniquely identify the associations.
 *

 * Filters also have associated with them a target class. The name of the target
 * class should match the name of the class at the other end of the association
 * path. This is used as a sanity check by comparing this name with the
 * service's domain model.
 *
 * @author Mark Grand
 */
public class Filter {
    private static final Pattern selfPattern = Pattern.compile(" - self$");
    private static final Pattern classPattern = Pattern.compile("^[A-Za-z0-9_$]+ - ");

    private String className;
    private String[] associationPath;
    private String associationPathString;
    private String attributeName;
    private String targetClassName;

    /**
     * Constructor
     *
     * @param className
     *            The name of the class that this filter is associated with.
     * @param associationPathString
     *            The is a representation of the association path as a single
     *            string. Non-empty association paths will be represented as one
     *            or more role names separated by a comma and zero or more
     *            spaces. Role names are assumed not to contain dots '.'.
     *

     *            A string that begins with the class name (contains a '.') is
     *            assumed to represent the empty association path.
     * @param attributeName
     *            The name of the attribute that is associated with this filter.
     * @param targetClassName
     *            The name of the class that is expected at the end of the
     *            association path. If this contains any blanks characters from
     *            the first blank onward are stripped off.
     */
    public Filter(String className, String associationPathString, String attributeName, String targetClassName) {
        super();
        this.className = className.trim();
        this.associationPathString = associationPathString.trim();
        if (this.associationPathString.length()==0 || this.associationPathString.startsWith(className)) {
            this.associationPath = new String[] {};
        } else {
            this.associationPath = associationPathString.split("[, ]+");
            for (int i = 0; i < this.associationPath.length; i++) {
                int index = associationPath[i].indexOf(" - ");
                if (index > 0) {
                    associationPathString.substring(index+3);
                }
            }
        }
        this.attributeName = attributeName.trim();
        this.targetClassName = targetClassName.trim();
        this.targetClassName = selfPattern.matcher(this.targetClassName).replaceFirst("");
        this.targetClassName = classPattern.matcher(this.targetClassName).replaceFirst("");
    }

    /**
     * @return the className
     */
    public String getClassName() {
        return className;
    }

    /**
     * @return the associationPath
     */
    public String[] getAssociationPath() {
        return associationPath;
    }

    /**
     * Return the raw string that specifies that association path for this filter.
     */
    public String getAssociationPathString() {
        return associationPathString;
    }

    /**
     * @return the attributeName
     */
    public String getAttributeName() {
        return attributeName;
    }

    /**
     * @return the targetClassName
     */
    public String getTargetClassName() {
        return targetClassName;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + Arrays.hashCode(associationPath);
        result = prime * result + ((attributeName == null) ? 0 : attributeName.hashCode());
        result = prime * result + ((className == null) ? 0 : className.hashCode());
        result = prime * result + ((targetClassName == null) ? 0 : targetClassName.hashCode());
        return result;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof Filter)) {
            return false;
        }
        Filter other = (Filter) obj;
        if (!Arrays.equals(associationPath, other.associationPath)) {
            return false;
        }
        if (attributeName == null) {
            if (other.attributeName != null) {
                return false;
            }
        } else if (!attributeName.equals(other.attributeName)) {
            return false;
        }
        if (className == null) {
            if (other.className != null) {
                return false;
            }
        } else if (!className.equals(other.className)) {
            return false;
        }
        if (targetClassName == null) {
            if (other.targetClassName != null) {
                return false;
            }
        } else if (!targetClassName.equals(other.targetClassName)) {
            return false;
        }
        return true;
    }
}


text:
package card_hold_create;

import com.balancedpayments.*;
import com.balancedpayments.errors.*;
import java.util.HashMap;
import java.util.Map;

public class card_hold_create {

public static void main(String[] args) throws HTTPError, NoResultsFound, MultipleResultsFound {
Balanced.configure("ak-test-2eKlj1ZDfAcZSARMf3NMhBHywDej0avSY");

Card card = new Card("/cards/CC3vhL91rWtwtHcOBl0ITshG");

Map<String, Object> payload = new HashMap<String, Object>();
payload.put("amount", 5000);
payload.put("description", "Some descriptive text for the debit in the dashboard");

try {
    CardHold cardHold = card.hold(payload);
}
catch (HTTPError e) {}

}
}


text:
"""Generate and run C code.
"""

# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import platform
import subprocess
import sys
import tempfile

def remove_file_if_exists(filename):
    """Remove the specified file, ignoring errors."""
    if not filename:
        return
    try:
        os.remove(filename)
    except OSError:
        pass

def create_c_file(file_label):
    """Create a temporary C file.

    * ``file_label``: a string that will be included in the file name.

    Return ```(c_file, c_name, exe_name)``` where ``c_file`` is a Python
    stream open for writing to the file, ``c_name`` is the name of the file
    and ``exe_name`` is the name of the executable that will be produced
    by compiling the file.
    """
    c_fd, c_name = tempfile.mkstemp(prefix='tmp-{}-'.format(file_label),
                                    suffix='.c')
    exe_suffix = '.exe' if platform.system() == 'Windows' else ''
    exe_name = c_name[:-2] + exe_suffix
    remove_file_if_exists(exe_name)
    c_file = os.fdopen(c_fd, 'w', encoding='ascii')
    return c_file, c_name, exe_name

def generate_c_printf_expressions(c_file, cast_to, printf_format, expressions):
    """Generate C instructions to print the value of ``expressions``.

    Write the code with ``c_file``'s ``write`` method.

    Each expression is cast to the type ``cast_to`` and printed with the
    printf format ``printf_format``.
    """
    for expr in expressions:
        c_file.write('    printf("{}\\n", ({}) {});\n'
                     .format(printf_format, cast_to, expr))

def generate_c_file(c_file,
                    caller, header,
                    main_generator):
    """Generate a temporary C source file.

    * ``c_file`` is an open stream on the C source file.
    * ``caller``: an informational string written in a comment at the top
      of the file.
    * ``header``: extra code to insert before any function in the generated
      C file.
    * ``main_generator``: a function called with ``c_file`` as its sole argument
      to generate the body of the ``main()`` function.
    """
    c_file.write('/* Generated by {} */'
                 .format(caller))
    c_file.write('''
#include <stdio.h>
''')
    c_file.write(header)
    c_file.write('''
int main(void)
{
''')
    main_generator(c_file)
    c_file.write('''    return 0;
}
''')

def get_c_expression_values(
        cast_to, printf_format,
        expressions,
        caller=__name__, file_label='',
        header='', include_path=None,
        keep_c=False,
): # pylint: disable=too-many-arguments, too-many-locals
    """Generate and run a program to print out numerical values for expressions.

    * ``cast_to``: a C type.
    * ``printf_format``: a printf format suitable for the type ``cast_to``.
    * ``header``: extra code to insert before any function in the generated
      C file.
    * ``expressions``: a list of C language expressions that have the type
      ``cast_to``.
    * ``include_path``: a list of directories containing header files.
    * ``keep_c``: if true, keep the temporary C file (presumably for debugging
      purposes).

    Use the C compiler specified by the ``CC`` environment variable, defaulting
    to ``cc``. If ``CC`` looks like MSVC, use its command line syntax,
    otherwise assume the compiler supports Unix traditional ``-I`` and ``-o``.

    Return the list of values of the ``expressions``.
    """
    if include_path is None:
        include_path = []
    c_name = None
    exe_name = None
    obj_name = None
    try:
        c_file, c_name, exe_name = create_c_file(file_label)
        generate_c_file(
            c_file, caller, header,
            lambda c_file: generate_c_printf_expressions(c_file,
                                                         cast_to, printf_format,
                                                         expressions)
        )
        c_file.close()
        cc = os.getenv('CC', 'cc')
        cmd = [cc]

        proc = subprocess.Popen(cmd,
                                stdout=subprocess.DEVNULL,
                                stderr=subprocess.PIPE,
                                universal_newlines=True)
        cc_is_msvc = 'Microsoft (R) C/C++' in proc.communicate()[1]

        cmd += ['-I' + dir for dir in include_path]
        if cc_is_msvc:
            # MSVC has deprecated using -o to specify the output file,
            # and produces an object file in the working directory by default.
            obj_name = exe_name[:-4] + '.obj'
            cmd += ['-Fe' + exe_name, '-Fo' + obj_name]
        else:
            cmd += ['-o' + exe_name]
        subprocess.check_call(cmd + [c_name])
        if keep_c:
            sys.stderr.write('List of {} tests kept at {}\n'
                             .format(caller, c_name))
        else:
            os.remove(c_name)
        output = subprocess.check_output([exe_name])
        return output.decode('ascii').strip().split('\n')
    finally:
        remove_file_if_exists(exe_name)
        remove_file_if_exists(obj_name)


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.08.25 at 05:48:09 PM CEST
//

package es.rickyepoderi.wbxml.bind.wvcsp;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "messageID"
})
@XmlRootElement(name = "MessageDelivered")
public class MessageDelivered {

    @XmlElement(name = "MessageID", required = true)
    protected MessageID messageID;

    /**
     * Gets the value of the messageID property.
     *
     * @return
     *     possible object is
     *     {@link MessageID }
     *
     */
    public MessageID getMessageID() {
        return messageID;
    }

    /**
     * Sets the value of the messageID property.
     *
     * @param value
     *     allowed object is
     *     {@link MessageID }
     *
     */
    public void setMessageID(MessageID value) {
        this.messageID = value;
    }

}


text:
using System;
using System.Xml.Serialization;

namespace HoloXPLOR.Data.DataForge
{
    [XmlRoot(ElementName = "BTSendSignalToGroup")]
    public partial class BTSendSignalToGroup : BTNode
    {
        [XmlArray(ElementName = "Name")]
        [XmlArrayItem(Type = typeof(BTInput_SendSignalToGroup_Name))]
        [XmlArrayItem(Type = typeof(BTInput_SendSignalToGroup_Name_String))]
        [XmlArrayItem(Type = typeof(BTInput_SendSignalToGroup_Name_Var))]
        [XmlArrayItem(Type = typeof(BTInput_SendSignalToGroup_Name_BB))]
        public BTInput_SendSignalToGroup_Name[] Name { get; set; }

        [XmlArray(ElementName = "Category")]
        [XmlArrayItem(Type = typeof(BTInput_SendSignalToGroup_Category))]
        [XmlArrayItem(Type = typeof(BTInput_SendSignalToGroup_Category_String))]
        [XmlArrayItem(Type = typeof(BTInput_SendSignalToGroup_Category_Var))]
        [XmlArrayItem(Type = typeof(BTInput_SendSignalToGroup_Category_BB))]
        public BTInput_SendSignalToGroup_Category[] Category { get; set; }

    }
}


text:
#include <linux/buffer_head.h>
#include <asm/unaligned.h>
#include "adfs.h"

/*
 * The ADFS map is basically a set of sectors.  Each sector is called a
 * zone which contains a bitstream made up of variable sized fragments.
 * Each bit refers to a set of bytes in the filesystem, defined by
 * log2bpmb.  This may be larger or smaller than the sector size, but
 * the overall size it describes will always be a round number of
 * sectors.  A fragment id is always idlen bits long.
 *
 *  < idlen > <       n        > <1>
 * +---------+-------//---------+---+
 * | frag id |  0000....000000  | 1 |
 * +---------+-------//---------+---+
 *
 * The physical disk space used by a fragment is taken from the start of
 * the fragment id up to and including the '1' bit - ie, idlen + n + 1
 * bits.
 *
 * A fragment id can be repeated multiple times in the whole map for
 * large or fragmented files.  The first map zone a fragment starts in
 * is given by fragment id / ids_per_zone - this allows objects to start
 * from any zone on the disk.
 *
 * Free space is described by a linked list of fragments.  Each free
 * fragment describes free space in the same way as the other fragments,
 * however, the frag id specifies an offset (in map bits) from the end
 * of this fragment to the start of the next free fragment.
 *
 * Objects stored on the disk are allocated object ids (we use these as
 * our inode numbers.)  Object ids contain a fragment id and an optional
 * offset.  This allows a directory fragment to contain small files
 * associated with that directory.
 */

/*
 * For the future...
 */
static DEFINE_RWLOCK(adfs_map_lock);

/*
 * This is fun.  We need to load up to 19 bits from the map at an
 * arbitary bit alignment.  (We're limited to 19 bits by F+ version 2).
 */
#define GET_FRAG_ID(_map,_start,_idmask)				\
	({								\
		unsigned char *_m = _map + (_start >> 3);		\
		u32 _frag = get_unaligned_le32(_m);			\
		_frag >>= (_start & 7);					\
		_frag & _idmask;					\
	})

/*
 * return the map bit offset of the fragment frag_id in the zone dm.
 * Note that the loop is optimised for best asm code - look at the
 * output of:
 *  gcc -D__KERNEL__ -O2 -I../../include -o - -S map.c
 */
static int
lookup_zone(const struct adfs_discmap *dm, const unsigned int idlen,
	    const unsigned int frag_id, unsigned int *offset)
{
	const unsigned int mapsize = dm->dm_endbit;
	const u32 idmask = (1 << idlen) - 1;
	unsigned char *map = dm->dm_bh->b_data + 4;
	unsigned int start = dm->dm_startbit;
	unsigned int mapptr;
	u32 frag;

	do {
		frag = GET_FRAG_ID(map, start, idmask);
		mapptr = start + idlen;

		/*
		 * find end of fragment
		 */
		{
			__le32 *_map = (__le32 *)map;
			u32 v = le32_to_cpu(_map[mapptr >> 5]) >> (mapptr & 31);
			while (v == 0) {
				mapptr = (mapptr & ~31) + 32;
				if (mapptr >= mapsize)
					goto error;
				v = le32_to_cpu(_map[mapptr >> 5]);
			}

			mapptr += 1 + ffz(~v);
		}

		if (frag == frag_id)
			goto found;
again:
		start = mapptr;
	} while (mapptr < mapsize);
	return -1;

error:
	printk(KERN_ERR "adfs: oversized fragment 0x%x at 0x%x-0x%x\n",
		frag, start, mapptr);
	return -1;

found:
	{
		int length = mapptr - start;
		if (*offset >= length) {
			*offset -= length;
			goto again;
		}
	}
	return start + *offset;
}

/*
 * Scan the free space map, for this zone, calculating the total
 * number of map bits in each free space fragment.
 *
 * Note: idmask is limited to 15 bits [3.2]
 */
static unsigned int
scan_free_map(struct adfs_sb_info *asb, struct adfs_discmap *dm)
{
	const unsigned int mapsize = dm->dm_endbit + 32;
	const unsigned int idlen  = asb->s_idlen;
	const unsigned int frag_idlen = idlen <= 15 ? idlen : 15;
	const u32 idmask = (1 << frag_idlen) - 1;
	unsigned char *map = dm->dm_bh->b_data;
	unsigned int start = 8, mapptr;
	u32 frag;
	unsigned long total = 0;

	/*
	 * get fragment id
	 */
	frag = GET_FRAG_ID(map, start, idmask);

	/*
	 * If the freelink is null, then no free fragments
	 * exist in this zone.
	 */
	if (frag == 0)
		return 0;

	do {
		start += frag;

		/*
		 * get fragment id
		 */
		frag = GET_FRAG_ID(map, start, idmask);
		mapptr = start + idlen;

		/*
		 * find end of fragment
		 */
		{
			__le32 *_map = (__le32 *)map;
			u32 v = le32_to_cpu(_map[mapptr >> 5]) >> (mapptr & 31);
			while (v == 0) {
				mapptr = (mapptr & ~31) + 32;
				if (mapptr >= mapsize)
					goto error;
				v = le32_to_cpu(_map[mapptr >> 5]);
			}

			mapptr += 1 + ffz(~v);
		}

		total += mapptr - start;
	} while (frag >= idlen + 1);

	if (frag != 0)
		printk(KERN_ERR "adfs: undersized free fragment\n");

	return total;
error:
	printk(KERN_ERR "adfs: oversized free fragment\n");
	return 0;
}

static int
scan_map(struct adfs_sb_info *asb, unsigned int zone,
	 const unsigned int frag_id, unsigned int mapoff)
{
	const unsigned int idlen = asb->s_idlen;
	struct adfs_discmap *dm, *dm_end;
	int result;

	dm	= asb->s_map + zone;
	zone	= asb->s_map_size;
	dm_end	= asb->s_map + zone;

	do {
		result = lookup_zone(dm, idlen, frag_id, &mapoff);

		if (result != -1)
			goto found;

		dm ++;
		if (dm == dm_end)
			dm = asb->s_map;
	} while (--zone > 0);

	return -1;
found:
	result -= dm->dm_startbit;
	result += dm->dm_startblk;

	return result;
}

/*
 * calculate the amount of free blocks in the map.
 *
 *              n=1
 *  total_free = E(free_in_zone_n)
 *              nzones
 */
unsigned int
adfs_map_free(struct super_block *sb)
{
	struct adfs_sb_info *asb = ADFS_SB(sb);
	struct adfs_discmap *dm;
	unsigned int total = 0;
	unsigned int zone;

	dm   = asb->s_map;
	zone = asb->s_map_size;

	do {
		total += scan_free_map(asb, dm++);
	} while (--zone > 0);

	return signed_asl(total, asb->s_map2blk);
}

int
adfs_map_lookup(struct super_block *sb, unsigned int frag_id,
		unsigned int offset)
{
	struct adfs_sb_info *asb = ADFS_SB(sb);
	unsigned int zone, mapoff;
	int result;

	/*
	 * map & root fragment is special - it starts in the center of the
	 * disk.  The other fragments start at zone (frag / ids_per_zone)
	 */
	if (frag_id == ADFS_ROOT_FRAG)
		zone = asb->s_map_size >> 1;
	else
		zone = frag_id / asb->s_ids_per_zone;

	if (zone >= asb->s_map_size)
		goto bad_fragment;

	/* Convert sector offset to map offset */
	mapoff = signed_asl(offset, -asb->s_map2blk);

	read_lock(&adfs_map_lock);
	result = scan_map(asb, zone, frag_id, mapoff);
	read_unlock(&adfs_map_lock);

	if (result > 0) {
		unsigned int secoff;

		/* Calculate sector offset into map block */
		secoff = offset - signed_asl(mapoff, asb->s_map2blk);
		return secoff + signed_asl(result, asb->s_map2blk);
	}

	adfs_error(sb, "fragment 0x%04x at offset %d not found in map",
		   frag_id, offset);
	return 0;

bad_fragment:
	adfs_error(sb, "invalid fragment 0x%04x (zone = %d, max = %d)",
		   frag_id, zone, asb->s_map_size);
	return 0;
}


text:
using Renci.SshNet.Tests.Common;

namespace Renci.SshNet.Tests.Classes.Common
{
    public partial class ProxyExceptionTest : TestBase
    {
    }
}


text:
/* Wavestreaming.com - https://github.com/Wavestreaming/jquery-shoutcast - MIT licensed */
!function (a) {
	"use strict";
	function b(a) {
		this._attr = {},
		this.playedInterval = a.playedInterval || a.interval || 3e4,
		this.statsInterval = a.statsInterval || a.interval || 5e3,
		this.host = a.host,
		this.port = parseInt(a.port, 10) || 8e3,
		this.stream = parseInt(a.stream, 10) || 1,
		this.stats_path = a.stats_path || "stats",
		this.played_path = a.played_path || "played",
		this._statsinterval = null,
		this._playedinterval = null,
		this._stats = a.stats || function () {},
		this._played = a.played || function () {}

	}
	b.prototype.get = function (a, b) {
		return a ? "undefined" != typeof this._attr[a.toLowerCase()] ? this._attr[a.toLowerCase()] : b : this._attr
	},
	b.prototype.stats = function (b) {
		var c,
		d = this,
		e = "http://" + this.host + ":" + this.port + "/" + this.stats_path + "?sid=" + this.stream + "&json=1";
		return b = b || function () {},
		c = a.ajax({
				url : e,
				dataType : "jsonp",
				timeout : "2000"
			}),
		c.success(function (a) {
			return "object" != typeof a || "undefined" == typeof a.streamstatus ? void(d._status = 0) : (d._status = 1 === a.streamstatus ? 2 : 1, d._attr = a, d._attr.status = d.getStatusAsText(), b.call(d, d._attr), void d._stats(d._attr))
		}),
		c.error(function () {
			d._status = 0,
			d._attr.status = d.getStatusAsText(),
			b.call(d, d._attr),
			d._stats(d._attr)
		}),
		this
	},
	b.prototype.played = function (b) {
		var c = this,
		d = "http://" + this.host + ":" + this.port + "/" + this.played_path + "?sid=" + this.stream + "&type=json";
		return a.ajax({
			url : d,
			dataType : "jsonp",
			timeout : 2e3,
			success : function (a) {
				!a instanceof Array || (b && b.call(c, a), c._played(a))
			}
		}),
		this
	},
	b.prototype.startStats = function () {
		return this.stopStats(),
		this.stats(),
		this._statsinterval = setInterval(a.proxy(this.stats, this), this.statsInterval),
		this
	},
	b.prototype.stopStats = function () {
		return this._statsinterval && clearInterval(this._statsinterval),
		this
	},
	b.prototype.startPlayed = function () {
		return this.stopPlayed(),
		this.played(),
		this._playedinterval = setInterval(a.proxy(this.played, this), this.playedInterval),
		this
	},
	b.prototype.stopPlayed = function () {
		return this._playedinterval && clearInterval(this._playedinterval),
		this
	},
	b.prototype.getStatus = function () {
		return this._status
	},
	b.prototype.getStatusAsText = function () {
		return ["Offline", "Awaiting Connection", "On Air"][this._status]
	},
	b.prototype.onAir = function () {
		return 2 === this._status
	},
	a.SHOUTcast = function (a) {
		return new b(a)
	}
}
(window.jQuery);


text:
using System.Collections.Generic;

namespace CVaS.Web.Providers
{

    /// <summary>
    /// Interface for parser of arguments
    /// when starting algorithm
    /// </summary>
    public interface IArgumentParser
    {
        bool CanParse(object arguments);

        List<object> Parse(object arguments);
    }
}


text:
import * as remote from '@electron/remote'
import {h, Component} from 'preact'
import classNames from 'classnames'
import {parseVertex} from '@sabaki/sgf'

import sabaki from '../../modules/sabaki.js'
import i18n from '../../i18n.js'

import Bar from './Bar.js'

const t = i18n.context('AutoplayBar')
const setting = remote.require('./setting')

let maxSecPerMove = setting.get('autoplay.max_sec_per_move')
let secondsPerMove = setting.get('autoplay.sec_per_move')

export default class AutoplayBar extends Component {
  constructor() {
    super()

    this.state = {
      playing: false,
      secondsPerMove,
      secondsPerMoveInput: secondsPerMove
    }

    this.handleFormSubmit = evt => {
      evt.preventDefault()
    }

    this.handleValueInput = evt => {
      this.setState({secondsPerMoveInput: evt.currentTarget.value})
    }

    this.handleValueChange = evt => {
      let value = Math.round(
        Math.min(maxSecPerMove, Math.max(1, +evt.currentTarget.value))
      )

      if (!isNaN(value)) {
        this.setState({
          secondsPerMove: value,
          secondsPerMoveInput: value
        })
      }

      setting.set('autoplay.sec_per_move', this.state.secondsPerMove)
    }

    this.handlePlayButtonClick = () => {
      if (this.state.playing) this.stopAutoplay()
      else this.startAutoplay()
    }

    this.startAutoplay = this.startAutoplay.bind(this)
    this.stopAutoplay = this.stopAutoplay.bind(this)
  }

  shouldComponentUpdate(nextProps) {
    return nextProps.mode !== this.props.mode || nextProps.mode === 'autoplay'
  }

  componentWillReceiveProps(nextProps) {
    if (this.state.playing && nextProps.mode !== 'autoplay') this.stopAutoplay()
  }

  startAutoplay() {
    let autoplay = () => {
      sabaki.events.removeListener('navigate', this.stopAutoplay)
      if (!this.state.playing) return

      let {gameTree, gameCurrents, treePosition} = this.props
      let node = gameTree.navigate(treePosition, 1, gameCurrents)
      if (!node) return this.stopAutoplay()

      if (node.data.B == null && node.data.W == null) {
        sabaki.setCurrentTreePosition(gameTree, treePosition)
      } else {
        let vertex = parseVertex(
          node.data.B != null ? node.data.B[0] : node.data.W[0]
        )
        sabaki.makeMove(vertex, {player: node.data.B ? 1 : -1})
      }

      sabaki.events.addListener('navigate', this.stopAutoplay)
      this.autoplayId = setTimeout(autoplay, this.state.secondsPerMove * 1000)
    }

    this.setState({playing: true}, autoplay)
  }

  stopAutoplay() {
    sabaki.events.removeListener('navigate', this.stopAutoplay)
    clearTimeout(this.autoplayId)

    this.setState({playing: false})
  }

  render(_, {secondsPerMoveInput, playing}) {
    return h(
      Bar,
      Object.assign(
        {type: 'autoplay', class: classNames({playing})},
        this.props
      ),
      h(
        'form',
        {onSubmit: this.handleFormSubmit},
        h(
          'label',
          {},
          h('input', {
            type: 'number',
            value: secondsPerMoveInput,
            min: 1,
            max: maxSecPerMove,
            step: 1,

            onInput: this.handleValueInput,
            onChange: this.handleValueChange
          }),
          ' ',
          t('sec per move')
        )
      ),

      h('a', {class: 'play', href: '#', onClick: this.handlePlayButtonClick})
    )
  }
}


text:
package com.trofiv.test4sidenis;

import com.trofiv.test4sidenis.binaryclock.BinaryClockPattern;
import com.trofiv.test4sidenis.binaryclock.BinaryClockRowPattern;
import org.junit.Test;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

public class BinaryClockPatternTest {
    private static final int FIVE_HOURS = 5;
    private static final int ONE_HOUR = 1;
    private static final int FOUR_CELLS = 4;
    private static final int FIVE_MINUTES = 5;
    private static final int ELEVEN_CELLS = 11;
    private static final int ONE_MINUTE = 1;
    private static final BinaryClockRowPattern FIVE_HOURS_FOUR_CELLS = new BinaryClockRowPattern(FIVE_HOURS, TimeUnit.HOURS, FOUR_CELLS);
    private static final BinaryClockRowPattern ONE_HOUR_FOUR_CELLS = new BinaryClockRowPattern(ONE_HOUR, TimeUnit.HOURS, FOUR_CELLS);
    private static final BinaryClockRowPattern FIVE_MINUTES_ELEVEN_CELLS = new BinaryClockRowPattern(FIVE_MINUTES, TimeUnit.MINUTES, ELEVEN_CELLS);
    private static final BinaryClockRowPattern ONE_MINUTE_FOUR_CELLS = new BinaryClockRowPattern(ONE_MINUTE, TimeUnit.MINUTES, FOUR_CELLS);
    private static final String ROW_LIST_CHANGED_WITHOUT_EXCEPTION = "Validation returns another clock row list without exception!";
    private static final String INVALID_MOST_PRECISION_ROW_SELECTED = "Invalid most precision row selected!";

    @Test
    public void testValidClock() {
        final List<BinaryClockRowPattern> clockRows = Arrays.asList(
                FIVE_HOURS_FOUR_CELLS,
                ONE_HOUR_FOUR_CELLS,
                FIVE_MINUTES_ELEVEN_CELLS,
                ONE_MINUTE_FOUR_CELLS
        );
        final BinaryClockPattern pattern = new BinaryClockPattern(clockRows);
        assertThat(ROW_LIST_CHANGED_WITHOUT_EXCEPTION, pattern.getClockRows(), is(clockRows));
    }

    @Test
    public void testMostPrecisionRow() {
        final List<BinaryClockRowPattern> clockRows = Arrays.asList(
                FIVE_HOURS_FOUR_CELLS,
                ONE_HOUR_FOUR_CELLS,
                FIVE_MINUTES_ELEVEN_CELLS,
                ONE_MINUTE_FOUR_CELLS
        );
        final BinaryClockRowPattern mostPrecisionRow = BinaryClockPattern.getMostPrecisionRow(clockRows);
        assertThat(INVALID_MOST_PRECISION_ROW_SELECTED, mostPrecisionRow, is(ONE_MINUTE_FOUR_CELLS));
    }

    @Test
    @SuppressWarnings("JUnitTestMethodWithNoAssertions")
    public void testValidDayCoverage() {
        final List<BinaryClockRowPattern> clockRows = Arrays.asList(
                FIVE_HOURS_FOUR_CELLS,
                ONE_HOUR_FOUR_CELLS,
                FIVE_MINUTES_ELEVEN_CELLS,
                ONE_MINUTE_FOUR_CELLS
        );
        final BinaryClockRowPattern mostPrecisionRow = ONE_MINUTE_FOUR_CELLS;
        BinaryClockPattern.checkAllDayCoveredByRows(clockRows, mostPrecisionRow);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testInvalidDayCoverage() {
        final List<BinaryClockRowPattern> clockRows = Arrays.asList(
                FIVE_HOURS_FOUR_CELLS,
                FIVE_MINUTES_ELEVEN_CELLS,
                ONE_MINUTE_FOUR_CELLS
        );
        final BinaryClockRowPattern mostPrecisionRow = ONE_MINUTE_FOUR_CELLS;
        BinaryClockPattern.checkAllDayCoveredByRows(clockRows, mostPrecisionRow);
    }

    @Test(expected = NullPointerException.class)
    @SuppressWarnings({"unused", "UnusedAssignment"})
    public void testNullClockRows() {
        final BinaryClockPattern pattern = new BinaryClockPattern(null);
    }

    @Test(expected = IllegalArgumentException.class)
    @SuppressWarnings({"unused", "UnusedAssignment"})
    public void testEmptyClockRows() {
        final List<BinaryClockRowPattern> clockRows = new LinkedList<>();
        final BinaryClockPattern pattern = new BinaryClockPattern(clockRows);
    }
}


text:
<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration,
    Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your need!
 */
class Version20130925204213 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");

        $this->addSql("ALTER TABLE dan_game ADD min_players INT NOT NULL, ADD max_players INT NOT NULL, DROP minPlayer, DROP maxPlayers");
    }

    public function down(Schema $schema)
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");

        $this->addSql("ALTER TABLE dan_game ADD minPlayer INT NOT NULL, ADD maxPlayers INT NOT NULL, DROP min_players, DROP max_players");
    }
}


text:
package hcsshim

import "github.com/Sirupsen/logrus"

// WaitForProcessInComputeSystem waits for a process ID to terminate and returns
// the exit code. Returns exitcode, errno, error
func WaitForProcessInComputeSystem(id string, processid uint32, timeout uint32) (int32, uint32, error) {

	title := "HCSShim::WaitForProcessInComputeSystem"
	logrus.Debugf(title+" id=%s processid=%d", id, processid)

	var exitCode uint32
	err := waitForProcessInComputeSystem(id, processid, timeout, &exitCode)
	if err != nil {
		err := makeErrorf(err, title, "id=%s", id)
		return 0, err.HResult(), err
	}

	logrus.Debugf(title+" succeeded id=%s processid=%d exitcode=%d", id, processid, exitCode)
	return int32(exitCode), 0, nil
}


text:
var promisify = require("promisify-node");
var path = require("path");
var fs = require("fs");

var whichNativeNodish = require("which-native-nodish");
var prepareForBuild = require("./prepareForBuild");

var exec = promisify(function(command, opts, callback) {
  return require("child_process").exec(command, opts, callback);
});
var nwVersion = null;
var asVersion = null;

var local = path.join.bind(path, __dirname);

return whichNativeNodish("..")
  .then(function(results) {
    nwVersion = results.nwVersion;
    asVersion = results.asVersion;
  })
  .then(function() {
    if (fs.existsSync(local("../.didntcomefromthenpmregistry"))) {
      return prepareAndBuild();
    }
    if (process.env.BUILD_DEBUG) {
      console.info("[nodegit] Doing a debug build, no fetching allowed.");
      return prepareAndBuild();
    }
    if (process.env.BUILD_ONLY) {
      console.info("[nodegit] BUILD_ONLY is set to true, no fetching allowed.");
      return prepareAndBuild();
    }
    var args = [];
    if (asVersion) {
      args.push("--runtime=electron");
      args.push("--target=" + asVersion);
      args.push("--is_clang=1");
    } else if (nwVersion) {
      args.push("--runtime=node-webkit");
      args.push("--target=" + nwVersion);
    }
    return installPrebuilt(args);
  });

function installPrebuilt(args) {
  console.info("[nodegit] Fetching binary from S3.");
  var installArguments = args.join(" ");
  return exec("node-pre-gyp install " + installArguments)
    .then(
      function() {
        console.info("[nodegit] Completed installation successfully.");
      },
      function(err) {
        console.info("[nodegit] Failed to install prebuilt binary, " +
          "building manually.");
        console.error(err);
        return prepareAndBuild();
      }
    );
}

function prepareAndBuild() {
  console.info("[nodegit] Regenerating and configuring code");
  return prepareForBuild()
    .then(function() {
      return build();
    });
}

function build() {
  console.info("[nodegit] Everything is ready to go, attempting compilation");
  if (nwVersion) {
    console.info("[nodegit] Building native node-webkit module.");
  }
  else {
    console.info("[nodegit] Building native node module.");
  }

  var opts = {
    cwd: ".",
    maxBuffer: Number.MAX_VALUE,
    env: process.env
  };

  var target = "";
  var debug = (process.env.BUILD_DEBUG ? " --debug" : "");
  var builder = "node-gyp";
  var distUrl = "";

  if (asVersion) {
    var home = process.platform == "win32" ?
            process.env.USERPROFILE : process.env.HOME;

    opts.env.HOME = path.join(home, ".atom-shell-gyp");

    target = "--target=" + asVersion;

    distUrl = "--dist-url=https://gh-contractor-zcbenz.s3." +
      "amazonaws.com/atom-shell/dist";
  }
  else if (nwVersion) {
    builder = "nw-gyp";
    target = "--target=" + nwVersion;
  }

  builder = path.resolve(".", "node_modules", ".bin", builder);
  builder = builder.replace(/\s/g, "\\$&");
  var cmd = [builder, "rebuild", target, debug, distUrl]
    .join(" ").trim();

  return exec(cmd, opts)
    .then(function() {
        console.info("[nodegit] Compilation complete.");
        console.info("[nodegit] Completed installation successfully.");
        process.exitCode = 0;
      },
      function(err, stderr) {
        console.error(err);
        console.error(stderr);
        process.exitCode = 13;
      }
    );
}