text:
using System;
using System.IO;
using System.Linq;
using DEG.Emfluence.Models;
using DEG.ServiceCore.Helpers;
using FluentAssertions;
using NUnit.Framework;

namespace DEG.Emfluence.Tests
{
    [TestFixture]
    public class SearchGroupResultsSerializationTests
    {
        private readonly SearchGroupsResponse _results;

        public SearchGroupResultsSerializationTests()
        {
            var file = File.OpenText(@".\Data\SearchGroupResponse.json");

            _results = JsonHelper.Parse<SearchGroupsResponse>(file.ReadToEnd());
        }

        [Test]
        public void ParsesSuccessAndCode()
        {
            _results.Success.Should().Be(1);
            _results.Code.Should().Be(0);
        }

        [Test]
        public void ParsesPaging()
        {
            _results.Data.Paging.Page.Should().Be(1);
            _results.Data.Paging.RecordsPerPage.Should().Be(20);
            _results.Data.Paging.TotalPages.Should().Be(1);
            _results.Data.Paging.TotalRecords.Should().Be(2);
        }

        [Test]
        public void ParsesFirstRecord()
        {
            var record = _results.Data.Records.First();
            record.FriendlyName.Should().Be("B2C Customers");
            record.DateAdded.Should().Be(new DateTime(2013, 02, 12, 2, 42, 0));
            record.Description.Should().Be("");
            record.GroupId.Should().Be(123);
            record.Private.Should().Be(1);
            record.DateModified.Should().Be(null);
            record.UserId.Should().Be(123);
            record.AutoResponseEmailId.Should().Be(null);
            record.TotalMembers.Should().Be(1000);
            record.ActiveMembers.Should().Be(500);
            record.DateLastEmailSent.Should().Be(new DateTime(2015, 02, 12, 0, 42, 0));
        }

        [Test]
        public void ParsesSecondRecord()
        {
            var record = _results.Data.Records.Skip(1).First();
            record.FriendlyName.Should().Be("B2B Customers");
            record.DateAdded.Should().Be(new DateTime(2014, 01, 21, 2, 57, 0));
            record.Description.Should().Be("");
            record.GroupId.Should().Be(456);
            record.Private.Should().Be(1);
            record.DateModified.Should().Be(null);
            record.UserId.Should().Be(null);
            record.AutoResponseEmailId.Should().Be(123);
            record.TotalMembers.Should().Be(1000);
            record.ActiveMembers.Should().Be(500);
            record.DateLastEmailSent.Should().Be(new DateTime(2015, 02, 12, 0, 42, 0));
        }
    }
}


text:
A small project that popped up when I needed to access a popular browser based MMO but could not seem
to get any response. At first i thought it was something to do with my browser cache, so i decided to
write a short script to fetch the webite via get and validate its response. History cut short, I decided to
open source the script.

## Installation

```installation
git clone https://github.com/frankmaina/http-STATUS-CODES-for-humans.git
```

### Running

```running
cd http-STATUS-CODES-for-humans
nodejs index.js {URL} e.g.
nodejs index.js https://github.com

```

### Optional -O

You can have the script redirect you to a website with further explanation on the status code by simply adding " -O " after the {URL} arguement.

### TO COME
* Specific search functionality
* different types of http calls
* native GUI(windows first)

## License

MIT LICENSE
Special thanks to .....

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2017 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->
<resources>
  <!--The class name for the FabTransformationSheetBehavior. Deprecated. Use
      com.google.android.material.transition.MaterialContainerTransform
      instead. -->
  <string name="fab_transformation_sheet_behavior" translatable="false">com.google.android.material.transformation.FabTransformationSheetBehavior</string>
  <!--The class name for the FabTransformationScrimBehavior. Deprecated. Use
      com.google.android.material.transition.MaterialContainerTransform
      instead. -->
  <string name="fab_transformation_scrim_behavior" translatable="false">com.google.android.material.transformation.FabTransformationScrimBehavior</string>
</resources>


text:
(function($) {
	$.enterfocus = function(selector, callback) {
		var boxArray = [].slice.call(document.querySelectorAll(selector));
		for (var index in boxArray) {
			var box = boxArray[index];
			box.addEventListener('keyup', function(event) {
				if (event.keyCode == 13) {
					var boxIndex = boxArray.indexOf(this);
					if (boxIndex == boxArray.length - 1) {
						if (callback) callback();
					} else {
						//console.log(boxIndex);
						var nextBox = boxArray[++boxIndex];
						nextBox.focus();
					}
				}
			}, false);
		}
	};
}(window.mui = window.mui || {}));


text:
<?php

namespace Omnipay\NetBanx\Message;

/**
 * NetBanx Capture Request
 */
class CaptureRequest extends AbstractRequest
{
    /**
     * Method
     *
     * @var string
     */
    protected $txnMode = 'ccSettlement';

    /**
     * Get data
     *
     * @return array
     */
    public function getData()
    {
        $this->validate('amount', 'transactionReference');

        $data = $this->getBaseData();
        $data['txnRequest'] = $this->getXmlString();

        return $data;
    }

    /**
     * Get XML string
     *
     * @return string
     */
    protected function getXmlString()
    {
        $xml = '<?xml version="1.0" encoding="UTF-8"?>
                <ccPostAuthRequestV1
                    xmlns="http://www.optimalpayments.com/creditcard/xmlschema/v1"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://www.optimalpayments.com/creditcard/xmlschema/v1" />';

        $sxml = new \SimpleXMLElement($xml);

        $merchantAccount = $sxml->addChild('merchantAccount');

        $merchantAccount->addChild('accountNum', $this->getAccountNumber());
        $merchantAccount->addChild('storeID', $this->getStoreId());
        $merchantAccount->addChild('storePwd', $this->getStorePassword());

        $sxml->addChild('confirmationNumber', $this->getTransactionReference());
        $sxml->addChild('merchantRefNum', $this->getCustomerId());
        $sxml->addChild('amount', $this->getAmount());

        return $sxml->asXML();
    }
}


text:
<?php

class WvWEndpointTest extends TestCase {
    public function test() {
        $endpoint = $this->api()->wvw();

        $this->assertEndpointUrl( 'v2/wvw', $endpoint );
    }

    public function testObjectiveEndpoint() {
        $endpoint = $this->api()->wvw()->objectives();

        $this->assertEndpointIsBulk( $endpoint );
        $this->assertEndpointIsLocalized( $endpoint );
        $this->assertEndpointUrl( 'v2/wvw/objectives', $endpoint );

        $this->mockResponse('{"id": "968-98","name": "Wurm Tunnel"}');
        $this->assertEquals( 'Wurm Tunnel', $endpoint->get('968-98')->name );
    }
}


text:
uvg-tot
=======

Simple responsive announcement application built with Flask.

TODO:
- Fill out about section
- better 500 error template
- fix tags layout subtle overlap on mobile in detail view


text:
layout: post
title: Dpkg Error Processing Package Libapache2-mpm-itk
modified:
categories:
description:
tags: []
image:
  feature:
  credit:
  creditlink:
comments: false
share:
date: 2016-04-06T11:07:21-04:00
---

При установке пакета libapache2-mpm-itk ошибка:

```
Setting up libapache2-mpm-itk (2.4.6-01-1) ...
dpkg: error processing package libapache2-mpm-itk (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of apache2-mpm-itk:
 apache2-mpm-itk depends on libapache2-mpm-itk; however:
  Package libapache2-mpm-itk is not configured yet.

dpkg: error processing package apache2-mpm-itk (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libapache2-mpm-itk
 apache2-mpm-itk
```

Деактивировать модуль mpm_event и повторить установку пакета

```
a2dismod mpm_event
```


text:
int main(int argc, char* argv[])
{
    //Instance of new application pass arguments received from commandline
    QApplication app(argc, argv);

    //Instead of creating our GUI components ourselves. We will visually design
    //Everything then we subclass
    Window appWindow;

    //Show application MainWindow
    appWindow.show();

    //Execute app
    app.exec();

    return 0;
}


text:
package de.peeeq.wurstscript.attributes;

import java.util.Collections;
import java.util.List;

import org.eclipse.jdt.annotation.Nullable;

import com.google.common.collect.Lists;

import de.peeeq.wurstscript.ast.ActionStatement;
import de.peeeq.wurstscript.ast.AstElement;
import de.peeeq.wurstscript.ast.CompoundStatement;
import de.peeeq.wurstscript.ast.EndFunctionStatement;
import de.peeeq.wurstscript.ast.Expr;
import de.peeeq.wurstscript.ast.ExprBoolVal;
import de.peeeq.wurstscript.ast.LoopStatement;
import de.peeeq.wurstscript.ast.StartFunctionStatement;
import de.peeeq.wurstscript.ast.StmtExitwhen;
import de.peeeq.wurstscript.ast.StmtIf;
import de.peeeq.wurstscript.ast.StmtLoop;
import de.peeeq.wurstscript.ast.StmtReturn;
import de.peeeq.wurstscript.ast.StmtWhile;
import de.peeeq.wurstscript.ast.SwitchCase;
import de.peeeq.wurstscript.ast.SwitchDefaultCaseStatements;
import de.peeeq.wurstscript.ast.SwitchStmt;
import de.peeeq.wurstscript.ast.WBlock;
import de.peeeq.wurstscript.ast.WEntity;
import de.peeeq.wurstscript.ast.WStatement;
import de.peeeq.wurstscript.ast.WStatements;

public class Flow {

	public static List<WStatement> getNext(ActionStatement s) {
		List<WStatement> r = getFollowingStatements(s);
		setPrevios(s, r);
		return r;
	}

	public static List<WStatement> getNext(StartFunctionStatement s) {
		List<WStatement> r = getFollowingStatements(s);
		setPrevios(s, r);
		return r;
	}

	public static List<WStatement> getNext(LoopStatement s) {
		// we can go to the statement following the loop
		List<WStatement> r;
		if (s instanceof StmtLoop) {
			r = Lists.newArrayList();
		} else if (s instanceof StmtWhile && isConstantBool(((StmtWhile) s).getCond(), true)) {
			r = Lists.newArrayList();
		} else {
			r = getFollowingStatements(s);
		}

		// we can go to the start of the loop
		if (!s.getBody().isEmpty()) {
			r.add(s.getBody().get(0));
		}

		setPrevios(s, r);
		return r;
	}

	public static List<WStatement> getNext(StmtExitwhen s) {
		LoopStatement loop = getParentLoopStatement(s);
		if (loop == null) {
			s.addError("Break statements must be used inside a loop.");
			return Collections.emptyList();
		}
		List<WStatement> next = getFollowingStatements(loop);
		if (isConstantBool(s.getCond(), true)) {
			// always breaks
		} else {
			next.addAll(getFollowingStatements(s));
		}
		setPrevios(s, next);
		return next;
	}

	private static boolean isConstantBool(Expr cond, boolean value) {
		return cond instanceof ExprBoolVal && ((ExprBoolVal) cond).getValB() == value;
	}

	public static List<WStatement> getNext(StmtIf s) {
		List<WStatement> r;
		if (s.getThenBlock().isEmpty() || s.getElseBlock().isEmpty()) {
			r = getFollowingStatements(s);
		} else {
			r = Lists.newArrayList();
		}

		if (!s.getThenBlock().isEmpty()) {
			r.add(s.getThenBlock().get(0));
		}
		if (!s.getElseBlock().isEmpty()) {
			r.add(s.getElseBlock().get(0));
		}

		setPrevios(s, r);
		return r;
	}

	public static List<WStatement> getNext(WBlock s) {
		if (s.getBody().isEmpty()) {
			return s.attrAfterBodyStatements();
		}
		return Collections.singletonList(s.getBody().get(0));
	}

