text:
"""
dsq_postgres.decorators
~~~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2012 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""

from django.conf import settings
from django.db import connections, transaction, DEFAULT_DB_ALIAS
from functools import wraps

def autocommit(using=DEFAULT_DB_ALIAS, conditional=None):
    """
    Decorator that sets database-level autocommit and turns off managed
    transactions in Django.

    If ``conditional`` is passed and is a callable, it is called with the
    arguments to the wrapped function and will enable autocommit only if
    True is returned.
    """
    def _autocommit(func):
        @wraps(func)
        def __autocommit(*args, **kwargs):
            # TODO: Testing autocommit on views isn't very useful and
            #       significantly slows down the test suite.  Instead, write
            #       some better tests for this decorator.
            if getattr(settings, 'TEST', False):
                return func(*args, **kwargs)
            if callable(conditional) and not conditional(*args, **kwargs):
                return func(*args, **kwargs)

            if isinstance(using, basestring):
                using_list = [using]
            else:
                using_list = using

            for alias in using_list:
                connection = connections[using]
                connection.set_autocommit()

            try:
                return func(*args, **kwargs)
            except Exception:
                raise
            finally:
                for alias in using_list:
                    connection = connections[using]
                    connection.set_default_commit()

        return transaction.autocommit(__autocommit)

    # This allows you to use @autocommit or @autocommit(using='...') instead
    # of @autocommit().
    if using is None:
        using = DEFAULT_DB_ALIAS
    if callable(using):
        func = using
        using = DEFAULT_DB_ALIAS
        return _autocommit(func)
    return lambda func: _autocommit(func)


text:
import { RESET_NOTIFICATION, CREATE_NOTIFICATION } from '../actions';

const initial = {
  message: null,
  type: 'info',
  isRetry: false,
  retryAction: null
};

export default function reducer(state = initial, action) {
  const { type, payload } = action;

  if (type === RESET_NOTIFICATION) {
    return initial;
  } else if (type === CREATE_NOTIFICATION) {
    return payload;
  }

  return state;
}

redpajama_set_name: RedPajamaGithub


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

<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
BinaryQueryResponseWriter (Solr 5.0-2012-07-18_13-07-53 API)
</TITLE>

<META NAME="date" CONTENT="2012-07-18">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.solr.response

Interface BinaryQueryResponseWriter

All Superinterfaces:
NamedListInitializedPlugin, QueryResponseWriter

All Known Implementing Classes:
BinaryResponseWriter, RawResponseWriter

public interface BinaryQueryResponseWriter
extends QueryResponseWriter

Implementations of BinaryQueryResponseWriter are used to
 write response in binary format
 Functionality is exactly same as its parent class QueryResponseWriter
 But it may not implement the write(Writer writer, SolrQueryRequest request, SolrQueryResponse response)
 method

Field Summary

Fields inherited from interface org.apache.solr.response.QueryResponseWriter

CONTENT_TYPE_TEXT_ASCII, CONTENT_TYPE_TEXT_UTF8, CONTENT_TYPE_XML_UTF8

Method Summary

 void
write(OutputStream out,
      SolrQueryRequest request,
      SolrQueryResponse response)

          Use it to write the reponse in a binary format

Methods inherited from interface org.apache.solr.response.QueryResponseWriter

getContentType, init, write

Method Detail

write

void write(OutputStream out,
           SolrQueryRequest request,
           SolrQueryResponse response)
           throws IOException

Use it to write the reponse in a binary format

Throws:

IOException

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

          <address>Copyright © 2000-2012 Apache Software Foundation.  All Rights Reserved.</address>


text:
import React from 'react';
import { mount } from 'enzyme';

import Badge from './Badge.component';

describe('Badge', () => {
	it('should render by default', () => {
		// given
		const label = 'my label';

		// when
		const wrapper = mount(<Badge label={label} />);

		// then
		expect(wrapper.html()).toMatchSnapshot();
	});

	it('should render the given children', () => {
		// when
		const wrapper = mount(
			<Badge>

children

			</Badge>,
		);

		// then
		expect(wrapper.find('div[test-id="testId"]').text()).toBe('children');
	});
});


text:
function [tri,hys]=hysteresis3d(img,t1,t2,conn)
% function [tri,hys]=HYSTERESIS3D(img,t1,t2,conn)
%
% Hysteresis3d is a simple function that performs trinarisation and
% hysteresis for 2D and 3D images. Hysteresis3d was inspired by Peter
% Kovesi's 2D hysteresis function
% (http://www.csse.uwa.edu.au/~pk/research/matlabfns/). This 3D function
% takes advantage of the 3D connectivities of imfill instead of the 2D
% connectivities of bwselect.
%
% Usage:        [tri,hys]=HYSTERESIS3D(img,t1,t2,conn)
%
% Arguments:    img - image for hysteresis (assumed to be non-negative)
%               t1 - lower threshold value (fraction b/w 0-1, e.g.: 0.1)
%               t2 - upper threshold value (fraction b/w 0-1, e.g.: 0.9)
%                   (t1/t2 can be entered in any order, larger one will be
%                   set as the upper threshold)
%               conn - number of connectivities (4 or 8 for 2D)
%                                               (6, 18, or 26 for 3D)
% Returns:
%               tri - the trinarisation image (values are 0, 1, or 2)
%               hys - the hysteresis image (logical mask image)
%
% Examples:     [tri,hys]=HYSTERESIS3D(img,0.25,0.8,26)
%
% 2012/07/10: written by Luke Xie
% 2013/12/09: defaults added
%
% To see an example of hysteresis used to segment a kidney region, please
% refer to supplement in QSM of Kidney, NMR Biomed, 2013 Dec;26(12):1853-63
% (http://onlinelibrary.wiley.com/doi/10.1002/nbm.3039/abstract).
% Supplemental material is also available on our CIVMspace:
% http://www.civm.duhs.duke.edu/lx201204/

%% arguments
if nargin<3
    disp('function needs at least 3 inputs')
    return;
elseif nargin==3
    disp('inputs=3')
    if numel(size(img))==2;
        disp('img=2D')
        disp('conn set at 4 connectivies (number of neighbors)')
        conn=4;
    end
    if numel(size(img))==3;
        disp('img=3D')
        disp('conn set at 6 connectivies (number of neighbors)')
        conn=6;
    end
end

%% scale t1 & t2 based on image intensity range
if t1>t2    % swap values if t1>t2
	tmp=t1;
	t1=t2;
	t2=tmp;
end
minv=min(img(:));                % min image intensity value
maxv=max(img(:));                % max image intensity value
t1v=t1*(maxv-minv)+minv;
t2v=t2*(maxv-minv)+minv;

%% trinarisation
tri=zeros(size(img));
tri(img>=t1v)=1;
tri(img>=t2v)=2;

%% hysteresis
abovet1=img>t1v;                                     % points above lower threshold
seed_indices=sub2ind(size(abovet1),find(img>t2v));   % indices of points above upper threshold
hys=imfill(~abovet1,seed_indices,conn);              % obtain all connected regions in abovet1 that include points with values above t2
hys=hys & abovet1;


text:
<?php

/**
 * Block for Dependencies
 *
 * @category    Mage
 * @package     Mage_Connect
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Depends
    extends Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract
{

    /**
     * Prepare Dependencies Form before rendering HTML
     *
     * @return Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Package
     */
    protected function _prepareForm()
    {
        parent::_prepareForm();

        $form = new Varien_Data_Form();
        $form->setHtmlIdPrefix('_depends');

        $fieldset = $form->addFieldset('depends_php_fieldset', array(
            'legend'    => Mage::helper('connect')->__('PHP Version')
        ));

        $fieldset->addField('depends_php_min', 'text', array(
            'name'      => 'depends_php_min',
            'label'     => Mage::helper('connect')->__('Minimum'),
            'required'  => true,
            'value'     => '5.2.0',
        ));

        $fieldset->addField('depends_php_max', 'text', array(
            'name'      => 'depends_php_max',
            'label'     => Mage::helper('connect')->__('Maximum'),
            'required'  => true,
            'value'     => '5.2.20',
        ));

        $form->setValues($this->getData());
        $this->setForm($form);

        return $this;
    }

    /**
     * Retrieve list of loaded PHP extensions
     *
     * @return array
     */
    public function getExtensions()
    {
        $extensions = array();
        foreach (get_loaded_extensions() as $ext) {
            $extensions[$ext] = $ext;
        }
        asort($extensions, SORT_STRING);
        return $extensions;
    }

    /**
     * Get Tab Label
     *
     * @return string
     */
    public function getTabLabel()
    {
        return Mage::helper('connect')->__('Dependencies');
    }

    /**
     * Get Tab Title
     *
     * @return string
     */
    public function getTabTitle()
    {
        return Mage::helper('connect')->__('Dependencies');
    }
}


text:
package com.android.hoxapp;

import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.util.Log;

public class AndroidAlarmTracking extends Activity {
	private MediaPlayer mMediaPlayer;

	 public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        alarm();

	 }
	private void alarm(){
		Log.e("ACTION", "ALARM FUNCTION");

		Uri alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
	     if(alert == null){
	         // alert is null, using backup
	         alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
	         if(alert == null){  // I can't see this ever being null (as always have a default notification) but just incase
	             // alert backup is null, using 2nd backup
	             alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
	         }
	     }

	     try {
			mMediaPlayer = new MediaPlayer();
			mMediaPlayer.setDataSource(this, alert);
			final AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
			if (audioManager.getStreamVolume(AudioManager.STREAM_RING) != 0) {
				mMediaPlayer.setAudioStreamType(AudioManager.STREAM_RING);
				mMediaPlayer.setLooping(true);
				mMediaPlayer.prepare();
				mMediaPlayer.start();

			     new CountDownTimer(60000, 1000) {
					@Override
					public void onTick(long millisUntilFinished) {
						// TODO Auto-generated method stub

					}
					public void onFinish() {
						mMediaPlayer.stop();
					}
			      }.start();
			}
    	} catch(Exception e) {

    	}

	}

}


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

<title>The Red Hat newlib C Library: isascii</title>

<meta name="description" content="The Red Hat newlib C Library: isascii">
<meta name="keywords" content="The Red Hat newlib C Library: isascii">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Document-Index.html#Document-Index" rel="index" title="Document Index">
<link href="Document-Index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Ctype.html#Ctype" rel="up" title="Ctype">
<link href="isblank.html#isblank" rel="next" title="isblank">
<link href="isalpha.html#isalpha" rel="prev" title="isalpha">

Next: isblank, Previous: isalpha, Up: Ctype   [Contents][Index]

3.3 isascii, isascii_l—ASCII character predicate

Synopsis

#include <ctype.h>
int isascii(int <var>c</var>);

#include <ctype.h>
int isascii_l(int <var>c</var>, locale_t <var>locale</var>);

Description

isascii is a macro which returns non-zero when <var>c</var> is an ASCII
character, and 0 otherwise.  It is defined for all integer values.

isascii_l is like isascii but performs the check based on the
locale specified by the locale object locale.  If <var>locale</var> is
LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined.

You can use a compiled subroutine instead of the macro definition by
undefining the macro using ‘#undef isascii’ or ‘#undef isascii_l’.

Returns

isascii, isascii_l return non-zero if the low order byte of <var>c</var>
is in the range 0 to 127 (0x00–0x7F).

Portability

isascii is ANSI C.
isascii_l is a GNU extension.

No supporting OS subroutines are required.


text:
branch=v3.3

arch=x86_64
mirror=http://nl.alpinelinux.org/
main_mirror=${mirror}alpine/${branch}/main/
community_mirror=${mirror}alpine/${branch}/community/

chroot_dir=$PWD/alpine
fs=$PWD/filesystem
size=256M


text:
<!doctype html>

    <meta charset="utf-8">

    <title>The train</title>
    <meta name="description" content="The train project">
    <meta name="author" content="Rulikkk <Rulikkk@me.com>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="css/styles.css">

Img source


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SteamVRObjectGrab : MonoBehaviour
{
    Transform initialParent;

    private SteamVR_TrackedObject trackedObj;
    private SteamVR_Controller.Device Controller
    {
        get
        {
            return SteamVR_Controller.Input((int)trackedObj.index);
        }
    }

    void Awake()
    {
        trackedObj = GetComponent<SteamVR_TrackedObject>();
    }

     GameObject collidingObject;//To keep track of what objects have rigidbodies
     GameObject objectInHand;//To track the object you're holding

    void OnTriggerEnter(Collider other)//Activate function in trigger zone, checking rigidbodies and ignoring if no rigidbodies
    {
        if (other.GetComponentInParent<GrabbableObject>())
        {
            collidingObject = other.transform.parent.gameObject;
            initialParent = collidingObject.transform.parent;
        }

    }

    void OnTriggerExit(Collider other)
    {
        collidingObject = null;
    }

    void Update()
    {
        if (Controller.GetPressDown(SteamVR_Controller.ButtonMask.Grip))// Push grip buttons and touching object, set GrabObject function
        {
            //print("grip pressed");
            if (collidingObject)
                GrabObject();
        }

        if (Controller.GetPressUp(SteamVR_Controller.ButtonMask.Grip))// If release grip buttons and holding object, set to release
        {
            if (objectInHand)
                ReleaseObject();
        }
    }

    private void GrabObject() // Picking up object and assigning objectInHand variable
    {

        objectInHand = collidingObject;
        objectInHand.transform.SetParent(this.transform);
        objectInHand.GetComponent<Rigidbody>().isKinematic = true;
        objectInHand.GetComponent<GrabbableObject>().Grabbed(this.gameObject);
    }

    // Releasing object
    private void ReleaseObject()
    {
        objectInHand.transform.SetParent(initialParent);
        objectInHand.GetComponent<GrabbableObject>().Released(this.gameObject);
    }
}


text:
package com.amazonaws.services.cloudwatchrum.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum Telemetry {

    Errors("errors"),
    Performance("performance"),
    Http("http");

    private String value;

    private Telemetry(String value) {
        this.value = value;
    }

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

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return Telemetry corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static Telemetry fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (Telemetry enumEntry : Telemetry.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
#include <errno.h>
#include <inttypes.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#include <shared/macro.h>

#include <libkmod/libkmod.h>

#include "testsuite.h"

static noreturn int test_initlib(const struct test *t)
{
	struct kmod_ctx *ctx;
	const char *null_config = NULL;

	ctx = kmod_new(NULL, &null_config);
	if (ctx == NULL)
		exit(EXIT_FAILURE);

	kmod_unref(ctx);

	exit(EXIT_SUCCESS);
}
DEFINE_TEST(test_initlib,
		.description = "test if libkmod's init function work");

static noreturn int test_insert(const struct test *t)
{
	struct kmod_ctx *ctx;
	struct kmod_module *mod;
	const char *null_config = NULL;
	int err;

	ctx = kmod_new(NULL, &null_config);
	if (ctx == NULL)
		exit(EXIT_FAILURE);

	err = kmod_module_new_from_path(ctx, "/mod-simple.ko", &mod);
	if (err != 0) {
		ERR("could not create module from path: %m\n");
		exit(EXIT_FAILURE);
	}

	err = kmod_module_insert_module(mod, 0, NULL);
	if (err != 0) {
		ERR("could not insert module: %m\n");
		exit(EXIT_FAILURE);
	}
	kmod_unref(ctx);

	exit(EXIT_SUCCESS);
}
DEFINE_TEST(test_insert,
	.description = "test if libkmod's insert_module returns ok",
	.config = {
		[TC_ROOTFS] = TESTSUITE_ROOTFS "test-init/",
		[TC_INIT_MODULE_RETCODES] = "bla:1:20",
	},
	.modules_loaded = "mod_simple",
	.need_spawn = true);

static noreturn int test_remove(const struct test *t)
{
	struct kmod_ctx *ctx;
	struct kmod_module *mod_simple, *mod_bla;
	const char *null_config = NULL;
	int err;

	ctx = kmod_new(NULL, &null_config);
	if (ctx == NULL)
		exit(EXIT_FAILURE);

	err = kmod_module_new_from_name(ctx, "mod-simple", &mod_simple);
	if (err != 0) {
		ERR("could not create module from name: %s\n", strerror(-err));
		exit(EXIT_FAILURE);
	}

	err = kmod_module_new_from_name(ctx, "bla", &mod_bla);
	if (err != 0) {
		ERR("could not create module from name: %s\n", strerror(-err));
		exit(EXIT_FAILURE);
	}

	err = kmod_module_remove_module(mod_simple, 0);
	if (err != 0) {
		ERR("could not remove module: %s\n", strerror(-err));
		exit(EXIT_FAILURE);
	}

	err = kmod_module_remove_module(mod_bla, 0);
	if (err != -ENOENT) {
		ERR("wrong return code for failure test: %d\n", err);
		exit(EXIT_FAILURE);
	}

	kmod_unref(ctx);

	exit(EXIT_SUCCESS);
}
DEFINE_TEST(test_remove,
	.description = "test if libkmod's remove_module returns ok",
	.config = {
		[TC_ROOTFS] = TESTSUITE_ROOTFS "test-remove/",
		[TC_DELETE_MODULE_RETCODES] =
			"mod-simple:0:0:bla:-1:" STRINGIFY(ENOENT),
	},
	.need_spawn = true);

TESTSUITE_MAIN();


text:
@interface ZNGStatus : MTLModel<MTLJSONSerializing>

@property (nonatomic, strong) NSString *text;
@property (nonatomic) NSInteger statusCode;
@property (nonatomic, strong) NSString *statusDescription;
@property (nonatomic, strong) NSString *sortField;
@property (nonatomic, strong) NSString *sortDirection;
@property (nonatomic) NSInteger page;
@property (nonatomic) NSInteger pageSize;
@property (nonatomic) NSInteger totalPages;
@property (nonatomic) NSInteger totalRecords;

@end


text:
Kivy Designer Help
==================

Kivy Designer is Kivy's tool for designing Graphical User Interfaces (GUIs) from Kivy Widgets. You can compose and customize widgets, and test them.

Project
-------
A Project is what you would be working on. Each project contains atleast one 'kv' file and one 'py' file. For your project to be compatible completely with Kivy Designer, it will be good to start creating it from Kivy Designer.

Kivy Designer Start Page
------------------------
When you will start Kivy Designer, then first screen you will see is "Start Page" of Kivy Designer. It contains four buttons "Open Project", "New Project", "Kivy" and "Kivy Designer" and it shows recently open projects, click on any of them to open.

Create New Project
------------------
To create a new project:
    * Click File->New Project.
    * Select any of the desired templates from the popup.
    * Click "New" to create a new project.

Open a Project
--------------
To open a project:
    * Click on File->Open Project
    * Navigate to the path of project.
    * If you wish then select any 'kv' file.
    * Click "Open" to open project.

Open Recent Project
---------------------
* Open a Recent Project using Start Page
* In Start Page, under "Recent Files" you will see recent projects. Click on any of them.

* Go to File->Recent Files.
* Click on the path, you want to open.

Features
--------
After opening a project, you will see following:
    * "Project Tree" on the left side, shows files and folders inside the project's directory.
    * "Toolbox" contains widgets which could be drag-drop to the required positions.
    * "UI Creator" is place where you will be designing your project.
    * "Widget Tree" shows the Widget hierarchy of the project.
    * "Property Viewer" shows properties, their values and allows changing the values.
    * "Events" shows the available events and their event handler. You can change/set an event handler and add an event.
    * "KV Lang Area" shows what your kv file would be consisting.
    * "Kivy Console" is a console just like xterm, GNOME Terminal. You can enter commands and execute them.
    * "Python Shell" is an interactive Python Shell.
    * "Error Console" shows errors which may occur in the user code, while opening a project or creating custom widget.

Building a Project
------------------
After creating a new project or opening a project, next thing to do is to build your project. Here are number of available options through which you can create your project.

Adding Widget
~~~~~~~~~~~~~~
* Click on "Toolbox" in the left of the screen.
* A number of Widgets will be shown.
* Press the Widget which you want to add.
* Drag to the parent on which you want to add the widget. While dragging you can also see how it is going to look when added to that parent.
* Drop the widget when desired.

Similarly WidgetTree also supports drag-drop of widgets. Select any widget from WidgetTree or drag any widget from WidgetTree and drop it on the parent widget.

Changing Property Value of a Widget
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Select a Widget by clicking on it.
* On the bottom-right side you can see Widgets with its properties. To change the value, just enter the value.

Setting Event Handler
~~~~~~~~~~~~~~~~~~~~~
* Select a Widget.
* On the bottom-right side, select "Events".
* You can current available events of widget.
* To enter Event Handler, set the value of event handler in its corresponding text.
* While entering an id and dot '.', you will see a dropdown with available functions.
* If selected widget is a custom widget, then you can create a new event by entering event name in the last text and saving the project.

Open Project's Python Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Click on "Project Tree" on left side.
* Click on the file name you want to open.
* File will be opened in a new tab.

Edit Options
~~~~~~~~~~~~
Edit Options are available for Widgets and also for text in KVLangArea and Python Files. Select a Widget or click on KVLangArea or to see its available options.
    * Cut, delete the current widget/selected text from its position.
    * Copy, copies the current widget/selected text.
    * Paste, add the widget/text to parent widget/KV Lang Area or Python File
    * Select All, selects all widgets/text.
    * Delete, delete current selected widget/text.

Moreover you can also access these options using keyboard shortcuts.

Saving Project
~~~~~~~~~~~~~~
After creating a project you can save project by File->Save or File->Save As

Add Files to Project
~~~~~~~~~~~~~~~~~~~~
You can also add files to a project.
    * Go to Project->Add File.
    * Click on "Open File" to open the file you want to add.
    * Click on "Open Folder" to open the folder where you want to add file inside project.
    * Check "Always use this folder" if you want to always use this folder for this file type.
    * Click "Add" to Add File.

Add Custom Widgets to Project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can also add custom widgets to project.
    * Go to Project->Add Custom Widget.
    * Select custom widget's python file.
    * Click "Open"

Run Project
~~~~~~~~~~~
Go to Run->Run Project, to run current project.

Project Preferences
-------------------
To access Project Preferences, go to Project->Project Preferences. Here you can access environment variables and arguments which must be passed to project to run it.

Kivy Designer Settings
----------------------
Kivy Designer Settings can be accessed by File->Settings. Here you can
    * Modify Python Shell Path.
    * Modify whether to load changes in KV Lang Area automatically or not.
    * Number of Recent Files, Kivy Designer should keep track of.
    * Auto Save time out, after how many mins project should be saved automatically.

Auto Save
---------
Kivy Designer supports Auto Save. Your current project will be automatically saved after Auto Save Time out which is specified in Kivy Designer Settings. In case of any failure, you can access your last saved project from ".designer" folder present in the project's directory.

Detect Runtime Changes
----------------------
If a project has been changed outside Kivy Designer, then Kivy Designer will detect those changes. Kivy Designer will ask whether to reload the project or not.


text:
define(["app/controllers/home"], function() {

  angular
    .module('app.routes.home', [
      'app.controllers.home',
      'ui.router'
    ])
    .config([
      '$stateProvider',
      function($stateProvider) {
        $stateProvider
          .state('home', {
            controller:   'HomeController',
            templateUrl:  'app/templates/home.html',
            url:          ''
          })
        ;
      }
    ])
  ;

});


text:
importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");

var t = async_test("");
var t_pass = t.done.bind(t);
var t_fail = t.step_func(function(reason) {
    throw reason;
});
t.step(function() {

var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');

ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
var g = ctx.createLinearGradient(0, 0, 0, 50);
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
_assertPixelApprox(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
t.done();

});
done();


text:
package com.amazonaws.services.autoscaling.model;

import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 */
public class CompleteLifecycleActionRequest extends AmazonWebServiceRequest
        implements Serializable, Cloneable {

    /**
     *

     * The name of the lifecycle hook.
     *

     */
    private String lifecycleHookName;
    /**
     *

     * The name of the group for the lifecycle hook.
     *

     */
    private String autoScalingGroupName;
    /**
     *

     * A universally unique identifier (UUID) that identifies a specific
     * lifecycle action associated with an instance. Auto Scaling sends this
     * token to the notification target you specified when you created the
     * lifecycle hook.
     *

     */
    private String lifecycleActionToken;
    /**
     *

     * The action for the group to take. This parameter can be either
     * CONTINUE or ABANDON.
     *

     */
    private String lifecycleActionResult;
    /**
     *

     * The ID of the instance.
     *

     */
    private String instanceId;

    /**
     *

     * The name of the lifecycle hook.
     *

     *
     * @param lifecycleHookName
     *        The name of the lifecycle hook.
     */

    public void setLifecycleHookName(String lifecycleHookName) {
        this.lifecycleHookName = lifecycleHookName;
    }

    /**
     *

     * The name of the lifecycle hook.
     *

     *
     * @return The name of the lifecycle hook.
     */

    public String getLifecycleHookName() {
        return this.lifecycleHookName;
    }

    /**
     *

     * The name of the lifecycle hook.
     *

     *
     * @param lifecycleHookName
     *        The name of the lifecycle hook.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CompleteLifecycleActionRequest withLifecycleHookName(
            String lifecycleHookName) {
        setLifecycleHookName(lifecycleHookName);
        return this;
    }

    /**
     *

     * The name of the group for the lifecycle hook.
     *

     *
     * @param autoScalingGroupName
     *        The name of the group for the lifecycle hook.
     */

    public void setAutoScalingGroupName(String autoScalingGroupName) {
        this.autoScalingGroupName = autoScalingGroupName;
    }

    /**
     *

     * The name of the group for the lifecycle hook.
     *

     *
     * @return The name of the group for the lifecycle hook.
     */

    public String getAutoScalingGroupName() {
        return this.autoScalingGroupName;
    }

    /**
     *

     * The name of the group for the lifecycle hook.
     *

     *
     * @param autoScalingGroupName
     *        The name of the group for the lifecycle hook.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CompleteLifecycleActionRequest withAutoScalingGroupName(
            String autoScalingGroupName) {
        setAutoScalingGroupName(autoScalingGroupName);
        return this;
    }

    /**
     *

     * A universally unique identifier (UUID) that identifies a specific
     * lifecycle action associated with an instance. Auto Scaling sends this
     * token to the notification target you specified when you created the
     * lifecycle hook.
     *

     *
     * @param lifecycleActionToken
     *        A universally unique identifier (UUID) that identifies a specific
     *        lifecycle action associated with an instance. Auto Scaling sends
     *        this token to the notification target you specified when you
     *        created the lifecycle hook.
     */

    public void setLifecycleActionToken(String lifecycleActionToken) {
        this.lifecycleActionToken = lifecycleActionToken;
    }

    /**
     *

     * A universally unique identifier (UUID) that identifies a specific
     * lifecycle action associated with an instance. Auto Scaling sends this
     * token to the notification target you specified when you created the
     * lifecycle hook.
     *

     *
     * @return A universally unique identifier (UUID) that identifies a specific
     *         lifecycle action associated with an instance. Auto Scaling sends
     *         this token to the notification target you specified when you
     *         created the lifecycle hook.
     */

    public String getLifecycleActionToken() {
        return this.lifecycleActionToken;
    }

    /**
     *

     * A universally unique identifier (UUID) that identifies a specific
     * lifecycle action associated with an instance. Auto Scaling sends this
     * token to the notification target you specified when you created the
     * lifecycle hook.
     *

     *
     * @param lifecycleActionToken
     *        A universally unique identifier (UUID) that identifies a specific
     *        lifecycle action associated with an instance. Auto Scaling sends
     *        this token to the notification target you specified when you
     *        created the lifecycle hook.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CompleteLifecycleActionRequest withLifecycleActionToken(
            String lifecycleActionToken) {
        setLifecycleActionToken(lifecycleActionToken);
        return this;
    }

    /**
     *

     * The action for the group to take. This parameter can be either
     * CONTINUE or ABANDON.
     *

     *
     * @param lifecycleActionResult
     *        The action for the group to take. This parameter can be either
     *        CONTINUE or ABANDON.
     */

    public void setLifecycleActionResult(String lifecycleActionResult) {
        this.lifecycleActionResult = lifecycleActionResult;
    }

    /**
     *

     * The action for the group to take. This parameter can be either
     * CONTINUE or ABANDON.
     *

     *
     * @return The action for the group to take. This parameter can be either
     *         CONTINUE or ABANDON.
     */

    public String getLifecycleActionResult() {
        return this.lifecycleActionResult;
    }

    /**
     *

     * The action for the group to take. This parameter can be either
     * CONTINUE or ABANDON.
     *

     *
     * @param lifecycleActionResult
     *        The action for the group to take. This parameter can be either
     *        CONTINUE or ABANDON.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CompleteLifecycleActionRequest withLifecycleActionResult(
            String lifecycleActionResult) {
        setLifecycleActionResult(lifecycleActionResult);
        return this;
    }

    /**
     *

     * The ID of the instance.
     *

     *
     * @param instanceId
     *        The ID of the instance.
     */

    public void setInstanceId(String instanceId) {
        this.instanceId = instanceId;
    }

    /**
     *

     * The ID of the instance.
     *

     *
     * @return The ID of the instance.
     */

    public String getInstanceId() {
        return this.instanceId;
    }

    /**
     *

     * The ID of the instance.
     *

     *
     * @param instanceId
     *        The ID of the instance.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public CompleteLifecycleActionRequest withInstanceId(String instanceId) {
        setInstanceId(instanceId);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getLifecycleHookName() != null)
            sb.append("LifecycleHookName: " + getLifecycleHookName() + ",");
        if (getAutoScalingGroupName() != null)
            sb.append("AutoScalingGroupName: " + getAutoScalingGroupName()
                    + ",");
        if (getLifecycleActionToken() != null)
            sb.append("LifecycleActionToken: " + getLifecycleActionToken()
                    + ",");
        if (getLifecycleActionResult() != null)
            sb.append("LifecycleActionResult: " + getLifecycleActionResult()
                    + ",");
        if (getInstanceId() != null)
            sb.append("InstanceId: " + getInstanceId());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof CompleteLifecycleActionRequest == false)
            return false;
        CompleteLifecycleActionRequest other = (CompleteLifecycleActionRequest) obj;
        if (other.getLifecycleHookName() == null
                ^ this.getLifecycleHookName() == null)
            return false;
        if (other.getLifecycleHookName() != null
                && other.getLifecycleHookName().equals(
                        this.getLifecycleHookName()) == false)
            return false;
        if (other.getAutoScalingGroupName() == null
                ^ this.getAutoScalingGroupName() == null)
            return false;
        if (other.getAutoScalingGroupName() != null
                && other.getAutoScalingGroupName().equals(
                        this.getAutoScalingGroupName()) == false)
            return false;
        if (other.getLifecycleActionToken() == null
                ^ this.getLifecycleActionToken() == null)
            return false;
        if (other.getLifecycleActionToken() != null
                && other.getLifecycleActionToken().equals(
                        this.getLifecycleActionToken()) == false)
            return false;
        if (other.getLifecycleActionResult() == null
                ^ this.getLifecycleActionResult() == null)
            return false;
        if (other.getLifecycleActionResult() != null
                && other.getLifecycleActionResult().equals(
                        this.getLifecycleActionResult()) == false)
            return false;
        if (other.getInstanceId() == null ^ this.getInstanceId() == null)
            return false;
        if (other.getInstanceId() != null
                && other.getInstanceId().equals(this.getInstanceId()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime
                * hashCode
                + ((getLifecycleHookName() == null) ? 0
                        : getLifecycleHookName().hashCode());
        hashCode = prime
                * hashCode
                + ((getAutoScalingGroupName() == null) ? 0
                        : getAutoScalingGroupName().hashCode());
        hashCode = prime
                * hashCode
                + ((getLifecycleActionToken() == null) ? 0
                        : getLifecycleActionToken().hashCode());
        hashCode = prime
                * hashCode
                + ((getLifecycleActionResult() == null) ? 0
                        : getLifecycleActionResult().hashCode());
        hashCode = prime * hashCode
                + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode());
        return hashCode;
    }

    @Override
    public CompleteLifecycleActionRequest clone() {
        return (CompleteLifecycleActionRequest) super.clone();
    }
}


text:
from datetime import datetime

from django.core.urlresolvers import reverse

from corehq.apps.reports.filters.base import BaseMultipleOptionFilter, BaseReportFilter
from corehq.apps.reports_core.exceptions import FilterValueException
from corehq.apps.reports_core.filters import QuarterFilter as UCRQuarterFilter
from corehq.apps.userreports.reports.filters.choice_providers import LocationChoiceProvider
from custom.enikshay.reports.utils import StubReport

from django.utils.translation import ugettext_lazy as _

from dimagi.utils.decorators.memoized import memoized

class EnikshayLocationFilter(BaseMultipleOptionFilter):

    label = _('Location')
    slug = 'locations_id'

    @property
    def options(self):
        return []

    @property
    def selected(self):
        selected = super(EnikshayLocationFilter, self).selected
        choice_provider = LocationChoiceProvider(StubReport(domain=self.domain), None)
        choice_provider.configure({'include_descendants': True})
        return [
            {'id': location.value, 'text': location.display}
            for location in choice_provider.get_choices_for_known_values(selected)
        ]

    @property
    def pagination_source(self):
        return reverse('enikshay_locations', kwargs={'domain': self.domain})

    @property
    def filter_context(self):
        context = super(EnikshayLocationFilter, self).filter_context
        context['endpoint'] = self.pagination_source
        return context

class QuarterFilter(BaseReportFilter):
    label = _('Quarter')
    slug = 'datespan'

    template = 'enikshay/filters/quarter_filter.html'

    @classmethod
    @memoized
    def quarter_filter(cls):
        return UCRQuarterFilter(name=cls.slug, label=cls.label, css_id=cls.slug)

    @property
    def years(self):
        return self.quarter_filter().years

    @property
    def default_year(self):
        return datetime.utcnow().year

    @property
    def year(self):
        return self.request.GET.get('datespan-year') or self.default_year

    @property
    def quarter(self):
        return self.request.GET.get('datespan-quarter') or 1

    @property
    def filter_context(self):
        return {
            'context_': {
                'label': self.label
            },
            'filter': {
                'years': self.years,
                'year': self.year,
                'quarter': self.quarter,
                'css_id': self.quarter_filter().css_id
            }

        }

    @classmethod
    def get_value(cls, request, domain):
        year = request.GET.get('datespan-year')
        quarter = request.GET.get('datespan-quarter')

        if not year or not quarter:
            return cls.quarter_filter().default_value()

        try:
            return cls.quarter_filter().value(
                **{
                    'datespan-year': request.GET.get('datespan-year'),
                    'datespan-quarter': request.GET.get('datespan-quarter')
                }
            )
        except FilterValueException:
            return cls.quarter_filter().default_value()


text:
.. EN-Revision: none
.. _zend.filter.filter_chains:

Цепочки фильтров
================

Довольно часто встречается ситуация, когда к одним и тем же
данным нужно применить несколько фильтров в определенном
порядке. Например, форма аутентификации должна принимать имя
пользователя, состояшее только из алфавитных символов в
нижнем регистре. ``Zend_Filter`` предоставляет простой метод, через
который составляется цепочка из фильтров. Следующий код
демонстрирует создание цепочки из двух фильтров для имени
пользователя:

   .. code-block:: php
      :linenos:

      // Создание цепочки фильтров и добавление в нее фильтров
      $filterChain = new Zend\Filter\Filter();
      $filterChain->addFilter(new Zend\I18n\Filter\Alpha())
                  ->addFilter(new Zend\Filter\StringToLower());

      // Фильтрация имени пользователя
      $username = $filterChain->filter($_POST['username']);

Фильтры применяются в том же порядке, в котором они были
добавлены в ``Zend_Filter``. В примере выше из имени пользователя
сначала удаляются все неалфавитные символы, затем все символы
приводятся к нижнему регистру.

Все объекты, реализующие интерфейс ``Zend\Filter\Interface``, могут
использоваться в цепочке фильтров.


text:
<?php
/**
 * The right sidebar.
 *
 * @package bootstrap-basic4
 */

global $bootstrapbasic4_sidebar_right_size;
if (null == $bootstrapbasic4_sidebar_right_size || !is_numeric($bootstrapbasic4_sidebar_right_size)) {
    $bootstrapbasic4_sidebar_right_size = 3;
}

if (is_active_sidebar('sidebar-right')) {
?>
                <div id="sidebar-right" class="col-md-<?php echo $bootstrapbasic4_sidebar_right_size; ?>">
                    <?php do_action('before_sidebar'); ?>
                    <?php dynamic_sidebar('sidebar-right'); ?>
                </div>
<?php
}


text:
'''
Sample Android app updater service.

Remember to set the update check url below.
'''

UPDATE_CHECK_URL = 'http://192.168.2.130/updatecheck.txt'

from pyupdater.service import Updater

print 'service loading'

if __name__ == '__main__':
	print 'service starting'
	Updater(UPDATE_CHECK_URL).run()


text:
package org.apache.hawq.pxf.plugins.jdbc.utils;

/**
 * Implements methods for Oracle Database.
 */
public class OracleProduct extends DbProduct {
    @Override
    public String wrapDate(Object dateVal) {
        return "to_date('" + dateVal + "','yyyy-mm-dd')";
    }
}


text:
r"""
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
"""

from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response

class CurrentCallTestCase(IntegrationTestCase):

    def test_fetch_request(self):
        self.holodeck.mock(Response(500, ''))

        with self.assertRaises(TwilioException):
            self.client.preview.trusted_comms.current_calls().fetch()

        self.holodeck.assert_has_request(Request(
            'get',
            'https://preview.twilio.com/TrustedComms/CurrentCall',
        ))

    def test_read_found_response(self):
        self.holodeck.mock(Response(
            200,
            '''
            {
                "sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "from": "+1500123",
                "to": "+1500456",
                "status": "ringing",
                "reason": "Hello Jhon, your bank appointment has been confirmed.",
                "created_at": "2019-05-01T20:00:00Z",
                "caller": "Owl Bank",
                "logo": "https://www.twilio.com/marketing/bundles/company/img/logos/red/twilio-logo-red.png",
                "bg_color": "#fff",
                "font_color": "#f22f46",
                "use_case": "conversational",
                "manager": "Twilio",
                "shield_img": "https://www.twilio.com/marketing/bundles/company/img/badges/red/twilio-badge-red.png",
                "url": "https://preview.twilio.com/TrustedComms/CurrentCall"
            }
            '''
        ))

        actual = self.client.preview.trusted_comms.current_calls().fetch()

        self.assertIsNotNone(actual)


text:
/**
 * This is an example of a basic node.js script that performs
 * the Authorization Code oAuth2 flow to authenticate against
 * the Spotify Accounts.
 *
 * For more information, read
 * https://developer.spotify.com/web-api/authorization-guide/#authorization_code_flow
 */

var express = require('express'); // Express web server framework
var request = require('request'); // "Request" library
var querystring = require('querystring');
var cookieParser = require('cookie-parser');
// var csrf = require('csurf');

var client_id = '3481c5ebeb68422e98110dd22f644daf'; // Your client id
var client_secret = '5a02f4d8b20d467d96a58a39c59d1a13'; // Your secret
// OBS change back to http://localhost:8888/callback or the real website later when uploaded, e.g. heroku.
// var redirect_uri = 'http://192.168.1.172:8888/callback'; // Your redirect uri
var redirect_uri = 'http://localhost:8888/callback';
// var redirect_uri = 'https://bestmusicmap.herokuapp.com/callback';
/**
 * Generates a random string containing numbers and letters
 * @param  {number} length The length of the string
 * @return {string} The generated string
 */
var generateRandomString = function(length) {
  var text = '';
  var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';

  for (var i = 0; i < length; i++) {
    text += possible.charAt(Math.floor(Math.random() * possible.length));
  }
  return text;
};

var stateKey = 'spotify_auth_state';

var app = express();

// var csrfProtection = csrf({cookie: true});

//app.use(express.static(__dirname + '/public'))
app.use(express.static(__dirname))
   .use(cookieParser());

app.get('/login', function(req, res) {

  var state = generateRandomString(16);
  res.cookie(stateKey, state);

  // your application requests authorization
  var scope = 'user-read-private user-read-email user-read-playback-state';
  res.redirect('https://accounts.spotify.com/authorize?' +
    querystring.stringify({
      response_type: 'code',
      client_id: client_id,
      scope: scope,
      redirect_uri: redirect_uri,
      state: state,
      show_dialog: true
    }));
});

app.get('/callback', function(req, res) {

  console.log("entered callback get");

  // your application requests refresh and access tokens
  // after checking the state parameter

  var code = req.query.code || null;
  var state = req.query.state || null;
  var storedState = req.cookies ? req.cookies[stateKey] : null;

  if (state === null || state !== storedState) {
    res.redirect('/#' +
      querystring.stringify({
        error: 'state_mismatch'
      }));
  } else {
    res.clearCookie(stateKey);
    var authOptions = {
      url: 'https://accounts.spotify.com/api/token',
      form: {
        code: code,
        redirect_uri: redirect_uri,
        grant_type: 'authorization_code'
      },
      headers: {
        'Authorization': 'Basic ' + (new Buffer(client_id + ':' + client_secret).toString('base64'))
      },
      json: true
    };

    request.post(authOptions, function(error, response, body) {
      if (!error && response.statusCode === 200) {

        var access_token = body.access_token,
            refresh_token = body.refresh_token;
        console.log(body.expires_in);

        var options = {
          url: 'https://api.spotify.com/v1/me',
          headers: { 'Authorization': 'Bearer ' + access_token },
          json: true
        };

        // use the access token to access the Spotify Web API
        request.get(options, function(error, response, body) {
          console.log(body);
        });

        // we can also pass the token to the browser to make requests from there
        // res.redirect('/#' +
        //   querystring.stringify({
        //     access_token: access_token,
        //     refresh_token: refresh_token
        //   }));
        console.log("got to redirect");
        res.redirect(`/#/${access_token}/${refresh_token}`);

        // window.sessionStorage.access_token = access_token;
        // sessionStorage.refresh_token = refresh_token;

        // set a new cookie
        // res.cookie('access_token', access_token);
        // res.cookie('refresh_token', refresh_token);
        // Read somewhere that cookies are not sent with redirect... so this won't work.

        // res.redirect('/#/home')
      } else {
        res.redirect('/#' +
          querystring.stringify({
            error: 'invalid_token'
          }));
      }
    });
  }
});

app.get('/refresh_token', function(req, res) {
  console.log("got to refresh token")

  // requesting access token from refresh token
  var refresh_token = req.query.refresh_token;
  console.log(refresh_token);
  var authOptions = {
    url: 'https://accounts.spotify.com/api/token',
    headers: { 'Authorization': 'Basic ' + (new Buffer(client_id + ':' + client_secret).toString('base64')) },
    form: {
      grant_type: 'refresh_token',
      refresh_token: refresh_token
    },
    json: true
  };

  request.post(authOptions, function(error, response, body) {
    console.log("posted refresh token")
    if (!error && response.statusCode === 200) {
      var access_token = body.access_token;
      var expires_in = body.expires_in;
      res.send({
        'access_token': access_token,
        'expires_in': expires_in
      });
      // Added myself
      // res.redirect(`/#/${access_token}/${refresh_token}`);
    }
  });
});

console.log('Listening on 8888');
app.listen(process.env.PORT || 8888);


text:
module MagentoModels
  class CatalogCategoryEntityText < Base
    include Entity
    self.primary_key = "value_id"
    self.table_name = "catalog_category_entity_text"
  end
end


text:
import { RouteRecordRaw } from 'vue-router';

export const routeAuthLogin: RouteRecordRaw = {
	name: 'auth.login',
	path: '/login',
	component: () => import('./login.vue'),
};


text:
using namespace Ra::Core::Utils;

namespace Ra {
namespace Core {
namespace Asset {

namespace {
// Recursive function to add bones
void addBone( const uint parent,                       // index of parent bone
              const uint dataID,                       // index in map
              const Ra::Core::Asset::HandleData& data, // handle data
              const Ra::Core::AlignedStdVector<Ra::Core::Vector2ui>& edgeList, // list of edges
              std::vector<bool>& processed,        // which ids have been processed
              Core::Animation::Skeleton& skelOut ) // correspondance between bone name and bone idx
{
    if ( !processed[dataID] )
    {
        processed[dataID] = true;
        const auto& dd    = data.getComponentData()[dataID];
        uint index        = skelOut.addBone(
            parent, dd.m_frame, Ra::Core::Animation::HandleArray::SpaceType::MODEL, dd.m_name );
        for ( const auto& edge : edgeList )
        {
            if ( edge[0] == dataID )
            { addBone( index, edge[1], data, edgeList, processed, skelOut ); }
        }
    }
}
// function to add bones from a given root
void addRoot( const uint dataID,                                               // index in map
              const Ra::Core::Asset::HandleData& data,                         // handle data
              const Ra::Core::AlignedStdVector<Ra::Core::Vector2ui>& edgeList, // list of edges
              std::vector<bool>& processed,        // which ids have been processed
              Core::Animation::Skeleton& skelOut ) // correspondance between bone name and bone idx
{
    if ( !processed[dataID] )
    {
        processed[dataID] = true;
        const auto& dd    = data.getComponentData()[dataID];
        uint index        = skelOut.addRoot( dd.m_frame, dd.m_name );
        for ( const auto& edge : edgeList )
        {
            if ( edge[0] == dataID )
            { addBone( index, edge[1], data, edgeList, processed, skelOut ); }
        }
    }
}
} // namespace

void createSkeleton( const Ra::Core::Asset::HandleData& data, Core::Animation::Skeleton& skelOut ) {
    const uint size = data.getComponentDataSize();
    auto component  = data.getComponentData();

    std::set<uint> root;
    for ( uint i = 0; i < size; ++i )
    {
        root.insert( i );
    }
    std::set<uint> leaves = root;

    auto edgeList = data.getEdgeData();
    for ( const auto& edge : edgeList )
    {
        root.erase( edge[1] );
        leaves.erase( edge[0] );
    }

    std::vector<bool> processed( size, false );
    for ( const auto& r : root )
    {
        addRoot( r, data, edgeList, processed, skelOut );
    }

    if ( data.needsEndNodes() )
    {
        std::map<std::string, uint> boneNameMap;
        for ( uint i = 0; i < skelOut.size(); ++i )
        {
            boneNameMap[skelOut.getLabel( i )] = i;
        }
        for ( const auto& l : leaves )
        {
            const auto& dd = component[l];
            if ( dd.m_weights.size() )
            {
                LOG( logDEBUG ) << "Adding end-bone at " << dd.m_name << ".";
                skelOut.addBone( boneNameMap[dd.m_name],
                                 data.getFrame().inverse() * dd.m_frame,
                                 Ra::Core::Animation::HandleArray::SpaceType::MODEL,
                                 dd.m_name + "_Ra_endBone" );
            }
        }
    }
}
} // namespace Asset
} // namespace Core
} // namespace Ra


text:
<?php

namespace Roave\BetterReflectionTest\Fixture {
    new class
    {
    };
}

namespace {
    new class
    {
    };
}


text:
classdef cFibHeapNode < handle
    %CFIBHEAPNODE Fibonacci Heap Node
    %   Nodes for use in Fibonacci min-heap
    %
    %   (Based on algorithms from Cormen, Leiserson, Rivest, and Stein.
    %     "Introduction to Algorithms". 2nd Ed. McGraw-Hill (2007).)

    % Private data
    properties

        % Key of node
        key

        % Number of children in child list of node
        degree

        % Indicates whether node has lost child since last time node was
        %  made the child of another node
        mark

        % Pointers
        p           % parent
        child       % any child
        left        % left sibling
        right       % right sibling
    end

    methods

        % Initialize class instance
        function ND = cFibHeapNode(InitialKey)
            ND.key = InitialKey;
            ND.left = ND;
            ND.right = ND;
            ND.mark = 0;
            ND.degree = 0;
            ND.p = [];
            ND.child = [];
        end

        % display list of node and all siblings
        function siblingsList(ND)

            SL = [];
            assembleSL(ND, ND.left)

            function assembleSL(x,z)
               SL = [SL x.key];
               if x ~= z
                   assembleSL(x.right,z)
               end
            end

            SL %#ok<NOPRT>
        end %siblingsList()

    end %methods

end


text:
/* eslint-disable */

'use strict';

/*::
import type { ConcreteRequest, Query } from 'relay-runtime';
type RelayModernEnvironmentCommitPayloadTest4UserFragment$fragmentType = any;
export type RelayModernEnvironmentCommitPayloadTest4ActorQuery$variables = {||};
export type RelayModernEnvironmentCommitPayloadTest4ActorQuery$data = {|
  +me: ?{|
    +name: ?string,
    +$fragmentSpreads: RelayModernEnvironmentCommitPayloadTest4UserFragment$fragmentType,
  |},
|};
export type RelayModernEnvironmentCommitPayloadTest4ActorQuery = {|
  response: RelayModernEnvironmentCommitPayloadTest4ActorQuery$data,
  variables: RelayModernEnvironmentCommitPayloadTest4ActorQuery$variables,
|};
*/

var node/*: ConcreteRequest*/ = (function(){
var v0 = {
  "alias": null,
  "args": null,
  "kind": "ScalarField",
  "name": "name",
  "storageKey": null
};
return {
  "fragment": {
    "argumentDefinitions": [],
    "kind": "Fragment",
    "metadata": null,
    "name": "RelayModernEnvironmentCommitPayloadTest4ActorQuery",
    "selections": [
      {
        "alias": null,
        "args": null,
        "concreteType": "User",
        "kind": "LinkedField",
        "name": "me",
        "plural": false,
        "selections": [
          (v0/*: any*/),
          {
            "kind": "Defer",
            "selections": [
              {
                "args": null,
                "kind": "FragmentSpread",
                "name": "RelayModernEnvironmentCommitPayloadTest4UserFragment"
              }
            ]
          }
        ],
        "storageKey": null
      }
    ],
    "type": "Query",
    "abstractKey": null
  },
  "kind": "Request",
  "operation": {
    "argumentDefinitions": [],
    "kind": "Operation",
    "name": "RelayModernEnvironmentCommitPayloadTest4ActorQuery",
    "selections": [
      {
        "alias": null,
        "args": null,
        "concreteType": "User",
        "kind": "LinkedField",
        "name": "me",
        "plural": false,
        "selections": [
          (v0/*: any*/),
          {
            "if": null,
            "kind": "Defer",
            "label": "RelayModernEnvironmentCommitPayloadTest4ActorQuery$defer$RelayModernEnvironmentCommitPayloadTest4UserFragment",
            "selections": [
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "username",
                "storageKey": null
              }
            ]
          },
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "id",
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ]
  },
  "params": {
    "cacheID": "57271f60562edb814953caf06d97e88c",
    "id": null,
    "metadata": {},
    "name": "RelayModernEnvironmentCommitPayloadTest4ActorQuery",
    "operationKind": "query",
    "text": "query RelayModernEnvironmentCommitPayloadTest4ActorQuery {\n  me {\n    name\n    ...RelayModernEnvironmentCommitPayloadTest4UserFragment @defer(label: \"RelayModernEnvironmentCommitPayloadTest4ActorQuery$defer$RelayModernEnvironmentCommitPayloadTest4UserFragment\")\n    id\n  }\n}\n\nfragment RelayModernEnvironmentCommitPayloadTest4UserFragment on User {\n  username\n}\n"
  }
};
})();

if (__DEV__) {
  (node/*: any*/).hash = "8f2ceead1f06c0a0a54557f7a9827a27";
}

module.exports = ((node/*: any*/)/*: Query<
  RelayModernEnvironmentCommitPayloadTest4ActorQuery$variables,
  RelayModernEnvironmentCommitPayloadTest4ActorQuery$data,
>*/);


text:
namespace net {
class CertVerifyProc;
class CertVerifyResult;
class TrialComparisonCertVerifier;
}  // namespace net

FORWARD_DECLARE_TEST(TrialComparisonCertVerifierMojoTest, SendReportDebugInfo);

namespace cert_verifier {

// Wrapper around TrialComparisonCertVerifier that does trial configuration and
// reporting over Mojo pipes.
class TrialComparisonCertVerifierMojo
    : public net::CertVerifier,
      public mojom::TrialComparisonCertVerifierConfigClient {
 public:
  // |initial_allowed| is the initial setting for whether the trial is allowed.
  // |config_client_receiver| is the Mojo pipe over which trial configuration
  // updates are received.
  // |report_client| is the Mojo pipe used to send trial reports.
  // |primary_verify_proc| and |trial_verify_proc| are the CertVerifyProc
  // implementations to compare.
  TrialComparisonCertVerifierMojo(
      bool initial_allowed,
      mojo::PendingReceiver<mojom::TrialComparisonCertVerifierConfigClient>
          config_client_receiver,
      mojo::PendingRemote<mojom::TrialComparisonCertVerifierReportClient>
          report_client,
      scoped_refptr<net::CertVerifyProc> primary_verify_proc,
      scoped_refptr<net::CertVerifyProc> trial_verify_proc);

  TrialComparisonCertVerifierMojo(const TrialComparisonCertVerifierMojo&) =
      delete;
  TrialComparisonCertVerifierMojo& operator=(
      const TrialComparisonCertVerifierMojo&) = delete;

  ~TrialComparisonCertVerifierMojo() override;

  // CertVerifier implementation
  int Verify(const RequestParams& params,
             net::CertVerifyResult* verify_result,
             net::CompletionOnceCallback callback,
             std::unique_ptr<Request>* out_req,
             const net::NetLogWithSource& net_log) override;
  void SetConfig(const Config& config) override;

 private:
  FRIEND_TEST_ALL_PREFIXES(::TrialComparisonCertVerifierMojoTest,
                           SendReportDebugInfo);

  // mojom::TrialComparisonCertVerifierConfigClient implementation:
  void OnTrialConfigUpdated(bool allowed) override;

  void OnSendTrialReport(
      const std::string& hostname,
      const scoped_refptr<net::X509Certificate>& unverified_cert,
      bool enable_rev_checking,
      bool require_rev_checking_local_anchors,
      bool enable_sha1_local_anchors,
      bool disable_symantec_enforcement,
      const std::string& stapled_ocsp,
      const std::string& sct_list,
      const net::CertVerifyResult& primary_result,
      const net::CertVerifyResult& trial_result);

  mojo::Receiver<mojom::TrialComparisonCertVerifierConfigClient> receiver_;

  mojo::Remote<mojom::TrialComparisonCertVerifierReportClient> report_client_;

  std::unique_ptr<net::TrialComparisonCertVerifier>
      trial_comparison_cert_verifier_;
};

}  // namespace cert_verifier

#endif  // SERVICES_CERT_VERIFIER_TRIAL_COMPARISON_CERT_VERIFIER_MOJO_H_


text:
{% extends "base.html" %}
{% block title %}Impressum{% endblock %}
{% block  content %}
	<!--imports the navigation bar-->
    {% include "includes/navbar.html" %}
	<!-- uses the impressum_content.html for the adresses -->
    {% include "includes/impressum_content.html" %}
{% endblock %}


text:
Monitor whether your door is opened or closed.

Download the [fathym.io.photon-0.0.1-doorStatus library folder](https://github.com/fathym/fathym.io_Photon_DoorSensor/blob/master/fathym.io.photon-0.0.1-doorStatus.zip) to get your Door Sensor up and running in Fathym.
## About
[![Fathym logo](http://community.fathym.com/Files/Storage/ef3e1f7f-3303-4296-9660-044c33e60cbd "Fathym Logo")](http://fathym.com) [![Particle logo](http://blog.particle.io/images/particle-horizontal-dark.png "Particle logo")](http://particle.io)

[Fathym](http://fathym.com) is a platform that gives you collaborative, front-end apps, dashboards and notifications for your Particle Photon. Get up and running in the cloud, and even control your photon from your very own Fathym app in minutes.

# Tutorial

## Getting up and running

1. **Wire up your hardware**
  - Add the [Magnetic Door Switch](https://www.sparkfun.com/products/13247) to your breadboard
  ![Door Switch](http://community.fathym.com/Files/Storage/a828a1b4-820a-4c33-b30d-9e1afe84c93f)
      - Connect a wire from the door switch to AO on the Photon
      - Connect the other wire from the door switch to A5 on the Photon
  - Affix your sensor to your door (and the breadboard nearby).
  ![Door Switch](http://community.fathym.com/Files/Storage/69b900a7-e071-4faa-a68e-668891f60bd4)
    - Try to minimize the gap between the magnets
2. **Download the [fathym.io.photon-0.0.1-doorStatus library folder](https://github.com/fathym/fathym.io_Photon_DoorSensor/blob/master/fathym.io.photon-0.0.1-doorStatus.zip) zip folder from this repo and unzip**
2. **Open the Particle Dev Desktop app and add the fathym.io.photon-0.0.1-doorStatus folder**
![Particle Dev](https://40.media.tumblr.com/85a6b84ac6a20005769c38cf79ea9c55/tumblr_o58dv5IR7S1qcz8h1o1_1280.jpg "Particle Dev")
  - Download the [Particle Dev Environment](https://www.particle.io/dev) if you haven't already
  - Inside Particle Dev: File -> Add Project Folder -> Find the fathym.io folder
  - Take ["ownership"](https://docs.particle.io/support/troubleshooting/device-management/photon/) of your Photon using the [Particle Photon app](https://itunes.apple.com/us/app/particle-build-photon-electron/id991459054?mt=8)
  - For more about working with your Photon, start with the tutorials in the [Particle Guide](https://docs.particle.io/guide/getting-started/intro/photon/)
5. **Select your device, save, compile, flash**
    ![Particle Icons](http://community.fathym.com/Files/Storage/18dc2dab-fd6e-4754-89ba-28e6611c1dae "Particle Icons")
  - The .ino should get data flowing to Fathym exactly as is, so we'll test everything before messing with the code
6. **Create a new Photon Part in your Fathym Home Space**
  ![Fathym Home](https://41.media.tumblr.com/101c284e6b4c640957cbaa86e444fe32/tumblr_o58dv5IR7S1qcz8h1o2_1280.jpg "Fathym Home")
  - Create an  account at [community.fathym.com](http://community.fathym.com) if you haven't already
  - From your Home Space, click the plus "+" button to get to the catalog of addable parts
  - Choose the Particle Photon part
  - Add your Photon deviceID, which you can find on your [Particle Dashboard](https://dashboard.particle.io/user/devices)
8. **Enter your Photon Part on Fathym and add visualizations**
![Inspector](https://36.media.tumblr.com/e783e4d513003a6dc328c38347a4fa51/tumblr_o58dv5IR7S1qcz8h1o3_1280.jpg "Inspector")
  - From inside your Particle Photon Part, click the plus "+" button to get to the catalog of addable parts
  - Start by adding the inspector display
  - Save and watch your data flow through!

## Customizing

1. **Inside Particle Dev, open the fathym.io-photon.ino file**
![ino](https://40.media.tumblr.com/31879b26805e0ddac21e0a97e9fbe36e/tumblr_o58dv5IR7S1qcz8h1o4_1280.jpg "ino")
  - You'll see commented instructions about how and where to add code for your sensors
  - Note that fathym.set("attribute name", value, "units of measurement") formats the JSON to send to Fathym
2. **Open the Fathym.Build.h file**
![build.h](https://40.media.tumblr.com/7ec2caa15654a3f089cb182301aefcbd/tumblr_o58dv5IR7S1qcz8h1o5_1280.jpg "build.h")
  - Edit the attributes that are automatically sent along with your payload by setting each item to true or false
  - Note that the Fathym.io library includes support Photon battery power - enable battery support by uncommenting the code at the bottom of the FathymBuild.h file
3. **Add additional dashboard visualizations for your device in Fathym**
![Fathym Dashboard](https://36.media.tumblr.com/447b4d8abf0869768b89b0411e377eae/tumblr_o2crfxZXFf1qcz8h1o2_1280.jpg "Fathym Dashboard")
  - From inside your Particle Photon part, click the plus "+" button to get to the catalog of addable parts
  - Try an Historic Value part
    - Fill out the "Property Name" field with one of the attributes you're sending from your Photon (the attribute name must be an exact, case-sensitive match). Leave this field blank to create a generic graph with dropdown menu of the attributes you're sending so you can switch the attribute on the fly.
4. **Create a Fathym Notification**
![Notification Rule](http://community.fathym.com/Files/Storage/4ed0acc5-6b33-47e5-a8ae-a4bc5484b12a "Notification Rule")
  - From inside your Particle Photon part, click the config "cog wheel" button
  - Enter the "Add Ons" part
  - Enter the "Publish Subscription" part
  - Again, click the config "cog wheel" button
  - Enter the "Responses" part
  - Click the plus "+" button to get to the catalog of addable parts
  - Select the "Check" part
  - Name the Check Part and add a "Message Evaluation"
    - Ensure that the property name you use is an exact match to one you're sending from your Photon
  - Save the Check part and then Enter into the Check part you just created
  - Click the plus "+" button to get to the catalog of addable parts
  - Add an "Email Response" and configure with your message and desired send frequency

## Collaborating and Setting Permissions
![Permissions](http://community.fathym.com/Files/Storage/06927353-54ad-4ecc-b29a-99cbc1f837da "Permissions")
1. From inside your Particle Photon part, click the edit button (pencil icon)
2. Open the "Permissions" tab
3. Here you can select which users have read, write, delete, contributor, moderator, or full control access
  - Full control allows the user to enter the parts configure settings in addition to everything else
  - You can only give permission to existing Fathym users
  - Type "Everyone" to give the entire Fathym userbase a certain permission
4. Once you've given a user permission to work with your part, you'll need to share the part's url with them directly or place your part in a space that they already have access to, like the Community Space for example.

## Share your project with the Fathym community

1. From inside your Fathym Home Space, find and enter the "Community Space" (tree icon)
2. Inside the Community Space,  click the plus "+" button to get to the catalog of addable parts
3. Change the selected tab in the upper right from "Create New" to "Add Existing
4. Search the "Existing Catalog" for your Particle Photon Device and Add!

## Additional Internet of Things Projects
**1. Photon Weather Station**
  - Create a Weather Station using a [Sparkfun Photon Weather Shield](https://www.sparkfun.com/products/13630), a [Soil Moisture Sensor](https://www.sparkfun.com/products/13322) (optional) and Fathym.
  Visit the [fathym.io_Sparkfun_Photon_WeatherShield Repository](https://github.com/fathym/fathym.io_Sparkfun_Photon_WeatherShield) for more info.

**2. Photon Plant Monitor**
  - Monitor your plants' health with a [Soil Moisture Sensor](https://www.sparkfun.com/products/13322) and a [Temperature and Humidity Sensor](https://www.sparkfun.com/products/10167?gclid=CLqS-YDTkcwCFQiqaQodCMsK2Q).
  Visit the [fathym.io_Photon_Plant_Monitor Repository](https://github.com/fathym/fathym.io_Photon_Plant_Monitor) for more info.

**3. Photon Battery Power**
  - Power your Photon with a [Lithium Ion Battery](https://www.sparkfun.com/products/8483) using the [SparkFun Battery Shield](https://www.sparkfun.com/products/13626). Monitor the battery voltage and charge via Fathym.
  [fathym.io_Photon_BatteryShield Repository](https://github.com/fathym/fathym.io_Particle_BatteryShield)


text:
package com.swfarm.biz.chain.bo;

import java.io.Serializable;
import java.sql.Timestamp;

import com.swfarm.biz.product.bo.StockKeepingUnit;

public class QuoteItem implements Serializable {
	private Long id;

	private Vendor vendor;

	private Long vendorId;

	private String vendorName;

	private StockKeepingUnit stockKeepingUnit;

	private Long stockKeepingUnitId;

	private String vendorItemCode;

	private Double price;

	private Double quantity;

	private Integer purchaseQuantityForCurrentPrice;

	private Integer totalPurchaseQuantity;

	private Integer deliveryTime;

	private Boolean history = false;

	private Timestamp quoteTime = new Timestamp(System.currentTimeMillis());

	private String operation;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Vendor getVendor() {
		return vendor;
	}

	public void setVendor(Vendor vendor) {
		this.vendor = vendor;
	}

	public Long getVendorId() {
		return vendorId;
	}

	public void setVendorId(Long vendorId) {
		this.vendorId = vendorId;
	}

	public String getVendorName() {
		return vendorName;
	}

	public void setVendorName(String vendorName) {
		this.vendorName = vendorName;
	}

	public StockKeepingUnit getStockKeepingUnit() {
		return stockKeepingUnit;
	}

	public void setStockKeepingUnit(StockKeepingUnit stockKeepingUnit) {
		this.stockKeepingUnit = stockKeepingUnit;
	}

	public Long getStockKeepingUnitId() {
		return stockKeepingUnitId;
	}

	public void setStockKeepingUnitId(Long stockKeepingUnitId) {
		this.stockKeepingUnitId = stockKeepingUnitId;
	}

	public String getVendorItemCode() {
		return vendorItemCode;
	}

	public void setVendorItemCode(String vendorItemCode) {
		this.vendorItemCode = vendorItemCode;
	}

	public Double getPrice() {
		if (price == null) {
			price = 0d;
		}
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Double getQuantity() {
		return quantity;
	}

	public void setQuantity(Double quantity) {
		this.quantity = quantity;
	}

	public Integer getPurchaseQuantityForCurrentPrice() {
		return purchaseQuantityForCurrentPrice;
	}

	public void setPurchaseQuantityForCurrentPrice(
			Integer purchaseQuantityForCurrentPrice) {
		this.purchaseQuantityForCurrentPrice = purchaseQuantityForCurrentPrice;
	}

	public Integer getTotalPurchaseQuantity() {
		return totalPurchaseQuantity;
	}

	public void setTotalPurchaseQuantity(Integer totalPurchaseQuantity) {
		this.totalPurchaseQuantity = totalPurchaseQuantity;
	}

	public Integer getDeliveryTime() {
		return deliveryTime;
	}

	public void setDeliveryTime(Integer deliveryTime) {
		this.deliveryTime = deliveryTime;
	}

	public Boolean getHistory() {
		return history;
	}

	public void setHistory(Boolean history) {
		this.history = history;
	}

	public Timestamp getQuoteTime() {
		return quoteTime;
	}

	public void setQuoteTime(Timestamp quoteTime) {
		this.quoteTime = quoteTime;
	}

	public String getOperation() {
		return operation;
	}

	public void setOperation(String operation) {
		this.operation = operation;
	}

}


text:
/* Test for -mcpu=.  */
/* { dg-do preprocess } */
/* { dg-bfin-options "-mcpu=bf524" } */

#ifndef __ADSPBF524__
#error "__ADSPBF524__ is not defined"
#endif

#ifndef __ADSPBF52x__
#error "__ADSPBF52x__ is not defined"
#endif

#if __SILICON_REVISION__ != 0x0002
#error "__SILICON_REVISION__ is not 0x0002"
#endif

#ifndef __WORKAROUNDS_ENABLED
#error "__WORKAROUNDS_ENABLED is not defined"
#endif

#if __SILICON_REVISION__ <= 0x0001
#ifndef __WORKAROUND_RETS
#error "__WORKAROUND_RETS is not defined"
#endif
#else
#ifdef __WORKAROUND_RETS
#error "__WORKAROUND_RETS is defined"
#endif
#endif

#ifndef __WORKAROUND_SPECULATIVE_LOADS
#error "__WORKAROUND_SPECULATIVE_LOADS is not defined"
#endif

#ifdef __WORKAROUND_SPECULATIVE_SYNCS
#error "__WORKAROUND_SPECULATIVE_SYNCS is defined"
#endif


text:
module("Bootstrap.Forms.TextField", {
  setup: function() {
    object = Ember.Object.create({
      name: null
    });
    field = Bootstrap.Forms.TextField.create({
      bindingContext: object
    });
  },

  teardown: function() {
    field.destroy();
    field = null;
  }
});

function append() {
  Ember.run(function() {
    field.appendTo('#qunit-fixture');
  });
}

test("should have the field", function() {
  append();
  equal(field.$().find('input[type=text]').length, 1, "It needs to include the text field");
});

test("input value is updated when setting value property of view", function() {
  Ember.run(function() {
    field.set('value', 'foo');
    field.append();
  });
  textField = field.$().find('input[type=text]')

  equal(textField.val(), "foo", "renders text field with value");

  Ember.run(function() { field.set('value', 'bar'); });

  equal(textField.val(), "bar", "updates text field after value changes");
});


text:
package org.ppojo;

/**
 * Interface for abstracting {@link ArtifactBase#getArtifactParent()}. Regular artifacts have an {@link ArtifactFile} parent.
 * Nested artifacts have {@link ArtifactBase} parent.
 */
public interface IArtifactParent {
    ArtifactOptions getOptions();
    String getArtifactFileName();
    void addChildArtifact(ArtifactBase artifactBase);
}


text:
namespace app {
namespace Uno {

::uDelegateType* Func__Fuse_Controls_GraphicsView__float4__typeof();

}}

#endif


text:
BioTaxIDMapper is a simple tool for mapping taxonomy information onto files containing FASTA-like headers. It keeps local database containing links between protein accessions and taxonomy identifiers, as well as whole taxonomic lineages. Scripts provided together with the tool allows to constantly update local database using NCBI taxonomy dumps and link file containing taxid mapping onto protein IDs / accessions.

**Requirements**

Beside standard libraries BioTaxIDMapper requires **pymongo** ver. 3.4.0 or higher. It can be installed with [pip](https://pypi.python.org/pypi/pip):
```
pip install pymongo
```

## Creating a local database
In order to run software you need to install [MongoDB](https://www.mongodb.com/) database. Database configuration is specified in the file **db.cfg**. File is JSON formatted and contains 3 parameters:
```
{
"HOSTNAME": "localhost",
"PORT": 27017,
"NAME": "TaxIDMapper"
}
```
You don't need to create specific databases and collections, it will be done autmatically when first records will be added. However keep in mind that if you alredy have a database with name as specified in the configuration file, records will be added to already existing one. In such case it might be a smart move to change name in the config file.

**Data I/O Speedup**

In order to increase the speed with which records are added and / or retrieved, as well as to ommit having duplicated documents, I highly recommend creating unique Indexes for fields **'TaxID'** in the **'nodes'** collection, and **'ProteinID'** in the **'links'** collection. It can be achieved in MongoDB shell by executing:
```
> use TaxIDMapper
> db.nodes.createIndex( { TaxID: 1 }, { unique: true } )
> db.links.createIndex( { ProteinID: 1 }, { unique: true } )
```

More information about handling MongoDB can be found in official docs - [LINK](https://docs.mongodb.com/).

## Keeping database up to date
In order to update local database you can use provided script. Remember to set correct database in the config file. To run script simply type:
```
python updatelocaldb.py [PATH_TO_NCBI_DIR]
```
Where **[PATH_TO_NCBI_DIR]** is a path where all required dump files are stored:
  - *names.dmp,* containing scientific names for Taxonomy IDs
  - *nodes.dmp,* containing nodes information
  - *protein_taxonomy.lnk,* containing links between protein IDs / accessions and taxonomy IDs

If your database is empty all records will be added at the first run. Keep in mind that if you didn't create indexes in the database collections you will encounter duplicate records. To avoid this either create Indexes (described above, speeds up interaction with the database) or update database only with new nodes and protein accession - taxid links (e.g. by diff between old and new files.)

## Mapping lineages onto files
To map Lineages you can either use **Mapper** script or use module interactively. To learn how to use mapper script simply run it with **-h** parameter:
```
./mapper.py -h
```

To use Mapper as a module in your python console simply:
```
#Import module class
>>> from BioTaxIDMapper.taxonomydb import TaxDb

# Create and instance
>>> t = TaxDb()
```

You my now use following methods depending on your needs:
  - t.add_record()
  - t.add_protein_link()
  - t.get_node()
  - t.search_scientific_name()
  - t.protein_taxid()
  - t.get_lineage_from_db()

Docstrings will explain you how to use each of the methods. It is important to now, that in order to get protein accession to tax id link, we use accession, not version (e.g. WP_12323, not WP_12323.1). Module **mapper** has a function that returns proper accession:
```
>>> from BioTaxIDMapper.mapper import version_to_accession
>>> version_to_accession('WP_12323.34')
'WP_12323'
```
## Contact
If you have any questions or suggestions regarding this tool or README file itself, feel free to contact me:
  - **E-mail:** mat . korycinski [at] gmail.com
  - **Twitter:** @mkorycinski

## Acknowledgments
  - Vikram Alva
  - Andrew Stephens
  - David Rau
  - Lukas Zimmermann


text:
require 'rails_helper'

RSpec.describe VolumeName, type: :model do
  pending "add some examples to (or delete) #{__FILE__}"
end