text:
<?php

/**
 * This class exists purely to route CI type errors to the error handler
 *
 * @package     Nails
 * @subpackage  common
 * @category    errors
 * @author      Nails Dev Team
 * @link
 */

namespace Nails\Common\CodeIgniter\Core;

use CI_Exceptions;
use Nails\Common\Exception\NailsException;
use Nails\Factory;
use Nails\Functions;

/**
 * Class Exceptions
 *
 * @package Nails\Common\CodeIgniter\Core
 */
class Exceptions extends CI_Exceptions
{
    /**
     * Override the show_error method and pass to the Nails ErrorHandler
     *
     * @param string  $sSubject      The error's subject
     * @param string  $sMessage      The error message
     * @param string  $sTemplate     Unused; only there to suppress compatibility notification
     * @param int     $iStatusCode   Unused; only there to suppress compatibility notification
     * @param boolean $bUseException Whether to use an exception
     *
     * @throws NailsException
     */
    public function show_error(
        $sSubject,
        $sMessage = '',
        $sTemplate = '500',
        $iStatusCode = 500,
        $bUseException = true
    ) {
        Functions::showError(
            $sMessage,
            $sSubject,
            $iStatusCode,
            $bUseException
        );
    }

    // --------------------------------------------------------------------------

    /**
     * Override the show_exception method and pass to the Nails ErrorHandler
     *
     * @param \Exception $oException
     */
    public function show_exception($oException)
    {
        $oErrorHandler = Factory::service('ErrorHandler');
        $sMessage      = implode(
            '; ',
            [
                'Code: ' . $oException->getCode(),
                'File: ' . $oException->getFile(),
                'Line: ' . $oException->getLine(),
            ]
        );
        $oErrorHandler->showFatalErrorScreen($oException->getMessage(), $sMessage);
    }

    // --------------------------------------------------------------------------

    /**
     * Overrides the show_php_error method in order to track errors
     *
     * @param int    $iSeverity
     * @param string $sMessage
     * @param string $sFilePath
     * @param int    $iLine
     *
     * @return string
     */
    public function show_php_error($iSeverity, $sMessage, $sFilePath, $iLine)
    {
        $oErrorHandler = Factory::service('ErrorHandler');
        return $oErrorHandler->triggerError($iSeverity, $sMessage, $sFilePath, $iLine);
    }

    // --------------------------------------------------------------------------

    /**
     * Renders the 404 page and halts script execution
     *
     * @param bool $bLogError Whether to log the error
     */
    public function show_404($sPage = '', $bLogError = true)
    {
        Functions::show404($bLogError);
    }

    // --------------------------------------------------------------------------

    /**
     * Renders the 401 page and halts script execution
     *
     * @param bool $bLogError Whether to log the error
     */
    public function show_401($bLogError = true)
    {
        Functions::show401($bLogError);
    }
}


text:
package net.dsc.hazelcast.message;

import java.io.Serializable;

public class FlowMessage implements Serializable{

	private static final long serialVersionUID = 1L;
	public String json;

	public FlowMessage(String json){
		this.json = json;

	}
}

redpajama_set_name: RedPajamaGithub


text: Meu website pessoal


text:
class RemoveUnusedColumnFromFavorites < ActiveRecord::Migration

  def up
    remove_column :favorites, :body
  end

  def down
    add_column :favorites, :body, :text
  end
end


text:
import mock
from mock import PropertyMock

import pytest

from rest_framework.test import APIRequestFactory
from rest_framework.test import force_authenticate

from django.contrib.contenttypes.models import ContentType

from awx.api.views import (
    RoleUsersList,
    UserRolesList,
    TeamRolesList,
)

from awx.main.models import (
    User,
    Role,
)

@pytest.mark.parametrize("pk, err", [
    (111, "not change the membership"),
    (1, "may not perform"),
])
def test_user_roles_list_user_admin_role(pk, err):
    with mock.patch('awx.api.views.get_object_or_400') as role_get, \
            mock.patch('awx.api.views.ContentType.objects.get_for_model') as ct_get:

        role_mock = mock.MagicMock(spec=Role, id=1, pk=1)
        content_type_mock = mock.MagicMock(spec=ContentType)
        role_mock.content_type = content_type_mock
        role_get.return_value = role_mock
        ct_get.return_value = content_type_mock

        with mock.patch('awx.api.views.User.admin_role', new_callable=PropertyMock, return_value=role_mock):
            factory = APIRequestFactory()
            view = UserRolesList.as_view()

            user = User(username="root", is_superuser=True, pk=1, id=1)

            request = factory.post("/user/1/roles", {'id':pk}, format="json")
            force_authenticate(request, user)

            response = view(request, pk=user.pk)
            response.render()

            assert response.status_code == 403
            assert err in response.content

@pytest.mark.parametrize("admin_role, err", [
    (True, "may not perform"),
    (False, "not change the membership"),
])
def test_role_users_list_other_user_admin_role(admin_role, err):
    with mock.patch('awx.api.views.RoleUsersList.get_parent_object') as role_get, \
            mock.patch('awx.api.views.ContentType.objects.get_for_model') as ct_get:

        role_mock = mock.MagicMock(spec=Role, id=1)
        content_type_mock = mock.MagicMock(spec=ContentType)
        role_mock.content_type = content_type_mock
        role_get.return_value = role_mock
        ct_get.return_value = content_type_mock

        user_admin_role = role_mock if admin_role else None
        with mock.patch('awx.api.views.User.admin_role', new_callable=PropertyMock, return_value=user_admin_role):
            factory = APIRequestFactory()
            view = RoleUsersList.as_view()

            user = User(username="root", is_superuser=True, pk=1, id=1)
            queried_user = User(username="maynard")

            request = factory.post("/role/1/users", {'id':1}, format="json")
            force_authenticate(request, user)

            with mock.patch('awx.api.views.get_object_or_400', return_value=queried_user):
                response = view(request)
            response.render()

            assert response.status_code == 403
            assert err in response.content

def test_team_roles_list_post_org_roles():
    with mock.patch('awx.api.views.get_object_or_400') as role_get, \
            mock.patch('awx.api.views.ContentType.objects.get_for_model') as ct_get:

        role_mock = mock.MagicMock(spec=Role)
        content_type_mock = mock.MagicMock(spec=ContentType)
        role_mock.content_type = content_type_mock
        role_get.return_value = role_mock
        ct_get.return_value = content_type_mock

        factory = APIRequestFactory()
        view = TeamRolesList.as_view()

        request = factory.post("/team/1/roles", {'id':1}, format="json")
        force_authenticate(request, User(username="root", is_superuser=True))

        response = view(request)
        response.render()

        assert response.status_code == 400
        assert 'cannot assign' in response.content