	public static List<WStatement> getNext(StmtReturn s) {
		WStatement endStmt = findEndStatement(s);
		if (endStmt == null) return Collections.emptyList();
		endStmt.attrPreviousStatements().add(s);
		return Collections.singletonList(endStmt);
	}

	private static @Nullable EndFunctionStatement findEndStatement(@Nullable AstElement n) {
		if (n == null) {
			return null;
		}
		if (n instanceof WStatements) {
			WStatements stmts = (WStatements) n;
			if (!stmts.isEmpty()) {
				WStatement last = stmts.get(stmts.size()-1);
				if (last instanceof EndFunctionStatement) {
					return (EndFunctionStatement) last;
				}
			}
		}
		return findEndStatement(n.getParent());
	}

	public static List<WStatement> getNext(SwitchStmt s) {
		List<WStatement> r = Lists.newArrayList();
		boolean following = false;
		for (SwitchCase c : s.getCases()) {
			if (c.getStmts().isEmpty()) {
				following = true;
			} else {
				r.add(c.getStmts().get(0));
			}
		}
		if (s.getSwitchDefault() instanceof SwitchDefaultCaseStatements) {
			SwitchDefaultCaseStatements defaul = (SwitchDefaultCaseStatements) s.getSwitchDefault();
			if (defaul.getStmts().isEmpty()) {
				following = true;
			} else {
				r.add(defaul.getStmts().get(0));
			}
		} else {
			following = true;
		}

		if (following) {
			r.addAll(getFollowingStatements(s));
		}

		setPrevios(s, r);
		return r;
	}

	private static List<WStatement> getFollowingStatements(WStatement s) {
		if (s.getParent() instanceof WStatements) {
			WStatements parent = (WStatements) s.getParent();
			List<WStatement> r = Lists.newArrayList();

			int index = s.attrListIndex();
			if (index+1 < parent.size()) {
				r.add(parent.get(index+1));
			} else {
				// at end of statements, next statement depends on parent statement
				CompoundStatement parentStmt = getParentStatement(parent);
				if (parentStmt != null) {
					r.addAll(parentStmt.attrAfterBodyStatements());
				}
			}
			return r;
		} else {
			return Collections.emptyList();
		}
	}

	private static @Nullable CompoundStatement getParentStatement(AstElement node) {
		if (node instanceof CompoundStatement) {
			return (CompoundStatement) node;
		} else if (node instanceof WEntity) {
			return null;
		}
		return getParentStatement(node.getParent());
	}

	private static void setPrevios(WStatement s, List<WStatement> next) {
		for (WStatement n : next) {
			n.attrPreviousStatements().add(s);
		}
	}

	public static List<WStatement> getPrevious(WStatement s) {
		return Lists.newArrayListWithCapacity(1);
	}

	private static int lastUsedIndex = 0;

	public static int getListIndex(WStatement s) {
		WStatements parent = (WStatements) s.getParent();
		int r;
		if (get(parent, lastUsedIndex) == s) {
			r = lastUsedIndex;
		} else if (get(parent, lastUsedIndex+1) == s) {
			r = lastUsedIndex + 1;
		} else if (get(parent, lastUsedIndex-1) == s) {
			r = lastUsedIndex - 1;
		} else {
			r = parent.indexOf(s);
		}
		lastUsedIndex = r;
		return r;
	}

	private static @Nullable WStatement get(WStatements parent, int i) {
		if (i <= 0) return null;
		if (i >= parent.size()) return null;
		return parent.get(i);
	}

	public static List<WStatement> getAfterBody(LoopStatement loop) {
		List<WStatement> r = Lists.newArrayList();
		// at the end of an loop we can go to the beginning of the loop body...
		r.add(loop);

		// ... or after the loop
//		int index = loop.attrListIndex();
//		WStatements parent = (WStatements) loop.getParent();
//		if (index + 1 < parent.size()) {
//			r.add(parent.get(index+1));
//		}
		r.addAll(getFollowingStatements(loop));
		return r;
	}

	public static List<WStatement> getAfterBody(StmtIf s) {
		return getFollowingStatements(s);
	}

	public static List<WStatement> getAfterBody(WBlock s) {
		return getFollowingStatements(s);
	}

	public static List<WStatement> getAfterBody(SwitchStmt s) {
		return getFollowingStatements(s);
	}

	private static @Nullable LoopStatement getParentLoopStatement(@Nullable AstElement node) {
		while (node != null) {
			if (node instanceof LoopStatement) {
				return (LoopStatement) node;
			}
			node = node.getParent();
		}
		return null;
	}

	public static List<WStatement> getNext(EndFunctionStatement endFunctionStatement) {
		return Collections.emptyList();
	}

}


text:
namespace TomsToolbox.Wpf;

using System;

/// <summary>
/// Event arguments for the <see cref="PropertyBinding{T}.ValueChanged"/> event.
/// </summary>
/// <typeparam name="T">The type of the variable.</typeparam>
public class PropertyBindingValueChangedEventArgs<T> : EventArgs
{
    /// <summary>
    /// Initializes a new instance of the <see cref="PropertyBindingValueChangedEventArgs{T}"/> class.
    /// </summary>
    /// <param name="oldValue">The old value.</param>
    /// <param name="newValue">The new value.</param>
    public PropertyBindingValueChangedEventArgs(T? oldValue, T? newValue)
    {
        NewValue = newValue;
        OldValue = oldValue;
    }

    /// <summary>
    /// Gets the old value.
    /// </summary>
    public T? OldValue { get; }

    /// <summary>
    /// Gets the new value.
    /// </summary>
    public T? NewValue { get; }
}


text:
namespace Oracle.Models
{
    public class Item : BaseDataObject
	{
		string text = string.Empty;
		public string Text
		{
			get { return text; }
			set { SetProperty(ref text, value); }
		}

		string description = string.Empty;
		public string Description
		{
			get { return description; }
			set { SetProperty(ref description, value); }
		}
	}
}


text:
import LazyWrapper from './LazyWrapper';
import LodashWrapper from './LodashWrapper';
import arrayCopy from './arrayCopy';

/**
 * Creates a clone of `wrapper`.
 *
 * @private
 * @param {Object} wrapper The wrapper to clone.
 * @returns {Object} Returns the cloned wrapper.
 */
function wrapperClone(wrapper) {
  return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
}

export default wrapperClone;


text:
using System;
using System.Reflection;

namespace TerraFX.Graphics.Advanced;

/// An object which is created for a graphics command queue.
public abstract class GraphicsCommandQueueObject : GraphicsDeviceObject
{
    private readonly GraphicsCommandQueue _commandQueue;

    /// Initializes a new instance of the <see cref="GraphicsCommandQueueObject" /> class.
    /// <param name="commandQueue">The command queue for which the object is being created.</param>
    /// <param name="name">The name of the object or <c>null</c> to use <see cref="MemberInfo.Name" />.</param>
    /// <exception cref="ArgumentNullException"><paramref name="commandQueue" /> is <c>null</c>.</exception>
    protected GraphicsCommandQueueObject(GraphicsCommandQueue commandQueue, string? name = null) : base(commandQueue.Device, name)
    {
        _commandQueue = commandQueue;
    }

    /// Gets the command queue for which the object was created.
    public GraphicsCommandQueue CommandQueue => _commandQueue;
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Sydowia 4: 564 (1950)

#### Original name
Phomopsis andina Petr., 1950

### Remarks
null


text:
name             'server_base'
maintainer       'Robert L Carpenter'
maintainer_email 'robert@robacarp.com'
license          'MIT'
description      'Installs/Configures lots of packages on a linux system'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          '0.1.0'


text:
"""
Trivial ctypesgen demo library consumer
from http://code.google.com/p/ctypesgen

 NOTE demolib.py needs to be generated via:

    ../ctypesgen.py -o pydemolib.py -l demolib demolib.h
    ../ctypesgen.py -o pydemolib.py -l demolib.so demolib.h

"""

import sys

import pydemolib  # generated from demolib.h by ctypesgen

def do_demo():
    a = 1
    b = 2
    result = pydemolib.trivial_add(a, b)
    print "a", a
    print "b", b
    print "result", result

def main(argv=None):
    if argv is None:
        argv = sys.argv

    do_demo()

    return 0

if __name__ == "__main__":
    sys.exit(main())


text:
package org.apache.nutch.webui;

import org.apache.nutch.webui.pages.DashboardPage;
import org.apache.nutch.webui.pages.assets.NutchUiCssReference;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import de.agilecoders.wicket.core.Bootstrap;
import de.agilecoders.wicket.core.markup.html.themes.bootstrap.BootstrapCssReference;
import de.agilecoders.wicket.core.settings.BootstrapSettings;
import de.agilecoders.wicket.core.settings.SingleThemeProvider;
import de.agilecoders.wicket.core.settings.Theme;
import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesomeCssReference;

@Component
public class NutchUiApplication extends WebApplication implements
    ApplicationContextAware {
  private static final String THEME_NAME = "bootstrap";
  private ApplicationContext context;

  /**
   * @see org.apache.wicket.Application#getHomePage()
   */
  @Override
  public Class<? extends WebPage> getHomePage() {
    return DashboardPage.class;
  }

  /**
   * @see org.apache.wicket.Application#init()
   */
  @Override
  public void init() {
    super.init();
    BootstrapSettings settings = new BootstrapSettings();
    Bootstrap.install(this, settings);
    configureTheme(settings);

    getComponentInstantiationListeners().add(
        new SpringComponentInjector(this, context));
  }

  private void configureTheme(BootstrapSettings settings) {
    Theme theme = new Theme(THEME_NAME, BootstrapCssReference.instance(),
        FontAwesomeCssReference.instance(), NutchUiCssReference.instance());
    settings.setThemeProvider(new SingleThemeProvider(theme));
  }

  @Override
  public void setApplicationContext(ApplicationContext applicationContext)
      throws BeansException {
    this.context = applicationContext;
  }
}


text:
import floppyforms as forms

from .models import FoiSite

class FoiSiteURLWidget(forms.URLInput):
    template_name = 'reminders/_foisiteurlwidget.html'

    def get_context(self, name, value, attrs=None):
        ctx = super(FoiSiteURLWidget, self).get_context(name, value, attrs)
        ctx['foisites'] = FoiSite.objects.all()
        return ctx


text:
layout: "docs"
page_title: "Command: remote"
sidebar_current: "docs-commands-remote"
description: |-
  The `terraform remote` command is used to configure Terraform to make
  use of remote state storage, change remote storage configuration, or
  to disable it.
---

# Command: remote

The `terraform remote` command is used to configure all aspects of
remote state storage. When remote state storage is enabled,
Terraform will automatically fetch the latest state from the remote
server when necessary and if any updates are made, the newest state
is persisted back to the remote server.
In this mode, users do not need to durably store the state using version
control or shared storage.

## Usage

Usage: `terraform remote SUBCOMMAND [options]`

The `remote` command behaves as another command that further has more
subcommands. The subcommands available are:

