text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You 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.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
         http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <context:component-scan base-package="org.apache.camel.spring.interceptor"/>
    <tx:annotation-driven transaction-manager="txManager"/>

    <!-- datasource to the database -->
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
        <property name="url" value="jdbc:hsqldb:mem:camel"/>
        <property name="username" value="sa"/>
        <property name="password" value=""/>
    </bean>

    <!-- spring transaction manager -->
    <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <!-- bean for book business logic -->
    <bean id="bookService" class="org.apache.camel.spring.interceptor.AnnotatedBookServiceImpl"/>

    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <routeBuilder ref="annotatedRoute"/>
    </camelContext>

    <bean id="annotatedRoute" class="org.apache.camel.spring.interceptor.AnnotatedRoute"/>

    <bean id="annotatedConsumer" class="org.apache.camel.spring.interceptor.AnnotatedConsumeImpl"/>

</beans>


text:
{-# LANGUAGE ApplicativeDo #-}
module Test where

-- This exposed a bug in zonking ApplicativeLastStmt
test :: IO Int
test
  = do
      x <- return ()
      h <- return (\_ -> 3)
      return (h ())

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
   android:fitsSystemWindows="true"
    android:orientation="vertical"
    android:background="@color/white"
    >
    <include layout="@layout/header_view"/>
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="none">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">
    <TextView
        android:id="@+id/detailTxt"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:textSize="@dimen/text_middle"
        android:padding="@dimen/spacing_middle"
        android:lineSpacingMultiplier="1.2"
        android:lineSpacingExtra="2dp"
        android:textColor="@color/text_color_black"
        />
        </LinearLayout>
    </ScrollView>
</LinearLayout>


text:
package xworker.swt.xworker;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.xmeta.ActionContext;
import org.xmeta.Thing;
import org.xmeta.util.UtilString;

public class DataTableTableColumnCreator {
    public static void create(ActionContext actionContext){
        Thing self = (Thing) actionContext.get("self");

        TableColumn column = new TableColumn((Table) actionContext.get("parent"), SWT.NONE);

        String columnText = UtilString.getString(self.getString("text"), actionContext);
        if(columnText != null)
            column .setText(columnText);
        String toolTipText = UtilString.getString(self.getString("toolTipText"), actionContext);
        if(toolTipText != null)
            column.setToolTipText(toolTipText);
        else{
            column.setToolTipText(columnText);
        }
        String imagestr = self.getString("image");
        if(imagestr != null && !"".equals(imagestr)){
        	Image image = (Image) actionContext.get(imagestr);
        	if(image != null){
        		column.setImage(image);
        	}
        }
        String width = self.getString("width");
        if(width != null && !"".equals(width) && !"-1".equals(width))
            column.setWidth(self.getInt("width"));

        actionContext.getScope(0).put(self.getString("name"), column);
        actionContext.peek().put("parent", column);
        for(Thing child : self.getAllChilds()){
            child.doAction("create", actionContext);
        }
        actionContext.peek().remove("parent");
    }

    public static void toJavaCode(ActionContext actionContext){
    	/*
        String code = "TableColumn ${self.name} = new TableColumn(${self.parent.name}, SWT.NONE);";

        if(self.text != null)
            code = code + "\n${self.name}.setText(${self.text});";
        if(self.toolTipText != null)
            code = code + "\n${self.name}.setToolTipText(${self.toolTipText});";
        if(self.image != null)
            code = code + "\n${self.name}.setImage(${self.image});";
        if(self.width != "-1")
            code = code + "\n${self.name}.setWidth(${self.width});";

        for(child in self.childs){
            if(child.metadata.objectName != "scripts")
                code = code + "\n\n" + child.exec("toJavaCode", binding);
        }
        return code; */
    }

}


text:
# Base Model

This package provides an extensible, yet opinionated, base from which to build your models. It uses simpl-schema for data integrity, allow/deny for simple security, and collection-hooks for actions that need to be completed before or after CRUD operations complete. The [Socialize][socialize] package set is built upon this package.

>This is a [Meteor][meteor] package with part of it's code published as a companion NPM package made to work with clients other than Meteor. For example your server is Meteor, but you want to build a React Native app for the client. This allows you to share code between your Meteor server and other clients to give you a competitive advantage when bringing your mobile and web application to market.

<!-- TOC depthFrom:1 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->
- [Supporting The Project](#supporting-the-project)
- [Meteor Installation](#meteor-installation)
- [NPM Installation](#npm-installation)
- [Usage Outside Meteor](#usage-outside-meteor)
  - [React Native](#react-native)
- [Basic Usage](#basic-usage)
- [Caveats](#caveats)
<!-- /TOC -->

## Supporting The Project

Finding the time to maintain FOSS projects can be quite difficult. I am myself responsible for over 30 personal projects across 2 platforms, as well as Multiple others maintained by the [Meteor Community Packages](https://github.com/meteor-community-packages) organization. Therfore, if you appreciate my work, I ask that you either sponsor my work through GitHub, or donate via Paypal or Patreon. Every dollar helps give cause for spending my free time fielding issues, feature requests, pull requests and releasing updates. Info can be found in the "Sponsor this project" section of the [GitHub Repo](https://github.com/copleykj/socialize-base-model)

## Meteor Installation

```sh
meteor install socialize:base-model
meteor npm install --save simpl-schema
```

## NPM Installation

```sh
npm install --save @socialize/base-model react-native-meteor-collection2
```

## Usage Outside Meteor

The client side parts of this package are published to NPM as `@socialize/cloudinary` for use in front ends outside of Meteor.

When using the npm package you'll need to connect to a server, which hosts the server side Meteor code for your app, using `Meteor.connect` as per the [@socialize/react-native-meteor usage example](https://github.com/copleykj/react-native-meteor#example-usage) documentation.

 ```javascript
Meteor.connect('ws://192.168.X.X:3000/websocket');
 ```

### React Native

When using this package with React Native there is some minor setup required by the `@socialize/react-native-meteor` package. See [@socialize/react-native-meteor react-native](https://github.com/copleykj/react-native-meteor#react-native) for necessary instructions.

## Basic Usage

For save/update/delete you will need a collection attached to the Class which has a SimpleSchema attached to it. This is to ensure that you think about securing your models. Properly secured models can execute database operations completely client side without the need to manually define Meteor Methods. If you aren't familiar with Simple Schema, you can find the documentation [Here][simple-schema].

Lets get started with a quick example by Modeling a Book.

Depending on which platform you are on, you'll need to import things, and instantiate your Collections slightly different.

```javascript
// For meteor
import { BaseModel } from 'meteor/socialize:base-model';
import { Mongo } from 'meteor/mongo';
```

```javascript
// For React Native
import BaseModel from '@socialize/base-model';
import Collection from 'react-native-meteor-collection2';
```

```javascript

// Both Meteor and React Native
import SimpleSchema from 'simpl-schema';

//We assume that another model of an Author exists so we can import its collection here..
import { AuthorsCollection }  from "/models/Author";

//In Meteor Collection is scoped to Mongo
const BooksCollection = new Mongo.Collection("books");

//In React Native Collection is imported from react-native-meteor-collection2
const BooksCollection = new Collection("books");

const BooksSchema = new SimpleSchema({
    "userId":{
        type: String,
        regEx: SimpleSchema.RegEx.Id,
        autoValue: function() {
            if(this.isInsert){
                return this.userId;
            }
        }
    },
    "title":{
        type: String
        max: 30,
    },
    "subTitle":{
        type: String,
        max: 100
    },
    "authorId":{
        type: String,
        regEx: SimpleSchema.RegEx.Id
    }
});

class BookModel extends BaseModel {
    owner() {
        return Meteor.users.findOne(this.userId);
    }

    fullTitle() {
        return `${this.title}: ${this.subTitle}`;
    }

    author() {
        return AuthorsCollection.findOne(this.authorId);
    }
}

//Attach the schema to the collection
BooksCollection.attachSchema(BooksSchema);

//Attach the collection to the model so we can save/update/delete
BookModel.attachCollection(BooksCollection);

// This is Meteor server code and should not be added on React Native
BooksCollection.allow({
    insert(userId, book) {
        /*
        book is an instance of the Book class thanks to collection
        transforms. This enables us to call it's methods to check
        if the user owns it and the author record exists
        */
        return book.checkOwnership() && !!book.author();
    },
    update(userId, book) {
        /*
        book is an instance of the Book class thanks to collection
        transforms. This enables us to call it's methods to check
        if the user owns it and the author record exists
        */
        return book.checkOwnership() && !!book.author();
    },
    remove(userId, book) {
        /*
        book is an instance of the Book class thanks to collection
        transforms. This enables us to call it's methods to check
        if the user owns it and the author record exists
        */
        return book.checkOwnership()
    }
});
```

Let's examine what we have done here.

1. Import all the necessary parts. `Mongo`, `SimpleSchema`, and `BaseModel`.
2. Instantiate a `Mongo.Collection` and a `SimpleSchema` and define the schema for the model
3. Attach the schema to the collection as our first layer of write security.
4. Define a `Book` class that extends `BaseModel` making sure to call `super(document)`
5. Attach the collection to the `Book` class enabling instances of the class to execute save/update/remove operations
6. Specify allow rules for the collection as a final layer of security thus allowing total client side manipulation.

Now we are all set up to use the new `Book` class, and since we've properly secured our database writes through a combination of [SimpleSchema][simple-schema] and allow rules, we can now do all of our database operations using client side database methods.

>**Don't believe client side only database is possible?** Check the [results][allow-deny] of Discover Meteor's allow/deny security challenge and take note that it mentions issues with other submissions, but you'll only find *Kelly Copley* listed under people who got it right. Guess how I secured my solution ;-).

With this in mind, lets insert a book in to the database client side.

```javascript
//first we get get an Author for the book we want to insert
var author = Meteor.authors.findOne({firstName:"Dave", lastName:"Pilkey"});

var book = new Book({
    title: "Captain Underpants",
    subTitle: "and The Sensational Saga of Sir-Stinks-A-Lot",
    authorId: author._id,
    garbageKey: "Stripped By SimpleSchema.clean() when calling save()"
});

book.save(); //This will also clean the data before inserting so no garbage data gets through.
```

We do this with code (dev tools? :-P ), but you could use a form and template events, OR you could define necessary information on your `SimpleSchema` and use `aldeed:autoform` or `vazco:uniforms` to render a form to input this information.

Now that we have data in the database we can read it out, display it, and use the methods defined on the class as helpers. Assuming we have a template with a helper that returns a cursor from `Meteor.books`, we can iterate over the cursor and the context will be an instance of the `Book` class and we can call the methods of the class such as `fullTitle`, and `author`. Awesomely, since we've also returned a instance of the `Author` class from the `author` method, we can also call it's methods as well such as `author.fullName` which could concatenate the authors first and last name and return a single string.

```html
<h1>Book List</h1>
{{#each books}}
    <p>Author's Name: {{author.fullName}}<p>
    <p>{{fullTitle}}</p>
{{/each}}
```

This would yield HTML like so..

```html
<h1>Book List</h1>
<p>Author's Name: Dave Pilkey<p>
<p>Captain Underpants: and The Sensational Saga of Sir-Stinks-A-Lot </p>
```

## Caveats

There could be some things that I guess might not be so obvious. I'll try to list them here as they come up.

1. You must publish data for related models.. If `book.author()` returns a model of author that doesn't have data published for it, then it will return undefined. This is just how Meteor works.

For a more in depth explanation of how to use this package see [API.md](api)

[simple-schema]: https://github.com/aldeed/meteor-simple-schema
[allow-deny]: https://www.discovermeteor.com/blog/allow-deny-challenge-results/#results
[socialize]: https://atmospherejs.com/socialize
[meteor]: https://meteor.com
[api]: https://github.com/copleykj/socialize-base-model/blob/master/API.md


text:
using System.Web.Mvc;

namespace Orchard.UI.Resources {
    public class LinkEntry {
        private readonly TagBuilder _builder = new TagBuilder("link");

        public string Condition { get; set; }

        public string Rel {
            get {
                string value;
                _builder.Attributes.TryGetValue("rel", out value);
                return value;
            }
            set { SetAttribute("rel", value); }
        }

        public string Type {
            get {
                string value;
                _builder.Attributes.TryGetValue("type", out value);
                return value;
            }
            set { SetAttribute("type", value); }
        }

        public string Title {
            get {
                string value;
                _builder.Attributes.TryGetValue("title", out value);
                return value;
            }
            set { SetAttribute("title", value); }
        }

        public string Href {
            get {
                string value;
                _builder.Attributes.TryGetValue("href", out value);
                return value;
            }
            set { SetAttribute("href", value); }
        }

        public string GetTag() {
            string tag = _builder.ToString(TagRenderMode.SelfClosing);
            if (!string.IsNullOrEmpty(Condition)) {
                return "<!--[if " + Condition + "]>" + tag + "<![endif]-->";
            }
            return tag;
        }

        public LinkEntry AddAttribute(string name, string value) {
            _builder.MergeAttribute(name, value);
            return this;
        }

        public LinkEntry SetAttribute(string name, string value) {
            _builder.MergeAttribute(name, value, true);
            return this;
        }
    }
}


text:
package UserInterface.Listening;

import UserInterface.Components.GUIComponent;

/**
 * WAM! POW!
 */
public interface ActionListener {

    public void actionPerformed(GUIComponent source);
}


text:
package org.apache.fluo.command;

import java.util.Map;

import org.apache.fluo.api.client.FluoAdmin;
import org.apache.fluo.api.client.FluoFactory;
import org.apache.fluo.api.config.FluoConfiguration;

public class FluoConfig {

  public static void main(String[] args) {
    CommonOpts opts = CommonOpts.parse("fluo config", args);
    FluoConfiguration config = CommandUtil.resolveFluoConfig();
    config.setApplicationName(opts.getApplicationName());
    opts.overrideFluoConfig(config);
    CommandUtil.verifyAppInitialized(config);
    try (FluoAdmin admin = FluoFactory.newAdmin(config)) {
      for (Map.Entry<String, String> entry : admin.getApplicationConfig().toMap().entrySet()) {
        System.out.println(entry.getKey() + " = " + entry.getValue());
      }
    }
  }
}


text:
This part describes the process of taking raw source code from the user and
transforming it into various forms that the compiler can work with easily.
These are called _intermediate representations (IRs)_.

This process starts with compiler understanding what the user has asked for:
parsing the command line arguments given and determining what it is to compile.
After that, the compiler transforms the user input into a series of IRs that
look progressively less like what the user wrote.


text:
package org.fusesource.scalate
package wikitext

class AttributesTest extends AbstractConfluenceTest {
  test("attributes") {
    val context = new DefaultRenderContext("foo.conf", new TemplateEngine())

    RenderContext.using(context) {
      val source = "{attributes:layout=foo.scaml}"
      val actual = filter.filter(context, source)

      expect("") {actual}
      expect("foo.scaml", "layout attribute") {context.attributeOrElse("layout", "failed!")}
    }

  }
}


text:
var _ = require('lodash');
exports.banFromSub = async function (redToken, username, banMessage, banNote, subreddit, duration) {
  try {
    await Reddit.banUser(redToken, username, banMessage, banNote, subreddit, duration);
    sails.log('Banned ' + username + ' from /r/' + subreddit);
    return 'Banned ' + username + ' from /r/' + subreddit;
  } catch (err) {
    throw {error: 'Failed to ban user from /r/' + subreddit};
  }
};

//Give the 'BANNED USER' flair on a subreddit
exports.giveBannedUserFlair = async function (redToken, username, current_css_class, current_flair_text, subreddit) {
  try {
    var flair_text = current_flair_text || '';
    var css_class = Flairs.makeNewCSSClass(current_css_class, 'banned', subreddit);
    await Reddit.setUserFlair(redToken, username, css_class, flair_text, subreddit);
    sails.log('Changed ' + username + '\'s flair to ' + css_class + ' on /r/' + subreddit);
    return 'Changed ' + username + '\'s flair to ' + css_class + ' on /r/' + subreddit;
  } catch (err) {
    throw {error: 'Failed to give banned user flair'};
  }
};
//Update the AutoModerator config with the user's friend codes
exports.updateAutomod = async function (redToken, username, subreddit, friend_codes) {
  try {
    var current_config = await Reddit.getWikiPage(redToken, subreddit, 'config/automoderator');
  } catch (e) {
    throw {error: 'Error retrieving /r/' + subreddit + ' AutoModerator config'};
  }
  var lines = current_config.replace(/\r/g, '').split("\n");
  var fclist_indices = [lines.indexOf('#FCList1') + 1, lines.indexOf('#FCList2') + 1];
  if (fclist_indices.indexOf(0) != -1) {
    sails.log.error('Error: Could not find #FCList tags in /r/' + subreddit + ' AutoModerator config');
    throw {error: 'Error parsing /r/' + subreddit + ' AutoModerator config'};
  }
  try {
    for (var listno = 0; listno < fclist_indices.length; listno++) {
      var punctuation = listno ? [']', ', "', '-', '"'] : ['"', '|', ' ?-? ?', ''];
      var end_delimiter_index = lines[fclist_indices[listno]].lastIndexOf(punctuation[0]);
      var before_end = lines[fclist_indices[listno]].substring(0, end_delimiter_index);
      for (var i = 0; i < friend_codes.length; i++) {
        let formatted = friend_codes[i].replace(/-/g, punctuation[2]);
        if (lines[fclist_indices[listno]].indexOf(formatted) === -1) {
          before_end += punctuation[1] + formatted + punctuation[3];
        }
      }
      lines[fclist_indices[listno]] = before_end + lines[fclist_indices[listno]].substring(end_delimiter_index);
    }
  }
  catch (automodparseerr) {
    sails.log.error('Error parsing /r/' + subreddit + ' AutoModerator config');
    throw {error: 'Error parsing /r/' + subreddit + ' AutoModerator config'};
  }
  var content = lines.join("\n");
  if (content !== current_config) {
    await Reddit.editWikiPage(redToken, subreddit, 'config/automoderator', content, 'FlairHQ: Updated banned friend codes');
  }
  var output = 'Added /u/' + username + '\'s friend codes to /r/' + subreddit + ' AutoModerator blacklist';
  sails.log(output);
  return output;
};
//Lock and give flair to the user's TSV threads.
exports.markTSVThreads = async function (redToken, username) {
  var threads = await Reddit.searchTSVThreads(redToken, username);
  var tsv_promises = [];
  threads.forEach(function (entry) {
    tsv_promises.push(Reddit.lockPost(redToken, entry.data.id));
    tsv_promises.push(Reddit.markNsfw(redToken, entry.data.id));
    tsv_promises.push(Reddit.setLinkFlair(redToken, entry.data.subreddit, entry.data.id, 'banned', 'TSV (Banned)'));
  });
  await Promise.all(tsv_promises);
  var output = 'Marked and locked /u/' + username + '\'s TSV threads (' + threads.length.toString() + ' total)';
  sails.log(output);
  return output;
};
//Update the public banlist with the user's information
exports.updateBanlist = async function (redToken, username, banlistEntry, friend_codes, igns, knownAlt, tradeNote) {
  var valid_FCs = friend_codes.filter(Flairs.validFC);
  if (valid_FCs.length) {
    friend_codes = valid_FCs;
  }
  var current_list = await Reddit.getWikiPage(redToken, 'pokemontrades', 'banlist');
  var lines = current_list.replace(/\r/g, '').split("\n");
  var start_index = lines.indexOf('[//]:# (BEGIN BANLIST)') + 3;
  var end_index = lines.indexOf('[//]:# (END BANLIST)');
  if (start_index === 2 || end_index === -1) {
    sails.log.error('Error: Could not find parsing marker in public banlist');
    throw {error: 'Error: Could not find parsing marker in public banlist'};
  }
  let updated_content;
  for (let i = start_index; i < end_index; i++) {
    lines[i] = lines[i].replace(RegExp('\\\\_','g'),'_');
    if (knownAlt && lines[i].includes(knownAlt) || lines[i].includes(username)
        ||_.intersection(lines[i].match(/(\d{4}-){2}\d{4}/g), friend_codes).length) {
      // User was an alt account, modify the existing line instead of creating a new one
      let blocks = lines[i].split(/\s*\|\s*/);
      let user_regex = '(?:^|\\s)('+username+(knownAlt ? '|'+knownAlt : '')+')(?:,|$)';
      let fc_match = _.intersection(blocks[1].match(/(\d{4}-){2}\d{4}/g), friend_codes).length;
      if (blocks.length !== 5 || !(fc_match || blocks[0].match(new RegExp(user_regex)))) {
        continue;
      }
      blocks[0] = _.union(blocks[0].match(/[\w-]{1,20}/g), [username]).join(', ').replace(RegExp('_','g'),'\\_');
      blocks[1] = _.union(blocks[1].match(/(\d{4}-){2}\d{4}/g), friend_codes).join(', ');
      try {
        blocks[3] = Flairs.formatGames(Flairs.combineGames(Flairs.parseGames(blocks[3]), Flairs.parseGames(igns)));
      } catch (err) {
        blocks[3] += igns;
      }
      blocks[4] = tradeNote || blocks[4] || '';
      let new_line = blocks.join(' | ');
      updated_content = lines.slice(0, start_index).concat(new_line).concat(lines.slice(start_index, i)).concat(lines.slice(i + 1)).join('\n');
      break;
    }
  }
  if (!updated_content) {
    // User was probably not an alt, create a new line
    let formatted_igns;
    try {
      formatted_igns = Flairs.formatGames(Flairs.parseGames(igns));
    } catch (err) {
      formatted_igns = igns;
    }
    let new_line = [username, friend_codes.join(', '), banlistEntry, formatted_igns, tradeNote].join(' | ');
    updated_content = lines.slice(0, start_index).concat(new_line).concat(lines.slice(start_index)).join('\n');
  }
  try {
    await Reddit.editWikiPage(redToken, 'pokemontrades', 'banlist', updated_content, '');
  } catch (e) {
    sails.log.error(e);
    throw {error: 'Failed to update public banlist'};
  }
  sails.log('Added /u/' + username + ' to public banlist');
  return 'Added /u/' + username + ' to public banlist';
};
exports.localBanUser = async function(username) {
  try {
    let update = await User.update(username, {banned: true});
    sails.log('Updated local banlist');
    return update;
  } catch (err) {
    sails.log.error(err);
    throw {error: 'Failed to locally ban /u/' + username};
  }
};
exports.addUsernote = function (redToken, modname, subreddit, username, banNote, duration) {
  var type = duration ? 'ban' : 'permban';
  var note = duration ? 'Tempbanned for ' + duration + ' days - ' + banNote : 'Banned' + (banNote ? ' - ' + banNote : '');
  return Usernotes.addUsernote(redToken, modname, subreddit, username, note, type, '').then(function (response) {
    sails.log('Created a usernote on ' + username + ' in /r/' + subreddit);
    return response;
  }, function () {
    throw {error: 'Failed to update /u/' + subreddit + 'usernotes.'};
  });
};


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Tutorial: The Custom Controller Demo — Leap Motion Java SDK v2.3 documentation</title>

    <link rel="stylesheet" href="../../cpp/_static/bootstrap-3.0.0/css/documentation-bundle.1439949735.css" type="text/css" />

    <link rel="top" title="Leap Motion Java SDK v2.3 documentation" href="../index.html" />

<link rel="stylesheet" href="/assets/standalone-header.css?r9" type="text/css" />

<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">

            Developer Portal

      <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">

      </button>

What's new

Getting Started

Documentation

 Examples

 Blog

 Community

      JavaScript

      Unity

      C#

      C++

      Java

      Python

      Objective-C

      Unreal

<form class="navbar-form" action="../search.html" method="get" onsubmit="storeThisPage()">

  <input type="search" results="5" name="q" class="form-control" placeholder="Search" />

  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>

Tutorial: The Custom Controller Demo¶

The Custom Controller Demo example illustrates how to extend the Leap Motion Controller Actor and LeapMotionBoneActor classes using blueprints. The Unreal Engine project containing this example is available in our Example Gallery at: https://developer.leapmotion.com/gallery/unreal-4-7-demo-pack.

Before you start

The plugin is included with the full source distribution of Unreal Engine 4.9. To use the example project, you must checkout the Unreal Engine source code from Epic Game’s Github site and compile it. See Leap Motion Unreal Plugin.

In addition, to see hands in a level, you must have the Leap Motion service software installed and a Leap Motion hardware device plugged in.

In this tutorial, we will recreate the Custom Controller Demo level, which simply prints debug hand information to the screen and output message log. We will create two blueprints that extend the Controller Actor and Bone Actor classes to do the printing. While printing strings to the screen is not extraordinarily exciting, it does show how to access key information and events.

Before diving in, take a moment to examine the already-built level in the Leap Example project to see what we will be building. Open the Leap Examples project and double-click on <tt class="docutils literal">Maps/CustomControllerDemo.</tt> Press play and put your hands over your Leap Motion device. You should see something like this:

The custom blueprint code prints out the ids of the hands that are added and removed from view and the world locations of the fingertips.

Now, let’s get started by creating a new level and a custom Leap Motion Controller Actor Blueprint. You can refer back to the CustomControllerDemo map and blueprints for reference.

File > New Level

Choose the Default template, which has a floor and skybox.

Add a Leap Motion Controller Actor just in front of the Player Start marker.

Type “Leap” in the Mode panel to locate the controller actor class.

Drag the Leap Motion Controller Actor into the level.

With the Leap Motion Controller Actor selected in the World Outliner, click the Blueprint/Add Script button

Edit the blueprint to open the Blueprint Graph Editor window.

Using Hand Added and Removed events¶

In the Leap Motion Controller Actor blueprint, we are going to use the hand added and hand removed events and print a debug message containing the hand id to the screen and output log.

The first step is to add nodes for these events to the Leap Motion Controller Actor blueprint we just created:

In the Components list in the upper left corner of the Blueprint editor window, select the LeapMotionControllerComponent. This will show properties of the component in the Details panel on the right side of the window.

Scroll to the bottom of the Details panel to reveal the Events section.

Click the + buttons next to the On Hand Added and On Hand Removed events to add these nodes to the blueprint graph.

Notice that these events have an output pin for the Hand id. We will use the Unreal Print String function to display the id when one of these events is dispatched.

Add a String Append function to the Eventgraph.

Wire the Hand Id output from the hand added event to the Append B input pin.

For the A pin, enter the text, “Hand added:”.

Add a Print String function.

Wire the Append return value to the In String pin. Set the Text Color, as desired.

Repeat these steps to hook up the On Hand Removed event.

Extending the Bone Actor class¶

The LeapMotionBoneActor object represents the physical parts of the hand, including the forearm, the palm, and three segments per finger. When a hand is added, the Hand Actor spawns a Bone Actor for each of these parts. The Bone Actor contains the physical positions, orientations, visuals, and colliders of the hand.

To illustrate how to access information for particular bones, we are going to extend the Bone Actor class with a blueprint that prints out the position of the index finger tip.

In the Unreal Editor Toolbar, use the Blueprints command to open the Create New Empty Blueprint dialog.

Open the All Classes list at the bottom of the dialog box.

Type “Leap” into the search field.

Select LeapMotionBoneActor and click Select.

Assign a name to the Blueprint class and create it.

The Blueprint editor opens, displaying your new class. Go to the Event Graph tab.

We are going to use the Event Tick node to execute the Blueprint every Unreal tick. Our script will perform three tasks:

Check whether the current bone is the finger tip (since we only want to print out the location of this bone and not for any of the others).

Get the location of the bone.

Print the location to the screen.

You might have noticed that the pre-built Custom Controller Demo sample uses a time accumulator local variable so that the position is only printed once every half-second. In this example, we will leave that part out to keep things simple.

For the first step, add the Leap Bone Type variable to the blueprint. Open the Actions menu and type”Get Leap Bone Type” in the search box:

Next, drag off the output pin, and choose Equal (Enum) from the Actions list.

Choose Finger1Tip from the list of bone names, which is defined by the ELeapBone enumeration. The fingers are numbered 1-4, index to pinky.

Add a Branch node to the blueprint.

Wire the output of the Equals node to the input Condition pin of the Branch node.

Wire the Event Tick Exec pin to the Branch Exec input.

For the second task, we need to get the finger tip position. This requires one node: Get Actor Location. Since the base Bone Actor class has already converted the incoming Leap Motion tracking data into Unreal coordinates and updated the in-game bone position, we can simply use the standard actor location:

To complete the blueprint, convert the position vector to a string, append it to the label “Index finger tip is at: ” and print it:

Set the Bone Actor class¶

Before our new Bone Actor extension will be used, we have to tell the Leap Motion Controller Actor about it.

On the Unreal Viewport window, select your Leap Motion Controller Actor in the World Outliner.

In the Details panel, find the Bone Blueprint setting in the Leap Motion section.

Set the property to use your new class.

Now you can run the level and see the debug print statements on the screen.

Java Docs (v2.3)

Introducing the Skeletal Tracking Model

API Overview

Guidelines

Application Development

Using the Tracking API

API Reference

Appendices


text:
import { __platform_browser_private__ as _ } from '@angular/platform-browser';
export declare var getDOM: typeof _.getDOM;
export declare var BrowserDomAdapter: typeof _.BrowserDomAdapter;
export declare var ELEMENT_PROBE_PROVIDERS: typeof _.ELEMENT_PROBE_PROVIDERS;


text:
from django.urls import resolve
from django.test import TestCase

from citeIt import views

class TestURLs(TestCase):
    """Test that the URLs are matched and resolved to the correct views."""

    def test_index_url(self):
        view = resolve('/withers/').func
        self.assertEqual(view, views.index)

    def test_about_url(self):
        view = resolve('/withers/about/').func
        self.assertEqual(view, views.about)

    def test_citation_url(self):
        view = resolve('/withers/citation/001/').func
        self.assertEqual(view, views.citation)

    def test_author_url(self):
        view = resolve('/withers/author/Logan,_John_H./').func
        self.assertEqual(view, views.author)

    def test_author_url_with_special_chars(self):
        view = resolve('/withers/author/Logan-Durant,_John_H./').func
        self.assertEqual(view, views.author)

    def test_authors_url(self):
        view = resolve('/withers/author/').func
        self.assertEqual(view, views.authors)

    def test_institution_url(self):
        view = resolve('/withers/institution/UNT/').func
        self.assertEqual(view, views.institution)

    def test_institution_url_with_special_chars(self):
        view = resolve('/withers/institution/A&M/').func
        self.assertEqual(view, views.institution)

    def test_degree_url(self):
        view = resolve('/withers/degree/MA/').func
        self.assertEqual(view, views.degree)

    def test_degrees_url(self):
        view = resolve('/withers/degree/').func
        self.assertEqual(view, views.degrees)

    def test_year_url(self):
        view = resolve('/withers/year/1932/').func
        self.assertEqual(view, views.year)

    def test_subject_url(self):
        view = resolve('/withers/subject/local_politics/').func
        self.assertEqual(view, views.subject)

    def test_subject_url_with_special_chars(self):
        view = resolve('/withers/subject/K-12_Education/').func
        self.assertEqual(view, views.subject)

    def test_location_url(self):
        view = resolve('/withers/location/United_States/').func
        self.assertEqual(view, views.location)

    def test_location_url_with_special_chars(self):
        view = resolve('/withers/location/United_States_>_Texas/').func
        self.assertEqual(view, views.location)


text:
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Windows.Forms;
using DpSdkEngLib;
using DPSDKOPSLib;
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using System.Linq;
using System.Xml.Linq;
namespace _4PosBackOffice.NET
{
	[Microsoft.VisualBasic.CompilerServices.DesignerGenerated()]
	partial class frmStockTransferItem
	{
		#region "Windows Form Designer generated code "
		[System.Diagnostics.DebuggerNonUserCode()]
		public frmStockTransferItem() : base()
		{
			KeyPress += frmStockTransferItem_KeyPress;
			//This call is required by the Windows Form Designer.
			InitializeComponent();
		}
//Form overrides dispose to clean up the component list.
		[System.Diagnostics.DebuggerNonUserCode()]
		protected override void Dispose(bool Disposing)
		{
			if (Disposing) {
				if ((components != null)) {
					components.Dispose();
				}
			}
			base.Dispose(Disposing);
		}
//Required by the Windows Form Designer
		private System.ComponentModel.IContainer components;
		public System.Windows.Forms.ToolTip ToolTip1;
		private System.Windows.Forms.TextBox withEventsField_txtQtyT;
		public System.Windows.Forms.TextBox txtQtyT {
			get { return withEventsField_txtQtyT; }
			set {
				if (withEventsField_txtQtyT != null) {
					withEventsField_txtQtyT.TextChanged -= txtQtyT_TextChanged;
					withEventsField_txtQtyT.KeyPress -= txtQtyT_KeyPress;
					withEventsField_txtQtyT.Enter -= txtQtyT_Enter;
					withEventsField_txtQtyT.Leave -= txtQtyT_Leave;
				}
				withEventsField_txtQtyT = value;
				if (withEventsField_txtQtyT != null) {
					withEventsField_txtQtyT.TextChanged += txtQtyT_TextChanged;
					withEventsField_txtQtyT.KeyPress += txtQtyT_KeyPress;
					withEventsField_txtQtyT.Enter += txtQtyT_Enter;
					withEventsField_txtQtyT.Leave += txtQtyT_Leave;
				}
			}
		}
		public System.Windows.Forms.TextBox txtPSize;
		public System.Windows.Forms.TextBox txtPack;
		private System.Windows.Forms.TextBox withEventsField_txtPriceS;
		public System.Windows.Forms.TextBox txtPriceS {
			get { return withEventsField_txtPriceS; }
			set {
				if (withEventsField_txtPriceS != null) {
					withEventsField_txtPriceS.Enter -= txtPriceS_Enter;
					withEventsField_txtPriceS.Leave -= txtPriceS_Leave;
				}
				withEventsField_txtPriceS = value;
				if (withEventsField_txtPriceS != null) {
					withEventsField_txtPriceS.Enter += txtPriceS_Enter;
					withEventsField_txtPriceS.Leave += txtPriceS_Leave;
				}
			}
		}
		private System.Windows.Forms.TextBox withEventsField_txtQty;
		public System.Windows.Forms.TextBox txtQty {
			get { return withEventsField_txtQty; }
			set {
				if (withEventsField_txtQty != null) {
					withEventsField_txtQty.KeyPress -= txtQty_KeyPress;
					withEventsField_txtQty.Enter -= txtQty_Enter;
					withEventsField_txtQty.Leave -= txtQty_Leave;
				}
				withEventsField_txtQty = value;
				if (withEventsField_txtQty != null) {
					withEventsField_txtQty.KeyPress += txtQty_KeyPress;
					withEventsField_txtQty.Enter += txtQty_Enter;
					withEventsField_txtQty.Leave += txtQty_Leave;
				}
			}
		}
		private System.Windows.Forms.TextBox withEventsField_txtPrice;
		public System.Windows.Forms.TextBox txtPrice {
			get { return withEventsField_txtPrice; }
			set {
				if (withEventsField_txtPrice != null) {
					withEventsField_txtPrice.Enter -= txtPrice_Enter;
					withEventsField_txtPrice.KeyPress -= txtPrice_KeyPress;
					withEventsField_txtPrice.Leave -= txtPrice_Leave;
				}
				withEventsField_txtPrice = value;
				if (withEventsField_txtPrice != null) {
					withEventsField_txtPrice.Enter += txtPrice_Enter;
					withEventsField_txtPrice.KeyPress += txtPrice_KeyPress;
					withEventsField_txtPrice.Leave += txtPrice_Leave;
				}
			}
		}
		public System.Windows.Forms.ComboBox cmbQuantity;
		private System.Windows.Forms.Button withEventsField_cmdPack;
		public System.Windows.Forms.Button cmdPack {
			get { return withEventsField_cmdPack; }
			set {
				if (withEventsField_cmdPack != null) {
					withEventsField_cmdPack.Click -= cmdPack_Click;
				}
				withEventsField_cmdPack = value;
				if (withEventsField_cmdPack != null) {
					withEventsField_cmdPack.Click += cmdPack_Click;
				}
			}
		}
		private System.Windows.Forms.Button withEventsField_cmdCancel;
		public System.Windows.Forms.Button cmdCancel {
			get { return withEventsField_cmdCancel; }
			set {
				if (withEventsField_cmdCancel != null) {
					withEventsField_cmdCancel.Click -= cmdCancel_Click;
				}
				withEventsField_cmdCancel = value;
				if (withEventsField_cmdCancel != null) {
					withEventsField_cmdCancel.Click += cmdCancel_Click;
				}
			}
		}
		private System.Windows.Forms.Button withEventsField_cmdClose;
		public System.Windows.Forms.Button cmdClose {
			get { return withEventsField_cmdClose; }
			set {
				if (withEventsField_cmdClose != null) {
					withEventsField_cmdClose.Click -= cmdClose_Click;
				}
				withEventsField_cmdClose = value;
				if (withEventsField_cmdClose != null) {
					withEventsField_cmdClose.Click += cmdClose_Click;
				}
			}
		}
		public System.Windows.Forms.Panel picButtons;
		public System.Windows.Forms.Label _LBL_6;
		public System.Windows.Forms.Label _LBL_4;
		public System.Windows.Forms.Label Label2;
		public System.Windows.Forms.Label lblPComp;
		public System.Windows.Forms.Label lblSComp;
		public System.Windows.Forms.Label lblStockItemS;
		public System.Windows.Forms.Label _LBL_5;
		public System.Windows.Forms.Label _LBL_0;
		public System.Windows.Forms.Label _LBL_3;
		public System.Windows.Forms.Label _LBL_2;
		public System.Windows.Forms.Label _LBL_1;
		public System.Windows.Forms.Label lblStockItem;
		public Microsoft.VisualBasic.PowerPacks.RectangleShape _Shape1_2;
		public Microsoft.VisualBasic.PowerPacks.RectangleShape _Shape1_0;
		//Public WithEvents LBL As Microsoft.VisualBasic.Compatibility.VB6.LabelArray
		public RectangleShapeArray Shape1;
		public Microsoft.VisualBasic.PowerPacks.ShapeContainer ShapeContainer1;
//NOTE: The following procedure is required by the Windows Form Designer
//It can be modified using the Windows Form Designer.
//Do not modify it using the code editor.
		[System.Diagnostics.DebuggerStepThrough()]
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmStockTransferItem));
			this.components = new System.ComponentModel.Container();
			this.ToolTip1 = new System.Windows.Forms.ToolTip(components);
			this.ShapeContainer1 = new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
			this.txtQtyT = new System.Windows.Forms.TextBox();
			this.txtPSize = new System.Windows.Forms.TextBox();
			this.txtPack = new System.Windows.Forms.TextBox();
			this.txtPriceS = new System.Windows.Forms.TextBox();
			this.txtQty = new System.Windows.Forms.TextBox();
			this.txtPrice = new System.Windows.Forms.TextBox();
			this.cmbQuantity = new System.Windows.Forms.ComboBox();
			this.picButtons = new System.Windows.Forms.Panel();
			this.cmdPack = new System.Windows.Forms.Button();
			this.cmdCancel = new System.Windows.Forms.Button();
			this.cmdClose = new System.Windows.Forms.Button();
			this._LBL_6 = new System.Windows.Forms.Label();
			this._LBL_4 = new System.Windows.Forms.Label();
			this.Label2 = new System.Windows.Forms.Label();
			this.lblPComp = new System.Windows.Forms.Label();
			this.lblSComp = new System.Windows.Forms.Label();
			this.lblStockItemS = new System.Windows.Forms.Label();
			this._LBL_5 = new System.Windows.Forms.Label();
			this._LBL_0 = new System.Windows.Forms.Label();
			this._LBL_3 = new System.Windows.Forms.Label();
			this._LBL_2 = new System.Windows.Forms.Label();
			this._LBL_1 = new System.Windows.Forms.Label();
			this.lblStockItem = new System.Windows.Forms.Label();
			this._Shape1_2 = new Microsoft.VisualBasic.PowerPacks.RectangleShape();
			this._Shape1_0 = new Microsoft.VisualBasic.PowerPacks.RectangleShape();
			//Me.LBL = New Microsoft.VisualBasic.Compatibility.VB6.LabelArray(components)
			this.Shape1 = new RectangleShapeArray(components);
			this.picButtons.SuspendLayout();
			this.SuspendLayout();
			this.ToolTip1.Active = true;
			//CType(Me.LBL, System.ComponentModel.ISupportInitialize).BeginInit()
			((System.ComponentModel.ISupportInitialize)this.Shape1).BeginInit();
			this.BackColor = System.Drawing.Color.FromArgb(224, 224, 224);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.Text = "Edit Stock Transfer Item";
			this.ClientSize = new System.Drawing.Size(400, 249);
			this.Location = new System.Drawing.Point(3, 22);
			this.ControlBox = false;
			this.KeyPreview = true;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Enabled = true;
			this.Cursor = System.Windows.Forms.Cursors.Default;
			this.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.HelpButton = false;
			this.WindowState = System.Windows.Forms.FormWindowState.Normal;
			this.Name = "frmStockTransferItem";
			this.txtQtyT.AutoSize = false;
			this.txtQtyT.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			this.txtQtyT.Size = new System.Drawing.Size(67, 19);
			this.txtQtyT.Location = new System.Drawing.Point(96, 97);
			this.txtQtyT.TabIndex = 20;
			this.txtQtyT.Text = "0";
			this.txtQtyT.AcceptsReturn = true;
			this.txtQtyT.BackColor = System.Drawing.SystemColors.Window;
			this.txtQtyT.CausesValidation = true;
			this.txtQtyT.Enabled = true;
			this.txtQtyT.ForeColor = System.Drawing.SystemColors.WindowText;
			this.txtQtyT.HideSelection = true;
			this.txtQtyT.ReadOnly = false;
			this.txtQtyT.MaxLength = 0;
			this.txtQtyT.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.txtQtyT.Multiline = false;
			this.txtQtyT.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.txtQtyT.ScrollBars = System.Windows.Forms.ScrollBars.None;
			this.txtQtyT.TabStop = true;
			this.txtQtyT.Visible = true;
			this.txtQtyT.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.txtQtyT.Name = "txtQtyT";
			this.txtPSize.AutoSize = false;
			this.txtPSize.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
			this.txtPSize.Enabled = false;
			this.txtPSize.Size = new System.Drawing.Size(27, 19);
			this.txtPSize.Location = new System.Drawing.Point(184, 97);
			this.txtPSize.TabIndex = 19;
			this.txtPSize.Text = "1";
			this.txtPSize.AcceptsReturn = true;
			this.txtPSize.BackColor = System.Drawing.SystemColors.Window;
			this.txtPSize.CausesValidation = true;
			this.txtPSize.ForeColor = System.Drawing.SystemColors.WindowText;
			this.txtPSize.HideSelection = true;
			this.txtPSize.ReadOnly = false;
			this.txtPSize.MaxLength = 0;
			this.txtPSize.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.txtPSize.Multiline = false;
			this.txtPSize.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.txtPSize.ScrollBars = System.Windows.Forms.ScrollBars.None;
			this.txtPSize.TabStop = true;
			this.txtPSize.Visible = true;
			this.txtPSize.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.txtPSize.Name = "txtPSize";
			this.txtPack.AutoSize = false;
			this.txtPack.Size = new System.Drawing.Size(41, 19);
			this.txtPack.Location = new System.Drawing.Point(352, 160);
			this.txtPack.TabIndex = 17;
			this.txtPack.Text = "0";
			this.txtPack.AcceptsReturn = true;
			this.txtPack.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.txtPack.BackColor = System.Drawing.SystemColors.Window;
			this.txtPack.CausesValidation = true;
			this.txtPack.Enabled = true;
			this.txtPack.ForeColor = System.Drawing.SystemColors.WindowText;
			this.txtPack.HideSelection = true;
			this.txtPack.ReadOnly = false;
			this.txtPack.MaxLength = 0;
			this.txtPack.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.txtPack.Multiline = false;
			this.txtPack.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.txtPack.ScrollBars = System.Windows.Forms.ScrollBars.None;
			this.txtPack.TabStop = true;
			this.txtPack.Visible = true;
			this.txtPack.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.txtPack.Name = "txtPack";
			this.txtPriceS.AutoSize = false;
			this.txtPriceS.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			this.txtPriceS.Enabled = false;
			this.txtPriceS.Size = new System.Drawing.Size(91, 19);
			this.txtPriceS.Location = new System.Drawing.Point(291, 234);
			this.txtPriceS.TabIndex = 9;
			this.txtPriceS.Text = "0.00";
			this.txtPriceS.Visible = false;
			this.txtPriceS.AcceptsReturn = true;
			this.txtPriceS.BackColor = System.Drawing.SystemColors.Window;
			this.txtPriceS.CausesValidation = true;
			this.txtPriceS.ForeColor = System.Drawing.SystemColors.WindowText;
			this.txtPriceS.HideSelection = true;
			this.txtPriceS.ReadOnly = false;
			this.txtPriceS.MaxLength = 0;
			this.txtPriceS.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.txtPriceS.Multiline = false;
			this.txtPriceS.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.txtPriceS.ScrollBars = System.Windows.Forms.ScrollBars.None;
			this.txtPriceS.TabStop = true;
			this.txtPriceS.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.txtPriceS.Name = "txtPriceS";
			this.txtQty.AutoSize = false;
			this.txtQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			this.txtQty.Size = new System.Drawing.Size(67, 19);
			this.txtQty.Location = new System.Drawing.Point(316, 97);
			this.txtQty.ReadOnly = true;
			this.txtQty.TabIndex = 8;
			this.txtQty.Text = "0";
			this.txtQty.AcceptsReturn = true;
			this.txtQty.BackColor = System.Drawing.SystemColors.Window;
			this.txtQty.CausesValidation = true;
			this.txtQty.Enabled = true;
			this.txtQty.ForeColor = System.Drawing.SystemColors.WindowText;
			this.txtQty.HideSelection = true;
			this.txtQty.MaxLength = 0;
			this.txtQty.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.txtQty.Multiline = false;
			this.txtQty.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.txtQty.ScrollBars = System.Windows.Forms.ScrollBars.None;
			this.txtQty.TabStop = true;
			this.txtQty.Visible = true;
			this.txtQty.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.txtQty.Name = "txtQty";
			this.txtPrice.AutoSize = false;
			this.txtPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			this.txtPrice.Enabled = false;
			this.txtPrice.Size = new System.Drawing.Size(91, 19);
			this.txtPrice.Location = new System.Drawing.Point(293, 121);
			this.txtPrice.TabIndex = 4;
			this.txtPrice.Text = "0.00";
			this.txtPrice.AcceptsReturn = true;
			this.txtPrice.BackColor = System.Drawing.SystemColors.Window;
			this.txtPrice.CausesValidation = true;
			this.txtPrice.ForeColor = System.Drawing.SystemColors.WindowText;
			this.txtPrice.HideSelection = true;
			this.txtPrice.ReadOnly = false;
			this.txtPrice.MaxLength = 0;
			this.txtPrice.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.txtPrice.Multiline = false;
			this.txtPrice.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.txtPrice.ScrollBars = System.Windows.Forms.ScrollBars.None;
			this.txtPrice.TabStop = true;
			this.txtPrice.Visible = true;
			this.txtPrice.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.txtPrice.Name = "txtPrice";
			this.cmbQuantity.Size = new System.Drawing.Size(79, 21);
			this.cmbQuantity.Location = new System.Drawing.Point(184, 96);
			this.cmbQuantity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cmbQuantity.TabIndex = 3;
			this.cmbQuantity.Visible = false;
			this.cmbQuantity.BackColor = System.Drawing.SystemColors.Window;
			this.cmbQuantity.CausesValidation = true;
			this.cmbQuantity.Enabled = true;
			this.cmbQuantity.ForeColor = System.Drawing.SystemColors.WindowText;
			this.cmbQuantity.IntegralHeight = true;
			this.cmbQuantity.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmbQuantity.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmbQuantity.Sorted = false;
			this.cmbQuantity.TabStop = true;
			this.cmbQuantity.Name = "cmbQuantity";
			this.picButtons.Dock = System.Windows.Forms.DockStyle.Top;
			this.picButtons.BackColor = System.Drawing.Color.Blue;
			this.picButtons.Size = new System.Drawing.Size(400, 39);
			this.picButtons.Location = new System.Drawing.Point(0, 0);
			this.picButtons.TabIndex = 0;
			this.picButtons.TabStop = false;
			this.picButtons.CausesValidation = true;
			this.picButtons.Enabled = true;
			this.picButtons.ForeColor = System.Drawing.SystemColors.ControlText;
			this.picButtons.Cursor = System.Windows.Forms.Cursors.Default;
			this.picButtons.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.picButtons.Visible = true;
			this.picButtons.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.picButtons.Name = "picButtons";
			this.cmdPack.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.cmdPack.Text = "Break / Build P&ack";
			this.cmdPack.Size = new System.Drawing.Size(105, 29);
			this.cmdPack.Location = new System.Drawing.Point(88, 3);
			this.cmdPack.TabIndex = 18;
			this.cmdPack.TabStop = false;
			this.cmdPack.BackColor = System.Drawing.SystemColors.Control;
			this.cmdPack.CausesValidation = true;
			this.cmdPack.Enabled = true;
			this.cmdPack.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdPack.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdPack.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdPack.Name = "cmdPack";
			this.cmdCancel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.cmdCancel.Text = "&Undo";
			this.cmdCancel.Size = new System.Drawing.Size(73, 29);
			this.cmdCancel.Location = new System.Drawing.Point(8, 3);
			this.cmdCancel.TabIndex = 16;
			this.cmdCancel.TabStop = false;
			this.cmdCancel.BackColor = System.Drawing.SystemColors.Control;
			this.cmdCancel.CausesValidation = true;
			this.cmdCancel.Enabled = true;
			this.cmdCancel.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdCancel.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdCancel.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdCancel.Name = "cmdCancel";
			this.cmdClose.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.cmdClose.Text = "E&xit";
			this.cmdClose.Size = new System.Drawing.Size(73, 29);
			this.cmdClose.Location = new System.Drawing.Point(312, 3);
			this.cmdClose.TabIndex = 1;
			this.cmdClose.TabStop = false;
			this.cmdClose.BackColor = System.Drawing.SystemColors.Control;
			this.cmdClose.CausesValidation = true;
			this.cmdClose.Enabled = true;
			this.cmdClose.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdClose.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdClose.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdClose.Name = "cmdClose";
			this._LBL_6.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this._LBL_6.Text = "Item Qty:";
			this._LBL_6.Size = new System.Drawing.Size(42, 13);
			this._LBL_6.Location = new System.Drawing.Point(52, 99);
			this._LBL_6.TabIndex = 22;
			this._LBL_6.BackColor = System.Drawing.Color.Transparent;
			this._LBL_6.Enabled = true;
			this._LBL_6.ForeColor = System.Drawing.SystemColors.ControlText;
			this._LBL_6.Cursor = System.Windows.Forms.Cursors.Default;
			this._LBL_6.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this._LBL_6.UseMnemonic = true;
			this._LBL_6.Visible = true;
			this._LBL_6.AutoSize = true;
			this._LBL_6.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this._LBL_6.Name = "_LBL_6";
			this._LBL_4.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this._LBL_4.Text = "x";
			this._LBL_4.Size = new System.Drawing.Size(8, 16);
			this._LBL_4.Location = new System.Drawing.Point(170, 98);
			this._LBL_4.TabIndex = 21;
			this._LBL_4.BackColor = System.Drawing.Color.Transparent;
			this._LBL_4.Enabled = true;
			this._LBL_4.ForeColor = System.Drawing.SystemColors.ControlText;
			this._LBL_4.Cursor = System.Windows.Forms.Cursors.Default;
			this._LBL_4.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this._LBL_4.UseMnemonic = true;
			this._LBL_4.Visible = true;
			this._LBL_4.AutoSize = true;
			this._LBL_4.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this._LBL_4.Name = "_LBL_4";
			this.Label2.Text = "Please verify products from both locations";
			this.Label2.ForeColor = System.Drawing.Color.FromArgb(192, 0, 0);
			this.Label2.Size = new System.Drawing.Size(296, 23);
			this.Label2.Location = new System.Drawing.Point(56, 160);
			this.Label2.TabIndex = 15;
			this.Label2.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			this.Label2.BackColor = System.Drawing.Color.Transparent;
			this.Label2.Enabled = true;
			this.Label2.Cursor = System.Windows.Forms.Cursors.Default;
			this.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Label2.UseMnemonic = true;
			this.Label2.Visible = true;
			this.Label2.AutoSize = false;
			this.Label2.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this.Label2.Name = "Label2";
			this.lblPComp.Text = "Promotion Name:";
			this.lblPComp.Size = new System.Drawing.Size(352, 24);
			this.lblPComp.Location = new System.Drawing.Point(16, 52);
			this.lblPComp.TabIndex = 14;
			this.lblPComp.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			this.lblPComp.BackColor = System.Drawing.Color.Transparent;
			this.lblPComp.Enabled = true;
			this.lblPComp.ForeColor = System.Drawing.SystemColors.ControlText;
			this.lblPComp.Cursor = System.Windows.Forms.Cursors.Default;
			this.lblPComp.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.lblPComp.UseMnemonic = true;
			this.lblPComp.Visible = true;
			this.lblPComp.AutoSize = false;
			this.lblPComp.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this.lblPComp.Name = "lblPComp";
			this.lblSComp.Text = "Promotion Name:";
			this.lblSComp.Size = new System.Drawing.Size(360, 24);
			this.lblSComp.Location = new System.Drawing.Point(16, 192);
			this.lblSComp.TabIndex = 13;
			this.lblSComp.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			this.lblSComp.BackColor = System.Drawing.Color.Transparent;
			this.lblSComp.Enabled = true;
			this.lblSComp.ForeColor = System.Drawing.SystemColors.ControlText;
			this.lblSComp.Cursor = System.Windows.Forms.Cursors.Default;
			this.lblSComp.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.lblSComp.UseMnemonic = true;
			this.lblSComp.Visible = true;
			this.lblSComp.AutoSize = false;
			this.lblSComp.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this.lblSComp.Name = "lblSComp";
			this.lblStockItemS.Text = "Label1";
			this.lblStockItemS.Size = new System.Drawing.Size(286, 17);
			this.lblStockItemS.Location = new System.Drawing.Point(98, 216);
			this.lblStockItemS.TabIndex = 12;
			this.lblStockItemS.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			this.lblStockItemS.BackColor = System.Drawing.SystemColors.Control;
			this.lblStockItemS.Enabled = true;
			this.lblStockItemS.ForeColor = System.Drawing.SystemColors.ControlText;
			this.lblStockItemS.Cursor = System.Windows.Forms.Cursors.Default;
			this.lblStockItemS.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.lblStockItemS.UseMnemonic = true;
			this.lblStockItemS.Visible = true;
			this.lblStockItemS.AutoSize = false;
			this.lblStockItemS.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.lblStockItemS.Name = "lblStockItemS";
			this._LBL_5.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this._LBL_5.Text = "Stock Item Name:";
			this._LBL_5.Size = new System.Drawing.Size(85, 13);
			this._LBL_5.Location = new System.Drawing.Point(10, 184);
			this._LBL_5.TabIndex = 11;
			this._LBL_5.BackColor = System.Drawing.Color.Transparent;
			this._LBL_5.Enabled = true;
			this._LBL_5.ForeColor = System.Drawing.SystemColors.ControlText;
			this._LBL_5.Cursor = System.Windows.Forms.Cursors.Default;
			this._LBL_5.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this._LBL_5.UseMnemonic = true;
			this._LBL_5.Visible = true;
			this._LBL_5.AutoSize = true;
			this._LBL_5.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this._LBL_5.Name = "_LBL_5";
			this._LBL_0.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this._LBL_0.Text = "Price:";
			this._LBL_0.Size = new System.Drawing.Size(27, 13);
			this._LBL_0.Location = new System.Drawing.Point(260, 237);
			this._LBL_0.TabIndex = 10;
			this._LBL_0.Visible = false;
			this._LBL_0.BackColor = System.Drawing.Color.Transparent;
			this._LBL_0.Enabled = true;
			this._LBL_0.ForeColor = System.Drawing.SystemColors.ControlText;
			this._LBL_0.Cursor = System.Windows.Forms.Cursors.Default;
			this._LBL_0.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this._LBL_0.UseMnemonic = true;
			this._LBL_0.AutoSize = true;
			this._LBL_0.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this._LBL_0.Name = "_LBL_0";
			this._LBL_3.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this._LBL_3.Text = "Cost Price (singles) :";
			this._LBL_3.Size = new System.Drawing.Size(95, 13);
			this._LBL_3.Location = new System.Drawing.Point(194, 124);
			this._LBL_3.TabIndex = 7;
			this._LBL_3.BackColor = System.Drawing.Color.Transparent;
			this._LBL_3.Enabled = true;
			this._LBL_3.ForeColor = System.Drawing.SystemColors.ControlText;
			this._LBL_3.Cursor = System.Windows.Forms.Cursors.Default;
			this._LBL_3.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this._LBL_3.UseMnemonic = true;
			this._LBL_3.Visible = true;
			this._LBL_3.AutoSize = true;
			this._LBL_3.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this._LBL_3.Name = "_LBL_3";
			this._LBL_2.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this._LBL_2.Text = "Total Qty:";
			this._LBL_2.Size = new System.Drawing.Size(46, 13);
			this._LBL_2.Location = new System.Drawing.Point(268, 99);
			this._LBL_2.TabIndex = 6;
			this._LBL_2.BackColor = System.Drawing.Color.Transparent;
			this._LBL_2.Enabled = true;
			this._LBL_2.ForeColor = System.Drawing.SystemColors.ControlText;
			this._LBL_2.Cursor = System.Windows.Forms.Cursors.Default;
			this._LBL_2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this._LBL_2.UseMnemonic = true;
			this._LBL_2.Visible = true;
			this._LBL_2.AutoSize = true;
			this._LBL_2.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this._LBL_2.Name = "_LBL_2";
			this._LBL_1.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this._LBL_1.Text = "Stock Item Name:";
			this._LBL_1.Size = new System.Drawing.Size(85, 13);
			this._LBL_1.Location = new System.Drawing.Point(10, 79);
			this._LBL_1.TabIndex = 5;
			this._LBL_1.BackColor = System.Drawing.Color.Transparent;
			this._LBL_1.Enabled = true;
			this._LBL_1.ForeColor = System.Drawing.SystemColors.ControlText;
			this._LBL_1.Cursor = System.Windows.Forms.Cursors.Default;
			this._LBL_1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this._LBL_1.UseMnemonic = true;
			this._LBL_1.Visible = true;
			this._LBL_1.AutoSize = true;
			this._LBL_1.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this._LBL_1.Name = "_LBL_1";
			this.lblStockItem.Text = "Label1";
			this.lblStockItem.Size = new System.Drawing.Size(286, 17);
			this.lblStockItem.Location = new System.Drawing.Point(98, 79);
			this.lblStockItem.TabIndex = 2;
			this.lblStockItem.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			this.lblStockItem.BackColor = System.Drawing.SystemColors.Control;
			this.lblStockItem.Enabled = true;
			this.lblStockItem.ForeColor = System.Drawing.SystemColors.ControlText;
			this.lblStockItem.Cursor = System.Windows.Forms.Cursors.Default;
			this.lblStockItem.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.lblStockItem.UseMnemonic = true;
			this.lblStockItem.Visible = true;
			this.lblStockItem.AutoSize = false;
			this.lblStockItem.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.lblStockItem.Name = "lblStockItem";
			this._Shape1_2.BackColor = System.Drawing.Color.FromArgb(192, 192, 255);
			this._Shape1_2.BackStyle = Microsoft.VisualBasic.PowerPacks.BackStyle.Opaque;
			this._Shape1_2.Size = new System.Drawing.Size(383, 104);
			this._Shape1_2.Location = new System.Drawing.Point(7, 48);
			this._Shape1_2.BorderColor = System.Drawing.SystemColors.WindowText;
			this._Shape1_2.BorderStyle = System.Drawing.Drawing2D.DashStyle.Solid;
			this._Shape1_2.BorderWidth = 1;
			this._Shape1_2.FillColor = System.Drawing.Color.Black;
			this._Shape1_2.FillStyle = Microsoft.VisualBasic.PowerPacks.FillStyle.Transparent;
			this._Shape1_2.Visible = true;
			this._Shape1_2.Name = "_Shape1_2";
			this._Shape1_0.BackColor = System.Drawing.Color.FromArgb(192, 192, 255);
			this._Shape1_0.BackStyle = Microsoft.VisualBasic.PowerPacks.BackStyle.Opaque;
			this._Shape1_0.Size = new System.Drawing.Size(383, 56);
			this._Shape1_0.Location = new System.Drawing.Point(7, 184);
			this._Shape1_0.BorderColor = System.Drawing.SystemColors.WindowText;
			this._Shape1_0.BorderStyle = System.Drawing.Drawing2D.DashStyle.Solid;
			this._Shape1_0.BorderWidth = 1;
			this._Shape1_0.FillColor = System.Drawing.Color.Black;
			this._Shape1_0.FillStyle = Microsoft.VisualBasic.PowerPacks.FillStyle.Transparent;
			this._Shape1_0.Visible = true;
			this._Shape1_0.Name = "_Shape1_0";
			this.Controls.Add(txtQtyT);
			this.Controls.Add(txtPSize);
			this.Controls.Add(txtPack);
			this.Controls.Add(txtPriceS);
			this.Controls.Add(txtQty);
			this.Controls.Add(txtPrice);
			this.Controls.Add(cmbQuantity);
			this.Controls.Add(picButtons);
			this.Controls.Add(_LBL_6);
			this.Controls.Add(_LBL_4);
			this.Controls.Add(Label2);
			this.Controls.Add(lblPComp);
			this.Controls.Add(lblSComp);
			this.Controls.Add(lblStockItemS);
			this.Controls.Add(_LBL_5);
			this.Controls.Add(_LBL_0);
			this.Controls.Add(_LBL_3);
			this.Controls.Add(_LBL_2);
			this.Controls.Add(_LBL_1);
			this.Controls.Add(lblStockItem);
			this.ShapeContainer1.Shapes.Add(_Shape1_2);
			this.ShapeContainer1.Shapes.Add(_Shape1_0);
			this.Controls.Add(ShapeContainer1);
			this.picButtons.Controls.Add(cmdPack);
			this.picButtons.Controls.Add(cmdCancel);
			this.picButtons.Controls.Add(cmdClose);
			//Me.LBL.SetIndex(_LBL_6, CType(6, Short))
			//Me.LBL.SetIndex(_LBL_4, CType(4, Short))
			//Me.LBL.SetIndex(_LBL_5, CType(5, Short))
			//Me.LBL.SetIndex(_LBL_0, CType(0, Short))
			//Me.LBL.SetIndex(_LBL_3, CType(3, Short))
			//Me.LBL.SetIndex(_LBL_2, CType(2, Short))
			//Me.LBL.SetIndex(_LBL_1, CType(1, Short))
			this.Shape1.SetIndex(_Shape1_2, Convert.ToInt16(2));
			this.Shape1.SetIndex(_Shape1_0, Convert.ToInt16(0));
			((System.ComponentModel.ISupportInitialize)this.Shape1).EndInit();
			//CType(Me.LBL, System.ComponentModel.ISupportInitialize).EndInit()
			this.picButtons.ResumeLayout(false);
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
	}
}


text:
#pragma once

#include <react/renderer/components/progressbar/conversions.h>
#include <react/renderer/components/rncore/Props.h>
#include <react/renderer/core/ConcreteComponentDescriptor.h>
#include <react/renderer/core/LayoutConstraints.h>
#include <react/utils/ContextContainer.h>

namespace facebook {
namespace react {

class AndroidProgressBarMeasurementsManager {
 public:
  AndroidProgressBarMeasurementsManager(
      const ContextContainer::Shared &contextContainer)
      : contextContainer_(contextContainer) {}

  Size measure(
      SurfaceId surfaceId,
      AndroidProgressBarProps const &props,
      LayoutConstraints layoutConstraints) const;

 private:
  const ContextContainer::Shared contextContainer_;
  mutable std::mutex mutex_;
  mutable bool hasBeenMeasured_ = false;
  mutable Size cachedMeasurement_{};
};

} // namespace react
} // namespace facebook


text:
<?php

namespace SendGrid\Test;

use SendGrid\Client;

class ClientTest extends \PHPUnit_Framework_TestCase
{
    /** @var MockClient */
    private $client;
    /** @var string */
    private $host;
    /** @var array */
    private $headers;

    protected function setUp()
    {
        $this->host = 'https://localhost:4010';
        $this->headers = [
            'Content-Type: application/json',
            'Authorization: Bearer SG.XXXX'
        ];
        $this->client = new MockClient($this->host, $this->headers, '/v3', null, null);
    }

    public function testConstructor()
    {
        $this->assertAttributeEquals($this->host, 'host', $this->client);
        $this->assertAttributeEquals($this->headers, 'headers', $this->client);
        $this->assertAttributeEquals('/v3', 'version', $this->client);
        $this->assertAttributeEquals([], 'path', $this->client);
        $this->assertAttributeEquals([], 'curlOptions', $this->client);
        $this->assertAttributeEquals(['delete', 'get', 'patch', 'post', 'put'], 'methods', $this->client);
    }

    public function test_()
    {
        $client = new MockClient($this->host, $this->headers, '/v3', null, ['foo' => 'bar']);
        $client = $client->_('test');

        $this->assertAttributeEquals(['test'], 'path', $client);
        $this->assertAttributeEquals(['foo' => 'bar'], 'curlOptions', $client);
    }

    public function test__call()
    {
        $client = $this->client->get();
        $this->assertAttributeEquals('https://localhost:4010/v3/', 'url', $client);

        $queryParams = ['limit' => 100, 'offset' => 0];
        $client = $this->client->get(null, $queryParams);
        $this->assertAttributeEquals('https://localhost:4010/v3/?limit=100&offset=0', 'url', $client);

        $requestBody = ['name' => 'A New Hope'];
        $client = $this->client->get($requestBody);
        $this->assertAttributeEquals($requestBody, 'requestBody', $client);

        $requestHeaders = ['X-Mock: 200'];
        $client = $this->client->get(null, null, $requestHeaders);
        $this->assertAttributeEquals($requestHeaders, 'requestHeaders', $client);

        $client = $this->client->version('/v4');
        $this->assertAttributeEquals('/v4', 'version', $client);

        $client = $this->client->path_to_endpoint();
        $this->assertAttributeEquals(['path_to_endpoint'], 'path', $client);
        $client = $client->one_more_segment();
        $this->assertAttributeEquals(['path_to_endpoint', 'one_more_segment'], 'path', $client);
    }

    public function testGetHost()
    {
        $client = new Client('https://localhost:4010');
        $this->assertSame('https://localhost:4010', $client->getHost());
    }

    public function testGetHeaders()
    {
        $client = new Client('https://localhost:4010', ['Content-Type: application/json', 'Authorization: Bearer SG.XXXX']);
        $this->assertSame(['Content-Type: application/json', 'Authorization: Bearer SG.XXXX'], $client->getHeaders());

        $client2 = new Client('https://localhost:4010', null);
        $this->assertSame([], $client2->getHeaders());
    }

    public function testGetVersion()
    {
        $client = new Client('https://localhost:4010', null, '/v3');
        $this->assertSame('/v3', $client->getVersion());

        $client = new Client('https://localhost:4010', null, null);
        $this->assertSame(null, $client->getVersion());
    }

    public function testGetPath()
    {
        $client = new Client('https://localhost:4010', null, null, ['/foo/bar']);
        $this->assertSame(['/foo/bar'], $client->getPath());

        $client = new Client('https://localhost:4010', null, null, null);
        $this->assertSame([], $client->getPath());
    }

    public function testGetCurlOptions()
    {
        $client = new Client('https://localhost:4010', null, null, null, [CURLOPT_PROXY => '127.0.0.1:8080']);
        $this->assertSame([CURLOPT_PROXY => '127.0.0.1:8080'], $client->getCurlOptions());

        $client = new Client('https://localhost:4010', null, null, null, null);
        $this->assertSame([], $client->getCurlOptions());
    }
}


text:
var QuestionAppView = Backbone.View.extend({
    el: '#question-list',
    events: {},
    initialize: function(options) {
        var collection = this.collection;

        this.route = options.route;
        this.routeResultatTest = options.routeResultatTest;
        this.data = options.data;
        collection.on('add', this.addOne, this);
        collection.on('reset', this.addAll, this);
        collection.on('all', this.render, this);
    },
    addAll: function() {
        //this.$el.empty();
        this.collection.each(this.addOne, this);
    },
    addOne: function(item) {
        var view = new QuestionView({
            model: item,
            page: this.collection.page,
            previousPageQuestion: this.collection.previousPageQuestion,
            route: self.route,
            routeResultatTest: self.routeResultatTest,
            data: self.data
        });

        view.render();
    },
    render: function() {
        return this;
    }
});


text:
package com.sampson.yjj.xianba.todayhistory;

import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.sampson.yjj.xianba.R;
import com.sampson.yjj.xianba.adapter.HistoryListAdapter;
import com.sampson.yjj.xianba.base.BaseActivity;
import com.sampson.yjj.xianba.bean.HistoryDayBean;
import com.sampson.yjj.xianba.common.UrlContents;
import com.sampson.yjj.xianba.utils.HandleJokeToBean;
import com.sampson.yjj.xianba.utils.OkHttpUtil;

import java.io.IOException;
import java.util.List;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;

public class SearchHistoryDayActivity extends BaseActivity implements View.OnClickListener{
    @Override
    public void onClick(View v) {
        switch (v.getId())
        {
            case R.id.history_back_img:
                finish();
                break;
            case R.id.history_search:
                getHistoryDayData(Integer.parseInt(history_month.getText().toString())
                        ,Integer.parseInt(history_day.getText().toString()));
                break;
        }
    }

    private ListView history_search_listview;
    private EditText history_month;
    private EditText history_day;
    private ImageView history_back_img;
    private TextView history_search;
    List<HistoryDayBean> mHistoryDayList;
    @Override
    public int getContentViewId() {
        return R.layout.activity_search_history_day;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
        init();
    }
    private void init(){
        history_back_img.setOnClickListener(this);
        history_search.setOnClickListener(this);
    }
    private void initView(){
        history_month = (EditText) findViewById(R.id.history_month);
        history_day = (EditText) findViewById(R.id.history_day);
        history_back_img = (ImageView) findViewById(R.id.history_back_img);
        history_search = (TextView) findViewById(R.id.history_search);
        history_search_listview = (ListView) findViewById(R.id.history_search_listview);
    }
    /**
     * 获取莫一天的历史上
     */
    private void getHistoryDayData(int yue,int day){
        OkHttpUtil.sendOkHttpRequest(UrlContents.HISTORY_TODAY +
                "&yue=" + yue + "&ri=" + day + "&type=1", new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {

            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {
                String responseText = response.body().string();
                mHistoryDayList = HandleJokeToBean.json2TOList(responseText,HistoryDayBean.class);
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        initAdapter(mHistoryDayList,SearchHistoryDayActivity.this);
                    }
                });
            }
        });
    }
    /**
     * initAdapter
     */
    private void initAdapter(List<HistoryDayBean> mlist, Context context){
        HistoryListAdapter mAdapter = new HistoryListAdapter(mlist,context);
        history_search_listview.setAdapter(mAdapter);
        mAdapter.notifyDataSetChanged();
    }
}


text:
@implementation Unknown (Blarg) // expected-error{{cannot find interface declaration for 'Unknown'}}
- (int)method { return ivar; } // expected-error{{use of undeclared identifier 'ivar'}}
@end


text:
import a.A;

@A.<error descr="'a.A.Test' has protected access in 'a.A'">Test</error> ()
class B extends A {}

@A.<error descr="'a.A.Test' has protected access in 'a.A'">Test</error> ()
class C {}


text:
#include "Platform.h"

#include <stdio.h>
#include <stdlib.h>

#include "str.h"
#include "Statistics.h"

//----------------------------------------------------------------------
// SortStatistics Constructor.
//----------------------------------------------------------------------

SortStatistics::SortStatistics()
{
   memSizeB_        = 0L;
   numRecs_         = 0L;
   recLen_          = 0L;
   runSize_         = 0L;         //number of nodes in the tournament tree
   numRuns_         = 0L;

   numInitRuns_     = 0L;
   firstMergeOrder_ = 0L;
   finalMergeOrder_ = 0L;
   mergeOrder_      = 0L;
   numInterPasses_  = 0L;

   numCompares_     = 0L;
   numDupRecs_      = 0L;
   beginSortTime_ = 0;
   elapsedTime_ = 0;
   ioWaitTime_ = 0;
   scrBlockSize_    = 0L;
   scrNumBlocks_    = 0L;
   scrNumWrites_    = 0L;
   scrNumReads_     = 0L;
   scrNumAwaitio_   = 0L;
}

//----------------------------------------------------------------------
// SortStatistics Desstructor.
//----------------------------------------------------------------------

SortStatistics::~SortStatistics() {}

//----------------------------------------------------------------------
// SortStatistics Retrieval Functions.
//----------------------------------------------------------------------

Lng32 SortStatistics::getStatRunSize() const
{
   return runSize_;
}
Lng32 SortStatistics::getStatNumRuns() const
{
   return numRuns_;
}

Lng32 SortStatistics::getStatMemSizeB() const
{
  return memSizeB_;
}

Int64 SortStatistics::getStatNumRecs() const
{
  return numRecs_;
}

Lng32 SortStatistics::getStatRecLen() const
{
  return recLen_;
}

Lng32 SortStatistics::getStatNumInitRuns() const
{
   return numInitRuns_;
}

Lng32 SortStatistics::getStatFirstMergeOrder() const
{
  return firstMergeOrder_;
}

Lng32 SortStatistics::getStatFinalMergeOrder() const
{
  return finalMergeOrder_;
}

Lng32 SortStatistics::getStatMergeOrder() const
{
  return mergeOrder_;
}

Lng32 SortStatistics::getStatNumInterPasses() const
{
  return numInterPasses_;
}

Lng32 SortStatistics::getStatNumCompares() const
{
  return numCompares_;
}

Lng32 SortStatistics::getStatNumDupRecs() const
{
  return numDupRecs_;
}

Int64 SortStatistics::getStatBeginSortTime() const
{
 return beginSortTime_;
}

Int64 SortStatistics::getStatElapsedTime() const
{
 return elapsedTime_;
}

Int64 SortStatistics::getStatIoWaitTime() const
{
  return ioWaitTime_;
}

Lng32 SortStatistics::getStatScrBlockSize() const
{
  return scrBlockSize_;
}

Lng32 SortStatistics::getStatScrNumBlocks() const
{
  return scrNumBlocks_;
}

Lng32 SortStatistics::getStatScrNumWrites() const
{
  return scrNumWrites_;
}

Lng32 SortStatistics::getStatScrNumReads() const
{
  return scrNumReads_;
}

Lng32 SortStatistics::getStatScrAwaitIo() const
{
  return scrNumAwaitio_;
}


text:
package com.intellij.ide.todo;

import com.intellij.icons.AllIcons;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.todo.configurable.TodoConfigurable;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.ex.CustomComponentAction;
import com.intellij.openapi.actionSystem.impl.ActionButton;
import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.util.Consumer;

import javax.swing.*;

/**
* @author irengrig
*         Date: 2/24/11
*         Time: 3:38 PM
 *         moved from inner class
*/
public class SetTodoFilterAction extends AnAction implements CustomComponentAction {
  private final Project myProject;
  private final TodoPanelSettings myToDoSettings;
  private final Consumer<TodoFilter> myTodoFilterConsumer;

  public SetTodoFilterAction(final Project project, final TodoPanelSettings toDoSettings, final Consumer<TodoFilter> todoFilterConsumer) {
    super(IdeBundle.message("action.filter.todo.items"), null, AllIcons.General.Filter);
    myProject = project;
    myToDoSettings = toDoSettings;
    myTodoFilterConsumer = todoFilterConsumer;
  }

  @Override
  public void actionPerformed(AnActionEvent e) {
    Presentation presentation = e.getPresentation();
    JComponent button = (JComponent)presentation.getClientProperty("button");
    DefaultActionGroup group = createPopupActionGroup(myProject, myToDoSettings, myTodoFilterConsumer);
    ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.TODO_VIEW_TOOLBAR,
                                                                                group);
    popupMenu.getComponent().show(button, button.getWidth(), 0);
  }

  @Override
  public JComponent createCustomComponent(Presentation presentation) {
    ActionButton button = new ActionButton(
      this,
      presentation,
      ActionPlaces.TODO_VIEW_TOOLBAR,
      ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE
    );
    presentation.putClientProperty("button", button);
    return button;
  }

  public static DefaultActionGroup createPopupActionGroup(final Project project,
                                                          final TodoPanelSettings settings,
                                                          Consumer<TodoFilter> todoFilterConsumer) {
    TodoFilter[] filters = TodoConfiguration.getInstance().getTodoFilters();
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(new TodoFilterApplier(IdeBundle.message("action.todo.show.all"),
                                    IdeBundle.message("action.description.todo.show.all"), null, settings, todoFilterConsumer));
    for (TodoFilter filter : filters) {
      group.add(new TodoFilterApplier(filter.getName(), null, filter, settings, todoFilterConsumer));
    }
    group.addSeparator();
    group.add(
      new AnAction(IdeBundle.message("action.todo.edit.filters"),
                   IdeBundle.message("action.todo.edit.filters"), AllIcons.General.Settings) {
        @Override
        public void actionPerformed(AnActionEvent e) {
          final ShowSettingsUtil util = ShowSettingsUtil.getInstance();
          util.editConfigurable(project, new TodoConfigurable());
        }
      }
    );
    return group;
  }

  private static class TodoFilterApplier extends ToggleAction {
    private final TodoFilter myFilter;
    private final TodoPanelSettings mySettings;
    private final Consumer<TodoFilter> myTodoFilterConsumer;

    /**
     * @param text        action's text.
     * @param description action's description.
     * @param filter      filter to be applied. {@code null} value means "empty" filter.
     * @param settings
     * @param todoFilterConsumer
     */
    TodoFilterApplier(String text,
                      String description,
                      TodoFilter filter,
                      TodoPanelSettings settings,
                      Consumer<TodoFilter> todoFilterConsumer) {
      super(null, description, null);
      mySettings = settings;
      myTodoFilterConsumer = todoFilterConsumer;
      getTemplatePresentation().setText(text, false);
      myFilter = filter;
    }

    @Override
    public void update(AnActionEvent e) {
      super.update(e);
      if (myFilter != null) {
        e.getPresentation().setEnabled(!myFilter.isEmpty());
      }
    }

    @Override
    public boolean isSelected(AnActionEvent e) {
      return Comparing.equal(myFilter != null ? myFilter.getName() : null, mySettings.todoFilterName);
    }

    @Override
    public void setSelected(AnActionEvent e, boolean state) {
      if (state) {
        myTodoFilterConsumer.consume(myFilter);
        //setTodoFilter(myFilter);
      }
    }
  }
}


text:
layout: post
title: My fall semester, in name tags
date: '2013-12-11T09:50:30-05:00'
tags: [conferences]
redirect_from: /post/69691390430/my-fall-semester-in-name-tags-at-ihlseng/
---


text:
<?php

class ExampleTest extends TestCase
{
    /**
     * A basic test example.
     *
     * @return void
     */
    public function testExample()
    {
        $this->get('/');

        $this->assertEquals(
            $this->app->version(), $this->response->getContent()
        );
    }
}