text:
![logo](https://raw.github.com/inikulin/ineed/master/logo.png)

[![Build Status](https://api.travis-ci.org/inikulin/ineed.svg)](https://travis-ci.org/inikulin/ineed)

*Web scraping and HTML-reprocessing. The easy way.*

`ineed` allows you collect useful data from web pages using simple and nice API. Let's collect images, hyperlinks, scripts and stylesheets from http://google.com:

```js

var ineed = require('ineed');

ineed.collect.images.hyperlinks.scripts.stylesheets.from('http://google.com',
    function (err, response, result) {
        console.log(result);
    });

```

Also, it can be used to build HTML-reprocessing pipelines (like [jch/html-pipeline](https://github.com/jch/html-pipeline) but for Node) with elegance. E.g. we have the following `html`:
```html
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
        border-radius()
          -webkit-border-radius: arguments
          -moz-border-radius: arguments
          border-radius: arguments

        ul
          margin: 5px
          border: 1px solid
          border-radius: 5px
    </style>
</head>
<body>
This is an H1
=============
*   Red
*   Green
*   Blue
</body>
</html>
```

Let's render it's `<style>` with [stylus](https://github.com/learnboost/stylus) and convert text from Markdown to HTML using [marked](https://github.com/chjj/marked) then assemble results back to HTML:

```js
var ineed = require('ineed'),
    stylus = require('stylus'),
    marked = require('marked');

function renderStylus(code) {
    var css = null;

    stylus.render(code, null, function (err, result) {
        css = result;
    });

    return css;
}

var resultHtml = ineed.reprocess.cssCode(renderStylus).texts(marked).fromHtml(html);
```

And the `resultHtml` will be:
```html
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
        .ul {
            margin: 5px;
            border: 1px solid;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
        }
    </style>
</head>
<body>
<h1 id="this-is-an-h1">This is an H1</h1>
<ul>
    <li>Red</li>
    <li>Green</li>
    <li>Blue</li>
</ul>
</body>
</html>
```

`ineed` doesn't build and traverse DOM-tree, it operates on sequence of HTML tokens instead. Whole processing is done in  [one-pass](http://en.wikipedia.org/wiki/One-pass_algorithm), therefore, **it's blazing fast**! The token stream is produced by [parse5](https://github.com/inikulin/parse5) which parses HTML exactly the same way modern browsers do.

`ineed` provides built-in collectors and reprocessors that covers a wide variety of common use cases. However, if you feel that something is missing, then you can easily extend `ineed` with [custom plugins](#custom-plugins).

## Install
```
$ npm install ineed
```

## Usage
The general form:

#### ```ineed.<action>[.<plugin>...].<from*>```

### from* methods
##### .fromHtml(html)
Accepts `html` string as an argument and synchronously returns `result` of the action.

*Example:*
```js
var result = ineed.collect.texts.fromHtml('<div>Hey ya</div>');
```

##### .from(options, callback)
Asynchronously loads specified page and invokes `callback(err, response, result)`. It passes `response` object to `callback` in case if you need response headers or status codes. The first argument can be either a `url` or an `options` object.
The set of options is the same as in @mikeal's [request](https://github.com/mikeal/request#requestoptions-callback), so you can use POST method, set request headers or do any other advanced setup for the page request.

*Examples:*
```js
ineed.collect.jsCode.from('https://github.com', function (err, response, result) {
    console.log(response.statusCode);
    console.log(response.headers);
});
```
```js
ineed.collect.title.from({
    url: 'https://test.domain/',
    method: 'POST',
    form: 'input=test'
}, function (err, response, result) {
    console.log(result);
});

```

### .collect action
Collects information specified by plugin set. The `result` of the action is an object that contains individual plugin outputs as properties.

*Example*:
```js
var result = ineed.collect.texts.images.scripts.fromHtml(html);
```
will produce `result`:
```js
{
    "texts" : <collected texts>,
    "images" : <collected images>,
    "scripts" : <collected scripts>
}
```
Built-in plugins:

| Plugin|Description| Output |
--- | --- | ---
`.comments`| Collects HTML comments| Array of comment string
`.cssCode`| Collects CSS code enclosed in `<style>` tags| Array of CSS code strings
`.hyperlinks`| Collects URL (*see remark below*) and text of the hyperlinks | Array of `{href:[String], text:[String]}` objects
`.images`| Collects absolute URL (*see remark below*) and `alt` attribute of the images | Array of `{src:[String], alt:[String]}` objects
`.jsCode`| Collects JavaScript code enclosed in `<script>` tags |Array of JavaScript code strings
`.scripts` |Collects URL (*see remark below*) of the external `.js`-files, specified via `<script>` tags with `src` attribute  | Array of script URLs
`.stylesheets`| Collects URL (*see remark below*) of the external `*.css`-files, specified via `<link>` tag| Array of stylesheet URLs
`.texts`| Collects all text nodes in `<body>` of the document with except for `<script>` and `<style>` tag's content. Speaking clearly: all end-user visible text.  | Array of text strings
`.title`| Collects document title | Document title string

*Remark:* All URLs are collected in respect to `<base>` tag. The resulting URL will be an absolute URL if `.from()` method was used, `<base>` tag constains absolute URL or raw collected URL is already absolute.

### .reprocess action
Applies plugins' replacing functions to the source HTML-string. The `result` of the action is the reprocessed HTML-string.

*Example*:
```js
//Delete all HTML comments and render emoji
var result = ineed.reprocess
    .comments(function() {
        return null;
    })
    .texts(function(text, escapeHtml) {
        return escapeHtml(text).replace(/:beer:/g, '<img src="emoji/unicode/1f37a.png" alt=":beer:">');
    })
    .fromHtml(html);
```

Built-in plugins:

| Plugin        | `replacer` arguments | Description |
--- | --- | ---
`.comments(replacer)`|`replacer(commentString)` | Replaces HTML `commentString` with the value returned by `replacer`. Comment will be deleted from markup if `null` is returned.
`.cssCode(replacer)`|`replacer(cssCodeString)` | Replaces `cssCodeString` enclosed in `<style>` tag with the value returned by `replacer`.
`.hyperlinks(replacer`)|`replacer(pageBaseUrl, hrefAttrValue)`| Replaces `<a>` tag `href` attribute value with the value returned by `replacer`.
`.images(replacer)`|`replacer(pageBaseUrl, srcAttrValue)` | Replaces `<img>` tag `src` attribute value with the value returned by `replacer`.
`.jsCode(replacer)`|`replacer(jsCodeString)` | Replaces `jsCodeString` enclosed in the `<script>` tag with the value returned by `replacer`.
`.scripts(replacer)` | `replacer(pageBaseUrl, srcAttrValue)`| Replaces `<script>` tag `src` attribute value with the value returned by `replacer`.
`.stylesheets(replacer)`|`replacer(pageBaseUrl, hrefAttrValue)`| Replaces `<link rel="stylesheet">` tag `href` attribute value with the value returned by `replacer`.
`.texts(replacer)`| `replacer(text, escapeHtmlFunc)`| Replaces `text` with the value returned by `replacer`. Returned value will be not HTML escaped, so HTML code can be used as `replacer` result. You can manually apply `escapeHtmlFunc(str)` to force HTML escaping of the result.
`.title(replacer)`|`replacer(title)` | Replaces page `title` with the value returned by `replacer`.

## Custom plugins
There are two kinds of plugins: those that extends `.collect` action and those that extends `.reprocess` action. To enable plugin use `.using()` function, which will return new instance of `ineed` with enabled plugin.

*Example:*
```js
ineed
    .using(myPlugin1)
    .using(myPlugin2)
    .collect
    ...
```

### Common structure

Plugins of both kinds are objects and in addition to the kind-specific properties they should have the following properties:
#### .extends
Indicates which action will be extended by plugin. Can be `'collect'` or `'reprocess'`. Required property.

#### .name
Name of the plugin. Required property. It should reflect the target of the plugin action. Plugin will be accessable under the `name` in the `.collect` or `.reprocess` objects and will be used as result property name for `.collect` action. E.g. `plugin` has `name='tagNames'`. If it extends `.collect`:
```js
//Enable plugin and use it
var result = ineed.using(plugin).collect.tagNames.fromHtml(html);

//Access plugin results
var pluginResults = result.tagNames;
```

If it extends `.reprocess`:
```js
 var reprocessedHtml = ineed
        .using(plugin)
        .reprocess
        .tagNames(function (tagName) {
            if (tagName === 'applet')
                return 'object';
        })
        .fromHtml(html);
```

#### .init(ctx, ...)
Function that initializes plugin. Required field. It always receives `ctx` object as it first argument. `ctx` contains
some useful common information regarding current pipeline state:
##### ctx.baseUrl
Base URL of all resources on the page with respect to `<base>` tag.

##### ctx.leadingStartTag
Leading non-self-closing start tag for the current HTML token. Can be used to determine parent of the text nodes. Will be `null` if the leading start tag was self-closing or any leading end tag was met.

##### ctx.inBody
Indicates if emitted tokens are in `<body>` tag.

#### Token handlers
Plugin can have one or more HTML token handlers:
*  `.onDoctype(doctype)`

Where `doctype`:
```js
{
    name: [String],
    publicId: [String],
    systemId: [String]
}
```

*  `.onStartTag(startTag)`

Where `startTag`:
```js
{
    tagName: [String],
    attrs: [Array],
    selfClosing: [Boolean]
}
```
*  `.onEndTag(tagName)`
*  `.onText(text)`
*  `.onComment(commentText)`

### Collecting plugins
Collecting plugins in addition to [common properties](#common-structure) should have `.getCollection()` method that should return items collected by plugin.

*Example of the collecting plugin:*
```js
//Collects tagNames in <body>
var plugin = {
    extends: 'collect',
    name: 'tagNamesInBody',

    init: function (ctx) {
        this.ctx = ctx;
        this.tagNames = [];
    },

    addTagName: function (tagName) {
        if (this.ctx.inBody && this.tagNames.indexOf(tagName) < 0)
            this.tagNames.push(tagName);
    },

    onStartTag: function (startTag) {
        this.addTagName(startTag.tagName);
    },

    onEndTag: function (tagName) {
        this.addTagName(tagName);
    },

    getCollection: function () {
        return this.tagNames;
    }
};

//Let's use it
var results = ineed.using(plugin).collect.tagNamesInBody.fromHtml(html);
console.log(results.tagNamesInBody);
```

### Reprocessing plugins
Reprocessing plugin's `init` method in addition to `ctx` object receives all arguments passed to plugin in pipeline (e.g. `replacer()` function). If token handler returns `null` then token will be deleted from the pipeline and no farther processing by other plugins will be performed on it and it will not appear in the resulting HTML. If handler returns modified token then it will be passed to the farther plugins and will appear in the resulting HTML. If handler doesn't returns value or returns `undefined` then token will be passed unmodified to the farther plugins.

*Example of the reprocessing plugin:*
```js
//Replaces or deletes tagNames in <body>
var plugin = {
    extends: 'reprocess',
    name: 'tagNamesInBody',

    init: function (ctx, replacer) {
        this.ctx = ctx;
        this.replacer = replacer;
    },

    onStartTag: function (startTag) {
        if (this.ctx.inBody) {
            startTag.tagName = this.replacer(startTag.tagName);

            //Delete token if tagName is null
            return startTag.tagName === null ? null : startTag;
        }
    },

    onEndTag: function (tagName) {
        if (this.ctx.inBody)
            return this.replacer(tagName);
    }
};

//Let's use it
var reprocessedHtml = ineed
    .using(plugin)
    .reprocess
    .tagNamesInBody(function (tagName) {
        //Delete <noscript> start and end tags
        if (tagName === 'noscript')
            return null;

        //Replace <div> with <p>
        if(tagName === 'div')
            return 'p';

        return tagName;
    }).fromHtml(html);

```

## Testing
```
$ npm test
```

## Questions or suggestions?
If you have any questions, please feel free to create an issue [here on github](https://github.com/inikulin/ineed/issues).

## Author
[Ivan Nikulin](https://github.com/inikulin) (ifaaan@gmail.com)


text:
![](https://nexus.lab.fiware.org/static/badges/statuses/deprecated.svg)

> This repository is now archived and subsequent works will be carried out the
> in [Smart data models](https://github.com/smart-data-models) repositories.

## Description

Smart Spots are devices which provide the technology which allows users to get
access to smart points of interaction so that they can obtain extra information
(infotainment, etc.), provide suggestions (suggestions mailbox, etc.) or
generate new content (co-creation, etc.). The data model contains resources to
configure the interaction service such as the broadcasted URL (typically
shortened), the period between broadcasts, the availability of the service,
transmission power depending on the area to be covered, etc.

In addition to the presented data model, this entity type inherits from the
[Device](../../../Device/Device/doc/spec.md) entity type. This means that by
hierarchy, the `SmartSpot` entity type is a subtype of
[Device](../../../Device/Device/doc/spec.md) and as a result it can be the
subject of any of the properties that an entity of type
[Device](../../../Device/Device/doc/spec.md) may have.

## Data Model

The data model is defined as shown below:

-   `id` : Unique identifier.

-   `type` : Entity type. It must be equal to `SmartSpot`.

-   `source` : A sequence of characters giving the source of the entity data.

    -   Attribute type: Property. [Text](https://schema.org/Text) or
        [URL](https://schema.org/URL)
    -   Optional

-   `dataProvider` : Specifies the URL to information about the provider of this
    information

    -   Attribute type: Property. [URL](https://schema.org/URL)
    -   Optional

-   `announcedUrl` : URL broadcasted by the device.

    -   Attribute type: Property. [URL](https://schema.org/URL)
    -   Mandatory

-   `signalStrength` : Signal strength to adjust the announcement range.

    -   Attribute type: Property. [Text](https://schema.org/Text)
    -   Allowed values: "lowest", "medium" or "highest".
    -   Mandatory

-   `bluetoothChannel` : Bluetooth channels where to transmit the announcement.

    -   Attribute type: Property. [Text](https://schema.org/Text)
    -   Allowed values: "37", "38", "39", "37,38", "38,39", "37,39" or
        "37,38,39".
    -   Mandatory

-   `coverageRadius` : Radius of the spot coverage area in meters.

    -   Attribute type: Property. [Number](https://schema.org/Number)
    -   Default unit: Meters.
    -   Optional

-   `announcementPeriod` : Period between announcements.

    -   Attribute type: Property. [Number](https://schema.org/Number)
    -   Default unit: Milliseconds.
    -   Mandatory

-   `availability`: Specifies the functionality intervals in which the
    announcements will be sent. The syntax must be conformant with schema.org
    [openingHours specification](https://schema.org/openingHours). For instance,
    a service which is only active on dayweeks will be encoded as
    "availability": "Mo,Tu,We,Th,Fr,Sa 09:00-20:00".

    -   Attribute type: Property. [Text](https://schema.org/Text)
    -   Mandatory.

-   `refSmartPointOfInteraction` : Reference to the Smart Point of Interaction
    which includes this Smart Spot.
    -   Attribute type: Relationship. Reference to an entity of type
        [SmartPointOfInteraction](../../SmartPointOfInteraction/doc/spec.md)
    -   Optional

**Note**: JSON Schemas are intended to capture the data type and associated
constraints of the different Attributes, regardless their final representation
format in NGSI(v2, LD).

## Examples

### Normalized Example

Normalized NGSI response

```json
{
    "id": "SSPOT-F94C51A295D9",
    "type": "SmartSpot",
    "announcementPeriod": {
        "value": 500
    },
    "signalStrength": {
        "value": "highest"
    },
    "announcedUrl": {
        "value": "http://goo.gl/EJ81JP"
    },
    "availability": {
        "value": "Tu,Th 16:00-20:00"
    },
    "coverageRadius": {
        "value": 30
    },
    "bluetoothChannel": {
        "value": "37,38,39"
    },
    "refSmartPointOfInteraction": {
        "type": "Relationship",
        "value": "SPOI-ES-4326"
    }
}
```

### key-value pairs Example

Sample uses simplified representation for data consumers `?options=keyValues`

```json
{
    "id": "SSPOT-F94C51A295D9",
    "type": "SmartSpot",
    "announcedUrl": "http://goo.gl/EJ81JP",
    "signalStrength": "high",
    "bluetoothChannel": "37-38-39",
    "coverageRadius": 30,
    "announcementPeriod": 500,
    "availability": "Tu,Th 16:00-20:00",
    "refSmartPointOfInteraction": "SPOI-ES-4326"
}
```

### LD Example

Sample uses the NGSI-LD representation

```json
{
    "id": "urn:ngsi-ld:SmartSpot:SSPOT-F94C51A295D9",
    "type": "SmartSpot",
    "announcementPeriod": {
        "type": "Property",
        "value": 500
    },
    "signalStrength": {
        "type": "Property",
        "value": "highest"
    },
    "announcedUrl": {
        "type": "Property",
        "value": "http://goo.gl/EJ81JP"
    },
    "availability": {
        "type": "Property",
        "value": "Tu,Th 16:00-20:00"
    },
    "coverageRadius": {
        "type": "Property",
        "value": 30
    },
    "bluetoothChannel": {
        "type": "Property",
        "value": "37,38,39"
    },
    "refSmartPointOfInteraction": {
        "type": "Relationship",
        "object": "urn:ngsi-ld:SmartPointOfInteraction:SPOI-ES-4326"
    },
    "@context": [
        "https://schema.lab.fiware.org/ld/context",
        "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
    ]
}
```

## Use it with a real service

T.B.D.


text:
using System.Collections;
using System.Collections.Generic;
using UMA.CharacterSystem;
using UMA;
using UnityEngine;
using UnityEngine.Events;

[ExecuteInEditMode]
public class UMAMountedItem : MonoBehaviour
{
    [Tooltip("The name of the bone. Case must match.")]
    public string BoneName;

    [Tooltip("Unique ID for this object. Example: 'RightHandMount")]
    public string ID;
    public Vector3 Position;
    public Quaternion Orientation;
    public string IgnoreTag = "UMAIgnore";

    [Tooltip("If true the object will scale to bone DNA")]
    public bool setScale = true;

    [Tooltip("Mount this item in startup. Useful when instantiating prefabs.")]
    public bool MountOnStart;

    private int BoneHash;
    private DynamicCharacterAvatar avatar;
    private Transform MountPoint;  // This is the mount point we create/update.
    private UMAData lastUmaData;

    // Start is called before the first frame update
    void Start()
    {
        Initialize();
        gameObject.tag = IgnoreTag;
    }

    private bool Initialize()
    {
        avatar = GetComponentInParent<DynamicCharacterAvatar>();
        if (avatar == null)
        {
            return false;
        }
        avatar.CharacterUpdated.AddListener(new UnityAction<UMAData>(CharacterUpdated));
#if UNITY_EDITOR
        if (!Application.isPlaying || MountOnStart)
        {
            MountPoint = EditorFindOrCreateMountpoint();
            SetMountTransform();
        }
#endif
        return true;
    }

    // Used when mounting manually.
    public bool MountItem()
    {
        if (avatar == null)
        {
            Initialize();
            if (avatar == null)
                return false;
        }
        MountPoint = FindOrCreateMountpoint(avatar.umaData);
        SetMountTransform();
        return true;
    }

#if UNITY_EDITOR
    public Transform EditorFindOrCreateMountpoint()
    {
        Transform BoneTransform = SkeletonTools.RecursiveFindBone(avatar.gameObject.transform, BoneName);
        if (BoneTransform == null)
            return null;
        foreach (Transform child in BoneTransform)
        {
            if (child.name == ID)
            {
                return child;
            }
        }
        return CreateMountpoint(BoneTransform, avatar.gameObject.layer);
    }
#endif

    public void ResetMountPoint()
    {
        MountPoint = FindOrCreateMountpoint(avatar.umaData);
        SetMountTransform();
    }

    public Transform FindOrCreateMountpoint(UMAData umaData)
    {
        if (string.IsNullOrEmpty(BoneName))
        {
            return null;
        }
        if (umaData == null || umaData.skeleton == null)
        {
            return null;
        }
        BoneHash = UMAUtils.StringToHash(BoneName);
        Transform BoneTransform = umaData.skeleton.GetBoneTransform(BoneHash);
        if (BoneTransform == null)
        {
            return null;
        }
        foreach (Transform child in BoneTransform)
        {
            if (child.name == ID)
            {
                UpdateMountPoint(child);
                return child;
            }
        }

        return CreateMountpoint(BoneTransform, umaData.gameObject.layer);
    }

    private void UpdateMountPoint(Transform newRoot)
    {
        newRoot.transform.localPosition = Position;
        newRoot.transform.localRotation = Orientation;
        newRoot.transform.localScale = Vector3.one;
    }

    private Transform CreateMountpoint(Transform BoneTransform, int Layer)
    {
        GameObject newRoot = new GameObject(ID);
        newRoot.layer = Layer;
        newRoot.transform.parent = BoneTransform;
        newRoot.transform.localPosition = Position;
        newRoot.transform.localRotation = Orientation;
        newRoot.transform.localScale = Vector3.one;
        return newRoot.transform;
    }

    public void CharacterUpdated(UMAData umaData)
    {
        // Debug.Log("Getting bone info");
        MountPoint = FindOrCreateMountpoint(umaData);
        lastUmaData = umaData;
    }

    void LateUpdate()
    {
        if (avatar == null)
        {
            if (!Initialize())
                return;
        }
        if (MountPoint != null)
        {
            // get the worldpos/orientation of the mounted object.
            // copy to this object.
            SetMountTransform();
        }
        else
        {
            if (lastUmaData != null)
            {
                FindOrCreateMountpoint(lastUmaData);
                SetMountTransform();
            }
        }
    }

    private void SetMountTransform()
    {
       // Debug.Log("Setting mount transform");
        if (MountPoint != null)
        {
            Vector3 globalScale = avatar.gameObject.transform.lossyScale;

            transform.position = MountPoint.position;
            transform.rotation = MountPoint.rotation;
            if (setScale == true)
            {
                MountPoint.localScale = MountPoint.parent.localScale;
                transform.localScale = MountPoint.localScale;
            }
        }
    }
}


text:
#include <QDebug>
#include <QJsonObject>
#include <algorithm>
#include "Achievement.h"

#ifdef Q_OS_ANDROID
#include <Engine/android/AndroidActivity.h>
#endif

Achievement::Achievement(const QString& name) : mName(name) {
}

Achievement::Achievement(const QJsonObject& json) {
    if (!json.contains("Name")) {
        qDebug() << "Missing \"Name\" key.";
    } else {
        mName = json["Name"].toString();
    }

    mHasBeenRevealed = json["HasBeenRevealed"].toBool(false);
    mRevealIsDirty = json["RevealIsDirty"].toBool(false);
    mHasBeenUnlocked = json["HasBeenUnlocked"].toBool(false);
    mUnlockIsDirty = json["UnlockIsDirty"].toBool(false);
    mMinStepsSet = json["MinStepsSet"].toInt(0);
    mMinStepsDirty = json["MinStepsDirty"].toBool(false);
    mStepsIncremented = json["StepsIncremented"].toInt(0);
    mStepsIncrementedDirtiness = json["StepsIncrementedDirtiness"].toInt(0);
}

Achievement::AchievementType Achievement::getAchievementType() const {
    if (getMinStepsSet() > 0 || getStepsIncremented() > 0) {
        return INCREMENTAL;
    } else if (mHasBeenUnlocked) {
        return REGULAR;
    } else {
        // Revealed achievements could be either.
        return UNKNOWN;
    }
}

void Achievement::merge(const Achievement& achievement) {
    AchievementType ourType = getAchievementType();
    AchievementType theirType = achievement.getAchievementType();

    if (ourType != UNKNOWN && theirType != UNKNOWN && ourType != theirType) {
        qDebug() << "Error: Fundamentally cannot merge achievments of conflicting types.";
        return;
    }

    mHasBeenRevealed = mHasBeenRevealed || achievement.mHasBeenRevealed;
    mRevealIsDirty = mRevealIsDirty || achievement.mRevealIsDirty;

    if (ourType == REGULAR) {
        mHasBeenUnlocked = mHasBeenUnlocked || achievement.mHasBeenUnlocked;
        mUnlockIsDirty = mUnlockIsDirty || achievement.mUnlockIsDirty;
    } else if (ourType == INCREMENTAL) {
        mMinStepsSet = std::max(mMinStepsSet, achievement.mMinStepsSet);
        mMinStepsDirty = mMinStepsDirty || achievement.mMinStepsDirty;
        // NOTE: There is no intelligent way to know how much the increment may overlap.
        mStepsIncremented = std::max(mStepsIncremented, achievement.mStepsIncremented);
        mStepsIncrementedDirtiness = std::max(mStepsIncrementedDirtiness,
                achievement.mStepsIncrementedDirtiness);
    }
}

QJsonObject Achievement::toJsonObject() const {
    QJsonObject json;
    json["Name"] = mName;
    if (mHasBeenRevealed) {
        json["HasBeenRevealed"] = true;
    }
    if (mRevealIsDirty) {
        json["RevealIsDirty"] = true;
    }
    if (mHasBeenUnlocked) {
        json["HasBeenUnlocked"] = true;
    }
    if (mUnlockIsDirty) {
        json["UnlockIsDirty"] = true;
    }
    if (mMinStepsSet > 0) {
        json["MinStepsSet"] = mMinStepsSet;
    }
    if (mMinStepsDirty) {
        json["MinStepsDirty"] = true;
    }
    if (mStepsIncremented > 0) {
        json["StepsIncremented"] = mStepsIncremented;
    }
    if (mStepsIncrementedDirtiness > 0) {
        json["StepsIncrementedDirtiness"] = mStepsIncrementedDirtiness;
    }
    return json;
}

void Achievement::reveal(bool immediately) {
    if (!mHasBeenRevealed) {
        mHasBeenRevealed = true;
        mRevealIsDirty = !(immediately && cloudReveal());
    }
}

void Achievement::increment(int numSteps, bool immediately) {
    Q_ASSERT(getAchievementType() != REGULAR);
    if (numSteps > 0) {
        mStepsIncremented += numSteps;
        int stepsToIncrement = mStepsIncrementedDirtiness + numSteps;
        mStepsIncrementedDirtiness = !(immediately && cloudIncrement(stepsToIncrement))
                ? stepsToIncrement : 0;
    }
}

void Achievement::setSteps(int numSteps, bool immediately) {
    Q_ASSERT(getAchievementType() != REGULAR);
    if (numSteps > mMinStepsSet) {
        mMinStepsSet = numSteps;
        mMinStepsDirty = !(immediately && cloudSetSteps(numSteps));
    }
}

void Achievement::unlock(bool immediately) {
    Q_ASSERT(getAchievementType() != INCREMENTAL);
    if (!mHasBeenUnlocked) {
        mHasBeenUnlocked = true;
        mUnlockIsDirty = !(immediately && cloudUnlock());
    }
}

bool Achievement::saveToCloud() {
    if (mHasBeenRevealed && mRevealIsDirty) {
        mRevealIsDirty = !cloudReveal();
    }
    if (mHasBeenUnlocked && mUnlockIsDirty) {
        mUnlockIsDirty = !cloudUnlock();
    }
    if (mMinStepsSet > 0 && mMinStepsDirty) {
        mMinStepsDirty = !cloudSetSteps(mMinStepsSet);
    }
    if (mStepsIncremented > 0 && mStepsIncrementedDirtiness > 0) {
        mStepsIncrementedDirtiness = !cloudIncrement(mStepsIncrementedDirtiness)
            ? mStepsIncrementedDirtiness : 0;
    }
    return !mRevealIsDirty && !mUnlockIsDirty && !mMinStepsDirty && mStepsIncrementedDirtiness <= 0;
}

bool Achievement::cloudUnlock() {
    return true;
}

bool Achievement::cloudReveal() {
    return true;
}

bool Achievement::cloudIncrement(int numSteps) {
    Q_UNUSED(numSteps);
    return true;
}

bool Achievement::cloudSetSteps(int numSteps) {
    Q_UNUSED(numSteps);
    return true;
}


text:
package util

// KeysStr returns keys of map
func KeysStr(m map[string]string) []string {
	keys := make([]string, 0, len(m))
	for k := range m {
		keys = append(keys, k)
	}
	return keys
}

// IncludeStr check if slice includes a target.
func IncludeStr(s []string, t string) bool {
	for _, v := range s {
		if v == t {
			return true
		}
	}
	return false
}


text:
var express = require("express");
var app = express();
var fs = require('fs');

app.use(express.static("public"));
app.set("view engine", "ejs");

var web_projects_results;
var graphic_projects_results
fs.readFile('json/web_projects.json', 'utf8', function(err, data){
  if(err){
    throw err;
  } else {
    web_projects_results = JSON.parse(data)
  }
})
fs.readFile('json/graphic_projects.json', 'utf8', function(err, data){
  if(err){
    throw err;
  } else {
    graphic_projects_results = JSON.parse(data)
  }
})

// ========================
//ROUTES
// ========================

app.get("/", function(req, res) {
  res.render("index", {
    title: 'Home',
    web_projects: web_projects_results,
    graphic_projects : graphic_projects_results
  });
});

app.get("/about", function(req, res) {

})

app.get("/projects", function(req, res) {
    res.render("projects", {
    title: 'Projects',
    projects: results
  });
})

app.get("*", function(req, res) {

})

app.listen(3000, function(){
  console.log("Personal Portfolio Server has started")
})


text:
#region Usings
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Utilities.DataTypes;
using Utilities.DataTypes.ExtensionMethods;
using Utilities.ORM.Mapping.Interfaces;
using Utilities.ORM.QueryProviders.Interfaces;
using Utilities.SQL.DataClasses.Enums;
#endregion

namespace Utilities.ORM.Database
{
    /// <summary>
    /// Database manager (handles generation and mapping of stored procedures)
    /// </summary>
    public class DatabaseManager
    {
        #region Constructor

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Mappings">Mappings associated with databases (provided by query provider)</param>
        public DatabaseManager(ListMapping<IDatabase, IMapping> Mappings)
        {
            this.Mappings = Mappings;
            this.DatabaseStructures = new System.Collections.Generic.List<SQL.DataClasses.Database>();
        }

        #endregion

        #region Functions

        #region Setup

        /// <summary>
        /// Sets up the databases
        /// </summary>
        public virtual void Setup()
        {
            foreach (IDatabase Key in Mappings.Keys)
            {
                if (Key.Update)
                {
                    string DatabaseName = Regex.Match(Key.ConnectionString, "Initial Catalog=(.*?;)").Value.Replace("Initial Catalog=", "").Replace(";", "");
                    Utilities.SQL.DataClasses.Database TempDatabase = new SQL.DataClasses.Database(DatabaseName);
                    SetupFunctions(TempDatabase);
                    SetupTables(Key, TempDatabase);
                    SetupJoiningTables(Key, TempDatabase);
                    SetupAuditTables(Key, TempDatabase);

                    DatabaseStructures.Add(TempDatabase);
                    foreach (Utilities.SQL.DataClasses.Table Table in TempDatabase.Tables)
                    {
                        Table.SetupForeignKeys();
                    }
                    Utilities.SQL.DataClasses.Database CurrentDatabase = SQL.SQLServer.SQLServer.GetDatabaseStructure(Key.ConnectionString);
                    SQL.SQLServer.SQLServer.UpdateDatabase(TempDatabase, CurrentDatabase, Key.ConnectionString);

                    foreach (IMapping Mapping in Mappings[Key])
                    {
                        foreach (IProperty Property in Mapping.Properties)
                        {
                            Property.SetupLoadCommands();
                        }
                    }
                }
            }
        }

        #endregion

        #region SetupAuditTables

        private static void SetupAuditTables(IDatabase Key, SQL.DataClasses.Database TempDatabase)
        {
            if (!Key.Audit)
                return;
            System.Collections.Generic.List<Utilities.SQL.DataClasses.Table> TempTables = new System.Collections.Generic.List<Utilities.SQL.DataClasses.Table>();
            foreach (Utilities.SQL.DataClasses.Table Table in TempDatabase.Tables)
            {
                TempTables.Add(SetupAuditTables(Table));
                SetupInsertUpdateTrigger(Table);
                SetupDeleteTrigger(Table);
            }
            TempDatabase.Tables.Add(TempTables);
        }

        private static SQL.DataClasses.Table SetupAuditTables(SQL.DataClasses.Table Table)
        {
            SQL.DataClasses.Table AuditTable = new Utilities.SQL.DataClasses.Table(Table.Name + "Audit", Table.ParentDatabase);
            AuditTable.AddColumn("ID", DbType.Int32, 0, false, true, true, true, false, "", "", 0);
            AuditTable.AddColumn("AuditType", SqlDbType.NVarChar.To(DbType.Int32), 1, false, false, false, false, false, "", "", "");
            foreach (SQL.DataClasses.Interfaces.IColumn Column in Table.Columns)
                AuditTable.AddColumn(Column.Name, Column.DataType, Column.Length, Column.Nullable, false, false, false, false, "", "", "");
            return AuditTable;
        }

        #endregion

        #region SetupDeleteTrigger

        private static void SetupDeleteTrigger(SQL.DataClasses.Table Table)
        {
            StringBuilder Columns = new StringBuilder();
            StringBuilder Builder = new StringBuilder();
            Builder.Append("CREATE TRIGGER dbo.").Append(Table.Name).Append("_Audit_D ON dbo.")
                .Append(Table.Name).Append(" FOR DELETE AS IF @@rowcount=0 RETURN")
                .Append(" INSERT INTO dbo.").Append(Table.Name).Append("Audit").Append("(");
            string Splitter = "";
            foreach (Utilities.SQL.DataClasses.Interfaces.IColumn Column in Table.Columns)
            {
                Columns.Append(Splitter).Append(Column.Name);
                Splitter = ",";
            }
            Builder.Append(Columns.ToString());
            Builder.Append(",AuditType) SELECT ");
            Builder.Append(Columns.ToString());
            Builder.Append(",'D' FROM deleted");
            Table.AddTrigger(Table.Name + "_Audit_D", Builder.ToString(), TriggerType.INSERT);
        }

        #endregion

        #region SetupInsertUpdateTrigger

        private static void SetupInsertUpdateTrigger(SQL.DataClasses.Table Table)
        {
            StringBuilder Columns = new StringBuilder();
            StringBuilder Builder = new StringBuilder();
            Builder.Append("CREATE TRIGGER dbo.").Append(Table.Name).Append("_Audit_IU ON dbo.")
                .Append(Table.Name).Append(" FOR INSERT,UPDATE AS IF @@rowcount=0 RETURN declare @AuditType")
                .Append(" char(1) declare @DeletedCount int SELECT @DeletedCount=count(*) FROM DELETED IF @DeletedCount=0")
                .Append(" BEGIN SET @AuditType='I' END ELSE BEGIN SET @AuditType='U' END")
                .Append(" INSERT INTO dbo.").Append(Table.Name).Append("Audit").Append("(");
            string Splitter = "";
            foreach (Utilities.SQL.DataClasses.Interfaces.IColumn Column in Table.Columns)
            {
                Columns.Append(Splitter).Append(Column.Name);
                Splitter = ",";
            }
            Builder.Append(Columns.ToString());
            Builder.Append(",AuditType) SELECT ");
            Builder.Append(Columns.ToString());
            Builder.Append(",@AuditType FROM inserted");
            Table.AddTrigger(Table.Name + "_Audit_IU", Builder.ToString(), TriggerType.INSERT);
        }

        #endregion

        #region SetupJoiningTables

        private void SetupJoiningTables(IDatabase Key, SQL.DataClasses.Database TempDatabase)
        {
            foreach (IMapping Mapping in Mappings[Key])
            {
                foreach (IProperty Property in Mapping.Properties)
                {
                    if (Property is IMap)
                    {
                        IMapping MapMapping = Mappings[Key].FirstOrDefault(x => x.ObjectType == Property.Type);
                        TempDatabase[Mapping.TableName].AddColumn(Property.FieldName,
                            MapMapping.IDProperty.Type.To(DbType.Int32),
                            MapMapping.IDProperty.MaxLength,
                            !Property.NotNull,
                            false,
                            Property.Index,
                            false,
                            false,
                            MapMapping.TableName,
                            MapMapping.IDProperty.FieldName,
                            "",
                            false,
                            false,
                            Mapping.Properties.Count(x => x.Type == Property.Type) == 1 && Mapping.ObjectType != Property.Type);
                    }
                    else if (Property is IManyToOne || Property is IManyToMany || Property is IIEnumerableManyToOne||Property is IListManyToMany||Property is IListManyToOne)
                    {
                        SetupJoiningTablesEnumerable(Mapping, Property, Key, TempDatabase);
                    }
                }
            }
        }

        #endregion

        #region SetupJoiningTablesEnumerable

        private void SetupJoiningTablesEnumerable(IMapping Mapping, IProperty Property, IDatabase Key, SQL.DataClasses.Database TempDatabase)
        {
            if (TempDatabase.Tables.FirstOrDefault(x => x.Name == Property.TableName) != null)
                return;
            IMapping MapMapping = Mappings[Key].FirstOrDefault(x => x.ObjectType == Property.Type);
            if (MapMapping == Mapping)
            {
                TempDatabase.AddTable(Property.TableName);
                TempDatabase[Property.TableName].AddColumn("ID_", DbType.Int32, 0, false, true, true, true, false, "", "", "");
                TempDatabase[Property.TableName].AddColumn(Mapping.TableName + Mapping.IDProperty.FieldName,
                    Mapping.IDProperty.Type.To(DbType.Int32),
                    Mapping.IDProperty.MaxLength,
                    false,
                    false,
                    false,
                    false,
                    false,
                    Mapping.TableName,
                    Mapping.IDProperty.FieldName,
                    "",
                    false,
                    false,
                    false);
                TempDatabase[Property.TableName].AddColumn(MapMapping.TableName + MapMapping.IDProperty.FieldName + "2",
                    MapMapping.IDProperty.Type.To(DbType.Int32),
                    MapMapping.IDProperty.MaxLength,
                    false,
                    false,
                    false,
                    false,
                    false,
                    MapMapping.TableName,
                    MapMapping.IDProperty.FieldName,
                    "",
                    false,
                    false,
                    false);
            }
            else
            {
                TempDatabase.AddTable(Property.TableName);
                TempDatabase[Property.TableName].AddColumn("ID_", DbType.Int32, 0, false, true, true, true, false, "", "", "");
                TempDatabase[Property.TableName].AddColumn(Mapping.TableName + Mapping.IDProperty.FieldName,
                    Mapping.IDProperty.Type.To(DbType.Int32),
                    Mapping.IDProperty.MaxLength,
                    false,
                    false,
                    false,
                    false,
                    false,
                    Mapping.TableName,
                    Mapping.IDProperty.FieldName,
                    "",
                    true,
                    false,
                    false);
                TempDatabase[Property.TableName].AddColumn(MapMapping.TableName + MapMapping.IDProperty.FieldName,
                    MapMapping.IDProperty.Type.To(DbType.Int32),
                    MapMapping.IDProperty.MaxLength,
                    false,
                    false,
                    false,
                    false,
                    false,
                    MapMapping.TableName,
                    MapMapping.IDProperty.FieldName,
                    "",
                    true,
                    false,
                    false);
            }
        }

        #endregion

        #region SetupTables

        private void SetupTables(IDatabase Key, SQL.DataClasses.Database TempDatabase)
        {
            foreach (IMapping Mapping in Mappings[Key])
            {
                TempDatabase.AddTable(Mapping.TableName);
                SetupProperties(TempDatabase[Mapping.TableName], Mapping);
            }
        }

        #endregion

        #region SetupProperties

        private static void SetupProperties(SQL.DataClasses.Table Table, IMapping Mapping)
        {
            Table.AddColumn(Mapping.IDProperty.FieldName,
                Mapping.IDProperty.Type.To(DbType.Int32),
                Mapping.IDProperty.MaxLength,
                Mapping.IDProperty.NotNull,
                Mapping.IDProperty.AutoIncrement,
                Mapping.IDProperty.Index,
                true,
                Mapping.IDProperty.Unique,
                "",
                "",
                "");
            foreach (IProperty Property in Mapping.Properties)
            {
                if (!(Property is IManyToMany || Property is IManyToOne || Property is IMap || Property is IIEnumerableManyToOne || Property is IListManyToMany || Property is IListManyToOne))
                {
                    Table.AddColumn(Property.FieldName,
                    Property.Type.To(DbType.Int32),
                    Property.MaxLength,
                    !Property.NotNull,
                    Property.AutoIncrement,
                    Property.Index,
                    false,
                    Property.Unique,
                    "",
                    "",
                    "");
                }
            }
        }

        #endregion

        #region SetupFunctions

        private static void SetupFunctions(SQL.DataClasses.Database Database)
        {
            Database.AddFunction("Split", "CREATE FUNCTION dbo.Split(@List nvarchar(MAX),@SplitOn nvarchar(5)) RETURNS @ReturnValue table(Id int identity(1,1),Value nvarchar(200)) AS  BEGIN While (Charindex(@SplitOn,@List)>0) Begin Insert Into @ReturnValue (value) Select Value = ltrim(rtrim(Substring(@List,1,Charindex(@SplitOn,@List)-1))) Set @List = Substring(@List,Charindex(@SplitOn,@List)+len(@SplitOn),len(@List)) End Insert Into @ReturnValue (Value) Select Value = ltrim(rtrim(@List)) Return END");
        }

        #endregion

        #endregion

        #region Properties

        /// <summary>
        /// Mappings associated to databases
        /// </summary>
        public ListMapping<IDatabase, IMapping> Mappings { get;private set; }

        /// <summary>
        /// List of database structures
        /// </summary>
        public ICollection<Utilities.SQL.DataClasses.Database> DatabaseStructures { get;private set; }

        #endregion
    }
}


text:
package com.itboye.bluebao.breceiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest.HttpMethod;

/**
 * 中枢控制Receiver
 * @author Administrator
 *
 */
public class ReceiverCentralControl extends BroadcastReceiver {

	private static final String TAG = "-----ReceiverCentralControl";

	@Override
	public void onReceive(Context context, Intent intent) {

		String action = intent.getAction();

		if ( "TO_LOGIN".equals(action) ) {

			String access_token = intent.getStringExtra("access_token");
			String username = intent.getStringExtra("username");
			String password = intent.getStringExtra("password");

			String url = "http://lanbao.itboye.com/api.php/User/login?access_token="+ access_token;

			Log.i(TAG, "token is :" + access_token + "  username is :" + username + "  password is :" +password +"  url is: " + url);

			 HttpUtils httpUtils = new HttpUtils();

			  RequestParams params = new RequestParams();
			  params.addBodyParameter("username",username);
			  params.addBodyParameter("password",password);

			  httpUtils.send(HttpMethod.POST, url ,params, new RequestCallBack<String>(){
			  @Override
				  public void onFailure(HttpException arg0, String arg1) {
					  Log.i(TAG, "登录失败:" +  arg0.getLocalizedMessage() + "  " + arg0.getMessage() + "  " + arg1);
				  }

				  @Override public void onSuccess(ResponseInfo<String> arg0) {
					  Log.i(TAG, "登录成功:" + arg0.result);
				  }
			  });

		}
		//==========

	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
 Copyright 2010-2014, Google Inc.
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:

     * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
     * Redistributions in binary form must reproduce the above
 copyright notice, this list of conditions and the following disclaimer
 in the documentation and/or other materials provided with the
 distribution.
     * Neither the name of Google Inc. nor the names of its
 contributors may be used to endorse or promote products derived from
 this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<resources>
    <string name="symbol_minor_symbol_history_title">History</string>
    <string name="symbol_minor_symbol_general_title">General\nSymbol</string>
    <string name="symbol_minor_symbol_half_title">Half-width\nFull-width</string>
    <string name="symbol_minor_symbol_parenthesis_title">Parenthesis\nRule</string>
    <string name="symbol_minor_symbol_arrow_title">Arrow\nNumber</string>
    <string name="symbol_minor_symbol_math_title">Math\nUnit</string>

    <string name="symbol_minor_emoticon_history_title">History</string>
    <string name="symbol_minor_emoticon_smile_title">Smile\n(^^)</string>
    <string name="symbol_minor_emoticon_sweat_title">Sweat\n(^^;)</string>
    <string name="symbol_minor_emoticon_surprise_title">Surprize\n(゜д゜)</string>
    <string name="symbol_minor_emoticon_sadness_title">Sadness\n(T_T)</string>
    <string name="symbol_minor_emoticon_displeasure_title">Displeasure\n(-_-)</string>

    <string name="symbol_minor_emoji_history_title">History</string>
    <string name="symbol_minor_emoji_face_title">Face\nEmotion</string>
    <string name="symbol_minor_emoji_food_title">Food\nPlay</string>
    <string name="symbol_minor_emoji_activity_title">Activity\nLife</string>
    <string name="symbol_minor_emoji_city_title">City\nWork</string>
    <string name="symbol_minor_emoji_nature_title">Nature\nFigure</string>
</resources>