  * [config](/docs/commands/remote-config.html) - Configure the remote storage,
      including enabling/disabling it.
  * [pull](/docs/commands/remote-pull.html) - Sync the remote storage to
      the local storage (download).
  * [push](/docs/commands/remote-push.html) - Sync the local storage to
      remote storage (upload).


text:
import * as React from 'react';
import { BaseTexture } from 'babylonjs/Materials/Textures/baseTexture';
import { IPixelData } from './textureCanvasManager';
import { ISize } from 'babylonjs/Maths/math.size';

interface IPropertiesBarProps {
    texture: BaseTexture;
    size: ISize;
    saveTexture(): void;
    pixelData: IPixelData;
    face: number;
    setFace(face : number): void;
    resetTexture() : void;
    resizeTexture(width: number, height: number) : void;
    uploadTexture(file : File) : void;
    mipLevel: number;
    setMipLevel: (mipLevel : number) => void;
}

interface IPropertiesBarState {
    width: number;
    height: number;
}

interface IPixelDataProps {
    name: string;
    data: number | undefined;
}

export class PropertiesBar extends React.PureComponent<IPropertiesBarProps,IPropertiesBarState> {
    private _resetButton = require('./assets/reset.svg');
    private _uploadButton = require('./assets/upload.svg');
    private _saveButton = require('./assets/save.svg');
    private _babylonLogo = require('./assets/babylonLogo.svg');

    private _resizeButton = require('./assets/resizeTool.svg');

    private _mipUp = require('./assets/mipUp.svg');
    private _mipDown = require('./assets/mipDown.svg');

    private _faces = [
        require('./assets/posX.svg'),
        require('./assets/negX.svg'),
        require('./assets/posY.svg'),
        require('./assets/negY.svg'),
        require('./assets/posZ.svg'),
        require('./assets/negZ.svg')
    ]

    constructor(props : IPropertiesBarProps) {
        super(props);

        this.state = {
            width: props.size.width,
            height: props.size.height
        }
    }

    private pixelData(props: IPixelDataProps) {
        return {props.name}: {props.data !== undefined ? props.data : '-'};
    }

    private getNewDimension(oldDim : number, newDim : any) {
        if (!isNaN(newDim)) {
            if (parseInt(newDim) > 0) {
                if (Number.isInteger(parseInt(newDim)))
                    return parseInt(newDim);
            }
        }
        return oldDim;
    }

    componentWillUpdate(nextProps: IPropertiesBarProps) {
        if (nextProps.size.width != this.props.size.width || nextProps.size.height != this.props.size.height) {
            this.setState({
                width: nextProps.size.width,
                height: nextProps.size.height
            })
        }
    }

    render() {
        const {mipLevel, setMipLevel, pixelData, resizeTexture, texture, face, setFace, saveTexture, resetTexture, uploadTexture} = this.props;
        const maxLevels = Math.floor(Math.log2(Math.max(texture.getSize().width, texture.getSize().height)));
        const engine = texture.getScene()!.getEngine();
        const mipsEnabled = (!texture.noMipmap && engine.getCaps().textureLOD);
        return

                        <form onSubmit={evt => {
                            this.props.resizeTexture(this.state.width, this.state.height);
                            evt.preventDefault();
                        }}>

                                W: <input type='text' value={this.state.width} readOnly={texture.isCube} onChange={(evt) => this.setState({width: this.getNewDimension(this.state.width, evt.target.value)})}/>

                                H: <input type='text' value={this.state.height} readOnly={texture.isCube} onChange={(evt) => this.setState({height: this.getNewDimension(this.state.height, evt.target.value)})}/>

                        {!texture.isCube &&  resizeTexture(this.state.width, this.state.height)}/>}
                        </form>

                        <this.pixelData name='X' data={pixelData.x}/>
                        <this.pixelData name='Y' data={pixelData.y}/>

                        <this.pixelData name='R' data={pixelData.r}/>
                        <this.pixelData name='G' data={pixelData.g}/>
                        <this.pixelData name='B' data={pixelData.b}/>
                        <this.pixelData name='A' data={pixelData.a}/>

                    {texture.isCube &&

                            {this._faces.map((value, index) =>
                             setFace(index)}
                            />)}

                    }
                    {mipsEnabled &&

                             mipLevel > 0 && setMipLevel(mipLevel - 1)} />
                             mipLevel < maxLevels && setMipLevel(mipLevel + 1)} />

                    }

                     resetTexture()}/>

                        <input
                            accept='.jpg, .png, .tga, .dds, .env'
                            type='file'
                            onChange={
                                (evt : React.ChangeEvent<HTMLInputElement>) => {
                                    const files = evt.target.files;
                                    if (files && files.length) {
                                        uploadTexture(files[0]);
                                    }

                                    evt.target.value = "";
                                }
                            }
                        />

                     saveTexture()}/>

;
    }
}


text:
<?php
/**
 * Reports section of the CMS.
 *
 * All reports that should show in the ReportAdmin section
 * of the CMS need to subclass {@link SS_Report}, and implement
 * the appropriate methods and variables that are required.
 *
 * @see SS_Report
 *
 * @package cms
 * @subpackage reports
 */
class ReportAdmin extends LeftAndMain implements PermissionProvider {

	static $url_segment = 'reports';

	static $url_rule = '/$ReportClass/$Action';

	static $menu_title = 'Reports';

	static $template_path = null; // defaults to (project)/templates/email

	static $tree_class = 'SS_Report';

	public static $url_handlers = array(
		'$ReportClass/$Action' => 'handleAction'
	);

	/**
	 * Variable that describes which report we are currently viewing based on the URL (gets set in init method)
	 * @var String
	 */
	protected $reportClass;

	protected $reportObject;

	public function init() {
		parent::init();

		//set the report we are currently viewing from the URL
		$this->reportClass = (isset($this->urlParams['ReportClass'])) ? $this->urlParams['ReportClass'] : null;
		$allReports = SS_Report::get_reports();
		$this->reportObject = (isset($allReports[$this->reportClass])) ? $allReports[$this->reportClass] : null;

		Requirements::css(CMS_DIR . '/css/screen.css');

		// Set custom options for TinyMCE specific to ReportAdmin
		HtmlEditorConfig::get('cms')->setOption('ContentCSS', project() . '/css/editor.css');
		HtmlEditorConfig::get('cms')->setOption('Lang', i18n::get_tinymce_lang());

		// Always block the HtmlEditorField.js otherwise it will be sent with an ajax request
		Requirements::block(FRAMEWORK_DIR . '/javascript/HtmlEditorField.js');
	}

	/**
	 * Does the parent permission checks, but also
	 * makes sure that instantiatable subclasses of
	 * {@link Report} exist. By default, the CMS doesn't
	 * include any Reports, so there's no point in showing
	 *
	 * @param Member $member
	 * @return boolean
	 */
	function canView($member = null) {
		if(!$member && $member !== FALSE) $member = Member::currentUser();

		if(!parent::canView($member)) return false;

		$hasViewableSubclasses = false;
		foreach($this->Reports() as $report) {
			if($report->canView($member)) return true;
		}

		return false;
	}

	/**
	 * Return a SS_List of SS_Report subclasses
	 * that are available for use.
	 *
	 * @return SS_List
	 */
	public function Reports() {
 		$output = new ArrayList();
		foreach(SS_Report::get_reports() as $report) {
			if($report->canView()) $output->push($report);
		}
		return $output;
	}

	/**
	 * Determine if we have reports and need
	 * to display the "Reports" main menu item
	 * in the CMS.
	 *
	 * The test for an existance of a report
	 * is done by checking for a subclass of
	 * "SS_Report" that exists.
	 *
	 * @return boolean
	 */
	public static function has_reports() {
		return sizeof(SS_Report::get_reports()) > 0;
	}

	/**
	 * Returns the Breadcrumbs for the ReportAdmin
	 * @return ArrayList
	 */
	public function Breadcrumbs($unlinked = false) {
		$items = parent::Breadcrumbs($unlinked);

		// The root element should explicitly point to the root node.
		// Uses session state for current record otherwise.
		$items[0]->Link = singleton('ReportAdmin')->Link();

		if ($this->reportObject) {
			//build breadcrumb trail to the current report
			$items->push(new ArrayData(array(
					'Title' => $this->reportObject->title(),
					'Link' => Controller::join_links($this->Link(), '?' . http_build_query(array('q' => $this->request->requestVar('q'))))
				)));
		}

		return $items;
	}

	/**
	 * Returns the link to the report admin section, or the specific report that is currently displayed
	 * @return String
	 */
	public function Link($action = null) {
		$link = parent::Link($action);
		if ($this->reportObject) $link = $this->reportObject->getLink($action);
		return $link;
	}

	function providePermissions() {
		$title = _t("ReportAdmin.MENUTITLE", LeftAndMain::menu_title_for_class($this->class));
		return array(
			"CMS_ACCESS_ReportAdmin" => array(
				'name' => _t('CMSMain.ACCESS', "Access to '{title}' section", array('title' => $title)),
				'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access')
			)
		);
	}

	public function getEditForm($id = null, $fields = null) {
		$fields = new FieldList();

		$report = $this->reportObject;

		if($report) {
			// List all reports
			$gridFieldConfig = GridFieldConfig::create()->addComponents(
				new GridFieldToolbarHeader(),
				new GridFieldSortableHeader(),
				new GridFieldDataColumns(),
				new GridFieldPaginator(),
				new GridFieldPrintButton(),
				new GridFieldExportButton()
			);
			$gridField = new GridField('Report',$report->title(), $report->sourceRecords(array(), null, null), $gridFieldConfig);
			$columns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns');
			$displayFields = array();
			$fieldCasting = array();
			$fieldFormatting = array();

			// Parse the column information
			foreach($report->columns() as $source => $info) {
				if(is_string($info)) $info = array('title' => $info);

				if(isset($info['formatting'])) $fieldFormatting[$source] = $info['formatting'];
				if(isset($info['csvFormatting'])) $csvFieldFormatting[$source] = $info['csvFormatting'];
				if(isset($info['casting'])) $fieldCasting[$source] = $info['casting'];

				if(isset($info['link']) && $info['link']) {
					$link = singleton('CMSPageEditController')->Link('show');
					$fieldFormatting[$source] = '$value';
				}

				$displayFields[$source] = isset($info['title']) ? $info['title'] : $source;
			}
			$columns->setDisplayFields($displayFields);
			$columns->setFieldCasting($fieldCasting);
			$columns->setFieldFormatting($fieldFormatting);

			$fields->push($gridField);
		} else {
			// List all reports
			$gridFieldConfig = GridFieldConfig::create()->addComponents(
				new GridFieldToolbarHeader(),
				new GridFieldSortableHeader(),
				new GridFieldDataColumns(),
				new GridFieldFooter()
			);
			$gridField = new GridField('Reports',false, $this->Reports(), $gridFieldConfig);
			$columns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns');
			$columns->setDisplayFields(array(
				'title' => 'Title',
			));
			$columns->setFieldFormatting(array(
				'title' => '$value'
			));
			$gridField->addExtraClass('all-reports-gridfield');
			$fields->push($gridField);
		}

		$actions = new FieldList();
		$form = new Form($this, "EditForm", $fields, $actions);
		$form->addExtraClass('cms-edit-form cms-panel-padded center ' . $this->BaseCSSClasses());

		$this->extend('updateEditForm', $form);

		return $form;
	}
}


text:
<?php use Cake\Core\Configure; ?>
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title><?php echo Configure::read('Theme.title'); ?> | <?php echo $this->fetch('title'); ?></title>

  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

  <?php echo $this->Html->css('AdminLTE./bower_components/bootstrap/dist/css/bootstrap.min'); ?>

  <?php echo $this->Html->css('AdminLTE./bower_components/font-awesome/css/font-awesome.min'); ?>

  <?php echo $this->Html->css('AdminLTE./bower_components/Ionicons/css/ionicons.min'); ?>

  <?php echo $this->Html->css('AdminLTE.AdminLTE.min'); ?>

  <?php echo $this->Html->css('AdminLTE.skins/_all-skins.min'); ?>

  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">

  <?php echo $this->fetch('css'); ?>

