text:
CacheJSON is a JSON encoder/decoder for [Intersystems Cache](http://www.intersystems.com) based applications and systems.

It can be used as a stand-alone utility class or extended inside your own custom classes to "JSON Enable" your objects.

A handy way to validate that the JSON is legal is to copy the string into this site http://json.parser.online.fr/

The primary features of CacheJSON are:

* Decode a single JSON object into an %ArrayOfDataTypes
* Decode nested arrays of JSON objects into a %ListOfObjects containing %ArrayOfDataTypes
* Decode a single JSON object into a custom Cache object
* Encode an %ArrayOfDataTypes to a JSON string
* Encode a custom Cache object class to a JSON string
* Encode a %ListOfObjects containing %ArrayOfDataTypes into a JSON string
* Embed an array as the value of an element
* Convert a Cache object instance into an %ArrayOfDataTypes

The original code originated from the [Intersystem's Zen Google Group Community](http://groups.google.com/group/intersystems-zen), however, the base for this class was taken from [Yontan's Blog](http://blog.yonatan.me/2010/03/objectscript-json-decoderencoder.html) and added to GitHub by [@mccrackend](http://twitter.com/#!/mccrackend)for proper tracking of enhancements and maintenance.

Cache does not come with any native JSON support, necessitating a third party utility to translate JSON strings to & from Cache objects for web applications.

## Information & Help

* For information about Intersystems products visit their [website](http://www.intersystems.com).
* Post to the [Intersystems Zen Google Group](http://groups.google.com/group/intersystems-zen) for help or questions.
* See the [GitHub issue tracker](https://github.com/PlanetCache/CacheJSON/issues).
* Visit the Intersystems [online documentation](http://docs.intersystems.com/).
* Send a message to [@PlanetCache](http://twitter.com/#!/PlanetCache) on Twitter.

## Installation

### Extending an existing %Persistent object

Import the class into your `namespace` and compile.

Then simply extend `CacheJSON` on the class you wish to use it with:

``` ruby
Class Sample.Person Extends (%Persistent, %Populate, CacheJSON) [ ClassType = persistent, Inheritance = right ]
````

### Stand-alone utility

Import the class into your `namespace` and compile.

Then call the `CacheJSON` class methods from your code.

``` ruby
Set encodedList = ##class(CacheJSON).Encode(list)
````

## Usage

Below I'll go through some of the common uses and flows you can use with CacheJSON.

### Encode an %ArrayOfObjects

An `%ArrayOfDataTypes` is a simple Key/Value pair dictionary object used in Cache.  `CacheJSON` will parse this object into a JSON string with the same key/value pairs contained in this object.  Below is sample code to create this array and encode it to a JSON string.

``` ruby
Set myArray = ##class(%ArrayOfDataTypes).%New()
Do myArray.SetAt("Dan","FirstName")
Do myArray.SetAt("McCracken","LastName")
Do myArray.SetAt("01/01/1983","DOB")
Set jsonString = ##class(CacheJSON).Encode(myArray)
````

Creates a string like so:

``` ruby
{"DOB":"01/01/1983","FirstName":"Dan","LastName":"McCracken"}
````

### Encode a %ListOfDataTypes containing arrays

A `%ListOfDataTypes` is a simple array object used in Cache.  Insert a bunch of `%ArrayOfDataTypes` into the list, and `CacheJSON` will translate this into a JSON array.  Below is sample code using a list:

``` ruby
Set arr1 = ##class(%ArrayOfDataTypes).%New()
Do arr1.SetAt("Dan","FirstName")
Do arr1.SetAt("McCracken","LastName")
Do arr1.SetAt("01/01/1983","DOB")

Set arr2 = ##class(%ArrayOfDataTypes).%New()
Do arr2.SetAt("Ron","FirstName")
Do arr2.SetAt("Sweeney","LastName")
Do arr2.SetAt("12/31/1978","DOB")

Set list = ##class(%ListOfDataTypes).%New()
Set sc = list.Insert(arr1)
Set sc = list.Insert(arr2)
Set encodedList = ##class(CacheJSON).Encode(list)
````

Creates a string like so:

``` ruby
[{"DOB":"01/01/1983","FirstName":"Dan","LastName":"McCracken"},{"DOB":"12/31/1978","FirstName":"Ron","LastName":"Sweeney"}]
````

### Encode an array as an element value

Set the value of an item to another `%ArrayOfDataTypes`.  Example below:

``` ruby
Set message = ##class(%ArrayOfDataTypes).%New()
Do message.SetAt("Posting to Campfire from Cache!","body")
Set payload = ##class(%ArrayOfDataTypes).%New()
Do payload.SetAt(message,"message")
Set jsonPost = ##class(CacheJSON).Encode(payload)
````

Creates a string like so:

``` ruby
{"message":{"body":"Posting to Campfire from Cache!"}}
````

### Encode a %Persistent object

After you extend the persistent class with the `CacheJSON` class (see instructions above), you can call a method to simply project the object as a JSON string.  Example below:

``` ruby
Set obj = ##class(Sample.Person).%OpenId(1)
Set jsonString = obj.GetJSONFromObject()
````

Creates a string like so:

``` ruby
{"DOB":40434,"MyBool":null,"Name":"Bolt  Usain","SSN":"722-81-1666"}
````

### Decode a single JSON object

Given a JSON string representing a single object:

``` ruby
{"DOB":57311,"Name":"Dan McCracken","SSN":"192-20-3003"}
````

`CacheJSON` creates an `%ArrayOfDataTypes` object containing all the properties using the Decode() method.

``` ruby
Set myDecodedArray = ##class(CacheJSON).Decode(encodedString)
Do $System.OBJ.Dump(myDecodedArray)

+----------------- general information ---------------
|      oref value: 3
|      class name: %Library.ArrayOfDataTypes
| reference count: 1
+----------------- attribute values ------------------
|        Data("DOB") = 57311
|       Data("Name") = "Dan McCracken"
|        Data("SSN") = "192-20-3003"
|        ElementType = "%String"
````

### Decode an array of JSON objects

Given a JSON string representing an array of JSON objects:

``` ruby
[{"DOB":33997,"Name":"Koivu,Phyllis Z.","SSN":"676-82-4467"},{"DOB":61685,"Name":"Kelvin,Kristen S.","SSN":"546-95-9170"},{"DOB":53364,"Name":"DeLillo,Alexandra O.","SSN":"566-60-9488"}]
````

`CacheJSON` will decode this array into a `%ListOfDataTypes` with nodes containing `%ArrayOfDataTypes` that represent each decoded object individually.

``` ruby
Set myDecodedArray = ##class(User.Util.CacheJSON).Decode(arrString)
Do $System.OBJ.Dump(myDecodedArray)
+----------------- general information ---------------
|      oref value: 7
|      class name: %Library.ListOfDataTypes
| reference count: 1
+----------------- attribute values ------------------
|            Data(1) = "12@%Library.ArrayOfDataTypes"
|            Data(2) = "14@%Library.ArrayOfDataTypes"
|            Data(3) = "16@%Library.ArrayOfDataTypes"
|        ElementType = ""
|               Size = 3  <Set>

Do $System.OBJ.Dump(myDecodedArray.GetAt(1))
+----------------- general information ---------------
|      oref value: 12
|      class name: %Library.ArrayOfDataTypes
| reference count: 1
+----------------- attribute values ------------------
|        Data("DOB") = 33997
|       Data("Name") = "Koivu,Phyllis Z."
|        Data("SSN") = "676-82-4467"
|        ElementType = "%String"
````

### Decode a single JSON object into a custom Cache object

Given a JSON string with keys that map to a custom Cache object:

``` ruby
{"DOB":57311,"Name":"Dan McCracken","SSN":"192-20-3003"}
````

When `CacheJSON` is extended on the object you're trying to map the JSON string to, you can create a new object containing the JSON values as properties using the GetObjectFromJSON() method.

``` ruby
USER> Set newPerson = ##class(Sample.Person).GetObjectFromJSON(encodedJSON)
USER> Write newPerson.Name
Dan McCracken
````

### Convert a Cache object into an %ArrayOfDataTypes

This is a helper method that will translate your object into an `%ArrayOfDataTypes`, allowing you to quickly build up a `%ListOfDataTypes` to Encode() as a return value for your methods.  Using this method inside a quick loop generates a desired list:

``` ruby
Set list = ##class(%ListOfDataTypes).%New()
For x=1:1:3 {
	Set obj = ##class(Sample.Person).%OpenId(x)
	Set sc = list.Insert(obj.GetAsArrayOfDataTypes())
}
Set encodedList = ##class(Sample.Person).Encode(list)
````

This code generates an array of 3 JSON encoded Person objects that look like this:

``` ruby
[{"DOB":33997,"Name":"Koivu,Phyllis Z.","SSN":"676-82-4467","Spouse":null},{"DOB":61685,"Name":"Kelvin,Kristen S.","SSN":"546-95-9170","Spouse":null},{"DOB":53364,"Name":"DeLillo,Alexandra O.","SSN":"566-60-9488","Spouse":null}]
````

## Tests

There is a set of tests included in the repository that originated from [Yontan's Blog](http://blog.yonatan.me/2010/03/objectscript-json-decoderencoder.html) that is a standard Cache `%UnitTest.TestCase`.

To run the test, use a command like:

``` ruby
Do ##class(%UnitTest.Manager).RunTest("TestJSON:TestJSON","/noload/norecursive/nodelete")
````

## Contributing

If you find something that looks like a bug:

1. Check the [GitHub issue tracker](http://github.com/PlanetCache/CacheJSON/issues) to see if it's a known issue.
2. If you don't see anything, create an issue with information on how to reproduce it.

If you want to contribute an enhancement or a fix:

1. Fork the project on GitHub.
2. Make your changes and (optionally) update the test class.
3. Commit the changes to your forked repo.
4. Send a pull request.


text:
/* FreeRTOS kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "timers.h"

#include "pin_mux.h"
#include "clock_config.h"
#include "../hardware/capture.h"
#include "../hardware/adc.h"
#include "../algorithms/weather.h"

#include "tasks.h"

/* The software timer period. */
#define SW_TIMER_PERIOD_MS (1000 / portTICK_PERIOD_MS)
/* The callback function. */
static void SwTimerCallback(TimerHandle_t xTimer);

static float rainFallCountsPerSecond = 0.0;
static float windSpeedCountsPerSecond = 0.0;

/*
 * The capture_Init() sets up two gpio pins as inputs
 * and enables the port change to fire an interrupt.
 * The ISR increments a counter.
 */
void capture_task(void *pvParameters) {
	const TickType_t xDelay = 10000 / portTICK_PERIOD_MS;
	TimerHandle_t SwTimerHandle = NULL;
	AWeatherMessage pxRxedMessage;
	extern QueueHandle_t weatherMessageQueue;

	capture_init();

	/* Create the software timer. */
	SwTimerHandle = xTimerCreate("pulseRates", /* Text name. */
	SW_TIMER_PERIOD_MS, /* Timer period. */
	pdTRUE, /* Enable auto reload. */
	0, /* ID is not used. */
	SwTimerCallback); /* The callback function. */
	/* Start timer. */
	xTimerStart(SwTimerHandle, 0);

	for (;;) {

		pxRxedMessage.weather_data.current = windSpeedCountsPerSecond;
		pxRxedMessage.messageType = WINDSPEED;
		// Send a pointer to a struct AMessage object.  Block if the
		// queue is already full.
		xQueueSend(weatherMessageQueue, (void * ) &pxRxedMessage,
				(TickType_t ) 5);

		pxRxedMessage.weather_data.current = rainFallCountsPerSecond;
		pxRxedMessage.messageType = RAINFALL;
		xQueueSend(weatherMessageQueue, (void * ) &pxRxedMessage,
				(TickType_t ) 5);

		vTaskDelay(xDelay);
	}
}

/*!
 * @brief Software timer callback.
 */
static void SwTimerCallback(TimerHandle_t xTimer) {
	windSpeedCountsPerSecond = (float) readWindSpeedCounter();
	clearWindSpeedCounter();

	rainFallCountsPerSecond = (float) readRainFallCounter();
	clearRainFallCounter();
}

redpajama_set_name: RedPajamaGithub


text:
package com.poet.reptile.service.spring.service;

import com.poet.reptile.api.dao.query.Condition;
import com.poet.reptile.api.dao.query.builder.ConditionBuilder;
import com.poet.reptile.api.model.IBook;
import com.poet.reptile.api.service.BookService;
import com.poet.reptile.api.service.support.AbstractGeneralService;

import java.util.List;

/**
 * Created by Love0 on 2016/1/9 0009.
 */
public class GeneralBookService extends AbstractGeneralService<IBook> implements BookService {

    @Override
    public IBook isBookExists(IBook book) {
        String bookIsbn = book.getBookIsbn();
        List<Condition> conditions = ConditionBuilder.makeContidions().eq("bookIsbn", bookIsbn).build();
        IBook result = this.findOne(conditions);
        return result;
    }

    @Override
    public IBook forceGetBook(IBook book) {

        IBook find = this.isBookExists(book);

        IBook result = find != null ? find : this.save(book);

        return result;
    }

}


text:
'use strict';

angular.module('users').controller('EditProfileController', ['$scope', '$http', '$location', 'Users', 'UserData', '$stateParams', 'Authentication', 'AdminAuthService', 'UtilsService',
  function ($scope, $http, $location, Users, UserData, $stateParams, Authentication, AdminAuthService, UtilsService) {
    $scope.user = Authentication.user;
    $scope.isAdmin = AdminAuthService;

    // console.log('\n\n$scope.user:\n', $scope.user, '\n\n');

    // Provides logic for the css in the forms
    UtilsService.cssLayout();

    // user fn to update a user profile
    $scope.updateUserProfile = function (isValid) {
      $scope.success = $scope.error = null;

      if (!isValid) {
        $scope.$broadcast('show-errors-check-validity', 'userForm');
        return false;
      }

      var user = new Users($scope.user);

      user.$update(function (response) {
        $scope.$broadcast('show-errors-reset', 'userForm');

        $scope.success = true;
        Authentication.user = response;
      }, function (response) {
        $scope.error = response.data.message;
      });
    };

    // admin fn to update existing User
    $scope.update = function (isValid) {
      $scope.error = null;

      if (!isValid) {
        $scope.$broadcast('show-errors-check-validity', 'userAdminForm');
        return false;
      }

      var userToEdit = $scope.userToEdit;

      userToEdit.$update(function () {
        $location.path('users/' + user._id);
      }, function (errorResponse) {
        $scope.error = errorResponse.data.message;
      });
    };

    $scope.toggleEdit = false;
    $scope.toggleId = 0;

    $scope.toggleEditFn = function (editNum) {
      //todo console logs are to evaluate a possible bug - the same code (that's currenlty commented out) caused a bug in the `ProjectsController`  `$scope.toggle` in the line `$scope.toggleEdit = !$scope.toggle;` was undefined in projects controller ::  `$scope.toggleEdit = !$scope.toggleEdit;` solved the issue in the projects controller
      console.log('$scope.toggleEditFn - ');
      console.log('`editNum`:', editNum);
      console.log('`$scope.toggle`:', $scope.toggle);
      console.log('`$scope.toggleEdit`:', $scope.toggleEdit);
      // $scope.toggleEdit = !$scope.toggle;
      $scope.toggleEdit = !$scope.toggleEdit;
      $scope.toggleId = editNum;
    };

    $scope.toggleEditAllFn = function () {
      // $scope.toggleEdit = !$scope.toggle;
      $scope.toggleEdit = !$scope.toggleEdit;
      $scope.toggleId = editNum;
    };

    //runs a query to return user ID for admin panel editing
    $scope.find = function () {
      $scope.users = Users.query();
    };

    // Find a list of Users
    $scope.findAll = function () {
      $scope.users = Users.query($scope.query);
    };

    // Find existing User
    $scope.findOne = function (userIdToEdit) {
      // if (userIdToEdit) {
        console.log('here, here  :::: var `userIdToEdit`: ', userIdToEdit);
      //   $scope.userToEdit = UserData.get({
      //     userId: userIdToEdit
      //   });
      // } else {
        $scope.userToEdit = UserData.get({
          userId: $stateParams.userId
        });
      // }
      console.log('$scope.userToEdit:\n', $scope.userToEdit);
    };

  }
]);


text:
title: Overview
page_title: Resources Overview | RadGantt for ASP.NET AJAX Documentation
description: Overview
slug: gantt/resources/overview
tags: overview
published: True
position: 0
---

# Resources Overview

The following article describes the overall benefit and usage of the **Resources** of **RadGantt**

## Overview

As from **Q1 2015** release of the **Telerik UI for ASP.NET AJAX**, the RadGantt control provides full support for **Resources**. Using it, you will able to assign resources to your tasks, which could carry additional information for them. These resources might be people, materials, budget amount or anything else fitting your application. This could be very helpful in scenarios, where you need to associate people with the tasks in a particular project.

The **Resources** are enabled by setting the **EnableResources** property of the **RadGantt** to **true**. Each resource is defined by three fields : **ID, Text and Color**, where the **Color** is optional. The connection between **Tasks** and resources is done via **Assignments**. Each assignment is defined by an **ID**, **TaskID** and **ResourceID**. The assignment can also have a **Units** value associated with it, describing how much of each resource is taken up by the current task. Another optional column for the Resources is **Format**. This column define the format of the assignment **Units** and its default value is **percentage("p0")**.

## Visualization

The **Resources** are displayed next to the task that they are associated with in the **Timeline View**.The resources can also be visualized in the TreeList View with the **GanttResourceColumn**. The resources in the **Timeline View** could be colorized if the **ColorField** is defined (see **Figure 1**).

**Figure 1**: RadGantt with colorized Resources.![gantt-resources](images/gantt-resources.png)

## Binding Resources

The **RadGantt** control allows the implementation of the **Resources** in each of its binding scenarios which are listed below:

* [Declarative Data Binding (SqlDataSource)]({%slug gantt/data-binding/server-side-binding/declarative-binding%})

* [XML Provider Data Binding]({%slug gantt/resources/data-binding/xml-provider-binding%})

* [Web Service DataBinding]({%slug gantt/data-binding/client-side-binding/web-service-binding%})

* [Custom EntityFramework Provider Data Binding]({%slug gantt/resources/data-binding/custom-entityframework-provider%})

## Editing Assignments

You can edit each Task's assignments via a popup editor, which can be opened either by double-clicking on the resource cell in the **TreeList View** (see **Figure 2**), or through the **Assign** button in the **Advanced Edit Form**(see **Figure 3**) .

**Figure 2**: Assign Resources Popup.![gantt-resources-assign 1](images/gantt-resources-assign1.png)

**Figure 3**: Advanced Edit Form.![gantt-resources-assign 2](images/gantt-resources-assign2.png)

# See Also

 * [Resources Online Demo](http://demos.telerik.com/aspnet-ajax-beta/gantt/examples/functionality/resources/defaultcs.aspx)


text:
OpenGLTests
=========

Ejemplo de uso de cl-opengl y glop.


text:
class AddIsicNumberToCards < ActiveRecord::Migration
  def change
    add_column :cards, :isic_number, :string
  end
end


text:
Tests cached resource content is discarded when cached resource is destroyed if content size is too big for the resource agent's data storage.

Bug 92108


text:
<background-banner></background-banner>

  <md-card class="oppia-profile-user-card">

               Edit avatar
                

          <img ng-if="$ctrl.profileIsOfCurrentUser" ng-src="<[$ctrl.profilePictureDataUrl]>"
               class="oppia-profile-picture-fullsize protractor-test-profile-current-user-photo"
               alt="">
          <img ng-if="!$ctrl.profileIsOfCurrentUser" ng-src="<[$ctrl.profilePictureDataUrl]>"
               class="oppia-profile-picture-fullsize protractor-test-profile-other-user-photo"
               alt="">

          <span popover-placement="right" ng-attr-uib-popover="<[$ctrl.usernameIsLong ? $ctrl.username.helpText : undefined]>" popover-append-to-body popover-trigger="mouseenter">
            <[$ctrl.username.value| truncate:16]>

          <span popover-placement="right" ng-attr-uib-popover="<[$ctrl.username.helpText]>" popover-append-to-body popover-trigger="mouseenter">
            <[$ctrl.username.value| truncate:11]>

          Contributing since: <[$ctrl.getLocaleDateString($ctrl.firstContributionMsec)]>

        <div popover-placement="right" ng-attr-uib-popover="<[stat.helpText]>" popover-append-to-body popover-trigger="mouseenter">
          <span class="oppia-stats-value-text protractor-test-profile-<[stat.title | lowercase]>-stat"><[stat.value || 0]>
          <[stat.title]>

      <[$ctrl.userBio]>

        This user has not supplied a bio yet.

      Interests:
       0">

          <[interest]>

        none specified

        <div popover-placement="right" ng-attr-uib-popover="<[stat.helpText]>" popover-append-to-body popover-trigger="mouseenter">
          <[stat.value || 0]>
          <[stat.title]>

      <button class="btn oppia-subscription-button oppia-transition-200 protractor-test-subscription-button"
              ng-click="$ctrl.changeSubscriptionStatus()"
              popover-placement="right"
              ng-attr-popover="<[$ctrl.subscriptionButtonPopoverText]>"
              popover-append-to-body
              popover-trigger="mouseenter">

      </button>

  </md-card>

  <md-card class="oppia-profile-content-card">
    <md-content class="oppia-profile-portfolio-container">
      <exploration-summary-tile ng-repeat="expl in $ctrl.getExplorationsToDisplay() track by $index"
                                exploration-id="expl.id"
                                exploration-title="expl.title"
                                last-updated-msec="expl.lastUpdatedMsec"
                                objective="expl.objective"
                                category="expl.category"
                                ratings="expl.ratings"
                                thumbnail-icon-url="expl.thumbnailIconUrl"
                                thumbnail-bg-color="expl.thumbnailBgColor"
                                num-views="expl.numViews"
                                is-community-owned="expl.communityOwned"
                                mobile-cutoff-px="610">
      </exploration-summary-tile>

    </md-content>

     6">

        

      Showing <[$ctrl.startingExplorationNumber]> - <[$ctrl.endingExplorationNumber]> of <[$ctrl.numUserPortfolioExplorations]>
      = $ctrl.numUserPortfolioExplorations"
         ng-click="$ctrl.goToNextPage()"
         ng-class="{'oppia-navigation-mouse-pointer': $ctrl.endingExplorationNumber < $ctrl.numUserPortfolioExplorations}">
        

  </md-card>


text:
pixel-evolution
===============

Game design project for DZC10


text:
'use strict'
var path = require('path')
var fs = require('graceful-fs')
var rimraf = require('rimraf')
var asyncMap = require('slide').asyncMap
var mkdirp = require('mkdirp')
var npm = require('../../npm.js')
var andIgnoreErrors = require('../and-ignore-errors.js')
var rename = require('../../utils/rename.js')

// This is weird because we want to remove the module but not it's node_modules folder
// allowing for this allows us to not worry about the order of operations
module.exports = function (staging, pkg, log, next) {
  log.silly('remove', pkg.path)
  if (pkg.target) {
    removeLink(pkg, next)
  } else {
    removeDir(pkg, log, next)
  }
}

function removeLink (pkg, next) {
  npm.commands.unbuild(pkg.path, true, next)
}

function removeDir (pkg, log, next) {
  var modpath = path.join(path.dirname(pkg.path), '.' + path.basename(pkg.path) + '.MODULES')

  rename(path.join(pkg.path, 'node_modules'), modpath, unbuildPackage)

  function unbuildPackage (renameEr) {
    npm.commands.unbuild(pkg.path, true, function () {
      rimraf(pkg.path, renameEr ? andRemoveEmptyParents(pkg.path) : moveModulesBack)
    })
  }

  function andRemoveEmptyParents (path) {
    return function (er) {
      if (er) return next(er)
      removeEmptyParents(pkg.path)
    }
  }

  function moveModulesBack () {
    fs.readdir(modpath, makeTarget)
  }

  function makeTarget (readdirEr, files) {
    if (readdirEr) return cleanup()
    if (!files.length) return cleanup()
    mkdirp(path.join(pkg.path, 'node_modules'), function (mkdirEr) { moveModules(mkdirEr, files) })
  }

  function moveModules (mkdirEr, files) {
    if (mkdirEr) return next(mkdirEr)
    asyncMap(files, function (file, done) {
      var from = path.join(modpath, file)
      var to = path.join(pkg.path, 'node_modules', file)
      // we ignore errors here, because they can legitimately happen, for instance,
      // bundled modules will be in both node_modules folders
      rename(from, to, andIgnoreErrors(done))
    }, cleanup)
  }

  function cleanup () {
    rimraf(modpath, afterCleanup)
  }

  function afterCleanup (rimrafEr) {
    if (rimrafEr) log.warn('remove', rimrafEr)
    removeEmptyParents(path.resolve(pkg.path, '..'))
  }

  function removeEmptyParents (pkgdir) {
    fs.rmdir(pkgdir, function (er) {
      // FIXME: Make sure windows does what we want here
      if (er && er.code !== 'ENOENT') return next()
      removeEmptyParents(path.resolve(pkgdir, '..'))
    })
  }
}


text:
package apple.uikit;

import java.io.*;
import java.nio.*;
import java.util.*;
import com.google.j2objc.annotations.*;
import com.google.j2objc.runtime.*;
import com.google.j2objc.runtime.block.*;
import apple.audiotoolbox.*;
import apple.corefoundation.*;
import apple.coregraphics.*;
import apple.coreservices.*;
import apple.foundation.*;
import apple.coreanimation.*;
import apple.coredata.*;
import apple.coreimage.*;
import apple.coretext.*;
import apple.corelocation.*;

/**
 * @since Available in iOS 2.0 and later.
 */
@Library("UIKit/UIKit.h") @Mapping("UIButton")
public class UIButton
    extends UIControl
    implements NSCoding {

    @Mapping("initWithFrame:")
    public UIButton(CGRect frame) { }
    @Mapping("initWithCoder:")
    public UIButton(NSCoder aDecoder) { }
    @Mapping("init")
    public UIButton() { }

    @Mapping("contentEdgeInsets")
    public native UIEdgeInsets getContentEdgeInsets();
    @Mapping("setContentEdgeInsets:")
    public native void setContentEdgeInsets(UIEdgeInsets v);
    @Mapping("titleEdgeInsets")
    public native UIEdgeInsets getTitleEdgeInsets();
    @Mapping("setTitleEdgeInsets:")
    public native void setTitleEdgeInsets(UIEdgeInsets v);
    @Mapping("reversesTitleShadowWhenHighlighted")
    public native boolean reversesTitleShadowWhenHighlighted();
    @Mapping("setReversesTitleShadowWhenHighlighted:")
    public native void setReversesTitleShadowWhenHighlighted(boolean v);
    @Mapping("imageEdgeInsets")
    public native UIEdgeInsets getImageEdgeInsets();
    @Mapping("setImageEdgeInsets:")
    public native void setImageEdgeInsets(UIEdgeInsets v);
    @Mapping("adjustsImageWhenHighlighted")
    public native boolean adjustsImageWhenHighlighted();
    @Mapping("setAdjustsImageWhenHighlighted:")
    public native void setAdjustsImageWhenHighlighted(boolean v);
    @Mapping("adjustsImageWhenDisabled")
    public native boolean adjustsImageWhenDisabled();
    @Mapping("setAdjustsImageWhenDisabled:")
    public native void setAdjustsImageWhenDisabled(boolean v);
    @Mapping("showsTouchWhenHighlighted")
    public native boolean showsTouchWhenHighlighted();
    @Mapping("setShowsTouchWhenHighlighted:")
    public native void setShowsTouchWhenHighlighted(boolean v);
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Mapping("tintColor")
    public native UIColor getTintColor();
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Mapping("setTintColor:")
    public native void setTintColor(UIColor v);
    @Mapping("buttonType")
    public native @Representing("UIButtonType") long getButtonType();
    @Mapping("currentTitle")
    public native String getCurrentTitle();
    @Mapping("currentTitleColor")
    public native UIColor getCurrentTitleColor();
    @Mapping("currentTitleShadowColor")
    public native UIColor getCurrentTitleShadowColor();
    @Mapping("currentImage")
    public native UIImage getCurrentImage();
    @Mapping("currentBackgroundImage")
    public native UIImage getCurrentBackgroundImage();
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Mapping("currentAttributedTitle")
    public native NSAttributedString getCurrentAttributedTitle();
    /**
     * @since Available in iOS 3.0 and later.
     */
    @Mapping("titleLabel")
    public native UILabel getTitleLabel();
    /**
     * @since Available in iOS 3.0 and later.
     */
    @Mapping("imageView")
    public native UIImageView getImageView();

    @Mapping("setTitle:forState:")
    public native void setTitle(String title, @Representing("UIControlState") long state);
    @Mapping("setTitleColor:forState:")
    public native void setTitleColor(UIColor color, @Representing("UIControlState") long state);
    @Mapping("setTitleShadowColor:forState:")
    public native void setTitleShadowColor(UIColor color, @Representing("UIControlState") long state);
    @Mapping("setImage:forState:")
    public native void setImage(UIImage image, @Representing("UIControlState") long state);
    @Mapping("setBackgroundImage:forState:")
    public native void setBackgroundImage(UIImage image, @Representing("UIControlState") long state);
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Mapping("setAttributedTitle:forState:")
    public native void setAttributedTitle(NSAttributedString title, @Representing("UIControlState") long state);
    @Mapping("titleForState:")
    public native String getTitle(@Representing("UIControlState") long state);
    @Mapping("titleColorForState:")
    public native UIColor getTitleColor(@Representing("UIControlState") long state);
    @Mapping("titleShadowColorForState:")
    public native UIColor getTitleShadowColor(@Representing("UIControlState") long state);
    @Mapping("imageForState:")
    public native UIImage getImage(@Representing("UIControlState") long state);
    @Mapping("backgroundImageForState:")
    public native UIImage getBackgroundImage(@Representing("UIControlState") long state);
    /**
     * @since Available in iOS 6.0 and later.
     */
    @Mapping("attributedTitleForState:")
    public native NSAttributedString getAttributedTitle(@Representing("UIControlState") long state);
    @Mapping("backgroundRectForBounds:")
    public native CGRect getBackgroundRect(CGRect bounds);
    @Mapping("contentRectForBounds:")
    public native CGRect getContentRect(CGRect bounds);
    @Mapping("titleRectForContentRect:")
    public native CGRect getTitleRect(CGRect contentRect);
    @Mapping("imageRectForContentRect:")
    public native CGRect getImageRect(CGRect contentRect);
    @Mapping("buttonWithType:")
    public static native UIButton create(@Representing("UIButtonType") long buttonType);

}


text:
<?php

/**
 * @package BLW\MIME
 * @version 1.0.0
 * @author Walter Otsyula <wotsyula@mast3rpee.tk>
 */
namespace BLW\Model\MIME\Part;

use BLW\Model\InvalidArgumentException;
use BLW\Model\GenericFile;
use BLW\Model\FileException;

/**
 * Tests BLW Library MIME Attachment header.
 * @package BLW\MIME
 * @author  mAsT3RpEE <wotsyula@mast3rpee.tk>
 *
 * @coversDefaultClass \BLW\Model\MIME\Part\Attachment
 */
class AttatchmentTest extends \PHPUnit_Framework_TestCase
{
    const FILE   = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=';
    const BASE64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0A\r\nAAAASUVORK5CYII=";

    /**
     * @var \Attachment
     */
    protected $Attachment = NULL;

    protected function setUp()
    {
        $this->Attachment = new Attachment(new GenericFile(self::FILE), 'Test.png', 'image/png-test');
    }

    protected function tearDown()
    {
        $this->Attachment = NULL;
    }

    /**
     * @covers ::format
     */
    public function test_format()
    {
        $Excpected = substr(base64_encode(__FILE__), 0, 50);

        $this->assertStringStartsWith($Excpected, $this->Attachment->format(__FILE__, 50), 'Attachment::format() Returned an invalid value');
        $this->assertStringStartsWith($Excpected, $this->Attachment->format(new \SplFileInfo(__FILE__), 50), 'Attachment::format() Returned an invalid value');

        # Invalid arguments
        try {
            $this->Attachment->format(0, 50);
            $this->fail('Failed to generate exception with invalid arguments');
        } catch (InvalidArgumentException $e) {}
    }

    /**
     * @depends test_format
     * @covers ::__construct
     */
    public function test_construct()
    {
        # Check params
        $this->assertTrue(isset($this->Attachment['Content-Type']), 'Attachment::__construct() failed to set Content-Type');
        $this->assertTrue(isset($this->Attachment['Content-Transfer-Encoding']), 'Attachment::__construct() failed to set Content-Transfer-Encoding');
        $this->assertTrue(isset($this->Attachment['Content-Disposition']), 'Attachment::__construct() failed to set Content-Disposition');
        $this->assertTrue(isset($this->Attachment['Content']), 'Attachment::__construct() failed to set Content');

        $this->assertInstanceOf('\\BLW\\Model\\MIME\\ContentType', $this->Attachment['Content-Type'], 'Attachment::__construct() set invalid Content-Type');
        $this->assertInstanceOf('\\BLW\\Model\MIME\\ContentTransferEncoding', $this->Attachment['Content-Transfer-Encoding'], 'Attachment::__construct() set invalid Content-Transfer-Encoding');
        $this->assertInstanceOf('\\BLW\\Model\\MIME\\ContentDisposition', $this->Attachment['Content-Disposition'], 'Attachment::__construct() set invalid Content-Disposition');
        $this->assertEquals(self::BASE64 . "\r\n", $this->Attachment['Content'], 'Attachment::__construct() set invalid Content');

        # Invalid arguments
        try {
            new Attachment(new GenericFile('z:\\undefined\\!!!'), 'Test.png', 'image/png-test');
            $this->fail('Failed to generate exception with invalid arguments');
        } catch (FileException $e) {}
    }

    /**
     * @depends test_construct
     * @covers ::__toString
     */
    public function test_toString()
    {
        $Expected = <<<EOT
Content-Type: image/png-test; name=Test.png\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=Test.png\r\n\r\niVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0A\r\nAAAASUVORK5CYII=\r\n\r\n
EOT;

        $this->assertEquals($Expected, @strval($this->Attachment), 'Attachment::__toSting() returned an invalid format');
    }

    /**
     * @depends test_construct
     * @covers ::offsetSet
     */
    public function test_offsetSet()
    {
        # Content-Type
        try {
            $this->Attachment['Content-Type'] = 'foo';
            $this->fail('Failed generating warning on readonly offset');
        } catch (\PHPUnit_Framework_Error_Warning $e) {
            $this->assertContains('Cannot modify readonly offset', $e->getMessage(), 'Invalid warning: '.$e->getMessage());
        }

        @$this->Attachment['Content-Type'] = 'foo';

        # Content-Transfer-Encoding
        try {
            $this->Attachment['Content-Transfer-Encoding'] = 'foo';
            $this->fail('Failed generating warning on readonly offset');
        } catch (\PHPUnit_Framework_Error_Warning $e) {
            $this->assertContains('Cannot modify readonly offset', $e->getMessage(), 'Invalid warning: '.$e->getMessage());
        }

        @$this->Attachment['Content-Transfer-Encoding'] = 'foo';

        # Content-Disposition
        try {
            $this->Attachment['Content-Disposition'] = 'foo';
            $this->fail('Failed generating warning on readonly offset');
        } catch (\PHPUnit_Framework_Error_Warning $e) {
            $this->assertContains('Cannot modify readonly offset', $e->getMessage(), 'Invalid warning: '.$e->getMessage());
        }

        @$this->Attachment['Content-Disposition'] = 'foo';

        # Content
        try {
            $this->Attachment['Content'] = 'foo';
            $this->fail('Failed generating warning on readonly offset');
        } catch (\PHPUnit_Framework_Error_Warning $e) {
            $this->assertContains('Cannot modify readonly offset', $e->getMessage(), 'Invalid warning: '.$e->getMessage());
        }

        @$this->Attachment['Content'] = 'foo';

        # Undefined
        $this->Attachment['undefined'] = 'foo';
    }
}


text:
-- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Erstellungszeit: 27. Apr 2017 um 20:54
-- Server-Version: 5.5.54
-- PHP-Version: 5.6.27

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Datenbank: `clanwolf_tob`
--

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `winners`
--

CREATE TABLE `winners` (
  `id` int(11) NOT NULL,
  `sortorder` int(5) NOT NULL,
  `Clan` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Galaxy` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `MechWarrior` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Bloodright` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Sponsor` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `TourneyHost` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `TourneyStartTime` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Details` varchar(400) COLLATE utf8mb4_unicode_ci NOT NULL,
  `WitnessList` varchar(250) COLLATE utf8mb4_unicode_ci NOT NULL,
  `RulesVersion` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ChallongeTourneyLink` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ChallongeResultScreenshotLink` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


text:
<input type="text" [(ngModel)]="newCar.make">
<input type="text" [(ngModel)]="newCar.model">
<input type="text" [(ngModel)]="newCar.year">
<input type="text" [(ngModel)]="newCar.color">
<input type="text" [(ngModel)]="newCar.price">
Save Cancel


text:
from __future__ import absolute_import

import logging
import sentry

from django import template
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages import get_messages
from pkg_resources import parse_version

from sentry import features, options
from sentry.api.serializers.base import serialize
from sentry.models import ProjectKey
from sentry.utils import auth, json
from sentry.utils.email import is_smtp_enabled
from sentry.utils.assets import get_asset_url
from sentry.utils.functional import extract_lazy_object
from sentry.utils.support import get_support_mail

register = template.Library()

def _get_version_info():
    current = sentry.VERSION

    latest = options.get('sentry:latest_version') or current
    upgrade_available = parse_version(latest) > parse_version(current)
    build = sentry.__build__ or current

    return {
        'current': current,
        'latest': latest,
        'build': build,
        'upgradeAvailable': upgrade_available,
    }

def _needs_upgrade():
    version_configured = options.get('sentry:version-configured')
    if not version_configured:
        # If we were never previously upgraded (being a new install)
        # we want to force an upgrade, even if the values are set.
        return True

    smtp_disabled = not is_smtp_enabled()

    # Check all required options to see if they've been set
    for key in options.filter(flag=options.FLAG_REQUIRED):
        # Ignore mail.* keys if smtp is disabled
        if smtp_disabled and key.name[:5] == 'mail.':
            continue
        if not options.isset(key.name):
            return True

    if version_configured != sentry.get_version():
        # Everything looks good, but version changed, so let's bump it
        options.set('sentry:version-configured', sentry.get_version())

    return False

def _get_public_dsn():
    try:
        projectkey = ProjectKey.objects.filter(
            project=settings.SENTRY_FRONTEND_PROJECT or settings.SENTRY_PROJECT,
        )[0]
    except Exception:
        logging.exception('Unable to fetch ProjectKey for internal project')
        return
    return projectkey.dsn_public

def _get_statuspage():
    id = settings.STATUS_PAGE_ID
    if id is None:
        return None
    return {'id': id, 'api_host': settings.STATUS_PAGE_API_HOST}

@register.simple_tag(takes_context=True)
def get_react_config(context):
    if 'request' in context:
        user = getattr(context['request'], 'user', None) or AnonymousUser()
        messages = get_messages(context['request'])
        try:
            is_superuser = context['request'].is_superuser()
        except AttributeError:
            is_superuser = False
    else:
        user = None
        messages = []
        is_superuser = False

    if user:
        user = extract_lazy_object(user)

    enabled_features = []
    if features.has('organizations:create', actor=user):
        enabled_features.append('organizations:create')
    if auth.has_user_registration():
        enabled_features.append('auth:register')

    version_info = _get_version_info()

    needs_upgrade = False

    if is_superuser:
        needs_upgrade = _needs_upgrade()

    context = {
        'singleOrganization': settings.SENTRY_SINGLE_ORGANIZATION,
        'supportEmail': get_support_mail(),
        'urlPrefix': options.get('system.url-prefix'),
        'version': version_info,
        'features': enabled_features,
        'mediaUrl': get_asset_url('sentry', ''),
        'needsUpgrade': needs_upgrade,
        'dsn': _get_public_dsn(),
        'statuspage': _get_statuspage(),
        'messages': [{
            'message': msg.message,
            'level': msg.tags,
        } for msg in messages],
        'isOnPremise': settings.SENTRY_ONPREMISE,
        'invitesEnabled': settings.SENTRY_ENABLE_INVITES,
        'gravatarBaseUrl': settings.SENTRY_GRAVATAR_BASE_URL,
    }
    if user and user.is_authenticated():
        context.update({
            'isAuthenticated': True,
            'user': serialize(user, user),
        })
        context['user']['isSuperuser'] = is_superuser
    else:
        context.update({
            'isAuthenticated': False,
            'user': None,
        })
    return json.dumps_htmlsafe(context)


text:
* `#include <something>` 用于 lib 或 framework
* `#include "something"` 用于引入的代码

## Header Search Paths

## 添加 lib 或 framework

依赖的 Lib 和 Framework 需要添加到

`Target > Build Phase > Link Binary With Libraries` = `Target > General > Linked Frameworks and Libraries`

自定义的 Framework 需要添加到

`Target > Build Phase > Embed Framework` = `Target > General > Embedded Binaries`


text:
import { Match, Link } from './index';

Match.Link = Link;
export default Match;


text:
<?php

namespace FantasyDataAPI\Test\PlayerGameProjectionStatsByTeam;

use PHPUnit_Framework_TestCase;

use FantasyDataAPI\Test\MockClient;

class UnitTest extends PHPUnit_Framework_TestCase
{
    /** @var MockClient */
    protected static $sClient;

    /** @var \GuzzleHttp\Message\Response */
    protected static $sResponse;

    protected static $sEffectiveUrl;
    protected static $sUrlFragments;

    /**
     * Set up our test fixture.
     *
     * Expect a service URL something like this:
     *   http://api.nfldata.apiphany.com/developer/json/PlayerGameProjectionStatsByTeam/2013REG/17/NE?key=000aaaa0-a00a-0000-0a0a-aa0a00000000
     */
    public static function setUpBeforeClass()
    {
        static::$sClient = new MockClient($_SERVER['FANTASY_DATA_API_KEY']);

        /** \GuzzleHttp\Command\Model */
        static::$sClient->PlayerGameProjectionStatsByTeam(['Season' => '2013REG', 'Week' => '17', 'Team' => 'NE']);

        static::$sResponse = static::$sClient->mHistory->getLastResponse();
        static::$sEffectiveUrl = static::$sResponse->getEffectiveUrl();
        static::$sUrlFragments = explode('/', static::$sEffectiveUrl);
    }

    public static function tearDownAfterClass()
    {
        static::$sClient = null;
        static::$sResponse = null;
        static::$sEffectiveUrl = null;
        static::$sUrlFragments = null;
    }

       /**
     * Given: A developer API key
     * When: API is queried for 2013REG, Week 17, Team NE PlayerGameProjectionStatsByTeam
     * Then: Expect that the json format is placed in the URI
     *
     * @group Unit
     * @small
     */
    public function testFormatInURI()
    {
        /** key 5 should be the "format" based on URL structure */
        $this->assertArrayHasKey(5, static::$sUrlFragments);
        $this->assertEquals( static::$sUrlFragments[5], 'json');
    }

    /**
     * Given: A developer API key
     * When: API is queried for 2013REG, Week 17, Team NE PlayerGameProjectionStatsByTeam
     * Then: Expect that the PlayerGameProjectionStatsByTeam resource is placed in the URI
     *
     * @group Unit
     * @small
     */
    public function testResourceInURI()
    {
        /** key 6 should be the "resource" based on URL structure */
        $this->assertArrayHasKey(6, static::$sUrlFragments);
        $this->assertEquals( static::$sUrlFragments[6], 'PlayerGameProjectionStatsByTeam');
    }

    /**
     * Given: A developer API key
     * When: API is queried for 2013REG, Week 17, Team NE PlayerGameProjectionStatsByTeam
     * Then: Expect that the Season is placed in the URI
     *
     * @group Unit
     * @small
     */
    public function testSeasonInURI()
    {
        /** key 7 should be the Season based on URL structure */
        $this->assertArrayHasKey(7, static::$sUrlFragments);
        $this->assertEquals( static::$sUrlFragments[7], '2013REG');
    }

    /**
     * Given: A developer API key
     * When: API is queried for 2013REG, Week 17, Team NE PlayerGameProjectionStatsByTeam
     * Then: Expect that the Week is placed in the URI
     *
     * @group Unit
     * @small
     */
    public function testWeekInURI()
    {
        /** key 8 should be the Week based on URL structure */
        $this->assertArrayHasKey(8, static::$sUrlFragments);
        $this->assertEquals( static::$sUrlFragments[8], '17');
    }

    /**
     * Given: A developer API key
     * When: API is queried for 2013REG, Week 17, Team NE PlayerGameProjectionStatsByTeam
     * Then: Expect that the Team is placed in the URI
     *
     * @group Unit
     * @small
     */
    public function testTeamInURI()
    {
        /** key 9 should be the Team based on URL structure */
        $this->assertArrayHasKey(9, static::$sUrlFragments);

        list($week) = explode('?', static::$sUrlFragments[9]);
        $this->assertEquals( $week, 'NE');
    }

    /**
     * Given: A developer API key
     * When: API is queried for 2013REG, Week 17, Team NE PlayerGameProjectionStatsByTeam
     * Then: Expect a 200 response
     *
     * @group Unit
     * @small
     */
    public function testSuccessfulResponse()
    {
        $this->assertEquals('200', static::$sResponse->getStatusCode());
    }
}


text:
<?php

namespace PFE\V3\MobSurveyBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * FicheReponse
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="PFE\V3\MobSurveyBundle\Entity\FicheReponseRepository")
 */
class FicheReponse
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity="PFE\V3\MobSurveyBundle\Entity\Repondant" , cascade={"persist"})
     * @ORM\JoinColumn(name="repondant", referencedColumnName="id", nullable=false)
     */
    private $repondant;

    /**
     * @ORM\ManyToOne(targetEntity="PFE\V3\MobSurveyBundle\Entity\Questionnaire" , cascade={"persist"})
     * @ORM\JoinColumn(name="questionnaire", referencedColumnName="id", nullable=false)
     */
    private $questionnaire;

    /**
     * @ORM\ManyToOne(targetEntity="PFE\V3\MobSurveyBundle\Entity\Enqueteur"  ,cascade={"persist"})
     * @ORM\JoinColumn(name="enqueteur", referencedColumnName="id", nullable=false)
     */
    private $enqueteur;

    /**
     * @var long
     *
     * @ORM\Column(name="date_reponse", type="bigint")
     */
    private $answertime;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set repondant
     *
     * @param \PFE\V3\MobSurveyBundle\Entity\Repondant $repondant
     * @return FicheReponse
     */
    public function setRepondant(\PFE\V3\MobSurveyBundle\Entity\Repondant $repondant)
    {
        $this->repondant = $repondant;

        return $this;
    }

    /**
     * Get repondant
     *
     * @return \PFE\V3\MobSurveyBundle\Entity\Repondant
     */
    public function getRepondant()
    {
        return $this->repondant;
    }

    /**
     * Set questionnaire
     *
     * @param \PFE\V3\MobSurveyBundle\Entity\Questionnaire $questionnaire
     * @return FicheReponse
     */
    public function setQuestionnaire(\PFE\V3\MobSurveyBundle\Entity\Questionnaire $questionnaire)
    {
        $this->questionnaire = $questionnaire;

        return $this;
    }

    /**
     * Get questionnaire
     *
     * @return \PFE\V3\MobSurveyBundle\Entity\Questionnaire
     */
    public function getQuestionnaire()
    {
        return $this->questionnaire;
    }

    /**
     * Set enqueteur
     *
     * @param \PFE\V3\MobSurveyBundle\Entity\Enqueteur $enqueteur
     * @return FicheReponse
     */
    public function setEnqueteur(\PFE\V3\MobSurveyBundle\Entity\Enqueteur $enqueteur)
    {
        $this->enqueteur = $enqueteur;

        return $this;
    }

    /**
     * Get enqueteur
     *
     * @return \PFE\V3\MobSurveyBundle\Entity\Enqueteur
     */
    public function getEnqueteur()
    {
        return $this->enqueteur;
    }

    /**
     * Set answertime
     *
     * @param  $answertime
     * @return Repondant
     */
    public function setAnswertime($answertime)
    {
        $this->answertime = $answertime;

        return $this;
    }

    /**
     * Get answertime
     *
     *
     */
    public function getAnswertime()
    {
        return $this->answertime;
    }

}


text:
Quotes microservice implements a Seneca compatible API.
Seneca port and protocol can be specified in the microservice [configuration](Configuration.md/#api_seneca).

```javascript
var seneca = require('seneca')();

seneca.client({
    connection: {
        type: 'tcp', // Microservice seneca protocol
        localhost: '0.0.0.0', // Microservice localhost
        port: 9002, // Microservice seneca port
    }
});
```

The microservice responds on the following requests:

```javascript
seneca.act(
    {
        role: 'quotes',
        version: 1,
        cmd: ...cmd name....
        ... Arguments ...
    },
    function (err, result) {
        ...
    }
);
```

* [MultiStringV1 class](#class1)
* [QuoteV1 class](#class2)
* [DataPage<QuoteV1> class](#class3)
* [cmd: 'get_quotes'](#operation1)
* [cmd: 'get_random_quote'](#operation2)
* [cmd: 'get_quote_by_id'](#operation3)
* [cmd: 'create_quote'](#operation4)
* [cmd: 'update_quote'](#operation5)
* [cmd: 'delete_quote_by_id'](#operation6)

## Data types

###  MultiStringV1 class

String that contains versions in multiple languages

**Properties:**
- en: string - English version of the string
- sp: string - Spanish version of the string
- de: string - German version of the string
- fr: string - Franch version of the string
- pt: string - Portuguese version of the string
- ru: string - Russian version of the string
- .. - other languages can be added here

###  QuoteV1 class

Represents an inspirational quote

**Properties:**
- id: string - unique quote id
- text: MultiString - quote text in different languages
- author: MultiString - name of the quote author in different languages
- status: string - editing status of the quote: 'new', 'writing', 'translating', 'completed' (default: 'new')
- tags: [string] - (optional) search tags that represent topics associated with the quote
- all_tags: [string] - (read only) explicit and hash tags in normalized format for searching

###  DataPage<QuoteV1> class

Represents a paged result with subset of requested quotes

**Properties:**
- data: [QuoteV1] - array of retrieved Quote page
- count: int - total number of objects in retrieved resultset

## Operations

###  Cmd: 'get_quotes'

Retrieves a collection of quotes according to specified criteria

**Arguments:**
- correlation_id: string - (optional) unique id that identifies distributed transaction
- filter: object - filter parameters
  - tags: [string] - (optional) list tags with topic names
  - status: string - (optional) quote editing status
  - author: string - (optional) author name in any language
- paging: object - paging parameters
  - skip: int - (optional) start of page (default: 0). Operation returns paged result
  - take: int - (optional) page length (max: 100). Operation returns paged result

**Returns:**
- err: Error - occured error or null for success
- result: DataPage<QuoteV1> - retrieved quotes in page format

###  Cmd: 'get\_random\_quote'

Retrieves a random quote from filtered resultset

**Arguments:**
- correlation_id: string - (optional) unique id that identifies distributed transaction
- filter: object - filter parameters
  - tags: [string] - (optional) list tags with topic names
  - status: string - (optional) quote editing status
  - author: string - (optional) author name in any language

**Returns:**
- err: Error - occured error or null for success
- result: QuoteV1 - retrieved random quote, null if object wasn't found

###  Cmd: 'get\_quote\_by\_id'

Retrieves a single quote specified by its unique id

**Arguments:**
- correlation_id: string - (optional) unique id that identifies distributed transaction
- quote_id: string - unique Quote object id

**Returns:**
- err: Error - occured error or null for success
- result: QuoteV1 - retrieved quote, null if object wasn't found

###  Cmd: 'create_quote'

Creates a new quote

**Arguments:**
- correlation_id: string - (optional) unique id that identifies distributed transaction
- quote: QuoteV1 - Quote object to be created. If object id is not defined it is assigned automatically.

**Returns:**
- err: Error - occured error or null for success
- result: QuoteV1 - created quote object

###  Cmd: 'update_quote'

Updates quote specified by its unique id

**Arguments:**
- correlation_id: string - (optional) unique id that identifies distributed transaction
- quote_id: string - unique quote id
- quote: QuoteV1 - quote object with new values. Partial updates are supported

**Returns:**
- err: Error - occured error or null for success
- result: QuoteV1 - updated quote object

###  Cmd: 'delete\_quote\_by_id'

Deletes quote specified by its unique id

**Arguments:**
- correlation_id: string - (optional) unique id that identifies distributed transaction
- quote_id: string - unique quote id

**Returns:**
- err: Error - occured error or null for success


text:
@implementation JSValueCapture {
    JSGlobalContextRef _context;
    JSValueRef         _valueRef;
}

- (instancetype)initWithValue:(JSValueRef)valueRef context:(JSContextRef)context {
    if (self = [super init]) {
        _context   = JSContextGetGlobalContext(context);
        _valueRef = valueRef;
        JSValueProtect(_context, _valueRef);
        JSGlobalContextRetain(_context);
    }

    return self;
}

- (void)dealloc {
    JSValueUnprotect(_context, _valueRef);
    JSGlobalContextRelease(_context);
}

+ (instancetype)capture:(JSValueRef)valueRef context:(JSContextRef)context {
    return [[self alloc] initWithValue:valueRef context:context];
}

- (void)done {
}

@end


text:
package com.poomoo.edao.activity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.Gson;
import com.poomoo.edao.R;
import com.poomoo.edao.adapter.ChannelSpinnerAdapter;
import com.poomoo.edao.application.eDaoClientApplication;
import com.poomoo.edao.config.eDaoClientConfig;
import com.poomoo.edao.model.ResponseData;
import com.poomoo.edao.service.Get_UserInfo_Service;
import com.poomoo.edao.util.HttpCallbackListener;
import com.poomoo.edao.util.HttpUtil;
import com.poomoo.edao.util.Utity;
import com.poomoo.edao.widget.DialogResultListener;
import com.poomoo.edao.widget.MessageBox_YES;
import com.poomoo.edao.widget.MessageBox_YESNO;

import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.PopupWindow.OnDismissListener;
import android.widget.TextView;

/**
 *
 * @ClassName TransferOfPaymentActivity2
 * @Description TODO 转账支付2
 * @author 李苜菲
 * @date 2015-7-30 上午11:02:41
 */
public class TransferActivity2 extends BaseActivity implements OnClickListener {

	private TextView textView_payee_name, textView_payee_phonenum, textView_balance, textView_channel,
			textView_isEnough;
	private EditText editText_pay_money, editText_pay_password, editText_remark;
	private LinearLayout layout_balance, layout_password, layout_channel;
	private Button button_pay;

	private PopupWindow popupWindow;
	private View layout;
	private ChannelSpinnerAdapter adapter;
	private List<HashMap<String, String>> list;
	private ListView listView;

	private eDaoClientApplication application = null;
	private String userId = "", realName = "", tel = "", money = "", payType = "1", payPwd = "", remark = "";
	private static final String[] channel = new String[] { "意币支付", "现金支付" };
	private boolean needPassword = false, isBalanceEnough = true;
	private Gson gson = new Gson();
	private MessageBox_YESNO box_YESNO;
	private MessageBox_YES box_YES;
	private String transferType = "";// transferType:转账类型,1:意币转账,2:购买支付

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO 自动生成的方法存根
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_transfer2);
		// 实现沉浸式状态栏效果
		setImmerseLayout(findViewById(R.id.navigation_fragment));
		getIntentData();
		application = (eDaoClientApplication) getApplication();
		init();
	}

	private void getIntentData() {
		// TODO 自动生成的方法存根
		userId = getIntent().getExtras().getString("userId");
		realName = getIntent().getExtras().getString("realName");
		tel = getIntent().getExtras().getString("tel");
		money = getIntent().getExtras().getString("money");
		transferType = getIntent().getExtras().getString("transferType");
	}

	private void init() {
		// TODO 自动生成的方法存根
		textView_payee_name = (TextView) findViewById(R.id.transfer2_textView_payee_name);
		textView_payee_phonenum = (TextView) findViewById(R.id.transfer2_textView_payee_phonenum);
		textView_balance = (TextView) findViewById(R.id.transfer2_textView_balance);
		textView_channel = (TextView) findViewById(R.id.transfer2_textView_channel);
		textView_isEnough = (TextView) findViewById(R.id.transfer2_textView_isEnough);

		editText_pay_money = (EditText) findViewById(R.id.transfer2_editText_pay_money);
		editText_pay_password = (EditText) findViewById(R.id.transfer2_editText_pay_password);
		editText_remark = (EditText) findViewById(R.id.transfer2_editText_remark);

		layout_balance = (LinearLayout) findViewById(R.id.transfer2_layout_balance);
		layout_password = (LinearLayout) findViewById(R.id.transfer2_layout_password);
		layout_channel = (LinearLayout) findViewById(R.id.transfer2_layout_channel);

		button_pay = (Button) findViewById(R.id.transfer2_btn_pay);

		button_pay.setOnClickListener(this);

		textView_channel.setText(channel[0]);
		needPassword = true;
		// 购买支付
		if (transferType.equals("2")) {
			layout_channel.setOnClickListener(this);
			list = new ArrayList<HashMap<String, String>>();
			HashMap<String, String> data = null;
			int length = channel.length;
			for (int i = 0; i < length; i++) {
				data = new HashMap<String, String>();
				data.put("name", channel[i]);
				data.put("id", i + 1 + "");
		 		list.add(data);
			}
		}

		textView_payee_name.setText(realName);
		textView_payee_phonenum.setText(tel);

		// 指定了金额时不能手动修改
		if (!TextUtils.isEmpty(money)) {
			editText_pay_money.setText(money);
			editText_pay_money.setEnabled(false);
		}

		adapter = new ChannelSpinnerAdapter(this, list);
		textView_balance.setText("¥" + application.getTotalEb());
		editText_pay_money.addTextChangedListener(new TextWatcher() {

			@Override
			public void onTextChanged(CharSequence s, int start, int before, int count) {
				// TODO 自动生成的方法存根
			}

			@Override
			public void beforeTextChanged(CharSequence s, int start, int count, int after) {
				// TODO 自动生成的方法存根

			}

			@Override
			public void afterTextChanged(Editable s) {
				// TODO 自动生成的方法存根
				System.out.println("afterTextChanged");
				String temp = s.toString();
				int posDot = temp.indexOf(".");
				if (posDot > 0)
					if (temp.length() - posDot - 1 > 2)
						s.delete(posDot + 3, posDot + 4);

				System.out.println("s:" + s.toString());
				if (s.length() == 0) {
					textView_isEnough.setVisibility(View.GONE);
					return;
				}
				if (payType.equals("1")) {// 意币支付时不能超过上限
					double money = Double.parseDouble(s.toString().trim());
					if (money > (double) application.getTotalEb()) {
						textView_isEnough.setVisibility(View.VISIBLE);
						textView_isEnough.setText(eDaoClientConfig.balanceIsNotEnough);
						isBalanceEnough = false;
					} else {
						isBalanceEnough = true;
						textView_isEnough.setVisibility(View.GONE);
					}
				} else
					isBalanceEnough = true;
			}
		});
	}

	@Override
	public void onClick(View v) {
		// TODO 自动生成的方法存根
		switch (v.getId()) {
		case R.id.transfer2_layout_channel:
			showWindow(layout_channel, listView, list, textView_channel, adapter);
			break;
		case R.id.transfer2_btn_pay:
			if (checkInput()) {
				confirm();
			}
			break;
		}

	}

	private boolean checkInput() {
		// TODO 自动生成的方法存根
		// if (!isSelectedChannle) {
		// Utity.showToast(getApplicationContext(), "请选择支付方式");
		// return false;
		// }
		if (TextUtils.isEmpty(application.getPayPwdValue())) {
			box_YESNO = new MessageBox_YESNO(this);
			box_YESNO.showDialog("请设置支付密码", new DialogResultListener() {

				@Override
				public void onFinishDialogResult(int result) {
					// TODO 自动生成的方法存根
					if (result == 1) {
						Bundle pBundle = new Bundle();
						pBundle.putString("type", "2");
						openActivity(PassWordManageActivity.class, pBundle);
					}
				}
			});
			return false;
		}
		if (!isBalanceEnough) {
			Utity.showToast(getApplicationContext(), eDaoClientConfig.balanceIsNotEnough);
			return false;
		}
		money = editText_pay_money.getText().toString().trim();
		if (TextUtils.isEmpty(money)) {
			Utity.showToast(getApplicationContext(), "请输入金额");
			return false;
		}
		// 购买支付时金额不能超过5W
		if (transferType.equals("2")) {
			if (Double.parseDouble(money) > 5000) {
				Utity.showToast(getApplicationContext(), "不能超过5000!");
				return false;
			}
		}
		payPwd = editText_pay_password.getText().toString().trim();
		if (needPassword && TextUtils.isEmpty(payPwd)) {
			Utity.showToast(getApplicationContext(), "请输入支付密码");
			return false;
		}
		remark = editText_remark.getText().toString().trim();
		return true;
	}

	private void confirm() {
		// TODO 自动生成的方法存根
		Map<String, String> data = new HashMap<String, String>();
		data.put("bizName", "50000");
		data.put("fromUserId", application.getUserId());
		data.put("toUserId", userId);
		data.put("payFee", money);
		data.put("payType", payType);
		data.put("payPwd", payPwd);
		data.put("remark", remark);
		// transferType:转账类型,1:意币转账,2:购买支付
		if (transferType.equals("1"))
			data.put("method", "50002");
		else
			data.put("method", "50012");

		showProgressDialog("提交中...");
		HttpUtil.SendPostRequest(gson.toJson(data), eDaoClientConfig.url, new HttpCallbackListener() {

			@Override
			public void onFinish(final ResponseData responseData) {
				// TODO 自动生成的方法存根
				runOnUiThread(new Runnable() {

					@Override
					public void run() {
						// TODO 自动生成的方法存根
						closeProgressDialog();
						if (responseData.getRsCode() != 1) {
							box_YES = new MessageBox_YES(TransferActivity2.this);
							box_YES.showDialog(responseData.getMsg(), null);
						} else {
							Utity.showToast(getApplicationContext(), responseData.getMsg());
							if (payType.equals("1"))
								startService(new Intent(TransferActivity2.this, Get_UserInfo_Service.class));
							finish();
						}

					}
				});
			}

			@Override
			public void onError(Exception e) {
				// TODO 自动生成的方法存根
				runOnUiThread(new Runnable() {

					@Override
					public void run() {
						// TODO 自动生成的方法存根
						closeProgressDialog();
						Utity.showToast(getApplicationContext(), eDaoClientConfig.checkNet);
					}
				});
			}
		});
	}

	public void showWindow(View spinnerlayout, ListView listView, final List<HashMap<String, String>> list,
			final TextView text, final ChannelSpinnerAdapter adapter) {
		layout = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.myspinner_dropdown, null);
		listView = (ListView) layout.findViewById(R.id.myspinner_dropdown_listView);
		listView.setAdapter(adapter);
		popupWindow = new PopupWindow(spinnerlayout);
		// 设置弹框的宽度为布局文件的宽
		popupWindow.setWidth(spinnerlayout.getWidth());
		popupWindow.setHeight(LayoutParams.WRAP_CONTENT);
		// 设置一个透明的背景,不然无法实现点击弹框外,弹框消失
		ColorDrawable dw = new ColorDrawable(0xb0000000);
		popupWindow.setBackgroundDrawable(dw);
		// 设置点击弹框外部,弹框消失
		popupWindow.setOutsideTouchable(true);
		popupWindow.setFocusable(true);
		popupWindow.setContentView(layout);
		// 设置弹框出现的位置,在v的正下方横轴偏移textview的宽度,为了对齐~纵轴不偏移
		popupWindow.showAsDropDown(spinnerlayout, 0, 0);
		// 弹出动画
		// popupWindow.setAnimationStyle(R.style.popwin_anim_style);
		popupWindow.setOnDismissListener(new OnDismissListener() {
			@Override
			public void onDismiss() {
				// TODO Auto-generated method stub
				// spinnerlayout
				// .setBackgroundResource(R.drawable.preference_single_item);
			}

		});
		// listView的item点击事件
		listView.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
				// TODO Auto-generated method stub
				text.setText(list.get(arg2).get("name"));// 设置所选的item作为下拉框的标题
				payType = list.get(arg2).get("id");
				if (payType.equals("1")) {
					needPassword = true;
					layout_balance.setVisibility(View.VISIBLE);
					layout_password.setVisibility(View.VISIBLE);
				} else {
					needPassword = false;
					layout_balance.setVisibility(View.GONE);
					layout_password.setVisibility(View.GONE);
				}
				// 弹框消失
				popupWindow.dismiss();
				popupWindow = null;
			}
		});

	}

}


text:
/* Auto-generated by genmsg_cpp from file /home/notroot/IAI/ARES/px4/Firmware/msg/actuator_controls_0.msg */

#pragma once

#include <uORB/topics/actuator_controls_0.h>
#include "platforms/px4_message.h"

namespace px4
{

class __EXPORT px4_actuator_controls_0 :
	public PX4Message<actuator_controls_0_s>
{
public:
	px4_actuator_controls_0() :
		PX4Message<actuator_controls_0_s>()
	{}

	px4_actuator_controls_0(actuator_controls_0_s msg) :
		PX4Message<actuator_controls_0_s>(msg)
	{}

	~px4_actuator_controls_0() {}

	static PX4TopicHandle handle() {return ORB_ID(actuator_controls_0);}
};

};


text: The easiest way to make a form.


text:
package com.arturo.jm2api.user;

import com.arturo.jm2api.common.Profiles;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.test.context.ActiveProfiles;

import static org.junit.Assert.*;

@RunWith(MockitoJUnitRunner.class)
@ActiveProfiles(Profiles.DEVEVELOPMENT)
public class UserControllerTest {

    @InjectMocks private UserController userController;
    @Mock private UserService userService;

    @Test
    public void get() throws Exception {
        User user = new User();
        String username = "USERNAME";
        Mockito.when(userService.findUser(username)).thenReturn(user);

        assertEquals(user, userController.get(username));
    }

    @Test
    public void delete() throws Exception {
        Boolean expected = Boolean.TRUE;
        String username = "USERNAME";
        Mockito.when(userService.deleteUser(username)).thenReturn(expected);

        assertEquals(expected, userController.delete(username));
    }

    @Test
    public void save() throws Exception {
        User user = new User();
        Mockito.when(userService.saveUser(user)).thenReturn(user);

        assertEquals(user, userController.save(user));
    }

    @Test
    public void update() throws Exception {
        User user = new User();
        Mockito.when(userService.updateUser(user)).thenReturn(user);

        assertEquals(user, userController.update(user));
    }

}


text:
package org.killbill.billing.plugin.meter.timeline.metrics;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.tweak.ResultSetMapper;

public class MetricAndIdMapper implements ResultSetMapper<MetricAndId> {

    @Override
    public MetricAndId map(final int index, final ResultSet r, final StatementContext ctx) throws SQLException {
        return new MetricAndId(r.getString("sample_kind"), r.getInt("sample_kind_id"));
    }
}


text:
mkdir target -p

text2wfreq < src/tekstynas.txt | wfreq2vocab > target/tekstynas.vocab
text2idngram -vocab target/tekstynas.vocab  -idngram target/tekstynas.idngram < src/tekstynas.txt
idngram2lm -vocab_type 0 -idngram target/tekstynas.idngram  -vocab target/tekstynas.vocab -arpa target/tekstynas.arpa
sphinx_lm_convert -i target/tekstynas.arpa -o target/tekstynas.lm.DMP


text:
/*
 * Pathfinder
 * Core application for storage and analysis of IT landscape data
 *
 * OpenAPI spec version: 5.0.813
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package net.leanix.api.models;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * Deletion
 */

public class Deletion {
  /**
   * Gets or Sets deletionType
   */
  public enum DeletionTypeEnum {
    FACT_SHEET("FACT_SHEET"),

    RELATION("RELATION"),

    FACT_SHEET_FIELD("FACT_SHEET_FIELD"),

    FACT_SHEET_FIELD_VALUE("FACT_SHEET_FIELD_VALUE"),

    RELATION_FIELD("RELATION_FIELD"),

    RELATION_FIELD_VALUE("RELATION_FIELD_VALUE");

    private String value;

    DeletionTypeEnum(String value) {
      this.value = value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static DeletionTypeEnum fromValue(String text) {
      for (DeletionTypeEnum b : DeletionTypeEnum.values()) {
        if (String.valueOf(b.value).equals(text)) {
          return b;
        }
      }
      return null;
    }
  }

  @JsonProperty("deletionType")
  private DeletionTypeEnum deletionType = null;

  @JsonProperty("count")
  private Integer count = null;

  @JsonProperty("name")
  private String name = null;

  @JsonProperty("info1")
  private String info1 = null;

  @JsonProperty("info2")
  private String info2 = null;

  public Deletion deletionType(DeletionTypeEnum deletionType) {
    this.deletionType = deletionType;
    return this;
  }

   /**
   * Get deletionType
   * @return deletionType
  **/
  @ApiModelProperty(example = "null", value = "")
  public DeletionTypeEnum getDeletionType() {
    return deletionType;
  }

  public void setDeletionType(DeletionTypeEnum deletionType) {
    this.deletionType = deletionType;
  }

  public Deletion count(Integer count) {
    this.count = count;
    return this;
  }

   /**
   * Get count
   * @return count
  **/
  @ApiModelProperty(example = "null", value = "")
  public Integer getCount() {
    return count;
  }

  public void setCount(Integer count) {
    this.count = count;
  }

  public Deletion name(String name) {
    this.name = name;
    return this;
  }

   /**
   * Get name
   * @return name
  **/
  @ApiModelProperty(example = "null", value = "")
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public Deletion info1(String info1) {
    this.info1 = info1;
    return this;
  }

   /**
   * Get info1
   * @return info1
  **/
  @ApiModelProperty(example = "null", value = "")
  public String getInfo1() {
    return info1;
  }

  public void setInfo1(String info1) {
    this.info1 = info1;
  }

  public Deletion info2(String info2) {
    this.info2 = info2;
    return this;
  }

   /**
   * Get info2
   * @return info2
  **/
  @ApiModelProperty(example = "null", value = "")
  public String getInfo2() {
    return info2;
  }

  public void setInfo2(String info2) {
    this.info2 = info2;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Deletion deletion = (Deletion) o;
    return Objects.equals(this.deletionType, deletion.deletionType) &&
        Objects.equals(this.count, deletion.count) &&
        Objects.equals(this.name, deletion.name) &&
        Objects.equals(this.info1, deletion.info1) &&
        Objects.equals(this.info2, deletion.info2);
  }

  @Override
  public int hashCode() {
    return Objects.hash(deletionType, count, name, info1, info2);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Deletion {\n");

    sb.append("    deletionType: ").append(toIndentedString(deletionType)).append("\n");
    sb.append("    count: ").append(toIndentedString(count)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    info1: ").append(toIndentedString(info1)).append("\n");
    sb.append("    info2: ").append(toIndentedString(info2)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}


text:
<?php

return [

    'initial-setup'                   => 'Brazidesk Initial Setup',
    'master-template-file'            => 'Master template file',
    'master-template-other-path'      => 'Other path to the master template file',
    'master-template-other-path-ex'   => 'ex. views/layouts/app.blade.php',
    'migrations-to-be-installed'      => 'These migrations will be installed:',
    'all-tables-migrated'             => 'All needed tables are migrated',
    'proceed'                         => 'Proceed',
    'another-file'                    => 'another File',
    'admin-select'                    => 'Select administrator', // New
    'admin-select-help-block'         => 'Later you can select more users for administration', // New
    'upgrade'                         => 'Brazidesk version upgrade', // New v0.2.3
    'settings-to-be-installed'        => 'These settings will be installed:', // New v0.2.3
    'all-settings-installed'          => 'All needed settings are installed', // New v0.2.3
];


text:
FROM docker.io/mrjogo/scrapy
ENV PATH /usr/local/bin:$PATH
ENV PATH /home:$PATH
ADD . /home
WORKDIR /home
RUN pip install -i https://mirrors.aliyun.com/pypi/simple -r requirements.txt
CMD python ipproxytool.py


text:
//
//  ComponentPosition.h
//  aunteater
//
//  Created by Adrien on 05/04/14.
//
//

#ifndef __aunteater__NodeDisplay__
#define __aunteater__NodeDisplay__

#include <set>
#include <typeinfo>

class NodeDisplay
{
public:
	static const std::set<const std::type_info *> gComponentTypes;
};

#endif /* defined(__aunteater__NodeDisplay__) */


text:
//
//  MTAManager.h
//  CaibeiMarket
//
//  Created by icaibei on 2017/8/19.
//  Copyright © 2017年 qianji. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MTA.h"
#import "MTAConfig.h"
#import "MTADefine.h"

@interface MTAManager : NSObject

+ (void)initMTA;

/**
 页面进入

 @param page pageName
 */
+(void) trackPageViewBegin:(NSString*) page;

/**
 页面离开

 @param page pageName
 */
+(void) trackPageViewEnd:(NSString*) page;

/**
 上报异常code

 @param exception code
 @return code
 */
+ (MTAErrorCode)trackException:(NSException *)exception;

#pragma mark - -----【次数统计】----
/**
 【次数统计】Key-Value参数的事件
 @param event_id key
 @param kvs des
 */
+ (void) trackCustomKeyValueEvent:(NSString*)event_id props:( NSDictionary *) kvs;

/**
 【次数统计】字符串参数的事件

 @param event_id event_id description
 @param array array description
 */
+ (void) trackCustomEvent:(NSString*)event_id args:(NSArray*) array;

#pragma mark - -----【时长统计】----
/**
 时长统计】的Key-Value参数的事件
 可以指定事件的开始和结束时间,来上报一个带有统计时长的事件。

 @param event_id event_id description
 @param kvs kvs description
 */
+ (void) trackCustomKeyValueEventBegin:(NSString*)event_id props:( NSDictionary *) kvs;
+ (void) trackCustomKeyValueEventEnd:(NSString*)event_id props:( NSDictionary *) kvs;

/**
 【时长统计】字符串参数的事件
 可以指定事件的开始和结束时间,来上报一个带有统计时长的事件

 @param event_id event_id description
 @param array array description
 */
+ (void) trackCustomEventBegin:(NSString*)event_id args:(NSArray*) array;
+ (void) trackCustomEventEnd:(NSString*)event_id args:(NSArray*) array;

#pragma mark - -----【接口监控】----
+ (void)reportAppMonitorStat: (MTAAppMonitorStat *)stat;
@end

/*

 -(void) viewDidAppear:(BOOL)animated
 {
 NSString* page = @"Page1";
 [MTA trackPageViewBegin:page];
 }

 -(void) viewWillDisappear:(BOOL)animated
 {
 NSString* page = @"Page1";
 [MTA trackPageViewEnd:page];
 }

 NSDictionary* kvs=[NSDictionary  dictionaryWithObject:@"Value" forKey:@"Key"];
 [MTA trackCustomKeyValueEvent:@"KVEvent" props:kvs];

 [MTA trackCustomEvent:@"NormalEvent" args:[NSArray arrayWithObject:@"arg0"]];

 -(IBAction) clickStartButton:(id)sender{
 NSDictionary* kvs = [NSDictionary dictionaryWithObject:@"Value" forKey:@"TimeKey"];
 [MTA trackCustomKeyValueEventBegin :@"KVEvent" props:kvs];……
 }
 -(IBAction) clickEndButton:(id)sender{
 NSDictionary* kvs = [NSDictionary dictionaryWithObject:@"Value" forKey:@"TimeKey"];
 [MTA trackCustomKeyValueEventEnd :@"KVEvent" props:kvs];
 ……
 }

 -(IBAction) clickStartButton:(id)sender{
 [MTA trackCustomEventBegin:@"TimeEvent" args:nil];
 ……
 }
 -(IBAction) clickEndButton:(id)sender{
 [MTA trackCustomEventEnd:@"TimeEvent" args:nil];
 ……
 }
 */


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<?php echo link_tag('assets/bootstrap/css/bootstrap.min.css'); ?>
	<?php echo link_tag('assets/fonts/font-awesome/css/font-awesome.min.css'); ?>
	<?php echo link_tag('assets/css/style.css'); ?>
	<title></title>

				<?php echo img('assets/img/tuborg.svg'); ?>

			<?php echo img('assets/img/tinderbox_single_line.svg'); ?>


text:
package uuid

type Generator interface {
	Generate() (uuid string, err error)
}


text:
namespace Dcdr::Interconnect
{
    class WorkerServerStatusResponse;
    class WorkerLoginResponse;
    class WorkerPollTasksResponse;
    class WorkerDownloadSceneResponse;

    class IWorkerResponseDispatcher
    {
    public:
        virtual void dispatch(const WorkerServerStatusResponse&)
        {
            dispatch_not_implemented("WorkerServerStatusResponse");
        }

        virtual void dispatch(const WorkerLoginResponse&)
        {
            dispatch_not_implemented("WorkerLoginResponse");
        }

        virtual void dispatch(const WorkerPollTasksResponse&)
        {
            dispatch_not_implemented("WorkerPollTasksResponse");
        }

        virtual void dispatch(const WorkerDownloadSceneResponse&)
        {
            dispatch_not_implemented("WorkerDownloadSceneResponse");
        }

        virtual void dispatch(const WorkerGetSceneInfoResponse&)
        {
            dispatch_not_implemented("WorkerGetSceneInfoResponse");
        }

        virtual void dispatch_not_implemented(const std::string& parcelKind)
        {
            throw DispatchNotImplemented(std::string("Dispatch not implemented for ").append(parcelKind));
        };

        virtual ~IWorkerResponseDispatcher() = default;
    };
}


text:
Visual Basic Script to capture all the software installed/portable in Windows as well as OS, hardware and logical disk details and save results in either CSV format or SQL (to be used w/ MySQL, see below details)

# Features
* Reads Device Details from WMI
* Reads Logical Disk Details from WMI
* Reads all installed applications/drivers/runtimes/libraries/modules (both 32-bit and 64-bit) from Windows Registry
* Extracts versions from inscope portable applications (from whitelisted)
* Scans configured targeted pathes for versions of blacklisted EXE/DLL to assess vulnerabilities or End Of Life versions

## Supported environments and Testing
Following Microsoft Windows operating systems are targeted as supported environments:

Home (Client) | Business (Server) |  Device Details | Logical Disk Details | Installed things | Portable Whitelist Versions | Security Assesment
------------- | ----------------- | --------------- | -------------------- | ---------------- | --------------------------- | ------------------
:sun_with_face: 10 | :partly_sunny: 2016 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark:
:partly_sunny: 8.1 | :partly_sunny: 2012 R2 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark:
:partly_sunny: 8 | :partly_sunny: 2012 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark:
:first_quarter_moon: 7 | :first_quarter_moon: 2008 R2 | :wavy_dash: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark:
:partly_sunny: Vista | :partly_sunny: 2008 | :wavy_dash: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark:
:first_quarter_moon: XP | :partly_sunny: 2003 | :wavy_dash: | :white_check_mark: | :white_check_mark: |:white_check_mark: | :white_check_mark:
:partly_sunny: ME | :first_quarter_moon: 2000 |  :wavy_dash: |  :wavy_dash: | :white_check_mark: |:white_check_mark: | :white_check_mark:

where above used emoticons stands for:
* :sun_with_face: frequent testing
* :first_quarter_moon: seldom testing
* :partly_sunny: never tested _(as did not have an environment to test upon)_
* :white_check_mark: full support
* :wavy_dash: supported with most features (few values will be #N/A)

## SQL results compatibility for MySQL versions
* :white_check_mark: MySQL Server 5.7.x
* :no_entry: MySQL Server 3.23.x through 5.6.x _(no support for generated columns used to automatically determine certain things)_

## MySQL EER schema for results storage and traceability
![Capture-Windows-Software - MySQL EER schema](https://github.com/danielgp/capture-windows-software/blob/master/MySQL/CaptureWindowsSoftware-EER_Diagram.svg)

## Used refferences

Reference name | URL
-------------- | ---
Emoji Cheat Sheet | http://www.webpagefx.com/tools/emoji-cheat-sheet/
GetFileVersion Method | https://msdn.microsoft.com/en-us/library/b4e05k97(v=vs.84).aspx
Mastering Markdown | https://guides.github.com/features/mastering-markdown/
Operating System Version | https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx
MySQL Community Downloads | http://dev.mysql.com/downloads/
Uninstall Registry Key | https://msdn.microsoft.com/en-us/library/windows/desktop/aa372105(v=vs.85).aspx
VBScript Features | https://msdn.microsoft.com/en-us/library/273zc69c.aspx
VBScript Reference | https://technet.microsoft.com/en-us/library/ee198844.aspx
VBScript Version Information | https://msdn.microsoft.com/en-us/library/4y5y7bh5.aspx
Win32_BaseBoard class | https://msdn.microsoft.com/en-us/library/aa394072(v=vs.85).aspx
Win32_BIOS class | https://msdn.microsoft.com/en-us/library/aa394077(v=vs.85).aspx
Win32_ComputerSystem class | https://msdn.microsoft.com/en-us/library/aa394102(v=vs.85).aspx
Win32_DiskDrive class | https://msdn.microsoft.com/en-us/library/aa394132(v=vs.85).aspx
Win32_LogicalDisk class | https://msdn.microsoft.com/en-us/library/aa394173(v=vs.85).aspx
Win32_OperatingSystem | https://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx
Win32_PhysicalMemoryArray class | https://msdn.microsoft.com/en-us/library/aa394348(v=vs.85).aspx
Win32_Processor class | https://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx
Win32_VideoController class | https://msdn.microsoft.com/en-us/library/aa394512(v=vs.85).aspx


text:
namespace NTPoly {
////////////////////////////////////////////////////////////////////////////////
const int *SolverBase::GetIH(const Matrix_ps &dsm) { return dsm.ih_this; }

////////////////////////////////////////////////////////////////////////////////
int *SolverBase::GetIH(Matrix_ps &dsm) { return dsm.ih_this; }

////////////////////////////////////////////////////////////////////////////////
const int *SolverBase::GetIH(const SolverParameters &csp) {
  return csp.ih_this;
}

////////////////////////////////////////////////////////////////////////////////
int *SolverBase::GetIH(SolverParameters &csp) { return csp.ih_this; }
} // namespace NTPoly


text:
<?xml version="1.0" ?>
<doc>
	<str name="Patent Number">
		US8047030
	</str>
	<str name="Application Number">
		US12754260
	</str>
	<str name="Title">
		Housing for electronic lock
	</str>
	<str name="Abstract">
		A housing assembly adapted to fit into a mortised recess in a door is provided for accommodating components of an electronic lock mechanism. The housing assembly comprises a housing including opposed major side walls at least partially defining an opening into the housing. A circuit board comprising electronic circuitry for operating the lock mechanism is disposed in the housing. A bracket for holding batteries is adapted to be disposed in the opening in the housing. The bracket is accessible when the housing is in the mortised recess of the door such that the bracket is movable relative to the housing between a first position and a second position. In the first position the bracket is in the housing and in the second position the bracket is at least partially outside of the housing such that batteries may be inserted into or removed from the bracket.
	</str>
	<str name="Document Types">
		US | USB
	</str>
	<str name="Application Date">
		2010-04-05
	</str>
	<str name="Application Year">
		2010
	</str>
	<str name="Application(Year/Month)">
		2010-04
	</str>
	<str name="Publication Date">
		2011-11-01
	</str>
	<str name="Publication Year">
		2011
	</str>
	<str name="Publication(Year/Month)">
		2011-11
	</str>
	<str name="All IPC">
		H05K5/00 | E05B43/00 | E05B65/08 | E05B47/00 | E05B65/06
	</str>
	<str name="IPC Primary">
		H05K5/00
	</str>
	<str name="IPC Section">
		H
	</str>
	<str name="IPC Class">
		H05
	</str>
	<str name="IPC Subclass">
		H05K
	</str>
	<str name="IPC Group">
		H05K5
	</str>
	<str name="All UPC">
		70/271 | 70/91 | 361/759 | 70/101 | 70/277
	</str>
	<str name="UPC Primary">
		70/271
	</str>
	<str name="UPC Class">
		70
	</str>
	<str name="Family Member Count">
		0
	</str>
	<str name="Family Members Cited By Count">
		0
	</str>
	<str name="Other References Count">
		0
	</str>
	<str name="Cites">
		US20030214384 | US6117575 | US20040237609 | US7690230 | US5987818 | US6967562 | US5686890 | US5979754 | US5075182 | US6876293 | US6216502 | US4995248 | US5841637 | US5685182 | US4633687 | US6750568 | US20040261478 | US5488195 | US5608298 | US6580355 | US4929005 | US20030024288 | US7010947 | US5923264 | US4802353 | US6714118 | US6298699 | US5473922 | US4926664 | US4534194 | US5609051 | US5337588 | US5540069 | US5841361 | US5437174 | US5887467 | US6145353 | US4126341 | US4683741 | FR2734596
	</str>
	<str name="Cites Count">
		40
	</str>
	<str name="Assignee(s)">
		YALE SECURITY INC.
	</str>
	<str name="1st Assignee">
		YALE SECURITY INC.
	</str>
	<str name="Number of Assignees">
		1
	</str>
	<str name="1st Assignee Address">
		Monroe, NC
	</str>
	<str name="Assignee(s) Address">
		Monroe, NC
	</str>
	<str name="Inventor(s)">
		GRAY, JOHN, STEVEN
	</str>
	<str name="1st Inventor">
		GRAY, JOHN, STEVEN
	</str>
	<str name="Number of Inventors">
		1
	</str>
	<str name="1st Inventor Address">
		Maryville, TN
	</str>
	<str name="Inventor(s) Address">
		Maryville, TN
	</str>
	<str name="Agent/Attorney">
		JOHNSTON, MICHAEL G. MOORE & VAN ALLEN PLLC
	</str>
	<str name="Primary Examiner">
		PATEL, DHARTI
	</str>
	<str name="cited by within 3 years">
		0
	</str>
	<str name="cited by within 5 years">
		0
	</str>
</doc>


text:
require 'faraday_middleware/response_middleware'

module FaradayMiddleware
  # Public: Parse response bodies as YAML.
  #
  # Warning: This is not backwards compatible with versions of this middleware
  # prior to faraday_middleware v0.12 - prior to this version, we used
  # YAML.load rather than YAMl.safe_load, which exposes serious remote code
  # execution risks - see https://github.com/ruby/psych/issues/119 for details.
  # If you're sure you can trust YAML you're passing, you can set up an unsafe
  # version of this middleware like this:
  #
  #     class UnsafelyParseYaml < FaradayMiddleware::ResponseMiddleware
  #       dependency do
  #         require 'yaml'
  #       end
  #
  #       define_parser do |body|
  #         YAML.load body
  #       end
  #     end
  #
  #     Faraday.new(..) do |config|
  #       config.use UnsafelyParseYaml
  #       ...
  #     end
  class ParseYaml < ResponseMiddleware
    dependency 'safe_yaml/load'

    define_parser do |body, parser_options|
      SafeYAML.load(body, nil, parser_options || {})
    end
  end
end

# deprecated alias
Faraday::Response::ParseYaml = FaradayMiddleware::ParseYaml


text:
<?php

/**
 * Validate a value number.
 *
 * {@inheritDoc}
 *
 * @author Peter Decuyper <peter@serial-graphics.be>
 */
class Hostingcheck_Validator_Version extends Hostingcheck_Validator_Compare
{
    /**
     * Messages when the validator fails.
     *
     * @var array
     */
    protected $messages = array(
        'equal' => 'Version is not equal to {value}.',
        'min' => 'Version is to low, should be at least {min}.',
        'max' => 'Version is to high, should be at most {max}.',
    );

    /**
     * Get the equal argument.
     *
     * @return Hostingcheck_Value_Version
     */
    protected function getArgumentEqual()
    {
        return new Hostingcheck_Value_Version(
            $this->arguments['equal']
        );
    }

    /**
     * Get the minimum argument.
     *
     * @return Hostingcheck_Value_Version
     */
    protected function getArgumentMinimum()
    {
        return new Hostingcheck_Value_Version(
            $this->arguments['min']
        );
    }

    /**
     * Get the minimum argument.
     *
     * @return Hostingcheck_Value_Version
     */
    protected function getArgumentMaximum()
    {
        return new Hostingcheck_Value_Version(
            $this->arguments['max']
        );
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns8:Datacenters xmlns="http://oec.api.opsource.net/schemas/server" xmlns:ns9="http://oec.api.opsource.net/schemas/reset" xmlns:ns5="http://oec.api.opsource.net/schemas/vip" xmlns:ns12="http://oec.api.opsource.net/schemas/general" xmlns:ns6="http://oec.api.opsource.net/schemas/imageimportexport" xmlns:ns13="http://oec.api.opsource.net/schemas/support" xmlns:ns7="http://oec.api.opsource.net/schemas/whitelabel" xmlns:ns10="http://oec.api.opsource.net/schemas/ipplan" xmlns:ns8="http://oec.api.opsource.net/schemas/datacenter" xmlns:ns11="http://oec.api.opsource.net/schemas/storage" xmlns:ns2="http://oec.api.opsource.net/schemas/organization" xmlns:ns4="http://oec.api.opsource.net/schemas/network" xmlns:ns3="http://oec.api.opsource.net/schemas/directory">
    <ns8:datacenter>
        <ns8:location>NA1</ns8:location>
        <ns8:displayName>US - East</ns8:displayName>
        <ns8:city>Ashburn</ns8:city>
        <ns8:state>Virginia</ns8:state>
        <ns8:country>US</ns8:country>
        <ns8:vpnUrl>https://opsource-na1.cloud-vpn.net/</ns8:vpnUrl>
        <ns8:default>true</ns8:default>
    </ns8:datacenter>
</ns8:Datacenters>