text:
[![npm](https://img.shields.io/npm/v/react-native-multiple-select.svg)](https://www.npmjs.com/package/react-native-multiple-select) [![Downloads](https://img.shields.io/npm/dt/react-native-multiple-select.svg)](https://www.npmjs.com/package/react-native-multiple-select) [![Licence](https://img.shields.io/npm/l/react-native-multiple-select.svg)](https://www.npmjs.com/package/react-native-multiple-select)

> Simple select and multi-select component for react-native (Select2 for react-native).

![multiple](https://user-images.githubusercontent.com/16062709/30819847-0907dd1e-a218-11e7-9980-e70b2d8e7953.gif)  ![single](https://user-images.githubusercontent.com/16062709/30819849-095d6144-a218-11e7-85b9-4e2b96f9ead9.gif)

## Installation

``` bash
$ npm install react-native-quick-select --save
```
or use yarn

``` bash
$ yarn add react-native-quick-select
```

## Usage
Note: Ensure to add and configure [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons) to your project before using this package.

You can clone and try out the [sample](https://github.com/toystars/RN-multiple-select-sample) app.

The snippet below shows how the component can be used

```javascript
// import component
import React, { Component } from 'react';
import { View } from 'react-native';
import MultiSelect from 'react-native-multiple-select';

let

class MultiSelectExample extends Component {

  this.state = {
    selectedItems = [];
  };

  this.items = [{
    id: '92iijs7yta',
    name: 'Ondo',
  }, {
    id: 'a0s0a8ssbsd',
    name: 'Ogun',
  }, {
    id: '16hbajsabsd',
    name: 'Calabar',
  }, {
    id: 'nahs75a5sg',
    name: 'Lagos',
  }, {
    id: '667atsas',
    name: 'Maiduguri',
  }, {
    id: 'hsyasajs',
    name: 'Anambra',
  }, {
    id: 'djsjudksjd',
    name: 'Benue',
  }, {
    id: 'sdhyaysdj',
    name: 'Kaduna',
  }, {
    id: 'suudydjsjd',
    name: 'Abuja',
  }];

  onSelectedItemsChange = selectedItems => {
    this.setState({ selectedItems });
  };

  render() {
    <View style={{ flex: 1 }}>
      <MultiSelect
        items={items}
        uniqueKey="id"
        onSelectedItemsChange={this.onSelectedItemsChange}
        selectedItems={this.state.selectedItems}
        selectText="Pick Items"
        searchInputPlaceholderText="Search Items..."
        altFontFamily="ProximaNova-Light"
        tagRemoveIconColor="#CCC"
        tagBorderColor="#CCC"
        tagTextColor="#CCC"
        selectedItemTextColor="#CCC"
        selectedItemIconColor="#CCC"
        itemTextColor="#000"
        searchInputStyle={{ color: '#CCC' }}
        submitButtonColor="#CCC"
        submitButtonText="Submit"
      />
    </View>
  }
}

```

The component takes 3 compulsory props - `items`, `uniqueKey` and `selectedItemsChange`. Other props are optional. The table below explains more.

## Props

| Prop        | Required   | Purpose  |
| ------------- |-------------| -----|
| items      | Yes | (Array, control prop) List of items to display in the multi-select component. JavaScript Array of objects. Each object must contain a name and unique identifier (Check sample above) |
|selectedItems | No      | (Array, control prop) List of selected items keys . JavaScript Array of strings, that can be instantiated with the component |
| uniqueKey      | Yes      | (String) Unique identifier that is part of each item's properties. Used internally as means of identifying each item (Check sample below) |
| textColor | No     | (String) Color for selected item name displayed as label for multiselect  |
| fontSize | No     | (Number) Font size for selected item name displayed as label for multiselect |
| fixedHeight | No     | (Boolean) Defaults to false. Specifies if select dropdown take height of content or a fixed height with a scrollBar (There is an issue with this behavior when component is nested in a ScrollView in which scroll event will only be dispatched to parent ScrollView and select component won't be scrollable). See [this issue](https://github.com/toystars/react-native-multiple-select/issues/12) for more info. |
| single | No     | (Boolean) Toggles select component between single option and multi option |
| onSelectedItemsChange | Yes      | (Function) JavaScript function passed in as an argument. The function is to be defined with an argument (selectedItems). Triggered when `Submit` button is clicked (for multi select) or item is clicked (for single select). (Check sample above) |
| selectText | No     | (String) Text displayed in main component |
| searchInputPlaceholderText | No      | (String) Placeholder text displayed in multi-select filter input |
| fontFamily | No     | (String) Custom font family to be used in component (affects all text except `searchInputPlaceholderText` described above) |
| altFontFamily | No      | (String) Font family for `searchInputPlaceholderText` |
| tagRemoveIconColor | No      | (String) Color to be used for the remove icon in selected items list |
| tagBorderColor | No      | (String) Border color for each selected item  |
| tagTextColor | No  | (String) Text color for selected items list |
| selectedItemFontFamily | No   | (String) Font family for each selected item in multi-select drop-down |
| selectedItemTextColor | No   | (String) Text color for each selected item in multi-select drop-down |
| selectedItemIconColor | No     | (String) Color for `selected` check icon for each selected item in multi-select drop-down |
| itemFontFamily | No   | (String) Font family for each non-selected item in multi-select drop-down |
| itemTextColor | No   | (String) Text color for each non-selected item in multi-select drop-down |
| searchInputStyle | No   | (Object) Style object for multi-select input element  |
| hideSubmitButton | No | (Boolean) Defaults to false. Hide submit button from dropdown, and rather use arrow-button in search field"
| submitButtonColor | No   | (String) Background color for submit button  |
| submitButtonText | No   | (String) Text displayed on submit button  |

## Note

- When using the `single` prop, `selectedItems` should still be passed in as an array of selected items keys. Also, when an item is selected in the single mode, the selected item is returned as an array of string.

- The `items` props must be passed as an array of objects with a compulsory `name` key present in each object as the name key is used to display the items in the options component.

### Removing all selected items

To use, add ref to MultiSelect component in parent component, then call method against reference. i.e.

```javascript
<MultiSelect
  ref={c => this._multiSelect = c}
  ...
/>

clearSelectedCategories = () => {
   this._multiSelect.removeAllItems();
};

```

## Contributing

Contributions are **welcome** and will be fully **credited**.

Contributions are accepted via Pull Requests on [Github](https://github.com/toystars/react-native-multiple-select).

### Pull Requests

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.

- **Create feature branches** - Don't ask us to pull from your master branch.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.

## Issues

Check issues for current issues.

## Author

[Oscar Alvarez](https://www.presik.com/)

## License

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.


text:
extern "Java"
{
  namespace org
  {
    namespace xml
    {
      namespace sax
      {
          class AttributeList;
        namespace helpers
        {
            class ParserAdapter;
            class ParserAdapter$AttributeListAdapter;
        }
      }
    }
  }
}

class org::xml::sax::helpers::ParserAdapter$AttributeListAdapter : public ::java::lang::Object
{

public: // actually package-private
  ParserAdapter$AttributeListAdapter(::org::xml::sax::helpers::ParserAdapter *);
  void setAttributeList(::org::xml::sax::AttributeList *);
public:
  jint getLength();
  ::java::lang::String * getURI(jint);
  ::java::lang::String * getLocalName(jint);
  ::java::lang::String * getQName(jint);
  ::java::lang::String * getType(jint);
  ::java::lang::String * getValue(jint);
  jint getIndex(::java::lang::String *, ::java::lang::String *);
  jint getIndex(::java::lang::String *);
  ::java::lang::String * getType(::java::lang::String *, ::java::lang::String *);
  ::java::lang::String * getType(::java::lang::String *);
  ::java::lang::String * getValue(::java::lang::String *, ::java::lang::String *);
  ::java::lang::String * getValue(::java::lang::String *);
private:
  ::org::xml::sax::AttributeList * __attribute__((aligned(__alignof__( ::java::lang::Object)))) qAtts;
public: // actually package-private
  ::org::xml::sax::helpers::ParserAdapter * this$0;
public:
  static ::java::lang::Class class$;
};

#endif // __org_xml_sax_helpers_ParserAdapter$AttributeListAdapter__

redpajama_set_name: RedPajamaGithub


text:
package org.elasticsearch.xpack.core.ml.dataframe.analyses;

import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractSerializingTestCase;

import java.io.IOException;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;

public class RegressionTests extends AbstractSerializingTestCase<Regression> {

    @Override
    protected Regression doParseInstance(XContentParser parser) throws IOException {
        return Regression.fromXContent(parser, false);
    }

    @Override
    protected Regression createTestInstance() {
        return createRandom();
    }

    public static Regression createRandom() {
        String dependentVariableName = randomAlphaOfLength(10);
        BoostedTreeParams boostedTreeParams = BoostedTreeParamsTests.createRandom();
        String predictionFieldName = randomBoolean() ? null : randomAlphaOfLength(10);
        Double trainingPercent = randomBoolean() ? null : randomDoubleBetween(1.0, 100.0, true);
        return new Regression(dependentVariableName, boostedTreeParams, predictionFieldName, trainingPercent);
    }

    @Override
    protected Writeable.Reader<Regression> instanceReader() {
        return Regression::new;
    }

    public void testConstructor_GivenTrainingPercentIsNull() {
        Regression regression = new Regression("foo", new BoostedTreeParams(0.0, 0.0, 0.5, 500, 1.0), "result", null);
        assertThat(regression.getTrainingPercent(), equalTo(100.0));
    }

    public void testConstructor_GivenTrainingPercentIsBoundary() {
        Regression regression = new Regression("foo", new BoostedTreeParams(0.0, 0.0, 0.5, 500, 1.0), "result", 1.0);
        assertThat(regression.getTrainingPercent(), equalTo(1.0));
        regression = new Regression("foo", new BoostedTreeParams(0.0, 0.0, 0.5, 500, 1.0), "result", 100.0);
        assertThat(regression.getTrainingPercent(), equalTo(100.0));
    }

    public void testConstructor_GivenTrainingPercentIsLessThanOne() {
        ElasticsearchStatusException e = expectThrows(ElasticsearchStatusException.class,
            () -> new Regression("foo", new BoostedTreeParams(0.0, 0.0, 0.5, 500, 1.0), "result", 0.999));

        assertThat(e.getMessage(), equalTo("[training_percent] must be a double in [1, 100]"));
    }

    public void testConstructor_GivenTrainingPercentIsGreaterThan100() {
        ElasticsearchStatusException e = expectThrows(ElasticsearchStatusException.class,
            () -> new Regression("foo", new BoostedTreeParams(0.0, 0.0, 0.5, 500, 1.0), "result", 100.0001));

        assertThat(e.getMessage(), equalTo("[training_percent] must be a double in [1, 100]"));
    }

    public void testFieldCardinalityLimitsIsNonNull() {
        assertThat(createTestInstance().getFieldCardinalityLimits(), is(not(nullValue())));
    }

    public void testGetStateDocId() {
        Regression regression = createRandom();
        assertThat(regression.persistsState(), is(true));
        String randomId = randomAlphaOfLength(10);
        assertThat(regression.getStateDocId(randomId), equalTo(randomId + "_regression_state#1"));
    }
}


text:
https://www.visualstudio.com/en-us/features/cordova-vs.aspx
![Cordova comment](http://i.imgur.com/rfPEDIq.png)
![Cordova Tools installation](http://i.imgur.com/Zg7t52q.png)

###Install NodeJS Tools for Visual Studio
https://nodejstools.codeplex.com/
![Instruction1](http://i.imgur.com/j6cbceG.png)

###Create new project
![Instruction2](http://i.imgur.com/04BYe79.png)

###Install npm packages
![Instruction3](http://i.imgur.com/gKst68A.png)

###Build project
(This compile TypeScript files before inject task)

###Run initialize task
![Instruction4](http://i.imgur.com/EW5oK51.png)

### ~~Include 'lib' folders to the project // In future versions we will make this automatically~~

###Enjoy
![Instruction](http://i.imgur.com/DAG1g0x.png)


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

<title>IFailerObserver (FailFast v.1.3)</title>
<meta name="date" content="2015-08-31">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

starkcoder.failfast.fails

Interface IFailerObserver

public interface IFailerObserver

This is a specification for instances that would like to be notified when an exception is about
 to be thrown.

 The notifications can be used for communication purposes e.g. logging.

Author:

Keld Oelykke

Method Summary

Methods

Modifier and Type
Method and Description

void
notifyExceptionBeforeThrow(IFailer failer,
                          ICallContract contract,
                          RuntimeException runtimeException)

Notifies an exception about to be thrown due to the specified engaged call contract.

Method Detail

notifyExceptionBeforeThrow

void notifyExceptionBeforeThrow(IFailer failer,
                              ICallContract contract,
                              RuntimeException runtimeException)

Notifies an exception about to be thrown due to the specified engaged call contract.

Parameters:

failer - instance about to throw an exception

contract - engaged contract between checker and failer

runtimeException - exception about to be thrown

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

The MIT License (MIT) - Copyright © 2014-2015 Keld Oelykke. All Rights Reserved.


text:
package com.welovecoding.nbeditorconfig.model;

import com.welovecoding.nbeditorconfig.io.model.MappedCharset;
import java.text.MessageFormat;

public class MappedEditorConfig {

  // 1. charset
  private MappedCharset charset;
  // 2. end_of_line
  private String endOfLine;
  // 3. indent_size
  private int indentSize = -1;
  // 4. indent_style
  private String indentStyle;
  // 5. insert_final_newline
  private boolean insertFinalNewLine = false;
  // 6. tab_width
  private int tabWidth = -1;
  // 7. trim_trailing_whitespace
  private boolean trimTrailingWhiteSpace = false;

  public MappedEditorConfig() {
  }

  public String getReadableEndOfLine() {
    String lineEnding = "CRLF";

    if (endOfLine != null) {
      switch (endOfLine) {
        case "\r":
          lineEnding = "CR";
          break;
        case "\n":
          lineEnding = "LF";
          break;
      }
    } else {
      lineEnding = null;
    }

    return lineEnding;
  }

  @Override
  public String toString() {
    String template
            = "1. charset: {0}"
            + System.lineSeparator()
            + "2. end_of_line: {1}"
            + System.lineSeparator()
            + "3. indent_size: {2}"
            + System.lineSeparator()
            + "4. indent_style: {3}"
            + System.lineSeparator()
            + "5. insert_final_newline: {4}"
            + System.lineSeparator()
            + "6. tab_width: {5}"
            + System.lineSeparator()
            + "7. trim_trailing_whitespace: {6}"
            + System.lineSeparator();

    String charsetName = null;
    if (charset != null) {
      charsetName = charset.getName();
    }

    Object[] values = new Object[]{
      charsetName,
      getReadableEndOfLine(),
      indentSize,
      indentStyle,
      insertFinalNewLine,
      tabWidth,
      trimTrailingWhiteSpace
    };

    return MessageFormat.format(template, values);
  }

  // <editor-fold defaultstate="collapsed" desc="Getter & Setter">
  public MappedCharset getCharset() {
    return charset;
  }

  public void setCharset(MappedCharset charset) {
    this.charset = charset;
  }

  public String getEndOfLine() {
    return endOfLine;
  }

  public void setEndOfLine(String endOfLine) {
    this.endOfLine = endOfLine;
  }

  public int getIndentSize() {
    return indentSize;
  }

  public void setIndentSize(int indentSize) {
    this.indentSize = indentSize;
  }

  public String getIndentStyle() {
    return indentStyle;
  }

  public void setIndentStyle(String indentStyle) {
    this.indentStyle = indentStyle;
  }

  public boolean isInsertFinalNewLine() {
    return insertFinalNewLine;
  }

  public void setInsertFinalNewLine(boolean insertFinalNewLine) {
    this.insertFinalNewLine = insertFinalNewLine;
  }

  public int getTabWidth() {
    return tabWidth;
  }

  public void setTabWidth(int tabWidth) {
    this.tabWidth = tabWidth;
  }

  public boolean isTrimTrailingWhiteSpace() {
    return trimTrailingWhiteSpace;
  }

  public void setTrimTrailingWhiteSpace(boolean trimTrailingWhiteSpace) {
    this.trimTrailingWhiteSpace = trimTrailingWhiteSpace;
  }
// </editor-fold>
}


text:
import logging

from dart.model.action import ActionType

_logger = logging.getLogger(__name__)

class S3ActionTypes(object):
    copy = ActionType(
        name='copy',
        description='Accomplishes s3 source to s3 destination copy, giving the destination bucket owner full control',
        params_json_schema={
            'type': 'object',
            'properties': {
                'from_path': {'type': 'string', 'pattern': '^s3://.+$', 'description': 'The source s3 file path'},
                'to_path': {'type': 'string', 'pattern': '^s3://.+$', 'description': 'The destination s3 file path'},
                'recursive': {'type': ['boolean', 'null'], 'default': True, 'description': 'Performs recursive copy of source to destination'},
                'additionalProperties': False,
                'required': ['from_path', 'to_path']
            }
        }
    )

    data_check = ActionType(
        name='data_check',
        description='A data check that passes if an s3 key/file exists that matches the specified requirements',
        params_json_schema={
            'type': 'object',
            'properties': {
                's3_path_prefix': {
                    'type': ['string', 'null'],
                    'pattern': '^s3://.+$',
                    'description': 'The s3 path prefix where at least one s3 key/file should exist, e.g. '
                                   's3://bucket/prefix. The following values (with braces) will be substituted with '
                                   'the appropriate zero-padded values at runtime: {YEAR}, {MONTH}, {DAY}, {HOUR}, '
                                   '{MINUTE}, {SECOND}'
                },
                's3_path_regex': {
                    'type': ['string', 'null'],
                    'default': None,
                    'description': 'A regex pattern the s3 path must match. The following values (with braces) will '
                                   'be substituted with the appropriate zero-padded values at runtime: {YEAR}, {MONTH},'
                                   ' {DAY}, {HOUR}, {MINUTE}, {SECOND}'
                },
                'min_file_size_in_bytes': {
                    'type': ['integer', 'null'],
                    'default': 0,
                    'minimum': 0,
                    'description': 'If specified, at least one file matching the provided regex must be at least this size',
                },
                'date_offset_in_seconds': {
                    'type': ['integer', 'null'],
                    'default': 0,
                    'description': 'If specified, the date used in s3 path substitutions will be adjusted by this amount',
                },
                's3_file_last_modified': {
                    'type': ['boolean', 'null'],
                    'default': False,
                    'description': 'If specified, the data check factors last modified date into the data check',
                },
            },
            'additionalProperties': False,
        },
    )


text:
package org.gradle.normalization.internal;

import com.google.common.collect.ImmutableSet;
import org.gradle.api.GradleException;
import org.gradle.api.internal.changedetection.state.IgnoringResourceFilter;
import org.gradle.api.internal.changedetection.state.ResourceFilter;

public class DefaultRuntimeClasspathNormalization implements RuntimeClasspathNormalizationInternal {
    private final ImmutableSet.Builder<String> ignoresBuilder = ImmutableSet.builder();
    private ResourceFilter resourceFilter;

    @Override
    public void ignore(String pattern) {
        if (resourceFilter != null) {
            throw new GradleException("Cannot configure runtime classpath normalization after execution started.");
        }
        ignoresBuilder.add(pattern);
    }

    @Override
    public ResourceFilter getResourceFilter() {
        if (resourceFilter == null) {
            ImmutableSet<String> ignores = ignoresBuilder.build();
            resourceFilter = ignores.isEmpty() ? ResourceFilter.FILTER_NOTHING : new IgnoringResourceFilter(ignores);
        }
        return resourceFilter;
    }
}


text:
import sys
import sublime

#VERSION = int(sublime.version())

mod_prefix = "classes_and_tests"
reload_mods = []

"""
if VERSION > 3000:
    mod_prefix = "PersistentRegexHighlight." + mod_prefix
    from imp import reload
    for mod in sys.modules:
        if mod[0:24] == 'PersistentRegexHighlight' and sys.modules[mod] is not None:
            reload_mods.append(mod)
else:"""

for mod in sorted(sys.modules):
    testString = 'classes_and_tests'
    if mod[0:len(testString)] == testString and sys.modules[mod] is not None:
        reload_mods.append(mod)

mods_load_order = [
    '.src.Std',
    '.src.UnitTestFunctions',
    '.src.SublimeFunctions',
    '.src.SublimeWindowFunctions',
    '.src.SublimeWindowManipulator'
    '.src.UserSettings',
    '.src.FileComponents',
    '.src.MirroredDirectory',
    '.src.Command',
    #'.src.FileManipulation',
    '.src.FileSystem',
    #'.src.FileCreator',
    '.src.TemplateFileCreator',
    '.src.CommandExecutionThread',
    '.src.MultipleCommandExecutionThread',
    '.src.InputPanel',
    '.src.OutputPanel',
    '.src.LiveUnitTesting',
    '.TextInsert',
    '.ToggleSourcesTests',
    '.RunUnitTests',
    '.CreateMissingFunctions',
    '.ContinuousUnitTesting',
    '.ClassesAndTests'
    '.SyncronizeClassAndTestTabs',
    '.OutputPanelInsert',
    '.OutputPanelClear'
    '.DocumentationFromUnitTests'
]

for suffix in mods_load_order:
    mod = mod_prefix + suffix
    if mod in reload_mods:
        reload(sys.modules[mod])


text:
Some text in this document has been taken, either in part or in full, from various other documents, including PureScript's [documentation repository](https://github.com/purescript/documentation), PureScript's [official website](http://www.purescript.org/), and [Pursuit](https://pursuit.purescript.org/).

This document is not meant to replace any of the above resources. It's simply meant to be a helpful doc for beginners to quickly reference PureScript syntax & features. Please, see the [LICENSE](https://github.com/joshburgess/purescript-cheat-sheet/blob/master/LICENSE) and give credit where it's due if you choose to fork, modify, etc. in any way.

## Table of Contents

* [Language Summary](#language-summary)
* [Benefits](#benefits)
* [Getting Started](#getting-started)
* [Hello World](#hello-world)
    * [Getting Started](#getting-started)
    * [Simple Logging Example](#simple-logging-example)
    * [Example Using Smolder](#example-using-smolder)
    * [Simple Module Example](#simple-module-example)
* [Comments](#comments)
* [Operators](#operators)
    * [Infix Notation](#infix-notation)
    * [Prefix Notation](#prefix-notation)
    * [Prelude Infix Operators](#prelude-infix-operators)
* [Modules](#modules)
    * [Defining Modules](#defining-modules)
    * [Importing Modules](#importing-modules)
* [Links](#links)

## Language Summary

 * A strongly-typed, pure functional programming language that compiles to JavaScript
 * Features Hindley-Milner type annotations & top-level type inference
 * Compiles to easy to read, easy to understand JavaScript code
 * Very similar to Haskell in many ways, but strictly evaluated
 * Similar to Elm, but offers more advanced type features, like type classes & higher-kinded polymorphism, and can be used for both UI & server-side programming

## Benefits

* Compile to readable JavaScript and reuse existing JavaScript code easily
* An extensive collection of libraries for development of web applications, web servers, apps and more
* Excellent tooling and editor support with instant rebuilds
* An active community with many learning resources
* Build real-world applications using functional techniques and expressive types, such as:
    * Algebraic data types and pattern matching
    * Row polymorphism and extensible records
    * Higher kinded types
    * Type classes with functional dependencies
    * Higher-rank polymorphism

## Getting Started

1. `npm i -g purescript pulp bower` to install PureScript, Pulp, & Bower
2. `mkdir purescript-app` to create a directory for your PureScript app
3. `cd purescript-app` to move into the new directory
4. `pulp init` will generate a boilerplate PureScript project for you to modify as you see fit
5. `pulp run` will build and run the project, logging out `Hello Sailor!` in your terminal

## Hello World

### Simple Logging Example

```purescript
module Main where

import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)

main :: forall e. Eff (console :: CONSOLE | e) Unit
main = do
  log "Hello, world!"
```

### Example Using Smolder

```purescript
module Main where

import Prelude

import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Text.Smolder.HTML (html, h1)
import Text.Smolder.HTML.Attributes (lang)
import Text.Smolder.Markup (Markup, text, (!))
import Text.Smolder.Renderer.String (render)

doc :: forall e. Markup e
doc = html ! lang "en" $ do
  h1 $ text "Hello, world!"

main :: forall eff. Eff (console :: CONSOLE | eff ) Unit
main = log $ render doc
```

### Simple Module Example

```purescript
module HelloWorld where

import Prelude
import Data.Maybe (Maybe(Just, Nothing))

helloWorld :: Maybe String -> String
helloWorld Nothing = "Hello, world!"
helloWorld (Just x) = "Hello, " <> x <> "!"
```

## Comments

A single line comment starts with `--`:

``` purescript
-- This is a comment
```

Multi-line comments are enclosed in `{-` and `-}`:

``` purescript
{-
  Comment
  continued comment
-}
```

Comments that start with a pipe character, `|`, are considered documentation, and will appear in the output of tools like `psc-docs` and Pursuit. For example:

``` purescript
-- | `bool` performs case analysis for the `Boolean` data type, like an `if` statement.
bool :: forall a. Boolean -> a -> a -> a
bool true x _ = x
bool false _ x = x
```

Note that, unlike Haskell, every line which should be considered documentation must start with a pipe. This allows you to do things like:

``` purescript
-- | Sort an array based on its `Ord` instance.
-- |
-- | This implementation runs in `O(n^2)` time, where `n` is the length of the
-- | input array.
-- TODO: try to optimise this?
sort :: forall a. (Ord a) => Array a -> Array a
sort xs = [...]
```

## Operators

### Infix Notation

Functions in PureScript can alternatively be used with infix notation by wrapping them in backticks. For example,

```purescript
import Prelude
import Data.List (List, range)

ns :: List Int
ns = range 0 999
```

can also be written like this:

```purescript
import Prelude
import Data.List (List, range)

ns :: List Int
ns = 0 `range` 999
```

However, many functions have infix operators defined for convenience. For example, `range` has the `..` operator. The following is equivalent to the above example:

```purescript
import Prelude
import Data.List (List, (..))

ns :: List Int
ns = 0 .. 999
```

You can also define your own custom infix operators. For example, you might define `<$?>` as a custom infix operator for `filter`:

```purescript
import Prelude
import Data.List (List, (..), filter)

infixl 4 filter as <$?>

ns :: List Int
ns = 0 .. 999

multiples :: List Int
multiples = (\n -> mod n 3 == 0 || mod n 5 == 0) <$?> ns
```

### Prefix Notation

Infix operators can alternatively be used with prefix notation by wrapping them in parenthesis. For example,

```purescript
import Prelude

n :: Int
n = 3 + 5
```

can also be written like this:

```purescript
import Prelude

n :: Int
n = (+) 3 5
```

This can be useful because it allows partial application. You can simply leave out the second argument to create a reusable function:

```purescript
addThree :: Int -> Int
addThree = (+) 3
```

However, you can also accomplish the same thing using infix operators with the `_` placeholder, like:

```purescript
addThree :: Int -> Int
addThree = (3 + _)
```

Whether you're using normal function syntax or operator symbols, or infix or prefix notation, you're really just using functions in various forms. It's up to you to use them how you see fit. Use whichever form you feel makes the code you're writing most readable.

### Prelude Infix Operators

| Symbol          | Function                | Defined in                   | Meaning
|-----------------|-------------------------|------------------------------|------------------------------
| `<$>`           | `map`                   | `Data.Functor`               | `map` can be used to turn functions `a -> b` into functions `f a -> f b` whose argument and return types use the type constructor `f`, where `f` is a Functor.
| `<#>`           | `mapFlipped`            | `Data.Functor`               | `mapFlipped` is `map` with its arguments reversed.
| `<$`            | `voidRight`             | `Data.Functor`               | Ignore the return value of a computation, using the specified return value.
| `$>`            | `voidLeft`              | `Data.Functor`               | A version of `voidRight` with its arguments flipped.
| `<@>`           | `flap`                  | `Data.Functor`               | Apply a value in a computational context to a value in no context. Generalizes `flip`. (Flips the order of the arguments to a function of two arguments)
| `<*>`           | `apply`                 | `Control.Apply`              | `apply` is used to apply a function to an argument under a type constructor.
| `<*`            | `applyFirst`            | `Control.Apply`              | Combine two effectful actions, keeping only the result of the first.
| `*>`            | `applySecond`           | `Control.Apply`              | Combine two effectful actions, keeping only the result of the second.
| `$`             | `apply`                 | `Data.Function`              | Applies an argument to a function, allowing parentheses to be ommitted in some cases. (Like `<\|` in Elm, F#, etc.)
| `#`             | `applyFlipped`          | `Data.Function`              | `applyFlipped` is `apply` with its arguments reversed. (Like `\|>` in Elm, F#, etc.)
| `<<<`           | `compose`               | `Control.Semigroupoid`       | Backwards composition. Used for composing pure functions.
| `>>>`           | `composeFlipped`        | `Control.Semigroupoid`       | Forwards composition, or `compose` with its arguments reversed.
| `>>=`           | `bind`                  | `Control.Bind`               | `bind` composes computations in sequence, using the return value of one computation to determine the next computation.
| `=<<`           | `bindFlipped`           | `Control.Bind`               | `bindFlipped` is `bind` with its arguments reversed.
| `>=>`           | `composeKleisli`        | `Control.Bind`               | Forwards Kleisli composition. Used for composing monadic functions of type `(a -> m b)` and `(b -> m c)`.
| `<=<`           | `composeKleisliFlipped` | `Control.Bind`               | Backwards Kleisli composition, or `composeKleisli` with its arguments flipped.
| `~>`            | `NaturalTransformation` | `Data.NaturalTransformation` | A natural transformation is a mapping between type constructors of kind `* -> *` where the mapping operation has no ability to manipulate the inner values.
| `<>`            | `append`                | `Data.Semigroup`             | Concatenate two Semigroup values. (Example: String concatenation)
| `&&`            | `conj`                  | `Data.HeytingAlgebra`        | Boolean AND
| `\|\|`          | `disj`                  | `Data.HeytingAlgebra`        | Boolean OR
| `==`            | `eq`                    | `Data.Eq`                    | Equality check
| `/=`            | `notEq`                 | `Data.Eq`                    | Inequality check
| `<`             | `lessThan`              | `Data.Ord`                   | Less than
| `<=`            | `lessThanOrEq`          | `Data.Ord`                   | Less than or equal
| `>`             | `greaterThan`           | `Data.Ord`                   | Greater than
| `>=`            | `greaterThanOrEq`       | `Data.Ord`                   | Greater than or equal
| `+`             | `add`                   | `Data.Semiring`              | Addition
| `*`             | `mul`                   | `Data.Semiring`              | Multiplication
| `-`             | `sub`                   | `Data.Ring`                  | Subtraction
| `/`             | `div`                   | `Control.EuclideanRing`      | Division

See [the Prelude docs on Pursuit](https://pursuit.purescript.org/packages/purescript-prelude/3.1.0/docs/Prelude) for more details.

## Modules

#### Defining Modules
```purescript
-- Defining a module that exports everything
module MyModule where

-- Export only specified entities
module MyModule
  ( Type
  , value
  ) where

-- Export all or specific states of type
module MyModule
  ( Error(Forbidden, Timeout)
  , Stuff(..)
  , Person
  , class Something
  ) where

data Error
  = Forbidden String
  | Timeout String
  | NotFound String

data Stuff
  = Tag
  | SomeTag
  | AnotherTag

type Person = { name :: String, age :: Int }

class Something a where
  show :: a -> String
```

#### Importing Modules

##### Qualified Imports
```purescript
import Prelude
-- For Prelude, all imports are in scope

import Prelude hiding (div)
-- For Prelude, all imports are in scope except div

import Data.List (List(Nil))
-- For Data.List, Nil type is in scope

import Data.Array as A
-- For Data.Array, all imports are in scope with the A namespace

import Data.List as L
-- For Data.List, all imports are in scope with the L namespace

Example Usage:
list = 1 L.: 2 L.: 3 L.: Nil
array = 1 A.: 2 A.: 3 A.: []
```

##### Unqualified imports
```purescript
import Data.List ((:))
-- For Data.List, : is in scope

import MyModule (someFunction, someType(..), someType(Tag, AnotherTag), class SomeClass)
-- For MyModule, only the function, types, and class mentioned are in scope
```

## Links

- [Official Documentation](https://github.com/purescript/documentation)
- [Official Website](http://www.purescript.org/)
- [Pursuit (Purescript Search Engine)](https://pursuit.purescript.org/)
- [`Purescript by Example` Book](https://leanpub.com/purescript/read)
- [PureScript News](http://purescript.news/)
- [egghead.io Tutorial Videos](https://egghead.io/search?q=purescript)


text: A place to host some stuff because I dont want to pay for hosting, I am a cheapo.


text:
#ifndef __STYLE_SWITCH_H__
#define __STYLE_SWITCH_H__

#include "InteractorStyleSwitch.h"

#include "QInteractorStyleNavigation.h"
#include "QInteractorStyleWindowLevel.h"
#include "QInteractorStyleWindowLevelThreshold.h"
#include "QInteractorStyleThreshold.h"
#include "QInteractorStylePaintBrush.h"
#include "QInteractorStyleVOI.h"
#include "QInteractorStyleLumenSeedsPlacer.h"
#include "QInteractorStyleVBDSmokerSeeds.h"
#include "QInteractorStyleTubularVOI.h"
#include "QInteractorStyleMaximumWallThickness.h"
#include "QInteractorStyleRuler.h"
#include "InteractorStylePolygonDraw.h"
#include "QInteractorStylePolygonDrawSeries.h"
#include "QInteractorStyleVesselSegmentation2.h"

class StyleSwitch : public InteractorStyleSwitch
{
public:
	static StyleSwitch* New() { return new StyleSwitch; }
	vtkTypeMacro(StyleSwitch, InteractorStyleSwitch);

	vtkGetMacro(WindowLevel, QInteractorStyleWindowLevel*);
	SetInteractorStyleMacro(WindowLevel);
	CurrentStyleMacro(WindowLevel);

	vtkGetMacro(WindowLevelThreshold, QInteractorStyleWindowLevelThreshold*);
	SetInteractorStyleMacro(WindowLevelThreshold);
	CurrentStyleMacro(WindowLevelThreshold);

	vtkGetMacro(Threshold, QInteractorStyleThreshold*);
	SetInteractorStyleMacro(Threshold);
	CurrentStyleMacro(Threshold);

	vtkGetMacro(Navigation, QInteractorStyleNavigation*);
	SetInteractorStyleMacro(Navigation);
	CurrentStyleMacro(Navigation);

	vtkGetMacro(PaintBrush, QInteractorStylePaintBrush*);
	SetInteractorStyleMacro(PaintBrush);
	CurrentStyleMacro(PaintBrush);

	vtkGetMacro(LumenSeedsPlacer, QInteractorStyleLumenSeedsPlacer*);
	SetInteractorStyleMacro(LumenSeedsPlacer);
	CurrentStyleMacro(LumenSeedsPlacer);

	vtkGetMacro(VOI, QInteractorStyleVOI*);
	SetInteractorStyleMacro(VOI);
	CurrentStyleMacro(VOI);

	vtkGetMacro(TubularVOI, QInteractorStyleTubularVOI*);
	SetInteractorStyleMacro(TubularVOI);
	CurrentStyleMacro(TubularVOI);

	vtkGetMacro(Ruler, QInteractorStyleRuler*);
	SetInteractorStyleMacro(Ruler);
	CurrentStyleMacro(Ruler);

	vtkGetMacro(MaximumWallThickness, QInteractorStyleMaximumWallThickness*);
	SetInteractorStyleMacro(MaximumWallThickness);
	CurrentStyleMacro(MaximumWallThickness);

	vtkGetMacro(PolygonDraw, InteractorStylePolygonDraw*);
	SetInteractorStyleMacro(PolygonDraw);
	CurrentStyleMacro(PolygonDraw);

	vtkGetMacro(PolygonDrawSeries, QInteractorStylePolygonDrawSeries*);
	SetInteractorStyleMacro(PolygonDrawSeries);
	CurrentStyleMacro(PolygonDrawSeries);

	vtkGetMacro(VesselSegmentation2, QInteractorStyleVesselSegmentation2*);
	SetInteractorStyleMacro(VesselSegmentation2);
	CurrentStyleMacro(VesselSegmentation2);

	vtkGetMacro(VBDSmoker, QInteractorStyleVBDSmokerSeeds*);
	SetInteractorStyleMacro(VBDSmoker);
	CurrentStyleMacro(VBDSmoker);

protected:
	StyleSwitch() {
		// The first instance of QInteractorStyleNavigation should have control
		// of the ui
		Navigation = QInteractorStyleNavigation::New();
		allStyles.push_back(Navigation);
		WindowLevel = QInteractorStyleWindowLevel::New();
		allStyles.push_back(WindowLevel);
		WindowLevelThreshold = QInteractorStyleWindowLevelThreshold::New();
		allStyles.push_back(WindowLevelThreshold);
		Threshold = QInteractorStyleThreshold::New();
		allStyles.push_back(Threshold);
		//PolygonDraw = QInteractorStyleVesselSegmentation::New();
		LumenSeedsPlacer = QInteractorStyleLumenSeedsPlacer::New();
		allStyles.push_back(LumenSeedsPlacer);
		PaintBrush = QInteractorStylePaintBrush::New();
		allStyles.push_back(PaintBrush);
		VOI = QInteractorStyleVOI::New();
		allStyles.push_back(VOI);
		TubularVOI = QInteractorStyleTubularVOI::New();
		allStyles.push_back(TubularVOI);
		Ruler = QInteractorStyleRuler::New();
		allStyles.push_back(Ruler);
		PolygonDraw = InteractorStylePolygonDraw::New();
		allStyles.push_back(PolygonDraw);
		PolygonDrawSeries = QInteractorStylePolygonDrawSeries::New();
		allStyles.push_back(PolygonDrawSeries);
		VesselSegmentation2 = QInteractorStyleVesselSegmentation2::New();
		allStyles.push_back(VesselSegmentation2);
		MaximumWallThickness = QInteractorStyleMaximumWallThickness::New();
		allStyles.push_back(MaximumWallThickness);
		VBDSmoker = QInteractorStyleVBDSmokerSeeds::New();
		allStyles.push_back(VBDSmoker);
	}

	QInteractorStyleNavigation*	Navigation;
	QInteractorStyleWindowLevel* WindowLevel;
	QInteractorStyleThreshold* Threshold;
	QInteractorStyleWindowLevelThreshold* WindowLevelThreshold;
	QInteractorStyleLumenSeedsPlacer* LumenSeedsPlacer;
	QInteractorStylePaintBrush*	PaintBrush;
	QInteractorStyleVOI* VOI;
	QInteractorStyleTubularVOI* TubularVOI;
	QInteractorStyleRuler* Ruler;
	QInteractorStyleMaximumWallThickness* MaximumWallThickness;
	InteractorStylePolygonDraw* PolygonDraw;
	QInteractorStylePolygonDrawSeries* PolygonDrawSeries;
	QInteractorStyleVesselSegmentation2* VesselSegmentation2;
	QInteractorStyleVBDSmokerSeeds* VBDSmoker;

	//QInteractorStyleRuler* Ruler;
};

#endif


text:
package io.datarouter.filesystem.snapshot.group.dto;

import java.util.Optional;

import io.datarouter.filesystem.snapshot.block.root.RootBlock;
import io.datarouter.filesystem.snapshot.key.SnapshotKey;
import io.datarouter.util.Require;

public class SnapshotWriteResult{

	public final SnapshotKey key;
	public final boolean success;
	public final Optional<RootBlock> optRoot;

	private SnapshotWriteResult(SnapshotKey key, boolean success, RootBlock root){
		this.key = key;
		this.success = success;
		this.optRoot = Optional.ofNullable(root);
	}

	public static SnapshotWriteResult success(SnapshotKey key, RootBlock root){
		return new SnapshotWriteResult(key, true, root);
	}

	public static SnapshotWriteResult empty(SnapshotKey key){
		return new SnapshotWriteResult(key, false, null);
	}

	public static SnapshotWriteResult failure(SnapshotKey key){
		return new SnapshotWriteResult(key, false, null);
	}

	public void assertSuccess(){
		Require.isTrue(success);
	}

	public SnapshotKeyAndRoot toSnapshotKeyAndRoot(){
		return new SnapshotKeyAndRoot(key, optRoot.orElseThrow());
	}

}


text:
package pual.example.classloader;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import paul.example.dynamic.IDynamic;

import dalvik.system.DexClassLoader;

import android.support.v7.app.ActionBarActivity;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

public class MainActivity extends ActionBarActivity implements
		View.OnClickListener {

	private Button button1, button2, button3;
	private String SECONDARY_DEX_NAME = "test.jar";
	static final int BUF_SIZE = 8 * 1024;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		button1 = (Button) findViewById(R.id.button1);
		button1.setOnClickListener(this);
		button2 = (Button) findViewById(R.id.button2);
		button2.setOnClickListener(this);
		button3 = (Button) findViewById(R.id.button3);
		button3.setOnClickListener(this);

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub

		switch (v.getId()) {
		case R.id.button1:
			testDexClassLoader();
			break;
		case R.id.button2:
			testPathClassLoader();
			break;
		case R.id.button3:
			break;

		default:
			break;
		}

	}

	@SuppressLint("NewApi")
	private void testDexClassLoader() {

		File dexInternalStoragePath = new File(getDir("dex",
				Context.MODE_PRIVATE), SECONDARY_DEX_NAME);
		BufferedInputStream bis = null;
		OutputStream dexWriter = null;

		try {
			bis = new BufferedInputStream(getAssets().open(SECONDARY_DEX_NAME));
			dexWriter = new BufferedOutputStream(new FileOutputStream(
					dexInternalStoragePath));
			byte[] buf = new byte[BUF_SIZE];
			int len;
			while ((len = bis.read(buf, 0, BUF_SIZE)) > 0) {
				dexWriter.write(buf, 0, len);
			}
			dexWriter.close();
			bis.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		final File optimizedDexOutputPath = getDir("outdex",
				Context.MODE_PRIVATE);

		MyDexClassLoader cl = new MyDexClassLoader(
				dexInternalStoragePath.getAbsolutePath(),
				optimizedDexOutputPath.getAbsolutePath(), null,
				getClassLoader());
		Class libProviderClazz = null;
		// Load the library.
		try {
			libProviderClazz = cl.loadClass("pual.example.dynamic.DynamicTest");
			System.out.println(cl.toString());

			System.out.println(libProviderClazz.getClassLoader().toString());

			// Cast the return object to the library interface so that the
			// caller can directly invoke methods in the interface.
			// Alternatively, the caller can invoke methods through
			// reflection,
			// which is more verbose.
			IDynamic lib = (IDynamic) libProviderClazz.newInstance();
//			System.out.println(lib.getClass().getClassLoader().toString());
//			System.out.println(lib.helloworld());
//
//			System.out.println("------------------------");
//			lib.sayHello();
//			System.out.println("------------------------");
			lib.printIMEI(this);
			System.out.println("------------------------");
			String url = "http://fabowang.sinaapp.com/";
			lib.printWeb(url);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	private void testPathClassLoader() {

	}
}


text: Select the server to download iOSAppInstaller.zip from.


text:
class AddColumnToProfiles < ActiveRecord::Migration
  def change
    add_column :profiles, :bio, :text
    add_column :profiles, :color, :string
    add_column :profiles, :twitter, :string
  end
end


text:
#ifndef SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_TEST_MOCK_TELEMETRY_OBSERVEABLE_H
#define SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_TEST_MOCK_TELEMETRY_OBSERVEABLE_H

#include "gmock/gmock.h"
#include "telemetry_monitor/telemetry_observable.h"
#include "application_manager/telemetry_observer.h"

namespace test {
namespace components {
namespace telemetry_monitor_test {

class MockTelemetryObservable :
        public telemetry_monitor::TelemetryObservable<
        application_manager::AMTelemetryObserver> {
 public:
  MOCK_METHOD1(SetTelemetryObserver, void(application_manager::AMTelemetryObserver* observer));
};

}  // namespace telemetry_monitor_test
}  // namespace components
}  // namespace test

#endif  // SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_TEST_MOCK_TELEMETRY_OBSERVEABLE_H


text:
package android.text;

import com.francetelecom.rd.stubs.annotation.Code;

@com.francetelecom.rd.stubs.annotation.ClassDone(0)
public class TextUtils
{
  // Classes

  public static interface StringSplitter
    extends java.lang.Iterable<java.lang.String>
  {
    // Methods

    public void setString(java.lang.String arg1);
  }
  public static class SimpleStringSplitter
    implements java.util.Iterator<java.lang.String>, TextUtils.StringSplitter
  {
    // Constructors

    public SimpleStringSplitter(char arg1){
    }
    // Methods

    public boolean hasNext(){
      return false;
    }
    public java.util.Iterator<java.lang.String> iterator(){
      return (java.util.Iterator) null;
    }
    public java.lang.String next(){
      return (java.lang.String) null;
    }
    public void remove(){
    }
    public void setString(java.lang.String arg1){
    }
  }
  public static enum TruncateAt
  {
    // Enum Constants

    START()
, MIDDLE()
, END()
, MARQUEE()
, END_SMALL()
;
    // Fields

    // Constructors

    private TruncateAt(){
    }
    // Methods

  }
  public static interface EllipsizeCallback
  {
    // Methods

    @com.francetelecom.rd.stubs.annotation.CallBack("ellipsized")
    public void ellipsized(int arg1, int arg2);
  }
  // Fields

  public static final int ALIGNMENT_SPAN = 1;

  public static final int FOREGROUND_COLOR_SPAN = 2;

  public static final int RELATIVE_SIZE_SPAN = 3;

  public static final int SCALE_X_SPAN = 4;

  public static final int STRIKETHROUGH_SPAN = 5;

  public static final int UNDERLINE_SPAN = 6;

  public static final int STYLE_SPAN = 7;

  public static final int BULLET_SPAN = 8;

  public static final int QUOTE_SPAN = 9;

  public static final int LEADING_MARGIN_SPAN = 10;

  public static final int URL_SPAN = 11;

  public static final int BACKGROUND_COLOR_SPAN = 12;

  public static final int TYPEFACE_SPAN = 13;

  public static final int SUPERSCRIPT_SPAN = 14;

  public static final int SUBSCRIPT_SPAN = 15;

  public static final int ABSOLUTE_SIZE_SPAN = 16;

  public static final int TEXT_APPEARANCE_SPAN = 17;

  public static final int ANNOTATION = 18;

  public static final int SUGGESTION_SPAN = 19;

  public static final int SPELL_CHECK_SPAN = 20;

  public static final int SUGGESTION_RANGE_SPAN = 21;

  public static final int EASY_EDIT_SPAN = 22;

  public static final android.os.Parcelable.Creator<java.lang.CharSequence> CHAR_SEQUENCE_CREATOR = null;

  public static final int CAP_MODE_CHARACTERS = 4096;

  public static final int CAP_MODE_WORDS = 8192;

  public static final int CAP_MODE_SENTENCES = 16384;

  // Constructors

  private TextUtils(){
  }
  // Methods

  public static boolean equals(java.lang.CharSequence arg1, java.lang.CharSequence arg2){
    return false;
  }
  public static int indexOf(java.lang.CharSequence arg1, char arg2){
    return 0;
  }
  public static int indexOf(java.lang.CharSequence arg1, char arg2, int arg3){
    return 0;
  }
  public static int indexOf(java.lang.CharSequence arg1, char arg2, int arg3, int arg4){
    return 0;
  }
  public static int indexOf(java.lang.CharSequence arg1, java.lang.CharSequence arg2){
    return 0;
  }
  public static int indexOf(java.lang.CharSequence arg1, java.lang.CharSequence arg2, int arg3){
    return 0;
  }
  public static int indexOf(java.lang.CharSequence arg1, java.lang.CharSequence arg2, int arg3, int arg4){
    return 0;
  }
  public static java.lang.CharSequence concat(java.lang.CharSequence [] arg1){
    return (java.lang.CharSequence) null;
  }
  public static void getChars(java.lang.CharSequence arg1, int arg2, int arg3, char [] arg4, int arg5){
  }
  public static boolean isEmpty(java.lang.CharSequence arg1){
    return false;
  }
  public static int lastIndexOf(java.lang.CharSequence arg1, char arg2){
    return 0;
  }
  public static int lastIndexOf(java.lang.CharSequence arg1, char arg2, int arg3){
    return 0;
  }
  public static int lastIndexOf(java.lang.CharSequence arg1, char arg2, int arg3, int arg4){
    return 0;
  }
  public static boolean regionMatches(java.lang.CharSequence arg1, int arg2, java.lang.CharSequence arg3, int arg4, int arg5){
    return false;
  }
  public static java.lang.CharSequence replace(java.lang.CharSequence arg1, java.lang.String [] arg2, java.lang.CharSequence [] arg3){
    return (java.lang.CharSequence) null;
  }
  public static java.lang.String [] split(java.lang.String arg1, java.lang.String arg2){
    return (java.lang.String []) null;
  }
  public static java.lang.String [] split(java.lang.String arg1, java.util.regex.Pattern arg2){
    return (java.lang.String []) null;
  }
  public static java.lang.String substring(java.lang.CharSequence arg1, int arg2, int arg3){
    return (java.lang.String) null;
  }
  public static java.lang.CharSequence join(java.lang.Iterable<java.lang.CharSequence> arg1){
    return (java.lang.CharSequence) null;
  }
  public static java.lang.String join(java.lang.CharSequence arg1, java.lang.Object [] arg2){
    return (java.lang.String) null;
  }
  public static java.lang.String join(java.lang.CharSequence arg1, java.lang.Iterable arg2){
    return (java.lang.String) null;
  }
  public static void writeToParcel(java.lang.CharSequence arg1, android.os.Parcel arg2, int arg3){
  }
  public static java.lang.CharSequence ellipsize(java.lang.CharSequence arg1, TextPaint arg2, float arg3, TextUtils.TruncateAt arg4){
    return (java.lang.CharSequence) null;
  }
  public static java.lang.CharSequence ellipsize(java.lang.CharSequence arg1, TextPaint arg2, float arg3, TextUtils.TruncateAt arg4, boolean arg5, @com.francetelecom.rd.stubs.annotation.CallBackRegister("android.text.TextUtils.EllipsizeCallback.ellipsized") TextUtils.EllipsizeCallback arg6){
    return (java.lang.CharSequence) null;
  }
  public static java.lang.CharSequence ellipsize(java.lang.CharSequence arg1, TextPaint arg2, float arg3, TextUtils.TruncateAt arg4, boolean arg5, @com.francetelecom.rd.stubs.annotation.CallBackRegister("android.text.TextUtils.EllipsizeCallback.ellipsized") TextUtils.EllipsizeCallback arg6, TextDirectionHeuristic arg7, java.lang.String arg8){
    return (java.lang.CharSequence) null;
  }
  public static java.lang.CharSequence stringOrSpannedString(java.lang.CharSequence arg1){
    return (java.lang.CharSequence) null;
  }
  public static void copySpansFrom(Spanned arg1, int arg2, int arg3, java.lang.Class arg4, Spannable arg5, int arg6){
  }
  public static int getCapsMode(java.lang.CharSequence arg1, int arg2, int arg3){
    return 0;
  }
  public static int getOffsetAfter(java.lang.CharSequence arg1, int arg2){
    return 0;
  }
  public static int getOffsetBefore(java.lang.CharSequence arg1, int arg2){
    return 0;
  }
  public static int getTrimmedLength(java.lang.CharSequence arg1){
    return 0;
  }
  @Code("return arg1;")
  public static <T>T [] removeEmptySpans(T [] arg1, Spanned arg2, java.lang.Class<T> arg3){
    return (T []) null;
  }
  public static boolean delimitedStringContains(java.lang.String arg1, char arg2, java.lang.String arg3){
    return false;
  }
  public static java.lang.String htmlEncode(java.lang.String arg1){
    return (java.lang.String) null;
  }
  public static java.lang.CharSequence getReverse(java.lang.CharSequence arg1, int arg2, int arg3){
    return (java.lang.CharSequence) null;
  }
  public static void dumpSpans(java.lang.CharSequence arg1, android.util.Printer arg2, java.lang.String arg3){
  }
  public static java.lang.CharSequence expandTemplate(java.lang.CharSequence arg1, java.lang.CharSequence [] arg2){
    return (java.lang.CharSequence) null;
  }
  public static java.lang.CharSequence commaEllipsize(java.lang.CharSequence arg1, TextPaint arg2, float arg3, java.lang.String arg4, java.lang.String arg5){
    return (java.lang.CharSequence) null;
  }
  public static java.lang.CharSequence commaEllipsize(java.lang.CharSequence arg1, TextPaint arg2, float arg3, java.lang.String arg4, java.lang.String arg5, TextDirectionHeuristic arg6){
    return (java.lang.CharSequence) null;
  }
  public static boolean isGraphic(java.lang.CharSequence arg1){
    return false;
  }
  public static boolean isGraphic(char arg1){
    return false;
  }
  public static boolean isDigitsOnly(java.lang.CharSequence arg1){
    return false;
  }
  public static boolean isPrintableAscii(char arg1){
    return false;
  }
  public static boolean isPrintableAsciiOnly(java.lang.CharSequence arg1){
    return false;
  }
}


text:
[![Build Status](https://travis-ci.org/ahjephson/YouTubeAudioExtractor.svg?branch=master)](https://travis-ci.org/ahjephson/YouTubeAudioExtractor)

This is a simple prototype build a react app using fluxible and websockets.

### Requirements
* [Node](http://nodejs.org)
* [MongoDb](https://www.mongodb.org/)  - (localhost on 27017)
* [RabbitMQ](https://www.rabbitmq.com/)

### Components Used

* [React (react)](https://facebook.github.io/react/)
* [Fluxible (fluxible)](http://fluxible.io/)
* [React Router (react-router)](https://github.com/rackt/react-router)
* [Fetchr (fetchr)](https://github.com/yahoo/fetchr)
* [Fluxible Fetchr Plugin (fluxible-plugin-fetchr)](https://github.com/yahoo/fluxible-plugin-fetchr)
* [Bootstrap React Components (react-bootstrap)](http://react-bootstrap.github.io/components.html)
* [Socket Cluster (socketcluster-server)](https://github.com/SocketCluster)
* [MongoDb Native (mongodb)](https://github.com/mongodb/node-mongodb-native)
* [AMQP (amqp)](https://github.com/postwait/node-amqp)

### Setup
Execute `npm install`

### Running the website
Execute `npm run dev` and visit [http://localhost:3000](http://localhost:3000) in your browser of choice (Chrome).

### Running the conversion process
Execute `node startConvertor.js`.

### Building
Execute `npm run build`

### Running in production
Execute `npm run start` once built.

### Dev Notes
Please add any helpful notes here.


text:
  <hgroup>

{{ organization.name }}

  </hgroup>

{% if organization.address_set.all or organization.email_set.all or organization.phone_set.all or organization.website_set.all or organization.profile_set.all %}

  {% for address in organization.address_set.all %}
    {% if address.address1 %}
{{ address.address1 }}
{% endif %}
    {% if address.address2 %}
{{ address.address2 }}
{% endif %}
    {% if address.city or address.state or address.zip %}
{% if address.city and address.state and address.zip %}{{ address.city }}, {{ address.state }} {{ address.zip }}{% elif address.city and address.state %}{{ address.city }}, {{ address.state }}{% elif address.state %}{{ address.state }} {{ address.zip }}{% elif address.city and address.zip %}{{ address.city }}, {{ address.zip }}{% elif address.city %}{{ address.city }}{% elif address.zip %}{{ address.zip }}{% endif %}
{% endif %}
  {% endfor %}

  {% for email in organization.email_set.all %}

{{ email.address }}

  {% endfor %}

  {% for phone in organization.phone_set.all %}

{{ phone.number }}

  {% endfor %}

  {% for website in organization.website_set.all %}

{{ website.url }}

  {% endfor %}

  {% if organization.profile_set.all %}

    {% for profile in organization.profile_set.all %}
        {% if profile.type == 'Facebook' %}

{% endif %}
        {% if profile.type == 'GooglePlus' %}

{% endif %}
        {% if profile.type == 'Linkedin' %}

{% endif %}
        {% if profile.type == 'Twitter' %}

{% endif %}
    {% endfor %}

  {% endif %}

{% endif %}


text:
package org.appcelerator.titanium.proxy;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.AsyncResult;
import org.appcelerator.kroll.common.Log;
import org.appcelerator.kroll.common.TiMessenger;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiFileHelper;
import org.appcelerator.titanium.util.TiUIHelper;
import org.appcelerator.titanium.util.TiUrl;
import org.appcelerator.titanium.view.TiUIView;

import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Message;
import android.support.v4.view.MenuItemCompat;
import android.view.MenuItem;
import android.view.View;

@Kroll.proxy
public class MenuItemProxy extends KrollProxy
{
	private static final String TAG = "MenuItem";

	private MenuItem item;

	private static final int MSG_FIRST_ID = KrollProxy.MSG_LAST_ID + 1;
	protected static final int MSG_LAST_ID = MSG_FIRST_ID + 1000;

	private final class CompatActionExpandListener implements MenuItemCompat.OnActionExpandListener
	{
		public boolean onMenuItemActionCollapse(MenuItem item)
		{
			fireEvent(TiC.EVENT_COLLAPSE, null);
			return true;
		}

		public boolean onMenuItemActionExpand(MenuItem item)
		{
			fireEvent(TiC.EVENT_EXPAND, null);
			return true;
		}
	}

	protected MenuItemProxy(MenuItem item)
	{
		this.item = item;
		MenuItemCompat.setOnActionExpandListener(item, new CompatActionExpandListener());
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public int getGroupId()
	// clang-format on
	{
		return item.getGroupId();
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public int getItemId()
	// clang-format on
	{
		return item.getItemId();
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public int getOrder()
	// clang-format on
	{
		return item.getOrder();
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public String getTitle()
	// clang-format on
	{
		return (String) item.getTitle();
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public String getTitleCondensed()
	// clang-format on
	{
		return (String) item.getTitleCondensed();
	}

	@Kroll.method
	public boolean hasSubMenu()
	{
		return item.hasSubMenu();
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public boolean isChecked()
	// clang-format on
	{
		return item.isChecked();
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public boolean isCheckable()
	// clang-format on
	{
		return item.isCheckable();
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public boolean isEnabled()
	// clang-format on
	{
		return item.isEnabled();
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public boolean isVisible()
	// clang-format on
	{
		return item.isVisible();
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public String getAccessibilityLabel()
	// clang-format on
	{
		return TiConvert.toString(properties, TiC.PROPERTY_ACCESSIBILITY_LABEL);
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public String getAccessibilityHint()
	// clang-format on
	{
		return TiConvert.toString(properties, TiC.PROPERTY_ACCESSIBILITY_HINT);
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public String getAccessibilityValue()
	// clang-format on
	{
		return TiConvert.toString(properties, TiC.PROPERTY_ACCESSIBILITY_VALUE);
	}

	private void updateContentDescription()
	{
		String contentDescription = composeContentDescription();
		MenuItemCompat.setContentDescription(item, contentDescription);
	}

	public void setContentDescription(KrollDict d)
	{
		if (d.containsKeyAndNotNull(TiC.PROPERTY_ACCESSIBILITY_LABEL)) {
			properties.put(TiC.PROPERTY_ACCESSIBILITY_LABEL, d.get(TiC.PROPERTY_ACCESSIBILITY_LABEL));
		} else {
			properties.remove(TiC.PROPERTY_ACCESSIBILITY_LABEL);
		}
		if (d.containsKey(TiC.PROPERTY_ACCESSIBILITY_HINT)) {
			properties.put(TiC.PROPERTY_ACCESSIBILITY_HINT, d.get(TiC.PROPERTY_ACCESSIBILITY_HINT));
		} else {
			properties.remove(TiC.PROPERTY_ACCESSIBILITY_HINT);
		}
		if (d.containsKey(TiC.PROPERTY_ACCESSIBILITY_VALUE)) {
			properties.put(TiC.PROPERTY_ACCESSIBILITY_VALUE, d.get(TiC.PROPERTY_ACCESSIBILITY_VALUE));
		} else {
			properties.remove(TiC.PROPERTY_ACCESSIBILITY_VALUE);
		}
		updateContentDescription();
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public void setAccessibilityLabel(String label)
	// clang-format on
	{
		if (label != null && label.length() != 0) {
			properties.put(TiC.PROPERTY_ACCESSIBILITY_LABEL, label);
		} else {
			properties.remove(TiC.PROPERTY_ACCESSIBILITY_LABEL);
		}
		updateContentDescription();
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public void setAccessibilityHint(String hint)
	// clang-format on
	{
		if (hint != null && hint.length() != 0) {
			properties.put(TiC.PROPERTY_ACCESSIBILITY_HINT, hint);
		} else {
			properties.remove(TiC.PROPERTY_ACCESSIBILITY_HINT);
		}
		updateContentDescription();
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public void setAccessibilityValue(String value)
	// clang-format on
	{
		if (value != null && value.length() != 0) {
			properties.put(TiC.PROPERTY_ACCESSIBILITY_VALUE, value);
		} else {
			properties.remove(TiC.PROPERTY_ACCESSIBILITY_VALUE);
		}

		updateContentDescription();
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public MenuItemProxy setCheckable(boolean checkable)
	// clang-format on
	{
		item.setCheckable(checkable);
		return this;
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public MenuItemProxy setChecked(boolean checked)
	// clang-format on
	{
		item.setChecked(checked);
		return this;
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public MenuItemProxy setEnabled(boolean enabled)
	// clang-format on
	{
		item.setEnabled(enabled);
		return this;
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public MenuItemProxy setIcon(Object icon)
	// clang-format on
	{
		if (icon != null) {
			if (icon instanceof String) {
				String iconPath = TiConvert.toString(icon);
				TiUrl iconUrl = new TiUrl(iconPath);
				if (iconPath != null) {
					TiFileHelper tfh = new TiFileHelper(TiApplication.getInstance());
					Drawable d = tfh.loadDrawable(iconUrl.resolve(), false);
					if (d != null) {
						item.setIcon(d);
					}
				}
			} else if (icon instanceof Number) {
				Drawable d = TiUIHelper.getResourceDrawable(TiConvert.toInt(icon));
				if (d != null) {
					item.setIcon(d);
				}
			}
		}
		return this;
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public MenuItemProxy setTitle(String title)
	// clang-format on
	{
		item.setTitle(title);
		return this;
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public MenuItemProxy setTitleCondensed(String title)
	// clang-format on
	{
		item.setTitleCondensed(title);
		return this;
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public MenuItemProxy setVisible(boolean visible)
	// clang-format on
	{
		item.setVisible(visible);
		return this;
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public void setActionView(Object view)
	// clang-format on
	{
		if (view instanceof TiViewProxy) {
			final View v = ((TiViewProxy) view).getOrCreateView().getNativeView();
			TiMessenger.postOnMain(new Runnable() {
				@Override
				public void run()
				{
					item.setActionView(v);
				}
			});
		} else {
			Log.w(TAG, "Invalid type for actionView", Log.DEBUG_MODE);
		}
	}

	// clang-format off
	@Kroll.method
	@Kroll.setProperty
	public void setShowAsAction(final int flag)
	// clang-format on
	{
		TiMessenger.postOnMain(new Runnable() {
			@Override
			public void run()
			{
				item.setShowAsAction(flag);
			}
		});
	}

	@Kroll.method
	public void collapseActionView()
	{
		TiMessenger.postOnMain(new Runnable() {
			@Override
			public void run()
			{
				item.collapseActionView();
			}
		});
	}

	@Kroll.method
	public void expandActionView()
	{
		TiMessenger.postOnMain(new Runnable() {
			@Override
			public void run()
			{
				item.expandActionView();
			}
		});
	}

	// clang-format off
	@Kroll.method
	@Kroll.getProperty
	public boolean isActionViewExpanded()
	// clang-format on
	{
		return item.isActionViewExpanded();
	}

	@Override
	public String getApiName()
	{
		return "Ti.Android.MenuItem";
	}
}


text:
<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
        <item name="android:actionBarStyle">@style/WeChatActionBar</item>
        <item name="android:itemBackground">@drawable/actionbar_bg_selector</item>

        <item name="android:itemTextAppearance">@style/WeChatActionBarOverflow</item>
        <item name="android:actionOverflowButtonStyle">@style/WeChatActionButtonOverflow</item>
    </style>

    <style name="WeChatActionBar" parent="@android:style/Widget.Holo.ActionBar">
        <item name="android:background">#3f51b5</item>
        <item name="android:titleTextStyle">@style/WeChatActionBarTitleText</item>
    </style>

    <style name="WeChatActionBarTitleText" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">#cfcfcf</item>
        <item name="android:textSize">17sp</item>
    </style>

    <style name="WeChatActionBarOverflow" parent="@android:style/Widget.ActionButton.Overflow">
        <item name="android:textSize">16sp</item>
    </style>

    <style name="WeChatActionButtonOverflow" parent="android:style/Widget.Holo.ActionButton.Overflow">
        <item name="android:src">@drawable/actionbar_more_icon</item>
    </style>

</resources>


text:
"""
Flask app initialization.
"""
# pylint:skip-file
from flask import Flask
from flask.ext.mako import MakoTemplates

app = Flask(__name__)  # pylint: disable=invalid-name
mako = MakoTemplates(app)


text:
(function(angular){
  angular.module('docs.Directives', ['docs.Config'])
      .directive('resourceDescription', ['docsConfigConstant', function(config){
          return {
              restrict: 'E',
              replace: true,
              templateUrl: config.prepareViewTemplateUrl('directives/description'),
              scope: {
                  resource: '='
              }
          }
      }])
      .directive('resourceExample', ['docsConfigConstant', function(config){
          return {
              restrict: 'E',
              replace: true,
              templateUrl: config.prepareViewTemplateUrl('directives/example'),
              scope: {
                  resource: '='
              }
          }
      }])
      .directive('resourceGui', ['docsConfigConstant', '$http', function(config){
          return {
              restrict: 'E',
              replace: true,
              templateUrl: config.prepareViewTemplateUrl('directives/gui'),
              scope: {
                  resource: '='
              },
              link: function ($scope) {
                  $scope.httpMethods = ['get', 'post', 'put', 'patch', 'delete'];
                  $scope.selectedMethod = $scope.httpMethods[0];

                  $scope.selectMethod = function (method) {
                      $scope.selectedMethod = method;
                  };
              }
          }
      }])
      .directive('requestResponseContainer', ['docsConfigConstant', '$http', function(config, $http){
          return {
              restrict: 'E',
              replace: true,
              templateUrl: config.prepareViewTemplateUrl('directives/requestResponse'),
              scope: {
                  resource: '=',
                  method: '='
              },
              link: function ($scope) {
                  $scope.PK = $scope.resource.modelOptions ? $scope.resource.modelOptions.pk || 'id' : 'id';
                  $scope.ids = [];
                  $scope.relatedResource = {};
                  $scope.response = {};

                  $scope.addRequestParameter = function (id) {
                      if (id && $scope.ids.indexOf(id) == -1) $scope.ids.push(id);
                  };

                  $scope.removeRequestParameter = function (id) {
                      var index = $scope.ids.indexOf(id);
                      $scope.ids.splice(index, 1);
                  };

                  $scope.sendGETRequest = function (resource, ids, relatedResourceName) {
                      var requestConfig = {
                          method: $scope.method,
                          url: config.getApiNamespace() + '/' + resource.route
                      };

                      if (ids.length) {
                          if (ids.length == 1) requestConfig.url += '/' + ids[0];
                          if (ids.length > 1) requestConfig.params = { ids: ids.join(',') };
                          if (relatedResourceName) requestConfig.url += '/' + relatedResourceName;
                      }

                      $http(requestConfig)
                          .success(function (data, status, headers, config) {
                              $scope.response[resource.name] = $scope.response[resource.name] || {};
                              $scope.response[resource.name][$scope.method] = { body: data, status: status };
                          })
                          .error(function (data, status, headers, config) {
                              $scope.response[resource.name] = $scope.response[resource.name] || {};
                              $scope.response[resource.name][$scope.method] = { body: data || 'Request failed', status: status };
                          });
                  };

                  $scope.sendPOSTRequest = function (resource, data) {
                      var requestConfig = {
                          method: $scope.method,
                          url: config.getApiNamespace() + '/' + resource.route,
                          headers: {
                              "Content-Type": "application/json"
                          },
                          data: data
                      };

                      $http(requestConfig)
                          .success(function (data, status, headers, config) {
                              $scope.response[resource.name] = $scope.response[resource.name] || {};
                              $scope.response[resource.name][$scope.method] = { body: data, status: status };
                          })
                          .error(function (data, status, headers, config) {
                              $scope.response[resource.name] = $scope.response[resource.name] || {};
                              $scope.response[resource.name][$scope.method] = { body: data || 'Request failed', status: status };
                          });
                  };

                  $scope.sendDELETERequest = function (resource, id) {
                      var requestConfig = {
                          method: $scope.method,
                          url: config.getApiNamespace() + '/' + resource.route + '/' + id
                      };

                      $http(requestConfig)
                          .success(function (data, status, headers, config) {
                              $scope.response[resource.name] = $scope.response[resource.name] || {};
                              $scope.response[resource.name][$scope.method] = { body: data, status: status };
                          })
                          .error(function (data, status, headers, config) {
                              $scope.response[resource.name] = $scope.response[resource.name] || {};
                              $scope.response[resource.name][$scope.method] = { body: data || 'Request failed', status: status };
                          });
                  };
              }
          }
      }])
      .directive('response', ['docsConfigConstant', function(config){
          return {
              restrict: 'E',
              replace: true,
              templateUrl: config.prepareViewTemplateUrl('directives/response'),
              scope: {
                  response: '='
              }
          }
      }])
      .directive('resourceAttribute', ['docsConfigConstant', function(config){
          return {
              restrict: 'E',
              replace: true,
              templateUrl: config.prepareViewTemplateUrl('directives/attribute'),
              scope: {
                  name: '=',
                  value: '='
              },
              link: function ($scope) {
                  $scope.data = $scope.$parent.data;
              }
          }
      }])
})(angular);


text:
var demand = require('must');
var HtmlType = require('../HtmlType');

exports.initList = function (List) {
	List.add({
		html: { type: HtmlType },
		nested: {
			html: { type: HtmlType },
		},
	});
};

exports.createData = function (List) { // eslint-disable-line no-unused-vars

};

exports.testFilters = function (List) { // eslint-disable-line no-unused-vars

};

exports.testFieldType = function (List) {
	var testItem = new List.model();

	it('should update top level fields', function (done) {
		List.fields.html.updateItem(testItem, {
			html: 'foobar',
		}, function () {
			demand(testItem.html).be('foobar');
			testItem.html = undefined;
			done();
		});
	});

	it('should update nested fields', function (done) {
		List.fields['nested.html'].updateItem(testItem, {
			nested: {
				html: 'foobar',
			},
		}, function () {
			demand(testItem.nested.html).be('foobar');
			testItem.nested.html = undefined;
			done();
		});
	});

	it('should update nested fields with flat paths', function (done) {
		List.fields['nested.html'].updateItem(testItem, {
			'nested.html': 'foobar',
		}, function () {
			demand(testItem.nested.html).be('foobar');
			testItem.nested.html = undefined;
			done();
		});
	});
};


text:
AeroKnow is small Android App to practice Airline Pilot theoretical questions.
The project has been started as Proof-Of-Concept to test development with Jetbrain Koltin language for Android.

It includes:
  - Kotlin 1.1
  - [Dagger 2][dagger] for Depedencies injection
  - [RxJava / RxAndroid 2][rxLink] for asynch task
  - [Square Retrofit][retrofitLink] as HTTP Client
  - [Square Moshi][moshiLink] for JSON parsing
  - [Square Picasso][picassoLink] for Image display
  - [Google Room][roomLink] to handle offline
  - [GuillotineMenu-Android][GuillotineLink] by Yalantis for a "guillotine" style screen appearance

Been Used:
  - [Realm][realmLink] to store user progression
  - [Realm Extension][realmExtLink] extension by Víctor Manuel Pineda Murcia to help with Realm

# Current
  - Source list
  - Subject and Topic for a source
  - Questions campaign screen for a topic
  - About page
  - Parameters screen

# To compile
You need to create your keystore.properties at the root of the project. A file keystore.properties.temp is present to get the requested format

A fabric.properties file must be as well created at the root of APP folder. A file fabric.properties.temp is present to get the requested format

Continuous work in progress ;-)

# Known bug
... (none reported yet, yahooo)

License
----

Copyright 2017 Thibault de Lambilly
```
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.
```
[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)

   [rxLink]: <https://github.com/ReactiveX/RxAndroid>
   [dagger]: <https://google.github.io/dagger/>
   [retrofitLink]: <http://square.github.io/retrofit/>
   [moshiLink]: <https://github.com/square/moshi>
   [picassoLink]: <https://github.com/square/picasso>
   [realmLink]: <https://realm.io/>
   [realmExtLink]: <https://github.com/vicpinm/Kotlin-Realm-Extensions>
   [GuillotineLink]: <https://github.com/Yalantis/GuillotineMenu-Android>
   [roomLink]: <https://developer.android.com/topic/libraries/architecture/room.html>


text:
package es.usc.citius.hipster.examples;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import es.usc.citius.hipster.algorithm.Hipster;
import es.usc.citius.hipster.examples.problem.NQueens;
import es.usc.citius.hipster.model.Transition;
import es.usc.citius.hipster.model.function.CostFunction;
import es.usc.citius.hipster.model.function.HeuristicFunction;
import es.usc.citius.hipster.model.function.impl.StateTransitionFunction;
import es.usc.citius.hipster.model.node.impl.WeightedNode;
import es.usc.citius.hipster.model.problem.ProblemBuilder;
import es.usc.citius.hipster.model.problem.SearchProblem;
import es.usc.citius.hipster.util.Predicate;

/**
 * Example using the N-Queens problem (size 8x8) solved using the Annealing search.
 *
 * This example is a search problem with no explicit actions, only using a
 * transition function which generates from a state a set of
 * successor states. The cost function in this case is constant, and
 * we assume it has no cost to move a queen. As heuristic for this problem
 * we use the number of attacked queens. These components are defined
 * as the same time the problem is being built (using a
 * {@link es.usc.citius.hipster.model.problem.ProblemBuilder}.
 *
 *
 * @see {@link es.usc.citius.hipster.examples.problem.NQueens}
 *
 * @author Pablo Rodríguez Mier <pablo.rodriguez.mier@usc.es>
 * @author Adrián González Sieira <adrian.gonzalez@usc.es>
 */
public class EightQueensProblemExampleWithAnnealingSearch {

    public static void main(String[] args) {
        // Solve the 8-Queen problem with Hill Climbing and Enforced Hill Climbing
        final int size = 8;
        //search problem definition, here we define also
        //the transition function between states
        //and the cost (always 0)
        //and heuristic function (number of attacked queens)
        SearchProblem<Void,NQueens, WeightedNode<Void,NQueens,Double>> p = ProblemBuilder.create()
                .initialState(new NQueens(size))
                //problem without explicit actions, only a transition function is needed
                .defineProblemWithoutActions()
                .useTransitionFunction(new StateTransitionFunction<NQueens>() {
                    @Override
                    public Iterable<NQueens> successorsOf(NQueens state) {
                        // Generate all possible movements of one queen
                        // There are size*(size-1) available movements
                        Set<NQueens> states = new HashSet<NQueens>();
                        for (int i = 0; i < size; i++) {
                            for (int j = 0; j < size; j++) {
                                // Change the queen at row i to column j
                                // If i is already in j, then do not add the state
                                if (state.getQueens()[i] != j) {
                                    int[] queens = Arrays.copyOf(state.getQueens(), size);
                                    queens[i] = j;
                                    states.add(new NQueens(queens));
                                }
                            }
                        }
                        return states;
                    }
                })
                .useCostFunction(new CostFunction<Void, NQueens, Double>() {
                    @Override
                    public Double evaluate(Transition<Void, NQueens> transition) {
                        // We assume that the cost of moving a queen is 0
                        return 0d;
                    }
                })
                .useHeuristicFunction(new HeuristicFunction<NQueens, Double>() {
                    @Override
                    public Double estimate(NQueens state) {
                        return (double) state.attackedQueens();
                    }
                }).build();

        //print some information about the search that will be executed
        System.out.println("Random initial state (" + p.getInitialNode().state().attackedQueens() + " attacked queens):");
        System.out.println(p.getInitialNode().state());

        System.out.println("Running 8-Queens problem with Annealing search and a custom goal test predicate");
        //To execute the algorithm we have two options:
        // Option 1 - Run the algorithm until the predicate is satisfied (until we find a state with score 0, that is, no attacked queens)
        System.out.println(Hipster.createAnnealingSearch(p, null,null,null,null).search(new Predicate<WeightedNode<Void, NQueens, Double>>() {
            @Override
            public boolean apply(WeightedNode<Void, NQueens, Double> node) {
                return node.getScore().equals(0d);
            }
        }));
    }
}


text:
class Socket {
public:
	boost::shared_ptr<boost::asio::ip::tcp::socket> socket;
public:
	void setOption() {
		boost::asio::ip::tcp::no_delay option(true);
		socket->set_option(option);
	}

	void connect(boost::asio::ip::tcp::resolver::iterator &endpoint_iter, boost::system::error_code &error) {
		socket->connect(*endpoint_iter, error);
	}

	void close() {
		socket->close();
	}

public:
	bool read(void *data, size_t size) {
		boost::system::error_code error;
		size_t len = boost::asio::read(*socket, boost::asio::buffer(reinterpret_cast<char*>(data), (std::streamsize)(size)), boost::asio::transfer_exactly(size), error);
		if (error) {
			std::cout << "[socket::read] error : " << error << std::endl;
			return false;
		}
		if (size != len) {
			std::cout << "[socket::read] size error : " << size << ", " << len << std::endl;
			return false;
		}
		return true;
	}

	bool read(boost::asio::streambuf &streambuf) {
		boost::system::error_code error;
		size_t len = boost::asio::read_until(*socket, streambuf, "\n\n");
		if (error) {
			std::cout << "[socket::write] error : " << error << std::endl;
			return false;
		}
		if (streambuf.size() != len) {
			std::cout << "[socket::write] size error : " << streambuf.size() << ", " << len << std::endl;
			return false;
		}
		std::istream request_stream(&streambuf);
		std::string filename; size_t fileSize = 0;
		request_stream >> filename;
		request_stream >> fileSize;
		return true;
	}

	template< class T >
	bool read_buffer_with_size(std::vector<T> &buffer, size_t &buffer_size_bytes) {
		boost::system::error_code error;

		// read buffer size
		int buf_size = 0;
		if (!read(&buf_size, 4)) {
			return false;
		}
		// read buffer
		buffer.resize(buf_size / sizeof(T));
		if (!read(buffer.data(), buf_size)) {
			return false;
		}
		buffer_size_bytes = buf_size;
		return true;
	}

	template< class T >
	bool read_buffer(std::vector<T> &buffer) {
		boost::system::error_code error;

		// read buffer size
		int buf_size = 0;
		if (!read(&buf_size, 4)) {
			return false;
		}
		// read buffer
		buffer.resize(buf_size / sizeof(T));
		if (!read(buffer.data(), buf_size)) {
			return false;
		}
		return true;
	}

	bool read_string(std::string &str) {
		boost::system::error_code error;

		// read buffer size
		int buf_size = -1;
		if (!read(&buf_size, 4)) {
			return false;
		}

		// read buffer
		if (!read(&str, buf_size)) {
			return false;
		}

		return true;
	}

	bool write(const void *data, size_t size) {
		boost::system::error_code error;
		size_t len = boost::asio::write(*socket, boost::asio::buffer((char*)(data), (std::streamsize)(size)), boost::asio::transfer_exactly(size), error);
		if (error) {
			std::cout << "[socket::write] error : " << error << std::endl;
			return false;
		}
		if (size != len) {
			std::cout << "[socket::write] size error : " << size << ", " << len << std::endl;
			return false;
		}
		return true;
	}

	bool write(boost::asio::streambuf &streambuf) {
		size_t checksum = streambuf.size();
		boost::system::error_code error;
		size_t len = boost::asio::write(*socket, streambuf, boost::asio::transfer_exactly(checksum), error);
		if (error) {
			std::cout << "[socket::write] error : " << error << std::endl;
			return false;
		}
		if (checksum != len) {
			std::cout << "[socket::write] size error : " << streambuf.size() << ", " << len << std::endl;
			return false;
		}
		return true;
	}

	template< class T >
	bool write_buffer(std::vector<T> &buffer) {
		boost::system::error_code error;

		// write buffer size
		int buf_size = buffer.size() * sizeof(T);
		if (!write(&buf_size, 4)) {
			return false;
		}

		// write buffer
		if (!write(buffer.data(), buf_size)) {
			return false;
		}

		return true;
	}

	bool write_string(const char *str) {
		boost::system::error_code error;

		// write buffer size
		int buf_size = strlen(str) + 1;
		if (!write(&buf_size, 4)) {
			return false;
		}

		// write buffer
		if (!write(str, buf_size)) {
			return false;
		}

		return true;
	}
};

#endif


text:
module Shoppe
  module ProductCategoryHelper
    def nested_product_category_spacing_adjusted_for_depth(category, relative_depth)
      depth = category.depth - relative_depth
      spacing = depth < 2 ? 0.8 : 1.5
      ("" * category.depth).html_safe
    end

    def nested_product_category_rows(category, current_category = nil, link_to_current = true, relative_depth = 0)
      if category.present? && category.children.count > 0
        ''.tap do |s|
          category.children.ordered.each do |child|
            s << '
'
            s << ''
            if child == current_category
              if link_to_current == false
                s << "#{nested_product_category_spacing_adjusted_for_depth child, relative_depth} ↳ #{child.name} (#{t('shoppe.product_category.nesting.current_category')})"
              else
                s << "#{nested_product_category_spacing_adjusted_for_depth child, relative_depth} ↳ #{link_to(child.name, [:edit, child]).html_safe} (#{t('shoppe.product_category.nesting.current_category')})"
              end
            else
              s << "#{nested_product_category_spacing_adjusted_for_depth child, relative_depth} ↳ #{link_to(child.name, [:edit, child]).html_safe}"
            end
            s << '	'
            s << '
'
            s << nested_product_category_rows(child, current_category, link_to_current, relative_depth)
          end
        end.html_safe
      else
        ''
      end
    end
  end
end


text:
This project contains a plugin developed for Visual Paradigm 12.0 (www.visual-paradigm.com) which
implements a UML profile for MLT (with the «powertype» and «instantiation» stereotypes) and adds syntactic constraints to support the verification of MLT rules.

In order to use this plugin, extract the project to the folder $VISUAL_PARADIGM$/plugins/ and run the application. In the Classical Layout, the button "Run MLT Plugin" will appear under the menu "Tools/". The validation log appears in the  view "Log", tab "MLTPlugin".

Required Versions:
 - Visual Paradigm 12.0 Community Edition
 - Java SE 7

History:
 - Created by Claudenir M. Fonseca (15/03/2016)