<body class="hold-transition skin-<?php echo Configure::read('Theme.skin'); ?> layout-top-nav">

    <?php echo $this->element('nav-top', ['layout' => 'top']); ?>

    <?php echo $this->Flash->render(); ?>
    <?php echo $this->Flash->render('auth'); ?>
    <?php echo $this->fetch('content'); ?>

  <?php echo $this->element('footer', ['layout' => 'top']); ?>

<?php echo $this->Html->script('AdminLTE./bower_components/jquery/dist/jquery.min'); ?>

<?php echo $this->Html->script('AdminLTE./bower_components/bootstrap/dist/js/bootstrap.min'); ?>

<?php echo $this->Html->script('AdminLTE./bower_components/jquery-slimscroll/jquery.slimscroll.min'); ?>

<?php echo $this->Html->script('AdminLTE./bower_components/fastclick/lib/fastclick'); ?>

<?php echo $this->Html->script('AdminLTE.adminlte.min'); ?>

<?php echo $this->fetch('script'); ?>

<?php echo $this->fetch('scriptBottom'); ?>


text:
require 'spec_helper'

describe Spree::Promotion::Actions::CreateLineItems, type: :model do
  let(:order) { create(:order) }
  let(:action) { Spree::Promotion::Actions::CreateLineItems.create }
  let(:promotion) { stub_model(Spree::Promotion) }
  let(:shirt) { create(:variant) }
  let(:mug) { create(:variant) }
  let(:payload) { { order: order } }

  def empty_stock(variant)
    variant.stock_items.update_all(backorderable: false)
    variant.stock_items.each(&:reduce_count_on_hand_to_zero)
  end

  context "#perform" do
    before do
      allow(action).to receive_messages promotion: promotion
      action.promotion_action_line_items.create!(
        variant: mug,
        quantity: 1
      )
      action.promotion_action_line_items.create!(
        variant: shirt,
        quantity: 2
      )
    end

    context "order is eligible" do
      before do
        allow(promotion).to receive_messages eligible: true
      end

      it "adds line items to order with correct variant and quantity" do
        action.perform(payload)
        expect(order.line_items.count).to eq(2)
        line_item = order.line_items.find_by_variant_id(mug.id)
        expect(line_item).not_to be_nil
        expect(line_item.quantity).to eq(1)
      end

      it "only adds the delta of quantity to an order" do
        order.contents.add(shirt, 1)
        action.perform(payload)
        line_item = order.line_items.find_by_variant_id(shirt.id)
        expect(line_item).not_to be_nil
        expect(line_item.quantity).to eq(2)
      end

      it "doesn't add if the quantity is greater" do
        order.contents.add(shirt, 3)
        action.perform(payload)
        line_item = order.line_items.find_by_variant_id(shirt.id)
        expect(line_item).not_to be_nil
        expect(line_item.quantity).to eq(3)
      end

      it "doesn't try to add an item if it's out of stock" do
        empty_stock(mug)
        empty_stock(shirt)

        expect(order.contents).to_not receive(:add)
        action.perform(order: order)
      end
    end
  end

  describe "#item_available?" do
    let(:item_out_of_stock) do
      action.promotion_action_line_items.create!(variant: mug, quantity: 1)
    end

    let(:item_in_stock) do
      action.promotion_action_line_items.create!(variant: shirt, quantity: 1)
    end

    it "returns false if the item is out of stock" do
      empty_stock(mug)
      expect(action.item_available? item_out_of_stock).to be false
    end

    it "returns true if the item is in stock" do
      expect(action.item_available? item_in_stock).to be true
    end
  end
end


text:
import { Routes, RouterModule } from '@angular/router';
import {ProjectSingle} from "./projectsingle";

export const routes: Routes = [
    { path: '', component: ProjectSingle}
];

export const routing = RouterModule.forChild(routes);


text:
package techreborn.proxies;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.statemap.StateMap;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.util.RecipeBookClient;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import prospector.shootingstar.ShootingStar;
import reborncore.api.tile.IUpgradeable;
import reborncore.client.hud.StackInfoHUD;
import reborncore.client.multiblock.MultiblockRenderEvent;
import techreborn.blocks.BlockRubberLeaves;
import techreborn.client.*;
import techreborn.client.gui.GuiBase;
import techreborn.client.gui.slot.GuiSlotConfiguration;
import techreborn.client.keybindings.KeyBindings;
import techreborn.client.render.ModelDynamicCell;
import techreborn.client.render.entitys.RenderNukePrimed;
import techreborn.entities.EntityNukePrimed;
import techreborn.events.FluidBlockModelHandler;
import techreborn.init.ModBlocks;
import techreborn.items.ItemFrequencyTransmitter;
import techreborn.lib.ModInfo;

public class ClientProxy extends CommonProxy {

	public static MultiblockRenderEvent multiblockRenderEvent;

	@Override
	public void preInit(FMLPreInitializationEvent event) {
		super.preInit(event);
		ShootingStar.registerModels(ModInfo.MOD_ID);
		StackInfoHUD.registerElement(new ItemFrequencyTransmitter.StackInfoFreqTransmitter());
		RenderingRegistry.registerEntityRenderingHandler(EntityNukePrimed.class, new RenderManagerNuke());
		ModelDynamicCell.init();
		RegisterItemJsons.registerModels();
		MinecraftForge.EVENT_BUS.register(new IconSupplier());
		MinecraftForge.EVENT_BUS.register(new FluidBlockModelHandler());
		MinecraftForge.EVENT_BUS.register(ClientEventHandler.class);
	}

	@Override
	public void init(FMLInitializationEvent event) {
		super.init(event);
		MinecraftForge.EVENT_BUS.register(new StackToolTipEvent());
		multiblockRenderEvent = new MultiblockRenderEvent();
		MinecraftForge.EVENT_BUS.register(GuiSlotConfiguration.class);
		MinecraftForge.EVENT_BUS.register(multiblockRenderEvent);
		// TODO FIX ME
		ClientRegistry.registerKeyBinding(KeyBindings.config);
		ClientMultiBlocks.init();
		StateMap rubberLeavesStateMap = new StateMap.Builder().ignore(BlockRubberLeaves.CHECK_DECAY, BlockRubberLeaves.DECAYABLE).build();
		ModelLoader.setCustomStateMapper(ModBlocks.RUBBER_LEAVES, rubberLeavesStateMap);
	}

	@Override
	public boolean isCTMAvailable() {
		return isChiselAround;
	}

	@Override
	public String getUpgradeConfigText() {
		if (Minecraft.getMinecraft().currentScreen instanceof GuiBase) {
			GuiBase base = (GuiBase) Minecraft.getMinecraft().currentScreen;
			if (base.tile instanceof IUpgradeable) {
				if (((IUpgradeable) base.tile).canBeUpgraded()) {
					return TextFormatting.LIGHT_PURPLE + "Right click to configure";
				}
			}
		}
		return super.getUpgradeConfigText();
	}

	public class RenderManagerNuke implements IRenderFactory<EntityNukePrimed> {

		@Override
		public Render<? super EntityNukePrimed> createRenderFor(RenderManager manager) {
			return new RenderNukePrimed(manager);
		}
	}

	@Override
	public boolean fancyGraphics() {
		return Minecraft.getMinecraft().gameSettings.fancyGraphics;
	}

	@Override
	public void rebuildRecipeBook() {
		super.rebuildRecipeBook();
		RecipeBookClient.rebuildTable();
	}
}


text:
typedef unsigned int SkColor;

namespace gfx {
class ImageSkia;
}

namespace views {
class Label;
}

namespace ash {
namespace internal {

class TrayItemView;

class ViewClickListener {
 public:
  virtual ~ViewClickListener() {}
  virtual void ClickedOn(views::View* sender) = 0;
};

// A custom scroll-view that has a specified dimension.
class FixedSizedScrollView : public views::ScrollView {
 public:
  FixedSizedScrollView();

  virtual ~FixedSizedScrollView();

  void SetContentsView(View* view);
  // Change the fixed size of the view. Invalidates the layout (by calling
  // PreferredSizeChanged()).
  void SetFixedSize(const gfx::Size& size);

  void set_fixed_size(const gfx::Size& size) { fixed_size_ = size; }

  // views::View public method overrides.
  virtual gfx::Size GetPreferredSize() OVERRIDE;
  virtual void Layout() OVERRIDE;
  virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;

 protected:
  // views::View protected method overrides.
  virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
  virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE;

 private:
  gfx::Size fixed_size_;

  DISALLOW_COPY_AND_ASSIGN(FixedSizedScrollView);
};

// A border for label buttons that paints a vertical separator in normal state
// and a custom hover effect in hovered or pressed state.
class TrayPopupLabelButtonBorder : public views::LabelButtonBorder {
 public:
  TrayPopupLabelButtonBorder();
  virtual ~TrayPopupLabelButtonBorder();

  // Overridden from views::LabelButtonBorder.
  virtual void Paint(const views::View& view, gfx::Canvas* canvas) OVERRIDE;
  virtual gfx::Insets GetInsets() const OVERRIDE;

 private:
  DISALLOW_COPY_AND_ASSIGN(TrayPopupLabelButtonBorder);
};

// A label button with custom alignment, border and focus border.
class TrayPopupLabelButton : public views::LabelButton {
 public:
  TrayPopupLabelButton(views::ButtonListener* listener, const string16& text);
  virtual ~TrayPopupLabelButton();

 private:
  // Overridden from views::LabelButton.
  virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE;

  DISALLOW_COPY_AND_ASSIGN(TrayPopupLabelButton);
};

// A ToggleImageButton with fixed size, paddings and hover effects. These
// buttons are used in the header.
class TrayPopupHeaderButton : public views::ToggleImageButton {
 public:
  TrayPopupHeaderButton(views::ButtonListener* listener,
                        int enabled_resource_id,
                        int disabled_resource_id,
                        int enabled_resource_id_hover,
                        int disabled_resource_id_hover,
                        int accessible_name_id);
  virtual ~TrayPopupHeaderButton();

 private:
  // Overridden from views::View.
  virtual gfx::Size GetPreferredSize() OVERRIDE;
  virtual void OnPaintBorder(gfx::Canvas* canvas) OVERRIDE;
  virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE;

  // Overridden from views::CustomButton.
  virtual void StateChanged() OVERRIDE;

  DISALLOW_COPY_AND_ASSIGN(TrayPopupHeaderButton);
};

// A button with a bar image and title text below the bar image. These buttons
// will be used in audio and brightness control UI, which can be toggled with
// on/off states.
class TrayBarButtonWithTitle : public views::CustomButton {
 public:
  TrayBarButtonWithTitle(views::ButtonListener* listener,
                                  int title_id,
                                  int width);
  virtual ~TrayBarButtonWithTitle();

  // Overridden from views::View.
  virtual gfx::Size GetPreferredSize() OVERRIDE;
  virtual void Layout() OVERRIDE;

  void UpdateButton(bool control_on);

 private:
  class TrayBarButton;

  TrayBarButton* image_;
  views::Label* title_;
  int width_;
  int image_height_;

  DISALLOW_COPY_AND_ASSIGN(TrayBarButtonWithTitle);
};

// A SmoothedThrobber with tooltip.
class SystemTrayThrobber : public views::SmoothedThrobber {
 public:
  SystemTrayThrobber(int frame_delay_ms);
  virtual ~SystemTrayThrobber();

  void SetTooltipText(const string16& tooltip_text);

  // Overriden from views::View.
  virtual bool GetTooltipText(
        const gfx::Point& p, string16* tooltip) const OVERRIDE;

 private:
  // The current tooltip text.
  string16 tooltip_text_;

  DISALLOW_COPY_AND_ASSIGN(SystemTrayThrobber);
};

// A View containing a SystemTrayThrobber with animation for starting/stopping.
class ThrobberView : public views::View {
 public:
  ThrobberView();
  virtual ~ThrobberView();

  void Start();
  void Stop();
  void SetTooltipText(const string16& tooltip_text);

  // Overriden from views::View.
  virtual gfx::Size GetPreferredSize() OVERRIDE;
  virtual void Layout() OVERRIDE;
  virtual bool GetTooltipText(
      const gfx::Point& p, string16* tooltip) const OVERRIDE;

 private:
  // Schedules animation for starting/stopping throbber.
  void ScheduleAnimation(bool start_throbber);

  SystemTrayThrobber* throbber_;

  // The current tooltip text.
  string16 tooltip_text_;

  DISALLOW_COPY_AND_ASSIGN(ThrobberView);
};

// Sets up a Label properly for the tray (sets color, font etc.).
void SetupLabelForTray(views::Label* label);

// TODO(jennyz): refactor these two functions to SystemTrayItem.
// Sets the empty border of an image tray item for adjusting the space
// around it.
void SetTrayImageItemBorder(views::View* tray_view, ShelfAlignment alignment);
// Sets the empty border around a label tray item for adjusting the space
// around it.
void SetTrayLabelItemBorder(TrayItemView* tray_view,
                            ShelfAlignment alignment);

}  // namespace internal
}  // namespace ash

#endif  // ASH_SYSTEM_TRAY_TRAY_VIEWS_H_


text:
<form role="form" name="scheduleForm" autocomplete="off">

{{vm.mode}}

			Account
			<input name="primaryAccount" class="form-control" ng-model="vm.transaction.primary_account" uib-typeahead="account as account.name for account in vm.primaryAccounts($viewValue, 10)" ng-blur="vm.primaryAccountSelected()" typeahead-editable="false" typeahead-select-on-blur="true" typeahead-template-url="../../og-components/og-favourite/views/typeahead-suggestion.html" placeholder="Account" required og-input-autoselect autofocus>

			Frequency
			<input name="frequency" class="form-control" ng-model="vm.schedule.frequency" uib-typeahead="frequency for frequency in vm.frequencies($viewValue)" typeahead-editable="false" typeahead-min-length="0" typeahead-select-on-blur="true" placeholder="Frequency" required og-input-autoselect>

			{{vm.mode == 'Enter Transaction' ? "" : "Next Due "}} Date
			<input ng-switch-when="Enter Transaction" id="transactionDate" name="transactionDate" class="form-control" type="date" ng-model="vm.transaction.transaction_date" required>
			<input ng-switch-default id="transactionDate" name="transactionDate" class="form-control" type="date" ng-model="vm.schedule.next_due_date" required>

			Payee
			<input name="payee" class="form-control" ng-model="vm.transaction.payee" uib-typeahead="payee as payee.name for payee in vm.payees($viewValue, 10)" ng-blur="vm.payeeSelected()" typeahead-select-on-blur="true" typeahead-template-url="../../og-components/og-favourite/views/typeahead-suggestion.html" placeholder="Payee" required og-input-autoselect>

			Security
			<input name="security" class="form-control" ng-model="vm.transaction.security" uib-typeahead="security as security.name for security in vm.securities($viewValue, 10)" ng-blur="vm.securitySelected()" typeahead-select-on-blur="true" typeahead-template-url="../../og-components/og-favourite/views/typeahead-suggestion.html" placeholder="Security" required og-input-autoselect>

			Category
			<input id="category" name="category" class="form-control" ng-model="vm.transaction.category" uib-typeahead="category as category.name for category in vm.investmentCategories($viewValue)" ng-blur="vm.investmentCategorySelected()" typeahead-editable="false" typeahead-min-length="0" typeahead-select-on-blur="true" placeholder="Category" required og-input-autoselect>

			Amount
			<input id="amount" name="amount" class="form-control" ng-class="{'negative': vm.transaction.amount < -1}" ng-model="vm.transaction.amount" placeholder="Transaction Amount" required og-input-currency og-input-autoselect og-input-calculator>

			Category
			<input id="category" name="category" class="form-control" ng-model="vm.transaction.category" uib-typeahead="category as category.name for category in vm.categories($viewValue, 10, null, true)" ng-blur="vm.categorySelected()" typeahead-select-on-blur="true" typeahead-template-url="../../og-components/og-favourite/views/typeahead-suggestion.html" placeholder="Category" required og-input-autoselect>

			Subcategory
			<input id="subcategory" name="subcategory" class="form-control" ng-disabled="!(vm.isString(vm.transaction.category) || vm.transaction.category.id > 0)" ng-model="vm.transaction.subcategory" uib-typeahead="subcategory as subcategory.name for subcategory in vm.categories($viewValue, 10, vm.transaction.category)" typeahead-select-on-blur="true" typeahead-template-url="../../og-components/og-favourite/views/typeahead-suggestion.html" placeholder="Subcategory" og-input-autoselect>

			Account
			<input id="account" name="account" class="form-control" ng-model="vm.transaction.account" uib-typeahead="account as account.name for account in vm.accounts($viewValue, 10)" typeahead-editable="false" typeahead-select-on-blur="true" typeahead-template-url="../../og-components/og-favourite/views/typeahead-suggestion.html" placeholder="Account" required og-input-autoselect>

			Quantity
			<input id="quantity" name="quantity" class="form-control" ng-class="{'negative': vm.transaction.quantity < 0}" ng-model="vm.transaction.quantity" ng-change="vm.updateInvestmentDetails()" placeholder="Quantity" required og-input-number og-input-autoselect og-input-calculator>

			Price
			<input id="price" name="price" class="form-control" ng-class="{'negative': vm.transaction.price < 0}" ng-model="vm.transaction.price" ng-change="vm.updateInvestmentDetails()" placeholder="Price" required og-input-currency="3" og-input-autoselect og-input-calculator>

			Commission
			<input id="commission" name="commission" class="form-control" ng-class="{'negative': vm.transaction.commission < 0}" ng-model="vm.transaction.commission" ng-change="vm.updateInvestmentDetails()" placeholder="Commission" required og-input-currency og-input-autoselect og-input-calculator>

			Amount
			<div ng-class="{'text-danger': vm.transaction.amount < 0}">{{vm.transaction.amount | currency}}

						Category
						Subcategory
						Memo
						Amount

							<ng-form name="categoryForm">

										<input name="category" class="form-control" ng-model="subtransaction.category" uib-typeahead="category as category.name for category in vm.categories($viewValue, 10)" ng-blur="vm.categorySelected($index)" typeahead-select-on-blur="true" typeahead-template-url="../../og-components/og-favourite/views/typeahead-suggestion.html" placeholder="Category" required og-input-autoselect>

							</ng-form>

							<ng-form name="accountForm">

										<input class="form-control" ng-disabled="!(vm.isString(subtransaction.category) || subtransaction.category.id > 0)" ng-model="subtransaction.subcategory" uib-typeahead="subcategory as subcategory.name for subcategory in vm.categories($viewValue, 10, subtransaction.category)" typeahead-select-on-blur="true" typeahead-template-url="../../og-components/og-favourite/views/typeahead-suggestion.html" placeholder="Subcategory" og-input-autoselect>

										<input name="account" class="form-control" ng-model="subtransaction.account" uib-typeahead="account as account.name for account in vm.accounts($viewValue, 10)" typeahead-editable="false" typeahead-select-on-blur="true" typeahead-template-url="../../og-components/og-favourite/views/typeahead-suggestion.html" placeholder="Account" required og-input-autoselect>

							</ng-form>

							<input class="form-control" ng-model="subtransaction.memo" placeholder="Memo" og-input-autoselect>

							<ng-form name="amountForm">

										<input name="amount" class="form-control text-right" ng-class="{'negative': (subtransaction.amount * (subtransaction.direction == vm.transaction.direction ? 1 : -1)) < 0}" ng-model="subtransaction.amount" placeholder="Amount" required og-input-currency og-input-autoselect og-input-calculator="right">

							</ng-form>

							<button class="btn btn-default" type="button" ng-click="vm.deleteSubtransaction($index)">

							</button>

							<button class="btn btn-xs btn-success" type="button" ng-click="vm.addSubtransaction()">
								 Add
							</button>

						Allocated
						{{vm.totalAllocated | currency}}

						Unallocated
						{{vm.transaction.amount - vm.totalAllocated | currency}}

			Memo
			<input id="memo" name="memo" class="form-control" ng-model="vm.transaction.memo" placeholder="Memo" og-input-autoselect>

					<input type="checkbox" ng-model="vm.schedule.estimate"> Amount is an estimate, because it varies

					<input type="checkbox" ng-model="vm.schedule.auto_enter"> Automatically enter this transaction on the due date

					<input type="checkbox" ng-model="vm.schedule.autoFlag"> Automatically flag this transaction when entered

				Flag Type
				<select name="flagType" class="form-control" ng-model="vm.schedule.flag_type">
					<option value="followup">Follow Up</option>
					<option value="noreceipt">No Receipt</option>
					<option value="taxdeductible">Tax Deductible</option>
				</select>

				<input name="flag" class="form-control" ng-model="vm.schedule.flag" placeholder="Flag" og-input-autoselect>

		{{vm.errorMessage}}

		<button class="btn btn-default" type="button" ng-click="vm.cancel()">Cancel</button>
		<button ng-switch-when="Enter Transaction" class="btn btn-primary" type="button" ng-click="vm.edit()"> Schedule</button>
		<button ng-switch-when="Enter Transaction" class="btn btn-warning" type="button" ng-click="vm.skip()"> Skip</button>
		<button ng-switch-when="Enter Transaction" class="btn btn-success" type="submit" ng-disabled="scheduleForm.$invalid" ng-click="vm.enter()"> Enter</button>
		<button ng-switch-default class="btn btn-primary" type="submit" ng-disabled="scheduleForm.$invalid" ng-click="vm.save()"> Save</button>

</form>


text:
/**
 * @author Jacky Nguyen <jacky@sencha.com>
 * @docauthor Jacky Nguyen <jacky@sencha.com>
 * @class Ext.Object
 *
 * A collection of useful static methods to deal with objects.
 *
 * @singleton
 */

(function() {

var ExtObject = Ext.Object = {

    /**
     * Converts a `name` - `value` pair to an array of objects with support for nested structures. Useful to construct
     * query strings. For example:
     *
     *     var objects = Ext.Object.toQueryObjects('hobbies', ['reading', 'cooking', 'swimming']);
     *
     *     // objects then equals:
     *     [
     *         { name: 'hobbies', value: 'reading' },
     *         { name: 'hobbies', value: 'cooking' },
     *         { name: 'hobbies', value: 'swimming' },
     *     ];
     *
     *     var objects = Ext.Object.toQueryObjects('dateOfBirth', {
     *         day: 3,
     *         month: 8,
     *         year: 1987,
     *         extra: {
     *             hour: 4
     *             minute: 30
     *         }
     *     }, true); // Recursive
     *
     *     // objects then equals:
     *     [
     *         { name: 'dateOfBirth[day]', value: 3 },
     *         { name: 'dateOfBirth[month]', value: 8 },
     *         { name: 'dateOfBirth[year]', value: 1987 },
     *         { name: 'dateOfBirth[extra][hour]', value: 4 },
     *         { name: 'dateOfBirth[extra][minute]', value: 30 },
     *     ];
     *
     * @param {String} name
     * @param {Object/Array} value
     * @param {Boolean} [recursive=false] True to traverse object recursively
     * @return {Array}
     */
    toQueryObjects: function(name, value, recursive) {
        var self = ExtObject.toQueryObjects,
            objects = [],
            i, ln;

        if (Ext.isArray(value)) {
            for (i = 0, ln = value.length; i < ln; i++) {
                if (recursive) {
                    objects = objects.concat(self(name + '[' + i + ']', value[i], true));
                }
                else {
                    objects.push({
                        name: name,
                        value: value[i]
                    });
                }
            }
        }
        else if (Ext.isObject(value)) {
            for (i in value) {
                if (value.hasOwnProperty(i)) {
                    if (recursive) {
                        objects = objects.concat(self(name + '[' + i + ']', value[i], true));
                    }
                    else {
                        objects.push({
                            name: name,
                            value: value[i]
                        });
                    }
                }
            }
        }
        else {
            objects.push({
                name: name,
                value: value
            });
        }

        return objects;
    },

    /**
     * Takes an object and converts it to an encoded query string.
     *
     * Non-recursive:
     *
     *     Ext.Object.toQueryString({foo: 1, bar: 2}); // returns "foo=1&bar=2"
     *     Ext.Object.toQueryString({foo: null, bar: 2}); // returns "foo=&bar=2"
     *     Ext.Object.toQueryString({'some price': '$300'}); // returns "some%20price=%24300"
     *     Ext.Object.toQueryString({date: new Date(2011, 0, 1)}); // returns "date=%222011-01-01T00%3A00%3A00%22"
     *     Ext.Object.toQueryString({colors: ['red', 'green', 'blue']}); // returns "colors=red&colors=green&colors=blue"
     *
     * Recursive:
     *
     *     Ext.Object.toQueryString({
     *         username: 'Jacky',
     *         dateOfBirth: {
     *             day: 1,
     *             month: 2,
     *             year: 1911
     *         },
     *         hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
     *     }, true); // returns the following string (broken down and url-decoded for ease of reading purpose):
     *     // username=Jacky
     *     //    &dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911
     *     //    &hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&hobbies[3][0]=nested&hobbies[3][1]=stuff
     *
     * @param {Object} object The object to encode
     * @param {Boolean} [recursive=false] Whether or not to interpret the object in recursive format.
     * (PHP / Ruby on Rails servers and similar).
     * @return {String} queryString
     */
    toQueryString: function(object, recursive) {
        var paramObjects = [],
            params = [],
            i, j, ln, paramObject, value;

        for (i in object) {
            if (object.hasOwnProperty(i)) {
                paramObjects = paramObjects.concat(ExtObject.toQueryObjects(i, object[i], recursive));
            }
        }

        for (j = 0, ln = paramObjects.length; j < ln; j++) {
            paramObject = paramObjects[j];
            value = paramObject.value;

            if (Ext.isEmpty(value)) {
                value = '';
            }
            else if (Ext.isDate(value)) {
                value = Ext.Date.toString(value);
            }

            params.push(encodeURIComponent(paramObject.name) + '=' + encodeURIComponent(String(value)));
        }

        return params.join('&');
    },

    /**
     * Converts a query string back into an object.
     *
     * Non-recursive:
     *
     *     Ext.Object.fromQueryString(foo=1&bar=2); // returns {foo: 1, bar: 2}
     *     Ext.Object.fromQueryString(foo=&bar=2); // returns {foo: null, bar: 2}
     *     Ext.Object.fromQueryString(some%20price=%24300); // returns {'some price': '$300'}
     *     Ext.Object.fromQueryString(colors=red&colors=green&colors=blue); // returns {colors: ['red', 'green', 'blue']}
     *
     * Recursive:
     *
     *       Ext.Object.fromQueryString("username=Jacky&dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911&hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&hobbies[3][0]=nested&hobbies[3][1]=stuff", true);
     *     // returns
     *     {
     *         username: 'Jacky',
     *         dateOfBirth: {
     *             day: '1',
     *             month: '2',
     *             year: '1911'
     *         },
     *         hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
     *     }
     *
     * @param {String} queryString The query string to decode
     * @param {Boolean} [recursive=false] Whether or not to recursively decode the string. This format is supported by
     * PHP / Ruby on Rails servers and similar.
     * @return {Object}
     */
    fromQueryString: function(queryString, recursive) {
        var parts = queryString.replace(/^\?/, '').split('&'),
            object = {},
            temp, components, name, value, i, ln,
            part, j, subLn, matchedKeys, matchedName,
            keys, key, nextKey;

        for (i = 0, ln = parts.length; i < ln; i++) {
            part = parts[i];

            if (part.length > 0) {
                components = part.split('=');
                name = decodeURIComponent(components[0]);
                value = (components[1] !== undefined) ? decodeURIComponent(components[1]) : '';

                if (!recursive) {
                    if (object.hasOwnProperty(name)) {
                        if (!Ext.isArray(object[name])) {
                            object[name] = [object[name]];
                        }

                        object[name].push(value);
                    }
                    else {
                        object[name] = value;
                    }
                }
                else {
                    matchedKeys = name.match(/(\[):?([^\]]*)\]/g);
                    matchedName = name.match(/^([^\[]+)/);

                    //<debug error>
                    if (!matchedName) {
                        Ext.Error.raise({
                            sourceClass: "Ext.Object",
                            sourceMethod: "fromQueryString",
                            queryString: queryString,
                            recursive: recursive,
                            msg: 'Malformed query string given, failed parsing name from "' + part + '"'
                        });
                    }
                    //</debug>

                    name = matchedName[0];
                    keys = [];

                    if (matchedKeys === null) {
                        object[name] = value;
                        continue;
                    }

                    for (j = 0, subLn = matchedKeys.length; j < subLn; j++) {
                        key = matchedKeys[j];
                        key = (key.length === 2) ? '' : key.substring(1, key.length - 1);
                        keys.push(key);
                    }

                    keys.unshift(name);

                    temp = object;

                    for (j = 0, subLn = keys.length; j < subLn; j++) {
                        key = keys[j];

                        if (j === subLn - 1) {
                            if (Ext.isArray(temp) && key === '') {
                                temp.push(value);
                            }
                            else {
                                temp[key] = value;
                            }
                        }
                        else {
                            if (temp[key] === undefined || typeof temp[key] === 'string') {
                                nextKey = keys[j+1];

                                temp[key] = (Ext.isNumeric(nextKey) || nextKey === '') ? [] : {};
                            }

                            temp = temp[key];
                        }
                    }
                }
            }
        }

        return object;
    },

    /**
     * Iterates through an object and invokes the given callback function for each iteration.
     * The iteration can be stopped by returning `false` in the callback function. For example:
     *
     *     var person = {
     *         name: 'Jacky'
     *         hairColor: 'black'
     *         loves: ['food', 'sleeping', 'wife']
     *     };
     *
     *     Ext.Object.each(person, function(key, value, myself) {
     *         console.log(key + ":" + value);
     *
     *         if (key === 'hairColor') {
     *             return false; // stop the iteration
     *         }
     *     });
     *
     * @param {Object} object The object to iterate
     * @param {Function} fn The callback function.
     * @param {String} fn.key
     * @param {Object} fn.value
     * @param {Object} fn.object The object itself
     * @param {Object} [scope] The execution scope (`this`) of the callback function
     */
    each: function(object, fn, scope) {
        for (var property in object) {
            if (object.hasOwnProperty(property)) {
                if (fn.call(scope || object, property, object[property], object) === false) {
                    return;
                }
            }
        }
    },

    /**
     * Merges any number of objects recursively without referencing them or their children.
     *
     *     var extjs = {
     *         companyName: 'Ext JS',
     *         products: ['Ext JS', 'Ext GWT', 'Ext Designer'],
     *         isSuperCool: true
     *         office: {
     *             size: 2000,
     *             location: 'Palo Alto',
     *             isFun: true
     *         }
     *     };
     *
     *     var newStuff = {
     *         companyName: 'Sencha Inc.',
     *         products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
     *         office: {
     *             size: 40000,
     *             location: 'Redwood City'
     *         }
     *     };
     *
     *     var sencha = Ext.Object.merge(extjs, newStuff);
     *
     *     // extjs and sencha then equals to
     *     {
     *         companyName: 'Sencha Inc.',
     *         products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
     *         isSuperCool: true
     *         office: {
     *             size: 30000,
     *             location: 'Redwood City'
     *             isFun: true
     *         }
     *     }
     *
     * @param {Object...} object Any number of objects to merge.
     * @return {Object} merged The object that is created as a result of merging all the objects passed in.
     */
    merge: function(source, key, value) {
        if (typeof key === 'string') {
            if (value && value.constructor === Object) {
                if (source[key] && source[key].constructor === Object) {
                    ExtObject.merge(source[key], value);
                }
                else {
                    source[key] = Ext.clone(value);
                }
            }
            else {
                source[key] = value;
            }

            return source;
        }

        var i = 1,
            ln = arguments.length,
            object, property;

        for (; i < ln; i++) {
            object = arguments[i];

            for (property in object) {
                if (object.hasOwnProperty(property)) {
                    ExtObject.merge(source, property, object[property]);
                }
            }
        }

        return source;
    },

    /**
     * Returns the first matching key corresponding to the given value.
     * If no matching value is found, null is returned.
     *
     *     var person = {
     *         name: 'Jacky',
     *         loves: 'food'
     *     };
     *
     *     alert(Ext.Object.getKey(person, 'food')); // alerts 'loves'
     *
     * @param {Object} object
     * @param {Object} value The value to find
     */
    getKey: function(object, value) {
        for (var property in object) {
            if (object.hasOwnProperty(property) && object[property] === value) {
                return property;
            }
        }

        return null;
    },

    /**
     * Gets all values of the given object as an array.
     *
     *     var values = Ext.Object.getValues({
     *         name: 'Jacky',
     *         loves: 'food'
     *     }); // ['Jacky', 'food']
     *
     * @param {Object} object
     * @return {Array} An array of values from the object
     */
    getValues: function(object) {
        var values = [],
            property;

        for (property in object) {
            if (object.hasOwnProperty(property)) {
                values.push(object[property]);
            }
        }

        return values;
    },

    /**
     * Gets all keys of the given object as an array.
     *
     *     var values = Ext.Object.getKeys({
     *         name: 'Jacky',
     *         loves: 'food'
     *     }); // ['name', 'loves']
     *
     * @param {Object} object
     * @return {String[]} An array of keys from the object
     * @method
     */
    getKeys: ('keys' in Object.prototype) ? Object.keys : function(object) {
        var keys = [],
            property;

        for (property in object) {
            if (object.hasOwnProperty(property)) {
                keys.push(property);
            }
        }

        return keys;
    },

    /**
     * Gets the total number of this object's own properties
     *
     *     var size = Ext.Object.getSize({
     *         name: 'Jacky',
     *         loves: 'food'
     *     }); // size equals 2
     *
     * @param {Object} object
     * @return {Number} size
     */
    getSize: function(object) {
        var size = 0,
            property;

        for (property in object) {
            if (object.hasOwnProperty(property)) {
                size++;
            }
        }

        return size;
    }
};

/**
 * A convenient alias method for {@link Ext.Object#merge}.
 *
 * @member Ext
 * @method merge
 * @alias Ext.Object#merge
 */
Ext.merge = Ext.Object.merge;

/**
 * Alias for {@link Ext.Object#toQueryString}.
 *
 * @member Ext
 * @method urlEncode
 * @alias Ext.Object#toQueryString
 * @deprecated 4.0.0 Use {@link Ext.Object#toQueryString} instead
 */
Ext.urlEncode = function() {
    var args = Ext.Array.from(arguments),
        prefix = '';

    // Support for the old `pre` argument
    if ((typeof args[1] === 'string')) {
        prefix = args[1] + '&';
        args[1] = false;
    }

    return prefix + Ext.Object.toQueryString.apply(Ext.Object, args);
};

/**
 * Alias for {@link Ext.Object#fromQueryString}.
 *
 * @member Ext
 * @method urlDecode
 * @alias Ext.Object#fromQueryString
 * @deprecated 4.0.0 Use {@link Ext.Object#fromQueryString} instead
 */
Ext.urlDecode = function() {
    return Ext.Object.fromQueryString.apply(Ext.Object, arguments);
};

})();


text:
var GLOBALS = require('GLOBALS');

module.exports = function() {
	function presetModel() {
		Ti.App.Properties.setString('MODEL2', Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'model', 'model_template.json').read().text);
	}

	function presetUI() {
		Ti.App.Properties.setString('UI2', Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'model', 'ui_template.json').read().text);
	}

	var self = Ti.UI.createView({
		backgroundColor : 'white',
	});
	if (!Ti.App.Properties.hasProperty('MODEL2')) {
		presetModel();
	}
	if (!Ti.App.Properties.hasProperty('UI2')) {
		presetUI();
	}
	var model = Ti.App.Properties.getString('MODEL2');
	var ui = Ti.App.Properties.getString('UI2');

	var ModelField = Ti.UI.createTextArea({
		value : model,
		top : 10,
		font : {
			fontFamily : 'monospace',
			fontSize : 16
		},
		color : 'black',
		width : Ti.UI.FILL,
		height : 400
	});
	self.add(ModelField);
	var UIField = Ti.UI.createTextArea({
		value : ui,
		top : 410,
		font : {
			fontFamily : 'monospace',
			fontSize : 16
		},
		color : 'black',
		width : Ti.UI.FILL,
		height : 400,
		borderWidth : 1,
		borderColor : 'yellow',
		borderRadius : 5
	});
	self.add(ModelField);
	ModelField.add(Ti.UI.createLabel({
		top : 10,
		font : {
			fontSize : 60,
			fontWeight : 'bold'
		},
		color : 'black',
		touchEnabled : false,
		opacity : 0.2,
		text : 'Model'
	}));
	self.add(UIField);
	UIField.add(Ti.UI.createLabel({
		top : 10,
		font : {
			fontSize : 60,
			fontWeight : 'bold'
		},
		color : 'black',
		touchEnabled : false,
		opacity : 0.2,
		text : 'UI Styles'
	}));

	var buttonBar = Ti.UI.createView({
		bottom : 0,
		height : 50,
		layout : 'horizontal'
	});
	self.add(buttonBar);
	var button1 = Ti.UI.createButton({
		left : 10,
		title : 'Show PDF',
		height : 50,
		width : '45%'
	});
	buttonBar.add(button1);
	var button2 = Ti.UI.createButton({
		left : 10,
		width : '45%',
		title : 'Mailing of PDF'
	});
	buttonBar.add(button2);

	button1.addEventListener('click', function() {
		var valide = true;
		try {
			JSON.parse(ModelField.getValue());
			Ti.App.Properties.setString('MODEL2', ModelField.getValue());
		} catch(E) {
			alert('Ungültige JSON für Daten');
			valide = false;
			//presetModel();
		};
		try {
			JSON.parse(UIField.getValue());
			Ti.App.Properties.setString('UI2', UIField.getValue());
		} catch(E) {
			alert('Ungültige JSON für Template');
			valide = false;
			//presetUI();
		};
		if (valide) {
			var pdfFile = require('controls/pdfgenerator/index')(ModelField.getValue(), UIField.getValue());
			require('ui/pdfpreview.window')(pdfFile);
		}

	});
	button2.addEventListener('click', function() {
		Ti.App.Properties.setString('MODEL2', jsonField.getValue());
		var nr = Ti.App.Properties.getInt('nr', 0);
		const EMAIL = ['rs@hamburger-appwerft.de'],
		    BCC = ['rs@hamburger-appwerft.de'],
		    SUBJECT = 'New invoice №' + nr,
		    BODY = "Vielen Dank für den Auftrag, den ich hoffentlich zu Ihrer allergrößten Zugfriedenheit "erledigt" habe … Anbei die entsprechenden Bemerkungen, die ich geflissentlich anbiete";
		var pdfFile = require('controls/pdfgenerator')(jsonField.getValue());
		if (pdfFile) {
			if (GLOBALS.isIOS) {
				var emailDialog = Ti.UI.createEmailDialog();
				if (emailDialog.isSupported()) {
					emailDialog.subject = SUBJECT;
					emailDialog.toRecipients = EMAIL;
					emailDialog.messageBody = BODY;
					emailDialog.addAttachment(pdfFile);
					emailDialog.addEventListener('complete', function() {
						console.log('Info: PDF successful sendet');
					});
					emailDialog.open();
				} else {
					console.log('Info: on this device is not mail app configured');
				}
			}
			if (GLOBALS.isAndroid) {
				var intent = Ti.Android.createIntent({
					action : Ti.Android.ACTION_SEND,
					packageName : 'com.google.android.gm',
					type : 'application/octet-stream',
				});
				// https://gist.github.com/adumont/8040008
				intent.putExtra(Ti.Android.EXTRA_EMAIL, EMAIL);
				intent.putExtra(Ti.Android.EXTRA_SUBJECT, SUBJECT);
				intent.putExtra(Ti.Android.EXTRA_TEXT, BODY);
				intent.putExtraUri(Ti.Android.EXTRA_STREAM, pdfFile.nativePath);
				Ti.Android.currentActivity.startActivityForResult(intent, function(e) {
					console.log(_e);
				});
			}
			Ti.App.Properties.setInt('nr', nr + 1);
		}

	});
	return self;
};
/*
 https://gist.github.com/dawsontoth/832488

 * */


text:
{% load seahub_tags avatar_tags i18n %}

            {{ info_commit.props.desc|translate_commit_desc }}
            {% trans "Details"%}

            {% if info_commit.props.creator_name %}
                {% avatar info_commit.props.creator_name 20 %}
                {{ info_commit.creator_name|email2nickname }}
            {% else %}
                {% trans "Unknown"%}
            {% endif %}
            {{ info_commit.props.ctime|translate_seahub_time }}

        {% trans "History"%}


text:
// Copyright 2012 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @fileoverview Lightweight helper library for animation.
 * @author jered@google.com (Jered Wierzbicki)
 */

goog.provide('turing.anim');

goog.require('turing.sprites');
goog.require('turing.util');

/**
 * Iff true, do not schedule any more animations.
 * @type {boolean}
 * @private
 */
turing.anim.stopped_ = true;

/**
 * A list of pending animation frames.
 * @type {Array.<Object>}
 * @private
 */
turing.anim.queue_ = [];

/**
 * True iff there were more frames queued this tick and the queue needs to be
 * resorted.
 * @type {boolean}
 * @private
 */
turing.anim.queueDirty_ = false;

/**
 * The current animation tick.
 * @type {number}
 * @private
 */
turing.anim.curTick_ = 0;

/**
 * The next event id.
 * @private
 * @type {number}
 */
turing.anim.eventId_ = 1;

/**
 * The time when the last animation tick started.
 * @type {number}
 * @private
 */
turing.anim.lastTickStartTime_ = 0;

/**
 * A count of recent ticks which were were longer than the current target.
 * @type {number}
 * @private
 */
turing.anim.tooSlowTicks_ = 0;

/**
 * Inverse of the maximum frame rate (60 Hz).
 * @type {number}
 * @private
 * @const
 */
turing.anim.MAX_FPS_MS_ = 1000 / 60;

/**
 * Inverse of the minimum frame rate (20 Hz).
 * The game is functional, but really laggy to play below this frame rate. We'll
 * never schedule animations slower than this.
 * @type {number}
 * @private
 * @const
 */
turing.anim.MIN_FPS_MS_ = 1000 / 20;

/**
 * The interval at which the next frame will be rescheduled. This is controlled
 * by throttleFrameRate_.
 * @type {number}
 * @private
 */
turing.anim.msPerFrame_ = turing.anim.MAX_FPS_MS_;

/**
 * The name of the CSS3 transition property, or undefined if transitions are
 * unsupported.
 * @type {string|undefined}
 * @private
 */
turing.anim.transitionPropertyName_ = turing.util.getVendorCssPropertyName(
    'transition');

/**
 * Map from CSS properties we know how to animate to the units we expect will be
 * attached. Used to trim units off and add them back when interpolating values.
 * @type {Object.<string, string>}
 */
turing.anim.UNITS = {
  'top': 'px',
  'left': 'px'
};

/**
 * How to schedule the next animation frame.
 * @type {function(function())}
 */
window['requestAnimationFrame'] = (function() {
  return window['requestAnimationFrame'] ||
      window['webkitRequestAnimationFrame'] ||
      window['mozRequestAnimationFrame'] ||
      window['oRequestAnimationFrame'] ||
      window['msRequestAnimationFrame'] ||
      function(callback) {
        // Binding this on window because Chrome gets cross if we do not.
        // If we have nothing better, just do a setTimeout; the caller should be
        // careful to check turing.anim.stopped_. It is not checked here because
        // it'd be weird to export that behavior.
        window.setTimeout(callback, turing.anim.msPerFrame_);
      };
})();

/**
 * @param {number} duration A duration in ms.
 * @return {number} The corresponding number of ticks at the current frame rate.
 * @private
 */
turing.anim.getNumTicks_ = function(duration) {
  return Math.ceil(duration / turing.anim.msPerFrame_);
};

/**
 * Schedules callback to be run after a duration in ms.
 * @param {function()} callback The function to call when delay is elapsed.
 * @param {number} duration How long to wait in ms.
 * @return {number} An id for the event to be delayed.
 */
turing.anim.delay = function(callback, duration) {
  // Count ticks to wait based on the current frame rate.
  return turing.anim.delayTicks(callback,
      turing.anim.getNumTicks_(duration));
};

/**
 * Schedules callback to be run after a duration in animation ticks.
 * @param {function()} callback The function to call when delay is elapsed.
 * @param {number} ticksToWait How long to wait in animation loop ticks.
 * @return {number} An id for the event to be delayed.
 */
turing.anim.delayTicks = function(callback, ticksToWait) {
  var eventId = turing.anim.eventId_++;
  turing.anim.queue_.push({
    ticks: turing.anim.curTick_ + ticksToWait,
    call: callback,
    eventId: eventId
  });
  turing.anim.queueDirty_ = true;
  return eventId;
};

/**
 * Cancels a pending event previously scheduled with some delay.
 * @param {number} eventId The id of the event in the animation queue.
 */
turing.anim.cancel = function(eventId) {
  for (var i = 0; i < turing.anim.queue_.length; i++) {
    if (turing.anim.queue_[i].eventId == eventId) {
      turing.anim.queue_.splice(i, 1);
      return;
    }
  }
};

/**
 * Animates CSS properties on an element.
 * @param {Element} elem The element to animate.
 * @param {Object.<string, string>} properties CSS property names -> new values.
 * @param {number} duration How long the animation should run.
 * @param {function()=} opt_doneCallback Called when animation is done.
 */
turing.anim.animate = function(elem, properties, duration, opt_doneCallback) {
  var initialValue = {};
  var finalValue = {};
  for (var name in properties) {
    initialValue[name] = parseFloat(elem.style[name] || 0);
    finalValue[name] = parseFloat(properties[name]);
  }
  // Schedule ticks based on the current frame rate.
  var numTicks = turing.anim.getNumTicks_(duration);
  for (var tick = 0; tick <= numTicks; tick++) {
    var progress = Math.min(1, tick / numTicks);
    for (var name in properties) {
      turing.anim.delayTicks(goog.bind(function(progress) {
        var interp = (1 - progress) * initialValue[name] +
            progress * finalValue[name];
        var value = interp + (turing.anim.UNITS[name] || '');
        elem.style[name] = value;
      }, window, progress), tick);
    }
  }
  if (opt_doneCallback) {
    turing.anim.delayTicks(opt_doneCallback, numTicks);
  }
};

/**
 * Sets the CSS3 transition property for an element or does nothing if
 * transitions aren't supported.
 * @param {Element} elem The element to set transition for.
 * @param {string} transitionValue The css value for transition.
 */
turing.anim.setTransitionStyle = function(elem, transitionValue) {
  if (turing.anim.transitionPropertyName_) {
    elem.style[turing.anim.transitionPropertyName_] = transitionValue;
  }
};

/**
 * Clears CSS3 transitions on elem.
 * @param {Element} elem The element to clear transitions for.
 */
turing.anim.clearTransitionStyle = function(elem) {
  // Opera doesn't seem to completely support removing an animation
  // (setting it to 'none' still causes a delay when changing the left
  // offset), so instead set a dummy property to animate for.
  turing.anim.setTransitionStyle(elem, 'clear 0ms linear');
};

/**
 * Animates changing the sprite used for an element background.  Goes through
 * the background list, retrieving the sprite background, and then calls
 * animateThroughBackgrounds.
 * @param {Element} elem The element to animate.
 * @param {Array.<string>} spriteNames The names of the desired elements in the
 *     sprite to iterate through.
 * @param {number} duration How long the animation should run.
 * @param {function()=} opt_doneCallback Called when animation is done.
 */
turing.anim.animateFromSprites = function(elem, spriteNames, duration,
    opt_doneCallback) {
  var backgrounds = [];
  for (var i = 0; i < spriteNames.length; i++) {
    backgrounds[i] = turing.sprites.getBackground(spriteNames[i]);
  }
  turing.anim.animateThroughBackgrounds(
      elem, backgrounds, duration, opt_doneCallback);
};

/**
 * Animates changing the backgrounds of an element.
 * @param {Element} elem The element to animate.
 * @param {Array.<string>} backgrounds The CSS backgrounds to iterate through.
 * @param {number} duration How long the animation should run.
 * @param {function()=} opt_doneCallback Called when animation is done.
 */
turing.anim.animateThroughBackgrounds = function(elem, backgrounds, duration,
    opt_doneCallback) {
  // Schedule ticks based on the current frame rate.
  var numTicks = turing.anim.getNumTicks_(duration);
  for (var tick = 0; tick <= numTicks; tick++) {
    var progress = Math.min(1, tick / numTicks);
    turing.anim.delayTicks(goog.bind(function(progress) {
      elem.style.background = backgrounds[
          Math.min(backgrounds.length - 1,
                   Math.floor(progress * backgrounds.length))];
    }, window, progress), tick);
  }
  if (opt_doneCallback) {
    turing.anim.delayTicks(opt_doneCallback, numTicks);
  }
};

/**
 * A monolithic animation loop implemented using requestAnimationFrame. At each
 * tick, it runs any functions deferred til this tick.
 *
 * All deferred calls are scheduled to run from this loop so that the game
 * simulation and animation update synchronously without being explicitly
 * stitched together through callbacks everywhere.
 *
 * We also tried an asynchronous approach, using CSS3 transitions and
 * requestAnimationFrame to update animations and separate setTimeout calls to
 * run the game. This performed better, but degraded poorly; there were odd
 * skips in animation, and weird behavior when changing browser tabs since
 * requestAnimationFrame and setTimeout turn down differently. With this
 * approach, the game slows down uniformly under load.
 *
 * @private
 */
turing.anim.loop_ = function() {
  window.requestAnimationFrame(function step() {
    if (turing.anim.stopped_) {
      return;
    }
    // Note we must do this even when using requestAnimationFrame, because it
    // isn't 60 Hz everywhere, and we may need to throttle down to its actual
    // rate for our delays to make sense.
    turing.anim.throttleFrameRate_();
    if (turing.anim.queueDirty_) {
      // We'd like to keep frames in a priority queue but don't want to bother,
      // so just sort the frame queue when it changes.
      turing.anim.queue_.sort(function(a, b) {
        if (a.ticks == b.ticks) {
          // Guarantee the sort is stable.
          return a.eventId - b.eventId;
        }
        return a.ticks - b.ticks;
      });
      turing.anim.queueDirty_ = false;
    }
    var numFrames = 0;
    for (var i = 0, frame; frame = turing.anim.queue_[i]; i++) {
      if (frame.ticks <= turing.anim.curTick_) {
        frame.call();
        numFrames++;
      } else {
        break;
      }
    }
    turing.anim.queue_.splice(0, numFrames);
    turing.anim.curTick_++;
    window.requestAnimationFrame(step);
  });
};

/**
 * Measures and controls the interval between frames.
 * @private
 */
turing.anim.throttleFrameRate_ = function() {
  var tickStartTime = new Date().getTime();
  // At the start of the doodle, wait until things stabilize a bit (i.e. the
  // page finishes loading) before throttling the frame rate. Arbitrarily guess
  // this happens after 30 frames (which is nominally ~0.5 seconds).
  // Also check that lastTickStartTime is non-zero, since it will be reset to
  // zero if the animation loop is stopped for any reason (and then tickLength
  // below would be invalid).
  if (turing.anim.curTick_ > 30 && turing.anim.lastTickStartTime_) {
    var tickLength = tickStartTime - turing.anim.lastTickStartTime_;
    if (tickLength >= 1.05 * turing.anim.msPerFrame_) {
      // The last tick was too slow.
      turing.anim.tooSlowTicks_++;
    } else {
      // The last tick was within tolerance.
      turing.anim.tooSlowTicks_ = turing.anim.tooSlowTicks_ >> 1;
    }
    if (turing.anim.tooSlowTicks_ > 20) {
      // Animation consistently isn't making our target frame rate; slow down
      // frame rate by 20% up to a minimum frame rate.
      turing.anim.msPerFrame_ = Math.min(turing.anim.MIN_FPS_MS_,
          turing.anim.msPerFrame_ * 1.2);
      turing.anim.tooSlowTicks_ = 0;
    }
  }
  turing.anim.lastTickStartTime_ = tickStartTime;
};

/**
 * Start animation loop.
 */
turing.anim.start = function() {
  turing.anim.stopped_ = false;
  turing.anim.loop_();
};

/**
 * Resets controller state for frames-per-second throttling.
 * @private
 */
turing.anim.resetFpsController_ = function() {
  turing.anim.tooSlowTicks_ = 0;
  // Wait for a tick before measuring the interval between two ticks.
  turing.anim.lastTickStartTime_ = 0;
};

/**
 * Emergency brake; stop animation loop next time through.
 */
turing.anim.stop = function() {
  turing.anim.stopped_ = true;
  turing.anim.resetFpsController_();
};

/**
 * Stops the animation loop and cancels any queued animations.
 */
turing.anim.reset = function() {
  turing.anim.stop();
  turing.anim.queue_ = [];
  turing.anim.curTick_ = 0;
  turing.anim.queueDirty_ = false;
  turing.anim.eventId_ = 1;
  turing.anim.msPerFrame_ = turing.anim.MAX_FPS_MS_;
  turing.anim.resetFpsController_();
};

/**
 * @return {boolean} True iff animations are stopped.
 */
turing.anim.isStopped = function() {
  return turing.anim.stopped_;
};


text:
from distutils.core import setup

def readme():
    with open('README.rst') as f:
        return f.read()

setup(
    name='kaira',
    version='0.2.3',
    packages=['kaira', 'kaira.routing'],
    url='https://github.com/mulonemartin/kaira/',
    license='MIT',
    author='Martin Mulone',
    author_email='mulone.martin@gmail.com',
    description='Web Micro framework - Python',
    long_description=readme(),
    install_requires=[
              'whitenoise', 'wtforms', 'multidict'
    ],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Topic :: Internet :: WWW/HTTP',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6'
    ],
    include_package_data=True,
    zip_safe=False
)


text:
import paramiko
import pw

host=pw.hn
port = 22
username=pw.un
password=pw.pw

def getSSH():
  thisShell=paramiko.SSHClient()
  #
  #The next line is iffy if you are not sure what you are connecting to.
  #It should really only be used in an environment where you control
  #the server as well, but this is hacky and for personal use, so I am going
  #to set it to automatically trust the remote computer.
  thisShell.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  thisShell.connect(host, username=username, password=password)
  return thisShell


text:
<?php
declare(strict_types=1);

namespace Cake\TestSuite\Constraint\Response;

/**
 * BodyContains
 *
 * @internal
 */
class BodyNotContains extends BodyContains
{
    /**
     * Checks assertion
     *
     * @param mixed $other Expected type
     * @return bool
     */
    public function matches($other): bool
    {
        return parent::matches($other) === false;
    }

    /**
     * Assertion message
     *
     * @return string
     */
    public function toString(): string
    {
        return 'is not in response body';
    }
}


text:
layout: post
title:  "Notations Of Concurrent And Distributed Programming"
author: erkan
categories: [ Yazılım ]
image: assets/images/concurrent.png
featured:false
---
I am taking Concurrent and Distributed Programming lecture in my Erasmus+ journey. End of the lecture, there will be final exam
about mostly explation of some notations concerning Concurrent And Distributed Programming. Hence I decided to write whole
notation in this lecture here.

![Photo of Main](https://user-images.githubusercontent.com/9788440/35019354-baf8e6fa-fb26-11e7-84b2-a9dc5a5792e0.png)

__Process:__ is an instance of a computer program that is being executed. It contains the program code and its current activity

__Thread:__ is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system.

__Parallel__ ↔ processes overlap in time (they are executed on different processors)

__Concurrent__ ↔ processes can overlap in time but not necessary (they are executed on one or more processors).

__Distributed__ ↔ processes overlap in time (they are executed on
distributed processors, for example, in
computer clusters) .

* distributed system → computers in the network(Internet)
* parallel system → multicore processors

__Flynn's taxonomy for a classification of computer
architectures__

* __SISD__ (Single Instruction Stream – Single Data Stream)
von Neumann Architecture.
* __MIMD__ (Multiple Instruction Stream – Multiple Data Stream)
Multiprocessor Systems.
* __SIMD__ (Single Instruction Stream – Multiple Data Stream)
Vector Processors.
* __MISD__ (Multiple Instruction Stream – Single Data Stream)
Distributed systems.

__Critical section:__ In concurrent programming, a critical section is a part of a multi-process (multi-thread) program that may not be concurrently executed by more than one of the program's processes (threads). In other words, it is a piece of a program that requires mutual exclusion of access.

__Mutual exclusion:__ is a property of concurrency control, which is instituted for the purpose of preventing race conditions; it is the requirement that one thread of execution never enter its critical section at the same time that another concurrent thread of execution enters its own critical section.

__Deadlock:__ In concurrent programming, a deadlock is a situation in which two or
more competing actions are each waiting for the other to finish, and
thus neither ever does.

__Semaphore:__ an abstract data type that is used for controlling access, by multiple processes, to a common resource in a concurrent system.

__Cyclic Barrier:__  A class that is used to implement a scenario where one thread waits for one or more threads to complete there job before starts processing.

Notations: Critical Section, Remote, ORB
Groups: Multithread Programming, RMI, CORBA

3 Tasks: Multi-thread program, Socket-based program, JSP program.