text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.repay.android"
    android:installLocation="auto">

    <uses-permission android:name="android.permission.READ_CONTACTS" />
	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:name=".Application"
        android:hardwareAccelerated="true"
        android:icon="@drawable/ic_launcher"
		android:logo="@drawable/ic_actionbar_logo"
        android:theme="@style/AppTheme">

        <activity
            android:name="com.repay.android.MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name="com.repay.android.adddebt.AddDebtActivity"
            android:label="@string/title_activity_add_debt"
            android:parentActivityName="com.repay.android.MainActivity"
            android:windowSoftInputMode="stateHidden" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.repay.android.MainActivity" />
        </activity>

        <activity
            android:name="com.repay.android.adddebt.RepayDebtActivity"
            android:label="@string/title_activity_add_debt"
            android:parentActivityName="com.repay.android.MainActivity"
            android:windowSoftInputMode="stateHidden" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.repay.android.MainActivity" />
        </activity>

        <activity
            android:name="com.repay.android.adddebt.EditDebtActivity"
            android:label="@string/title_activity_add_debt"
            android:parentActivityName="com.repay.android.MainActivity"
            android:windowSoftInputMode="stateHidden" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.repay.android.MainActivity" />
        </activity>

        <activity
            android:name=".frienddetails.FriendActivity"
            android:label="@string/title_activity_frienddetails"
            android:parentActivityName="com.repay.android.MainActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.repay.android.MainActivity" />
        </activity>

        <activity
            android:name="com.repay.android.settings.SettingsActivity"
            android:label="@string/settings_activity_title"
            android:parentActivityName="com.repay.android.MainActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.repay.android.MainActivity" />
        </activity>
    </application>

</manifest>

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Class for ...
 *
 * @author Jens Wiese <jens@howtrueisfalse.de>
 * @since 2013-05-10
 */

namespace Phpteda\Generator\Configuration;

interface PropertyInterface
{
    /**
     * @param string $name
     */
    public function setName($name);

    /**
     * @return string
     */
    public function getName();

    /**
     * @param string $question
     */
    public function setQuestion($question);

    /**
     * @return string
     */
    public function getQuestion();

    /**
     * @param mixed $value
     */
    public function setValue($value);

    /**
     * @return mixed
     */
    public function getValue();
}


text:
<?php

namespace Mellivora\Database\Eloquent;

use RuntimeException;

class JsonEncodingException extends RuntimeException
{
    /**
     * Create a new JSON encoding exception for the model.
     *
     * @param mixed  $model
     * @param string $message
     *
     * @return static
     */
    public static function forModel($model, $message)
    {
        return new static('Error encoding model [' . get_class($model) . '] with ID [' . $model->getKey() . '] to JSON: ' . $message);
    }
}


text:
using CommandLine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KeePassDPG.Compressor
{
    internal class Options
    {
        [Option('s', "source", Required = true, HelpText = "Source file name.")]
        public string? Source { get; set; }

        [Option('o', "output", Required = false, HelpText = "Output path.")]
        public string? Output { get; set; }
    }
}


text:
package org.apache.ignite.internal.processors.rest.client.message;

import java.util.*;

/**
 *
 */
public class GridRouterResponse extends GridClientAbstractMessage {
    /** */
    private static final long serialVersionUID = 0L;

    /** Raw message. */
    private final byte[] body;

    /** Error message. */
    private final String errMsg;

    /** Status. */
    private final int status;

    /**
     * @param body Message in raw form.
     * @param clientId Client id.
     * @param reqId Request id.
     * @param destId Destination where this message should be delivered.
     */
    public GridRouterResponse(byte[] body, Long reqId, UUID clientId, UUID destId) {
        this.body = body;
        errMsg = null;
        status = GridClientResponse.STATUS_SUCCESS;

        destinationId(destId);
        clientId(clientId);
        requestId(reqId);
    }

    /**
     * @return Response body.
     */
    public byte[] body() {
        return body;
    }

    /**
     * @return Error message.
     */
    public String errorMessage() {
        return errMsg;
    }

    /**
     * @return Status.
     */
    public int status() {
        return status;
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return "GridRouterResponse [" +
            "clientId=" + clientId() +
            ", reqId=" + requestId() +
            ", destId=" + destinationId() +
            ", status=" + status +
            ", errMsg=" + errorMessage() + "]";
    }
}


text:
from django.views.generic import ListView
from django.db.models import get_model
from django import http
from django.shortcuts import get_object_or_404

from oscar.apps.offer.models import ConditionalOffer, Range

Product = get_model('catalogue', 'Product')

class OfferListView(ListView):
    model = ConditionalOffer
    context_object_name = 'offers'
    template_name = 'offer/list.html'

    def get_queryset(self):
        return ConditionalOffer.active.filter(
            offer_type=ConditionalOffer.SITE)

class OfferDetailView(ListView):
    context_object_name = 'products'
    template_name = 'offer/detail.html'
    paginate_by = 20

    def get(self, request, *args, **kwargs):
        try:
            self.offer = ConditionalOffer.objects.select_related().get(
                slug=self.kwargs['slug'])
        except ConditionalOffer.DoesNotExist:
            raise http.Http404
        return super(OfferDetailView, self).get(request, *args, **kwargs)

    def get_context_data(self, **kwargs):
        ctx = super(OfferDetailView, self).get_context_data(**kwargs)
        ctx['offer'] = self.offer
        ctx['upsell_message'] = self.offer.get_upsell_message(
            self.request.basket)
        return ctx

    def get_queryset(self):
        return self.offer.products()

class RangeDetailView(ListView):
    template_name = 'offer/range.html'
    context_object_name = 'products'

    def dispatch(self, request, *args, **kwargs):
        self.range = get_object_or_404(
            Range, slug=kwargs['slug'], is_public=True)
        return super(RangeDetailView, self).dispatch(
            request, *args, **kwargs)

    def get_queryset(self):
        return self.range.included_products.all()

    def get_context_data(self, **kwargs):
        ctx = super(RangeDetailView, self).get_context_data(**kwargs)
        ctx['range'] = self.range
        return ctx


text:
@interface VXFakeModalView ()
@property (nonatomic, retain) UIViewController *rootVC;
@end
@implementation VXFakeModalView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

-(instancetype)init {
    self = [super init];
    if (self) {

        [self setBackgroundColor: [UIColor clearColor]];
        _rootVC = self.rootVC = [[[[UIApplication sharedApplication] delegate] window] rootViewController] ;
        self.frame = _rootVC.view.bounds; // to make this view the same size as the application

		_background = [[UIView alloc] initWithFrame:self.bounds];
        [_background setBackgroundColor:[UIColor blackColor]];
        [_background setOpaque:NO];
        [_background setAlpha:0.7]; // make the background semi-transparent

        CGRect screenSize = [[UIScreen mainScreen] bounds];
		double margin = 30.0f;

		_webView = [[UIWebView alloc] initWithFrame:CGRectMake(margin, margin, screenSize.size.width - 2 * margin, screenSize.size.height - 2 * margin)];
		_webView.opaque= YES;
		_webView.backgroundColor= [UIColor blackColor];

		UIButton *button=[[UIButton alloc] init];

		button.frame = screenSize;

		[button addTarget:self action:@selector(close) forControlEvents:UIControlEventTouchUpInside];

        [self addSubview:_background]; // add the background
        [self addSubview:button];
		[self addSubview:_webView]; // add the web view on top of it
    }
    return self;
}

-(void)showWithHtml:(NSString*)pContent {
	// get baseurl - ensures display of images
	NSString *path = [[NSBundle mainBundle] bundlePath];
	NSURL *baseURL = [NSURL fileURLWithPath:path];

	// display if there is a html
	if (pContent) {
		[self.webView loadHTMLString:pContent baseURL:baseURL];
	}

	double pInterval = 8.0;
	[self performSelector:@selector(close) withObject:nil afterDelay:pInterval];

    [self.rootVC.view addSubview:self]; // show the fake modal view
}

-(void)close {

    [self removeFromSuperview]; // hide the fake modal view
}

@end


text:
/**
 * (created at 2011-5-20)
 */
package fm.liu.timo.parser.ast.stmt.dal;

import fm.liu.timo.parser.ast.expression.primary.Identifier;
import fm.liu.timo.parser.visitor.Visitor;

/**
 * @author QIU Shuo
 */
public class ShowCreate extends DALShowStatement {
    /** enum name must equals to real sql string */
    public static enum Type {
        DATABASE, EVENT, FUNCTION, PROCEDURE, TABLE, TRIGGER, VIEW
    }

    private final Type       type;
    private final Identifier id;

    public ShowCreate(Type type, Identifier id) {
        this.type = type;
        this.id = id;
    }

    public Type getType() {
        return type;
    }

    public Identifier getId() {
        return id;
    }

    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }
}


text:
namespace ME3D
{

class I_SceneSystem
{
public:
	I_SceneSystem() {}
	virtual ~I_SceneSystem() {}

	virtual void Initialize() = 0;

	virtual void CleanUp() = 0;

	virtual void NewScene() = 0;
	virtual void OpenScene( String& filePath ) = 0;
	virtual void SaveScene() = 0;
	virtual void SaveSceneAs( String& filePath ) = 0;

	virtual void StoreScene() = 0;
	virtual void RestoreScene() = 0;

	virtual bool HasSceneFilePath() = 0;

	virtual void Start() = 0;
	virtual void Update( float deltaTime ) = 0;

	virtual GameObject*	NewGameObject( String name ) = 0;
	virtual GameObject*	Instantiate( GameObject* prefab ) = 0;
	virtual GameObject*	Duplicate( GameObject* object ) = 0;
	virtual GameObject*	Find( String name ) = 0;
	virtual GameObject*	Find( uint objectIndex ) = 0;
	virtual void		Destroy( uint objectIndex ) = 0;

	// getters
	virtual GameObject*	GetMainCamera() = 0;
	virtual Material*	GetSkyboxMaterial() = 0;
	virtual float		GetSkyboxSize() = 0;
	virtual Scene*		GetCurrentScene() = 0;

	// setters
	virtual void SetMainCamera( String name ) = 0;
	virtual void SetSkyboxMaterial( Material* value ) = 0;
	virtual void SetSkyboxSize( float value ) = 0;

// scripting
public:
	GameObject* S_NewGameObject( const char* name );
	GameObject* S_Instantiate( GameObject* prefab );
	GameObject* S_FindByName( const char* name );
	GameObject* S_FindByIndex( uint objectIndex );

	GameObject*	S_GetMainCamera();
	Material*	S_GetSkyboxMaterial();
	float		S_GetSkyboxSize();

	void S_SetMainCamera( const char* name );
	void S_SetSkyboxMaterial( Material* value );
	void S_SetSkyboxSize( float value );
};

}


text:
using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace DaaSDemo.KubeClient.Models
{
    /// <summary>
    ///     APIServiceList is a list of APIService objects.
    /// </summary>
    public class APIServiceListV1Beta1 : KubeResourceListV1
    {
        /// <summary>
        ///     Description not provided.
        /// </summary>
        [JsonProperty("items", NullValueHandling = NullValueHandling.Ignore)]
        public List<APIServiceV1Beta1> Items { get; set; } = new List<APIServiceV1Beta1>();
    }
}


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.2.3.12-1-7
description: >
    Object.isFrozen applies to non-array object which contains index
    named properties
---*/

        var obj = Object.freeze({ 0: 0, 1: 1, 1000: 1000 });

assert(Object.isFrozen(obj), 'Object.isFrozen(obj) !== true');


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="blur_bg">#FFFAF0</color>
    <color name="contents_text">#ff000000</color>
</resources>


text:
ColorSharp [![Build Status](https://travis-ci.org/Litipk/ColorSharp.svg?branch=master)](https://travis-ci.org/Litipk/ColorSharp) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Litipk/ColorSharp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) [![Donate](https://img.shields.io/gratipay/litipk.svg "Donate")](https://gratipay.com/litipk/) [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=castarco&url=https://github.com/Litipk/ColorSharp/&title=ColorSharp&language=&tags=github&category=software)
==========

A .NET/Mono library to handle color spaces and light spectrums.

## Getting Started

ColorSharp is available as a [nuget package](https://www.nuget.org/packages/ColorSharp/) so you can install by searching for "ColorSharp" in the "Manage Nuget Packages" menu, or run the following command in the integrated Monodevelo's Package Manager Console:

`PM> Install-Package ColorSharp`

## Learn more

 * [Project Documentation](https://github.com/Litipk/ColorSharp/wiki) : Here you can find how to use ColorSharp in your applications.
 * [External References](https://github.com/Litipk/ColorSharp/blob/master/REFERENCES.md) : Here you can learn about the science behind ColorSharp and discover other projects that have inspired us.
 * [Blog](https://colorsharp.wordpress.com/) : News, technical articles, opinion...
 * [Chat Room](https://gitter.im/Litipk/ColorSharp) : If you want to have a real-time chat with other ColorSharp users or developers, you can do it here.
 * [Group / Mail List](https://groups.io/org/groupsio/litipk_colorsharp) : If a chat room isn't enough to post your doubts or ideas, you can join to our mail list.

## Project Status

 * [Changelog](https://github.com/Litipk/ColorSharp/blob/master/CHANGELOG.md)
 * [Travis CI Builds](https://travis-ci.org/Litipk/ColorSharp)
 * [OpenHUB Profile](https://www.openhub.net/p/ColorSharp)

## How to contribute

 * First of all, you can take a look on the [TODO list](https://github.com/Litipk/ColorSharp/blob/master/TODO.md) and decide if there is something that you want to do :wink: . If you think there are missing improvements in this file, then you are invited to modify the TODO list.
 * You can also send us bug reports through the [tracker](https://github.com/Litipk/ColorSharp/issues), or look for bugs to solve.
 * If you are really interested on helping to improve ColorSharp, we recommend to read the [contributing guidelines](https://github.com/Litipk/ColorSharp/blob/master/CONTRIBUTING.md).

## License

ColorSharp is licensed under the [MIT License](https://github.com/Litipk/ColorSharp/blob/master/LICENSE).


text:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>les_flashQuiz</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>
<body bgcolor="#606060" topmargin="0" leftmargin="0">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="javascript">
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
			'width', '625',
			'height', '534',
			'src', 'les_flashQuiz',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'false',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'les_flashQuiz',
			'bgcolor', '#ffffff',
			'name', 'les_flashQuiz',
			'menu', 'true',
			'allowFullScreen', 'true',
			'allowScriptAccess','sameDomain',
			'movie', 'les_flashQuiz',
			'salign', ''
			); //end AC code
	}
</script>
<noscript>
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="625" height="534" id="les_flashQuiz" align="middle">
	<param name="allowScriptAccess" value="sameDomain" />
	<param name="allowFullScreen" value="false" />
	<param name="movie" value="les_flashQuiz.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="les_flashQuiz.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="625" height="534" name="les_flashQuiz" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
	</object>
</noscript>
</body>
</html>


text:
'''
This tool generates custom transit and/or eclipse ephemerides
for your observatory and the dates you choose. You can also choose
a limiting target star magnitude (V) so that you don't get a list
flooded by targets that are too dim to observe at your with your
equipment. Similarly, you can choose a lower limit on the transit
depths, so that you'll generate a calendar of events that you'll
be able to produce observe with decent signal/noise.

The exoplanet data are loaded from exoplanets.org, so please run
this script while connected to the internet so that you can have
the most up-to-date exoplanet data.

Core developer: Brett Morris (NASA GSFC)
'''

from calculateEphemerides import *

parFile = 'maunaKea.par'   ## Path to observatory input parameter file

calculateEphemerides(parFile)
print 'runEpehemerisGenerator.py: Done.'


text:
author: slowe
categories: News
comments: false
date: 2006-02-15T21:47:08Z
slug: open-source-hardware
tags:
- BSD
- Hardware
- Linux
- OSS
- Sun
- Virtualization
- Interoperability
title: Open Source Hardware
url: /2006/02/15/open-source-hardware/
wordpress_id: 180
---

[Sun](http://www.sun.com/) joins [IBM](http://www.ibm.com/) in trying to use the open source software model to help with hardware as well. (Thanks to [Linux-Watch](http://www.linux-watch.com/) for the news.) Creating a new project called [OpenSPARC](http://opensparc.sunsource.net/nonav/index.html), Sun is open sourcing the specifications for its latest SPARC processor, the UltraSPARC T1, code-named "Niagara".

According to the [Linux-Watch article](http://www.linux-watch.com/news/NS6472325496.html), the effort is intended to help drive the development of ports of Linux and BSD that can take full advantage of the CoolThreads technology in the UltraSPARC T1, which provides 32 threads of execution. This allows the T1 to provide much greater throughput at lower clock speeds with dramatically lower power consumption.

In addition to the processor architecture and code, Sun is also open sourcing its HyperVisor API information. Like other vendors' hypervisor efforts, the idea is to allow multiple operating systems or multiple instances of an operating system to run simultaneously on the same hardware. Again, ports of Linux and BSD that are designed to take full advantage of the UltraSPARC T1 architecture and HyperVisor API are beneficial to Sun because they can help drive sales of their hardware.

It's a good idea, really, if you think about it. Sun's big into open source these days, after creating the [OpenSolaris](http://opensolaris.org/os/) project in an effort to open source the entire [Solaris](http://www.sun.com/software/solaris/) operating system. However, Solaris is really the only operating system that can run well on Sun's SPARC hardware, and helping other alternatives to run equally well on SPARC hardware would encourage more people to buy SPARC hardware. With any luck, Sun could create the kind of momentum and mystique around their SPARC hardware as they've done with their [AMD](http://www.amd.com/)-based "Galaxy" servers.

It'll be interesting to see how it plays out.


text:
<?php

namespace common\models\Search;

use common\models\Seller;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\Product;

/**
 * ProductSearch represents the model behind the search form about `common\models\Product`.
 */
class ProductSearch extends Product
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['ID_product', 'ID_category', 'ID_sub_category', 'ID_seller', 'ID_user', 'Count'], 'integer'],
            [['Name_product', 'Manufacturer', 'Description', 'IMG_product'], 'safe'],
            [['Price'], 'number'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $currentUser = Yii::$app->user->id;
        $command = Seller::find()->where(["ID_User" => $currentUser ])->one();
        $currentSeller = $command["ID_seller"];
        if ($currentSeller != ''){
            $query = Product::find()->where(["ID_seller" => $currentSeller]);
        } else {
            $query = Product::find()->where(["ID_User" => $currentUser]);
        }

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'ID_product' => $this->ID_product,
            'ID_category' => $this->ID_category,
            'ID_sub_category' => $this->ID_sub_category,
            'ID_seller' => $this->ID_seller,
            'ID_user' => $this->ID_user,
            'Price' => $this->Price,
            'Count' => $this->Count,
        ]);

        $query->andFilterWhere(['like', 'Name_product', $this->Name_product])
            ->andFilterWhere(['like', 'Manufacturer', $this->Manufacturer])
            ->andFilterWhere(['like', 'Description', $this->Description])
            ->andFilterWhere(['like', 'IMG_product', $this->IMG_product]);

        return $dataProvider;
    }
}


text:
The `Resource` object represents the resource data you wish to provide access to. Its main purposes are:

- Organize the different *CRUD* methods into its instance methods.
- Simplify your [responses](support.md), returning *JSON* whenever possible.
- Structure your *JSON* response, according to class attribute [*fields*](fields.md).
- Parse input according to class attribute [*Parameters*](working_with_forms/parameters.md).

## Basic Usage

### Create the Resource

```python
from yard import resources

class FooResource(resources.Resource):

    def index(self, request, params):
        return {'foo':'bar'}

    def show(self, request, book_id):
        return 404
```

#### CRUD instance methods

        Resource Method
        HTTP Method
        URL

        index
        Get
        /myresource/

        show
        Get
        /myresource/:pk/

        create
        Post
        /myresource/

        update
        Put
        /myresource/:pk/

        destroy
        Delete
        /myresource/:pk/

        option
        Option
        /myresource/ and /myresource/:pk/

The `option` method is implemented by default. Although it returns no content in the *HTTP* response, it list the available options for the resource in the *Allow* response header:

    ALLOW: GET, POST, DELETE

Any other method is not implemented by default, thus *Yard* returns *Not Found* whenever requested.

### Create the API

Add the `Resource` objects to an `Api` which will be responsible for generating the *urlpatterns*.

```python
from yard.api import Api

api = Api()
api.include( r'foo', FooResource )
```

If you want to add the `urlpatterns` of some other *urls.py*, you need to use the `extend` method.

```python
api.extend( r'someapp', 'path.to.someapp.urls' )
```

### Add to Urlpatterns

After including all the `Resource` objects, declare the `urlpatterns` variable in *urls.py* with the `Api` instance.

```python
urlpatterns = api.urlpatterns
```

```python
from django.conf.urls.defaults import patterns

urlpatterns = patterns('',
    ...
    *api.urlpatterns
)
```

### Request resource

Once added `api.urlpatterns` to the `urlpatterns`, the `FooResource` is accessible to your HTTP client:

	http://example.com/foo/


text:
namespace IronJS.Tests.UnitTests.Sputnik.Conformance.NativeECMAScriptObjects.TheMathObject.ValuePropertiesOfTheMathObject
{
    using System;
    using NUnit.Framework;

    [TestFixture]
    public class LOG2ETests : SputnikTestFixture
    {
        public LOG2ETests()
            : base(@"Conformance\15_Native_ECMA_Script_Objects\15.8_The_Math_Object\15.8.1_Value_Properties_of_the_Math_Object\15.8.1.4_LOG2E")
        {
        }

        [Test]
        [Category("Sputnik Conformance")]
        [Category("ECMA 15.8.1.4")]
        [TestCase("S15.8.1.4_A1.js", Description = "Math.LOG2E is approximately 1.4426950408889634")]
        public void MathLOG2EIsApproximately14426950408889634(string file)
        {
            RunFile(file);
        }

        [Test]
        [Category("Sputnik Conformance")]
        [Category("ECMA 15.8.1.4")]
        [TestCase("S15.8.1.4_A2.js", Description = "Value Property LOG2E of the Math Object has the attribute DontEnum")]
        public void ValuePropertyLOG2EOfTheMathObjectHasTheAttributeDontEnum(string file)
        {
            RunFile(file);
        }

        [Test]
        [Category("Sputnik Conformance")]
        [Category("ECMA 15.8.1.4")]
        [TestCase("S15.8.1.4_A3.js", Description = "Value Property LOG2E of the Math Object has the attribute DontDelete")]
        public void ValuePropertyLOG2EOfTheMathObjectHasTheAttributeDontDelete(string file)
        {
            RunFile(file);
        }

        [Test]
        [Category("Sputnik Conformance")]
        [Category("ECMA 15.8.1.4")]
        [TestCase("S15.8.1.4_A4.js", Description = "Value Property LOG2E of the Math Object has the attribute ReadOnly")]
        public void ValuePropertyLOG2EOfTheMathObjectHasTheAttributeReadOnly(string file)
        {
            RunFile(file);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
~   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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.basepom</groupId>
    <artifactId>basepom-standard-oss</artifactId>
    <version>4</version>
  </parent>

  <groupId>org.kitei.testing</groupId>
  <artifactId>lessio-build-root</artifactId>
  <version>2.1-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>kitei-lessio root</name>
  <description>
    LessIO is a security manager to control IO for tests.
  </description>
  <url>https://github.com/kitei/kitei-lessio/</url>

  <inceptionYear>2014</inceptionYear>

  <scm>
    <connection>scm:git:git://github.com/kitei/kitei-lessio.git</connection>
    <developerConnection>scm:git:git@github.com:kitei/kitei-lessio.git</developerConnection>
    <url>https://github.com/kitei/kitei-lessio/</url>
    <tag>HEAD</tag>
  </scm>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>hgschmie</id>
      <name>Henning Schmiedehausen</name>
      <timezone>-8</timezone>
    </developer>
  </developers>

  <modules>
    <module>lessio</module>
    <module>junit</module>
    <module>testng</module>
    <module>sample</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.kitei.testing</groupId>
        <artifactId>kitei-lessio</artifactId>
        <version>${project.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <configuration>
            <!-- move to basepom.release.tag-name-format after basepom 5 -->
            <tagNameFormat>kitei-lessio-@{project.version}</tagNameFormat>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>


text:
package programmerguide.exportingimages.exportimagetodifferentformats.java;

public class ExportImageToDifferentFormats
{
    public static void main(String[] args) throws Exception
    {
        // The path to the documents directory.
        String dataDir = "src/programmerguide/exportingimages/exportimagetodifferentformats/data/";

        //Load an existing image (of type Gif) in an instance of Image class
        com.aspose.imaging.Image image = com.aspose.imaging.Image.load(dataDir + "sample.gif");

        //Export to BMP file format using the default options
        image.save(dataDir + "output.bmp" , new com.aspose.imaging.imageoptions.BmpOptions());

        //Export to JPEG file format using the default options
        image.save(dataDir + "output.jpeg", new com.aspose.imaging.imageoptions.JpegOptions());

        //Export to PNG file format using the default options
        image.save(dataDir + "output.png", new com.aspose.imaging.imageoptions.PngOptions());

        //Export to TIFF file format using the default options
        image.save(dataDir + "output.tiff", new com.aspose.imaging.imageoptions.TiffOptions());

        // Display Status.
        System.out.println("Image exported to BMP, JPG, PNG and TIFF formats successfully!");
    }
}


text:
/**
 * Miscellaneous Utils
 */

function f_scrollTop(){
    return f_filterResults(window.pageYOffset ? window.pageYOffset : 0, document.documentElement ? document.documentElement.scrollTop : 0, document.body ? document.body.scrollTop : 0);
}

function f_filterResults(n_win, n_docel, n_body){
    var n_result = n_win ? n_win : 0;
    if (n_docel && (!n_result || (n_result > n_docel)))
        n_result = n_docel;
    return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

$PBJQ(document).ready(function(){
	$PBJQ('input, textarea', '#content').each( function(){
		if( $PBJQ(this).prop('disabled') ){
			$PBJQ(this).parent('label').addClass('disabled');
		}
	});

// SAK-29494: Escape key maps to keycode `27`
	$PBJQ(document).keyup(function(e) {
		if (e.keyCode == 27) {

			//Close More Sites
			if (!$PBJQ('#selectSiteModal').hasClass('outscreen') ){
				$PBJQ('#otherSitesMenu .otherSitesMenuClose').trigger('click');
			}

			//Close DirectUrl dialogs
			$PBJQ('.Mrphs-directUrl__dropDown').each(function(){
				if($PBJQ(this).hasClass('active')){
					$PBJQ(this).find('.dropDown_close').trigger('click');
				}
			});

			//Close Icon Selector in customization of Web Contents
			$PBJQ('.fip-icon-up-dir').trigger('click');

			//Close All sites dialog in Resources
			$PBJQ('.navigatePanelControls .close').trigger('click');
		}
	});
});


text:
define(['backbone'], function (Backbone) {
    return Backbone.Model.extend({
        url: function(){
            return '/visitCaseType/' + this.get('id')
        },

        idAttribute: '_id',

        defaults: function() {
            return {
                id: '',
                name: ''
            }
        }
    })
})


text: export const URL_SERVER = "http://192.168.22.128/ionic-products";


text:
/***************************************************************************

    Gottlieb hardware

***************************************************************************/

#include "emu.h"
#include "includes/gottlieb.h"
#include "machine/laserdsc.h"
#include "video/resnet.h"

/*************************************
 *
 *  Palette RAM writes
 *
 *************************************/

WRITE8_HANDLER( gottlieb_paletteram_w )
{
	gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
	int r, g, b, a, val;

	space->machine().generic.paletteram.u8[offset] = data;

	/* blue & green are encoded in the even bytes */
	val = space->machine().generic.paletteram.u8[offset & ~1];
	g = combine_4_weights(state->m_weights, (val >> 4) & 1, (val >> 5) & 1, (val >> 6) & 1, (val >> 7) & 1);
	b = combine_4_weights(state->m_weights, (val >> 0) & 1, (val >> 1) & 1, (val >> 2) & 1, (val >> 3) & 1);

	/* red is encoded in the odd bytes */
	val = space->machine().generic.paletteram.u8[offset | 1];
	r = combine_4_weights(state->m_weights, (val >> 0) & 1, (val >> 1) & 1, (val >> 2) & 1, (val >> 3) & 1);

	/* alpha is set to 0 if laserdisc video is enabled */
	a = (state->m_transparent0 && offset / 2 == 0) ? 0 : 255;
	palette_set_color(space->machine(), offset / 2, MAKE_ARGB(a, r, g, b));
}

/*************************************
 *
 *  Video controls
 *
 *************************************/

WRITE8_HANDLER( gottlieb_video_control_w )
{
	gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
	/* bit 0 controls foreground/background priority */
	if (state->m_background_priority != (data & 0x01))
		space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
	state->m_background_priority = data & 0x01;

	/* bit 1 controls horizonal flip screen */
	if (flip_screen_x_get(space->machine()) != (data & 0x02))
	{
		flip_screen_x_set(space->machine(), data & 0x02);
		tilemap_mark_all_tiles_dirty_all(space->machine());
	}

	/* bit 2 controls horizonal flip screen */
	if (flip_screen_y_get(space->machine()) != (data & 0x04))
	{
		flip_screen_y_set(space->machine(), data & 0x04);
		tilemap_mark_all_tiles_dirty_all(space->machine());
	}

	/* in Q*Bert Qubes only, bit 4 controls the sprite bank */
	state->m_spritebank = (data & 0x10) >> 4;
}

WRITE8_HANDLER( gottlieb_laserdisc_video_control_w )
{
	gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
	device_t *laserdisc = space->machine().devicelist().first(PIONEER_PR8210);

	/* bit 0 works like the other games */
	gottlieb_video_control_w(space, offset, data & 0x01);

	/* bit 1 controls the sprite bank. */
	state->m_spritebank = (data & 0x02) >> 1;

	/* bit 2 video enable (0 = black screen) */
	/* bit 3 genlock control (1 = show laserdisc image) */
	laserdisc_overlay_enable(laserdisc, (data & 0x04) ? TRUE : FALSE);
	laserdisc_video_enable(laserdisc, ((data & 0x0c) == 0x0c) ? TRUE : FALSE);

	/* configure the palette if the laserdisc is enabled */
	state->m_transparent0 = (data >> 3) & 1;
	gottlieb_paletteram_w(space, 0, space->machine().generic.paletteram.u8[0]);
}

/*************************************
 *
 *  Video RAM and character RAM access
 *
 *************************************/

WRITE8_HANDLER( gottlieb_videoram_w )
{
	gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
	UINT8 *videoram = state->m_videoram;
	videoram[offset] = data;
	tilemap_mark_tile_dirty(state->m_bg_tilemap, offset);
}

WRITE8_HANDLER( gottlieb_charram_w )
{
	gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
	if (state->m_charram[offset] != data)
	{
		state->m_charram[offset] = data;
		gfx_element_mark_dirty(space->machine().gfx[0], offset / 32);
	}
}

/*************************************
 *
 *  Palette RAM writes
 *
 *************************************/

static TILE_GET_INFO( get_bg_tile_info )
{
	gottlieb_state *state = machine.driver_data<gottlieb_state>();
	UINT8 *videoram = state->m_videoram;
	int code = videoram[tile_index];
	if ((code & 0x80) == 0)
		SET_TILE_INFO(state->m_gfxcharlo, code, 0, 0);
	else
		SET_TILE_INFO(state->m_gfxcharhi, code, 0, 0);
}

static TILE_GET_INFO( get_screwloo_bg_tile_info )
{
	gottlieb_state *state = machine.driver_data<gottlieb_state>();
	UINT8 *videoram = state->m_videoram;
	int code = videoram[tile_index];
	if ((code & 0xc0) == 0)
		SET_TILE_INFO(state->m_gfxcharlo, code, 0, 0);
	else
		SET_TILE_INFO(state->m_gfxcharhi, code, 0, 0);
}

VIDEO_START( gottlieb )
{
	gottlieb_state *state = machine.driver_data<gottlieb_state>();
	static const int resistances[4] = { 2000, 1000, 470, 240 };

	/* compute palette information */
	/* note that there really are pullup/pulldown resistors, but this situation is complicated */
	/* by the use of transistors, so we ignore that and just use the realtive resistor weights */
	compute_resistor_weights(0,	255, -1.0,
			4, resistances, state->m_weights, 180, 0,
			4, resistances, state->m_weights, 180, 0,
			4, resistances, state->m_weights, 180, 0);
	state->m_transparent0 = FALSE;

	/* configure the background tilemap */
	state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
	tilemap_set_transparent_pen(state->m_bg_tilemap, 0);
	tilemap_set_scrolldx(state->m_bg_tilemap, 0, 318 - 256);

	gfx_element_set_source(machine.gfx[0], state->m_charram);

	/* save some state */
	state_save_register_global(machine, state->m_background_priority);
	state_save_register_global(machine, state->m_spritebank);
	state_save_register_global(machine, state->m_transparent0);
}

VIDEO_START( screwloo )
{
	gottlieb_state *state = machine.driver_data<gottlieb_state>();
	static const int resistances[4] = { 2000, 1000, 470, 240 };

	/* compute palette information */
	/* note that there really are pullup/pulldown resistors, but this situation is complicated */
	/* by the use of transistors, so we ignore that and just use the realtive resistor weights */
	compute_resistor_weights(0,	255, -1.0,
			4, resistances, state->m_weights, 180, 0,
			4, resistances, state->m_weights, 180, 0,
			4, resistances, state->m_weights, 180, 0);
	state->m_transparent0 = FALSE;

	/* configure the background tilemap */
	state->m_bg_tilemap = tilemap_create(machine, get_screwloo_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
	tilemap_set_transparent_pen(state->m_bg_tilemap, 0);
	tilemap_set_scrolldx(state->m_bg_tilemap, 0, 318 - 256);

	gfx_element_set_source(machine.gfx[0], state->m_charram);

	/* save some state */
	state_save_register_global(machine, state->m_background_priority);
	state_save_register_global(machine, state->m_spritebank);
	state_save_register_global(machine, state->m_transparent0);
}

/*************************************
 *
 *  Sprite rendering
 *
 *************************************/

static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
	gottlieb_state *state = machine.driver_data<gottlieb_state>();
	UINT8 *spriteram = state->m_spriteram;
	rectangle clip = *cliprect;
    int offs;

    /* this is a temporary guess until the sprite hardware is better understood */
    /* there is some additional clipping, but this may not be it */
    clip.min_x = 8;

	for (offs = 0; offs < 256; offs += 4)
	{
		/* coordinates hand tuned to make the position correct in Q*Bert Qubes start */
		/* of level animation. */
		int sx = (spriteram[offs + 1]) - 4;
		int sy = (spriteram[offs]) - 13;
		int code = (255 ^ spriteram[offs + 2]) + 256 * state->m_spritebank;

		if (flip_screen_x_get(machine)) sx = 233 - sx;
		if (flip_screen_y_get(machine)) sy = 244 - sy;

		drawgfx_transpen(bitmap, &clip,
			machine.gfx[2],
			code, 0,
			flip_screen_x_get(machine), flip_screen_y_get(machine),
			sx,sy, 0);
	}
}

/*************************************
 *
 *  Video update
 *
 *************************************/

SCREEN_UPDATE( gottlieb )
{
	gottlieb_state *state = screen->machine().driver_data<gottlieb_state>();
	/* if the background has lower priority, render it first, else clear the screen */
	if (!state->m_background_priority)
		tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
	else
		bitmap_fill(bitmap, cliprect, 0);

	/* draw the sprites */
	draw_sprites(screen->machine(), bitmap, cliprect);

	/* if the background has higher priority, render it now */
	if (state->m_background_priority)
		tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);

	return 0;
}


text:
using Gallio.Common.Messaging.MessageSinks;
using MbUnit.Framework;

namespace Gallio.Tests.Common.Messaging.MessageSinks
{
    [Pending("To be tested.")]
    [TestsOn(typeof(MessageConsumer))]
    public class MessageConsumerTest
    {
    }
}


text:
package betterwithaddons.enchantment;

import com.google.common.collect.Sets;
import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.util.DamageSource;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.function.Predicate;

public class EnchantmentProtectionOther extends EnchantmentProtection {
    static HashSet<String> protectedSources = new HashSet<>();
    static ArrayList<Predicate<DamageSource>> sourceMatchers = new ArrayList<>();

    public static void reset() {
        protectedSources.clear();
        sourceMatchers.clear();
    }

    public static void register(String damageType) {
        protectedSources.add(damageType);
    }

    public static void register(Predicate<DamageSource> sourceMatcher) {
        sourceMatchers.add(sourceMatcher);
    }

    public EnchantmentProtectionOther(Rarity rarityIn, EntityEquipmentSlot... slots) {
        super(rarityIn, Type.ALL, slots);
    }

    @Override
    public int calcModifierDamage(int level, DamageSource source) {
        if (!source.canHarmInCreative() && isMiscDamage(source))
            return level;
        else
            return 0;
    }

    private boolean isMiscDamage(DamageSource source) {
        if(protectedSources.contains(source.damageType))
            return false;
        for (Predicate<DamageSource> sourceMatcher : sourceMatchers) {
            if(sourceMatcher.test(source))
                return false;
        }
        return true;
    }
}


text:
layout: default
modal-id: 1
date: 2000-09-26
img: Bambiniebambine.jpg
thumb: bambini.sm.jpg
alt: image-alt
project-date: 2016
client: Project
category: Illustration
description: This is a series of illustrations created for a children's book project. Characters' sketches. Watecolour and ink on paper.

---


text:
number: 202
date: 2018-12-27 10:15:00

title: "Agile UX: How to Incorporate UX and Product Design into Agile"
authors: "Debbie Levitt"
tags:
- Agile UX
- Sausage

site: "Toptal"
address: "https://www.toptal.com/agile/agile-ux-design-explained/"
---

When companies just build it, just ship it, iterate on it, and build and ship again, this means that customers are seeing a variety of versions. They are seeing the work in progress and watching the sausage being made. This is often a frustrating and confusing experience requiring customers to keep relearning a system that's evolving.


text:
function [results options] = framework(options)
tic
more off;

%%%%%init%%%%%
%get path of oms framework
omsDir = fileparts(mfilename('fullpath'));
%create result dir
resultDir = options.resultDir;
if(~exist(resultDir,'dir'))
	mkdir(resultDir);
end
options = generateExperimentID(options);
fn_structdisp('options');%display options

results = struct(); %empty struct to put all results in
blockSize = options.blockSize;
if(blockSize<1)
	error(sprintf('options.blockSize must be bigger than 0, but is %d',...
			blockSize));
end
timeShift = options.timeShift;
zeroPads = options.zeroPads;
iterICA = options.iterICA;
startFrequ = options.startFrequ;
c = options.c;
fAvNum = options.fAvNum;
tAvNum = options.tAvNum;

%test geometry setting
%TODO more testing
if(isrow(options.geometry))%vector, treat as x-coordinate
	options.geometry = [options.geometry;zeros(2,numel(options.geometry))];
elseif(size(options.geometry,1)~=3)%no three coordinates given, throw error
	error('geometry must contain 3 rows with the three coordinates');
end

if(options.doConvolution)
	%convolution;
	disp('Convolving signals...');
	[signal signalEval signalOrig fs geometry] = readDatabase(...
			options.irDatabaseName,options.inputSignals,...
			options.impulseResponses,options.irDatabaseChannels,...
			options.irDatabaseSampleRate,options.irDatabase.dir);
	options.geometry = geometry;
	options.fs = fs;
	srcNum = numel(signalEval);
	options.srcNum = srcNum;
	results.input.signalEval = signalEval;
	%store audio files in temp dir
	audioFileLength = size(signal,2);
	if(options.doEvalPeass)
		for srcCnt=1:srcNum
			wavName = sprintf('%ssignalEval%d.wav',options.tmpDirExp,srcCnt);
			wavwrite(signalEval{srcCnt}'/...
					max(max(abs(signalEval{srcCnt}))),fs,wavName);
		end
		wavName = sprintf('%ssignalOrig.wav',options.tmpDirExp);
		wavwrite(signalOrig'/max(max(abs(signalOrig))),fs,wavName);
	end
	geometryX = geometry(1,:);
	geometryY = geometry(2,:);
	geometryZ = geometry(3,:);
	options.geometry = geometry;
else
	disp('Loading signals...');
	if(iscell(options.inputSignals))%names of audio files
		sigNum = numel(options.inputSignals);%get number of input signals
		for sigCnt=1:sigNum%read all signals
			try
				[signal(sigCnt,:) fs] = wavread(options.inputSignals{sigCnt});
			catch err
				disp('error while reading audio input.possible causes:');
				disp('- input file has more than one channel');
				disp('- input files have different lengths');
				rethrow(err);
			end
			%store sample rate TODO check for equal sample rates
			disp(sprintf('adjusting sample rate to %d',fs));
			options.fs = fs;
		end
		clear sigNum;
	elseif(isnumeric(options.inputSignals))%signals given as value arrays
		signal = options.inputSignals;%use these as input signals
		%get their sample rate
		%if(isfield(options,'fs'))
			fs = options.fs;
		%else
			%error('samplerate must be specified in options.fs');
		%end
	elseif(ischar(options.inputSignals))%only one signal given as file name
		try
			[signal fs] = wavexread(options.inputSignals);
		catch err
			[signal fs] = wavread(options.inputSignals);
		end
		signal = signal.';
		%set arbitrary geometry
		options.geometry = zeros(3,size(signal,1));
		options.fs = fs;%get sample rate
	else%none of standard input formats worked
		error('can not handle options.inputSignals');
	end
	geometry = options.geometry;
	geometryX = geometry(1,:);
	geometryY = geometry(2,:);
	geometryZ = geometry(3,:);
end
results.input.signal = signal;%store input signals

options.sigNum = size(signal,1);%get number of input signals
sigNum = options.sigNum;
if(sigNum~=size(geometry,2))
	error(sprintf([['number of signals (%d) and number of microphones in ']...
			['geometry (%d) are not equal']],sigNum,size(geometry,2)));
end
blockSizeZeroPads = 2*zeroPads + blockSize;%overall block size
options.blockSizeZeroPads = blockSizeZeroPads;
frequNum = blockSizeZeroPads/2+1;%number of frequency bins in frequency domain
options.frequNum = frequNum;
options.frequency = linspace(0,fs/2,frequNum);%frequency values
frequency = options.frequency;
%%%%%init%%%%%

%%%%%beamforming - weighting matrix synthesis%%%%%
if(options.doBeamforming)
	if(options.beamforming.doNoProcess)
		if(isscalar(options.beamforming.noProcess.frequNum))
			options.frequNum = options.beamforming.noProcess.frequNum;
			frequNum = options.frequNum;
			options.frequency =...
				logspace(log10(options.beamforming.noProcess.frequMin)...
				,log10(options.beamforming.noProcess.frequMax)...
				,options.frequNum);
			results.frequency = options.frequency;
		elseif(isvector(options.beamforming.noProcess.frequNum))
			if(iscolumn(options.beamforming.noProcess.frequNum))
				options.frequency = options.beamforming.noProcess.frequNum.';
			else
				options.frequency = options.beamforming.noProcess.frequNum;
			end
			frequNum = numel(options.frequency);
			options.frequNum = frequNum;
		else
			disp('size(options.beamforming.noProcess.frequNum):');
			disp(size(options.beamforming.noProcess.frequNum));
			error(['options.beamforming.noProcess.frequNum must be a scalar'...
				   'or a vector']);
		end
	end
	if(options.beamforming.doWeightMatSynthesis)
		disp('synthesizing weight matrix...')
		[weightMatSynthResults] = weightMatSynth(options);
		results.weightMatSynth = weightMatSynthResults;
		% in case there are weights provided, we combine them via multiplication
		if(size_equal(options.beamforming.weights,weightMatSynthResults.W))
			options.beamforming.weights = weightMatSynthResults.W ...
										.*options.beamforming.weights;
		else
			options.beamforming.weights = weightMatSynthResults.W;
		end
	else%include beamforming.weights, beamforming.amp and beamforming.delays,
				%if given or just use equal weights
		W = options.beamforming.weights;%weights in frequency domain
		delays = options.beamforming.delays;%time domain delays
		amp = options.beamforming.amp;%amplification of each microphone
		noDelay = true;
		noWeight = true;
		noAmp = true;
		%time domain delays
		if(all(size(delays)==[sigNum,1]))%delays given as column vector
			W = W.';%transpose
		end
		if(all(size(delays)==[1,sigNum]))%delays given as row vector
			disp('transforming delays to frequency domain...');
			delays = exp(-i*2*pi*delays.'*options.frequency);
			noDelay = false;
		else%no valid delays given
			disp('no valid time domain delays found');
			delays = zeros(sigNum,frequNum);%all delays are zero
		end
		if(all(size(W)==[sigNum,frequNum]))%no weights given, set all equal
			disp('using frequency domain weights');
			noWeight = false;
		else
			disp(['no valid frequency domain weights found']);
			W=ones(sigNum,frequNum)/sigNum;
		end
		W = W + delays;%add delays to weights FIXME shouldn't we multiply here?
		%multiply with amplification weights, if given
		if(all(size(amp)==[sigNum,1]))%amplifications given as column vector
			amp = amp.';%transpose
		end
		if(all(size(amp)==[1,sigNum]))%amplifications given as row vector
			disp('adding amplifications to microphones...');
			amp = amp.' * ones(1,frequNum); % TODO use bsxfun
			W = W .* amp;
			noAmp = false;
		else
			disp('no valid amplifications found');
		end
		options.beamforming.weights = W;
		if(noWeight&noDelay&noAmp)
			disp('all microphones equally weighted');
		end
	end
	if(options.beamforming.doBeampattern)
		beampatternResults = beampattern(options);
		results.beamforming.beampattern = beampatternResults;
		results.beamforming.beampattern.teta =...
	   			options.beamforming.beampattern.teta;
		results.beamforming.beampattern.phi =...
				options.beamforming.beampattern.phi;
	end
	results.beamforming.weights = options.beamforming.weights;
end % options.doBeamforming
%%%%%beamforming - weighting matrix synthesis%%%%%

%%%%%speech recognition%%%%%
if(options.doSpeechRecognition)
	sigDir = options.speechRecognition.sigDir;
	sigDirRemote = options.speechRecognition.sigDirRemote;
	resultDirRemote = options.speechRecognition.resultDirRemote;
	uasrPath = options.speechRecognition.uasrPath;
	uasrDataPath = options.speechRecognition.uasrDataPath;
	tmpDir = options.tmpDir;
	model = options.speechRecognition.model;
	db = options.speechRecognition.db;
	disp('speech recognition...');
	logFilename2 = fullfile(resultDir,'logExtern.txt');%copy external log file
								%back to original machine with this file name

	% expand heading tilde and dot, UASR seems to not like it
	if(~isMatlab())%only possible in Octave TODO find Matlab function
		uasrPath = tilde_expand(uasrPath);
		uasrDataPath = tilde_expand(uasrDataPath);
		tmpDir = tilde_expand(tmpDir);
		sigDir = tilde_expand(sigDir);
	end
	uasrPath = dot_expand(uasrPath);
	uasrDataPath = dot_expand(uasrDataPath);
	tmpDir = dot_expand(tmpDir);
	sigDir = dot_expand(sigDir);

	if(options.speechRecognition.doRemote&&...
			~options.speechRecognition.doGetRemoteResults)
		%TODO make remote host (eakss1) a config key
		logFilename = fullfile(resultDirRemote,'log.txt');%log speech recognition here
		disp('copying files to remote machine...');
		recogName1 = fullfile(omsDir,'speechRecognizer.pl');
		recogName2 = fullfile(omsDir,'FileSemaphore.pm');
		recogNameRemote = fullfile(resultDirRemote,'speechRecognizer.pl');
		recogNameRemotePath = fullfile(resultDirRemote,'/');
		system(['ssh eakss1 mkdir -p ' resultDirRemote]);%create log dir on
													%remote machine
		system(['ssh eakss1 mkdir -p ' sigDirRemote]);%create sig dir on remote
													%machine
		%copy data files
		system(['scp ' sigDir '/*.* eakss1://' sigDirRemote],'-echo');
		%copy recognizer script
		system(['scp ' recogName1 ' ' recogName2 ' eakss1://' recogNameRemotePath],'-echo');
		disp(['running UASR on remote machine, see local logfile ' logFilename]);
		systemCall = ['ssh eakss1 "nohup perl -I' recogNameRemotePath  ' ' recogNameRemote ' ' sigDirRemote ' '...
			resultDirRemote ' ' db ' ' model ' >' logFilename ' 2>&1 </dev/null & "'];
		disp(systemCall);
		system(systemCall);
		results.speechRecognition = speechRecogGetResults();
	elseif(options.speechRecognition.doGetRemoteResults)
		logFilename = fullfile(resultDirRemote,'log.txt');%log speech recognition here
		disp('copying result files from remote machine...');
		disp(['scp eakss1://' logFilename ' ' logFilename2]);
		system(['scp eakss1://' logFilename ' ' logFilename2],'-echo');
		%read file
		fid = fopen(logFilename2,'r');
		lines = [];
		while ~feof(fid)
			line = fgets(fid);
			lines = [lines line];
		end
		fclose(fid);
		%get results from file
		results.speechRecognition = speechRecogGetResults(lines,db);
	else
		logFilename = fullfile(resultDir,'log.txt');%log speech recognition here
		results.speechRecognition = speechRecognizer(sigDir, tmpDir, db ...
                                                    ,model, uasrPath ...
                                                    ,uasrDataPath);
   end%do remote
end
%%%%%speech recognition%%%%%

%%%%%to frequency domain%%%%%
%sigVec: (signal,block,frequency)
%blockMat: (signal,block,time)
sigVecFileName = createFdFileName(options,sigNum);
if(exist(sigVecFileName,'file'));%did calc in a previous experiment
	disp('Loading frequency domain signals...');
	load(sigVecFileName);
else%need to do the calculation
	disp('Calculating frequency domain signals...');
	%sigVec: (signal,block,frequency)
	%blockMat: (signal,block,time)
	[sigVec blockMat blockNum blockTime] =...
			toFrequDomain(signal,blockSize,timeShift,zeroPads,fs);
	if(options.doConvolution)
		for srcCnt=1:srcNum
			[sigVecEval{srcCnt} blockMatEval{srcCnt}] =...
					toFrequDomain(signalEval{srcCnt},blockSize,timeShift,...
					zeroPads,fs);
		end
	end
	%if(~strcmp(inSigName,'noFile')&&options.doFdStore)
	if(options.doFdStore)
		if(options.doConvolution)
			save(sigVecFileName,'sigVec','blockMat','blockNum','blockTime',...
					'sigVecEval','blockMatEval');
		else
			save(sigVecFileName,'sigVec','blockMat','blockNum','blockTime');
		end
	end
end
%store results
options.blockNum = blockNum;
results.blockNum = blockNum;
results.blockTime = blockTime;
results.input.sigVec = sigVec;
results.input.blockMat = blockMat;
results.last.sigVec = sigVec;
results.last.blockMat = blockMat;
if(options.doConvolution)
	results.input.sigVecEval = sigVecEval;
	results.input.blockMatEval = blockMatEval;
	results.last.sigVecEval = sigVecEval;
	results.last.blockMatEval = blockMatEval;
end
%%%%%to frequency domain%%%%%

%time-frequency-domain histogram
%{
figure(1);clf;
subplot(411)
[tfhist centers] = tfHist(sigVec(2,:,10),sigVec(3,:,10),...
	abs(geometryX(3)-geometryX(2)),c,frequency(10));
disp([min(centers) max(centers)]);
plot(centers*180/pi,tfhist);
title(frequency(10))
subplot(412)
[tfhist centers] = tfHist(sigVec(2,:,20),sigVec(3,:,20),...
	abs(geometryX(3)-geometryX(2)),c,frequency(20));
plot(centers*180/pi,tfhist);
title(frequency(20))
%phi = angle(sigVec(2,:,10).*conj(sigVec(3,:,10)))/(2*pi*frequency(10));
%disp([min(phi) max(phi)]);
%plot(phi);
subplot(413)
[tfhist centers] = tfHist(sigVec(2,:,30),sigVec(3,:,30),...
	abs(geometryX(3)-geometryX(2)),c,frequency(30));
plot(centers*180/pi,tfhist);
title(frequency(30))
%phi = angle(sigVec(2,:,10)./sigVec(3,:,10))/(2*pi*frequency(10));
%disp(([min(phi) max(phi)]*c/abs(geometryX(3)-geometryX(2))));
%plot(phi);
subplot(414)
[tfhist centers] = tfHist(sigVec(2,:,40),sigVec(3,:,40),...
	abs(geometryX(3)-geometryX(2)),c,frequency(40));
plot(centers*180/pi,tfhist);
title(frequency(40))
%plot(acos(angle(sigVec(2,:,10)./sigVec(3,:,10))*c/(2*pi*frequency(10)*...
	%abs(geometryX(3)-geometryX(2)))));
%plot(asin(angle(sigVec(2,:,10).*conj(sigVec(3,:,10)))*c/(2*pi*frequency(10)*...
	%abs(geometryX(3)-geometryX(2)))));
%plot(asin(phi*c/abs(geometryX(3)-geometryX(2))));
%}

%%%%%%ADMA%%%%%%
if(options.doADMA)
	disp('adma processing ...');
	%keyboard

	%export raw cardioid or eight signals
	if(options.adma.returnCardioids...
	 ||options.adma.returnEights...
	 ||options.adma.doIcaBatch)
		[sigFullFd frequFull] = fftAndFrequ(signal,fs);
		[cardioidsFd eightsFd] = admaBuildCardioids(sigFullFd,frequFull...
					,options.adma.d,options.c,options.adma.doEqualization);
		results.adma.cardioids = ifft(cardioidsFd.').';
		results.adma.eights = ifft(eightsFd.').';
	end

	if(options.adma.doIcaBatch)
		if(options.doTdRestore)
			warning(['Result of batch ICA will be overwritten due to ' ...
					 '<doTdRestore> key! Please set "options.doTdRestore ' ...
					 '= false", or use result from "results.adma.icaBatch"']);
		end
		unmixMat = FastICA(results.adma.cardioids,100);
		results.adma.icaBatch = unmixMat * results.adma.cardioids;
		%results.signal = results.adma.icaBatch;
		if (options.doConvolution) % we don't know the correct signal yet, so
			results.eval.sigVecEval = sigVecEval; % bypass evaluation stage
		end
	else
		%initialize parameter
		options.adma.oldMask = -1;%TODO throw out of options struct
		options.adma.last_theta = NaN;%TODO throw out of options struct

		%preallocate arrays
		sigVecNew = zeros(size(sigVec));
		sigVecCard = zeros(size(sigVec));
		if(options.doConvolution)
			for srcCnt=1:srcNum
				sigVecEvalNew{srcCnt} = zeros(size(sigVecEval{srcCnt}));
			end
		end

		%loop blocks
		for (blockCnt=1:blockNum) %process blockwise
			sigVecProc = squeeze(sigVec(:,blockCnt,:)); %current processing block

			[sigVecProc adma_opt sigVecCard(:,blockCnt,:)] = adma(sigVecProc...
																  ,frequency...
																  ,fs...
																  ,options.adma...
																  ,options.c);

			options.adma.oldMask = adma_opt.newMask;
			options.adma.last_theta = adma_opt.theta1;

			sigVecNew(:,blockCnt,:) = sigVecProc;

			results.adma.opt(blockCnt) = adma_opt;
			sigVecNew(:,blockCnt,:) = sigVecProc;

			%Process single Signal for SNR evaluation
			if(options.doConvolution)
				%process evaluation signals blockwise
				for srcCnt=1:srcNum
					%current processing block
					sigVecEvalProc = squeeze(sigVecEval{srcCnt}(:,blockCnt,:));
					adma_opt.findMax = false;%use angles determinded by regular
					adma_opt.findMin = false;%signal pass
					[sigVecEvalProc Evalopt] = adma(sigVecEvalProc, ...
													frequency, ...
													fs, ...
													adma_opt,...
													options.c);
					results.adma.EvalOpt(srcCnt,blockCnt) = Evalopt;
					sigVecEvalNew{srcCnt}(:,blockCnt,:) = sigVecEvalProc;
				end
			end
		end

		sigVec = sigVecNew;
		clear sigVecNew;
		results.adma.sigVec = sigVec;
		results.adma.sigVecCard = sigVecCard;
		if (options.doConvolution)
			sigVecEval = sigVecEvalNew;
			clear sigVecEvalNew;
			results.eval.sigVecEval = sigVecEval;
		end
	end % options.adma.doIcaBatch
end
%%%%%%ADMA%%%%%%

%%%%%Beamforming%%%%%
if(options.doBeamforming)
	disp('beamforming...');
	sigVecNew = zeros(size(sigVec));
	for(blockCnt=1:blockNum)
		sigVecNew(1,blockCnt,:) = beamformProcessing(options,...
				squeeze(sigVec(:,blockCnt,:)),results.weightMatSynth.W);
	end
	sigVec = sigVecNew;
	clear sigVecNew;
	results.beamforming.sigVec = sigVec;
end
%%%%%Beamforming%%%%%

%%%%%Twin Mic%%%%%
if(doTwinMic(options))
	disp('Twin Mic Processing...');
	sigVecNew = zeros(size(sigVec));
	if(options.doConvolution)
		for srcCnt=1:srcNum
			sigVecEvalNew{srcCnt} = zeros(size(sigVecEval{srcCnt}));
		end
	end
	maskBf.previous = []; %initialize mask for beamforming
	maskDf.previous = []; %initialize mask for distance filter
	coeffWf.previous = []; %initialize coefficients for Wiener filter
	coeffNS.previous = []; %initialize coefficients for null steering
	%initialize array for estimatet null steering angles (NLMS and ICA)
	results.twinMic.nullSteering.angle = cell(blockNum,1);
	%results.twinMic.nullSteering.angle  = zeros(blockNum,1);
	for(blockCnt=1:blockNum) %process blockwise
		sigVecProc = squeeze(sigVec(:,blockCnt,:)); %current processing block
		if(options.doDma)
			sigVecProc = dma(options,sigVecProc);
		elseif(options.doTwinMicNullSteering)
			[sigVecProc coeffNS.previous] = twinMicNullSteering(options,...
					sigVecProc,squeeze(blockMat(:,blockCnt,:)),coeffNS);
			%store angle progression
			results.twinMic.nullSteering.angle{blockCnt} = coeffNS.previous;
		elseif(options.doTwinMicBeamforming&&options.doDistanceFiltering)
			[noi maskBf.previous] = twinMicBeamformer(options,...
					sigVecProc,maskBf);
			[noi maskDf.previous] = distanceFilter(options,...
					sigVecProc,maskDf);
			sigVecProc(2,:) = sigVecProc(1,:) + sigVecProc(2,:);
			sigVecProc(1,:) = sigVecProc(1,:) .* ...
					(maskBf.previous&maskDf.previous);
		elseif(options.doTwinMicBeamforming)
			[sigVecProc maskBf.previous] = twinMicBeamformer(options,...
					sigVecProc,maskBf);
		elseif(options.doDistanceFiltering)
			[sigVecProc maskDf.previous] = distanceFilter(options,...
					sigVecProc,maskDf);
		elseif(options.doTwinMicWienerFiltering)
			[sigVecProc coeffWf.previous] = twinMicWienerFilter(options,...
					sigVecProc,coeffWf);
		end
		sigVecNew(:,blockCnt,:) = sigVecProc;
		if(options.doConvolution)
			%process evaluation signals blockwise
			for srcCnt=1:srcNum
				%current processing block
				sigVecEvalProc = squeeze(sigVecEval{srcCnt}(:,blockCnt,:));
				if(options.doTwinMicNullSteering)
					sigVecEvalProc = twinMicNullSteering(options,...
							sigVecEvalProc,...
							squeeze(blockMatEval{srcCnt}(:,blockCnt,:)),...
							coeffNS);
				elseif(options.doTwinMicBeamforming&&options.doDistanceFiltering)
					sigVecEvalProc(2,:) = sigVecEvalProc(1,:) +...
							sigVecEvalProc(2,:);
					sigVecEvalProc(1,:) = sigVecEvalProc(1,:) .* ...
							(maskBf.previous&maskDf.previous);
				elseif(options.doTwinMicBeamforming)
					sigVecEvalProc = twinMicBeamformer(options,...
							sigVecEvalProc,maskBf.previous);
				elseif(options.doDistanceFiltering)
					sigVecEvalProc = distanceFilter(options,...
							sigVecEvalProc,maskDf.previous);
				elseif(options.doTwinMicWienerFiltering)
					sigVecEvalProc = twinMicWienerFilter(options,...
							sigVecEvalProc,coeffWf.previous);
				end
				sigVecEvalNew{srcCnt}(:,blockCnt,:) = sigVecEvalProc;
			end
		end
	end
	%make processed signal (sigVecNew) input signal for following algorhithms
		%(sigVec), same for evaluation signals
	sigVec = sigVecNew;
	clear sigVecNew;
	results.twinMic.sigVec = sigVec;
	results.last.sigVec = sigVec;
	if(options.doConvolution)
		sigVecEval = sigVecEvalNew;
		clear sigVecEvalNew;
		results.twinMic.sigVecEval = sigVecEval;
		results.last.sigVecEval = sigVecEval;
	end
end
%store result of complete twin mic processing chain
%results.twinMic.sigVec = results.last.sigVec;
%if(options.doConvolution)
	%results.twinMic.sigVecEval = results.last.sigVecEval;
%end
%%%%%Twin Mic%%%%%

%%%%%ICA%%%%%
if(options.doFDICA)
	icaResults = ica(options,results);
	sigVec = icaResults.postproc.sigVec;
	sigNum = size(sigVec,1);
	results.ica = icaResults;
	if(options.doConvolution)
		sigVecEval = icaResults.postproc.sigVecEval;
	end
	clear icaResults;
end
%%%%%ICA%%%%%

%%%%%to time domain%%%%%
if(options.doTdRestore)
	signalResult = ...
		toTimeDomain(sigVec,sigNum,blockSize,timeShift,zeroPads,blockNum);
	sigLength = size(results.input.signal,2);
	sigProcessedLength = size(signalResult,2);
	if(sigProcessedLength>=sigLength)
		doCut = true;
		results.signal = signalResult(:,1:sigLength);
	else
		doCut = false;
		diff = sigLength - sigProcessedLength;
		results.signal = [signalResult zeros(sigNum,diff)];
	end
	if(options.doConvolution)
		for srcCnt=1:srcNum
			signalEvalResult{srcCnt} = toTimeDomain(sigVecEval{srcCnt},sigNum,...
					blockSize,timeShift,zeroPads,blockNum);
			if(doCut)
				results.signalEval{srcCnt}=signalEvalResult{srcCnt}(:,1:sigLength);
			else
				results.signalEval{srcCnt} =...
						[signalEvalResult{srcCnt} zeros(sigNum,diff)];
			end
		end
	end
end
%%%%%to time domain%%%%%

if(options.doConvolution&options.doEval)
	results.eval = evaluate(options,results);
end

toc

%check if twin mic processing is switched on
function ret = doTwinMic(options)
ret = false;
if(options.doDma...
	|options.doDistanceFiltering...
	|options.doDistanceGate...
	|options.doTwinMicBeamforming...
	|options.doTwinMicNullSteering...
	|options.doTwinMicWienerFiltering)
	ret = true;
end

%TODO create hash of filename and store file with the hash as name instead of
%the generated name. this prevents awfull long filenames that could get too
%long to write
function sigVecFileName = createFdFileName(options,sigNum)
if(iscell(options.inputSignals))
	inSigName = strcat(options.inputSignals{:});
elseif(ischar(options.inputSignals))
	inSigName = options.inputSignals;
else%signal is given as array, we can't check whether we processed it before
	sigVecFileName = 'noFile';
	options.doFdStore = false;
	return
end
inSigName = regexprep(inSigName,{'/','\.'},'_');
%disp(inSigName);
sigVecFileName = sprintf('%s_%d_%d_%d_%d_%d_%d',...
							inSigName,...
							sigNum,...
							options.blockSize,...
							options.timeShift,...
							options.zeroPads,...
							options.fs,...
							options.doConvolution);
if(options.doConvolution)%append convolution information
	sigVecFileName = strcat(sigVecFileName,'_');
	%get field names of options.impulseResponses struct
	irFieldNames = fieldnames(options.impulseResponses);
	for irCnt=1:numel(irFieldNames)
		%get field name
		%keyboard
		%irFieldName = options.impulseResponses.(irFieldNames{irCnt})
		%add field name to file name
		sigVecFileName = strcat(sigVecFileName,irFieldNames{irCnt},'_');
		%get field content
		fieldContent = options.impulseResponses.(irFieldNames{irCnt});
		%iterate over field content and add each element to file name
		for eleCnt=1:numel(options.impulseResponses)
			element = options.impulseResponses(eleCnt).(irFieldNames{irCnt});
			%keyboard
			%add field content
			if(ischar(element))
				sigVecFileName = sprintf('%s%s_',sigVecFileName,...
						element);
			elseif(isnumeric(element))
				sigVecFileName = sprintf('%s%d_',sigVecFileName,...
						element);
			else
				error(['unknown field type while generating tmp file' ...
					   ' name for frequency domain data']);
			end
		end
	end
	sigVecFileName = sprintf('%s%s',sigVecFileName,options.irDatabaseName);
end
sigVecFileName = [fullfile(options.tmpDir,sigVecFileName) '.mat'];


text:
package com.gwtao.ui.widgets.client;

public class DateBox extends DateTimeBox {
  public DateBox() {
    super(DateTimeBox.TYPE.DATE_ONLY);
  }
}


text:
<?php
namespace Lapsic;
/**
 * Pagina di Front-end del progetto Lapsic
 *
 *
 * @version   1.00
 * @since     2015-05-17
 * @company   http://addictify.it/
 */
include_once(dirname(__FILE__).'/config/config.php');

include_once('super.php');

include_once(dirname(__FILE__).'/config/class/MagicUpload/index.php');
?>
<!doctype html>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" >
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>Lapsic | Add Photo</title>
<?php include_once('include/resources.php'); ?>

 <?php /*

  	chiudi x

  */
  ?>

    	add your photos

    <form target="_top" method="post" action="edit_photo.php" id="root_form">
		<input type="hidden" name="act" value="upload_img" />

<input type="hidden" id="source_name" value="" />

        <button type="submit" class="button-salva-modifiche" style="display:block; margin:auto;">Upload and edit</button>
    </form>

<?php
include_once(dirname(__FILE__).'/config/class/MagicUpload/script.php');
?>


text:
<?xml version="1.0"?>
<!-- this is faked for demo purposes -->
<root xmlns="urn:schemas-upnp-org:device-1-0">
 <specVersion>
  <major>1</major>
  <minor>0</minor>
 </specVersion>
 <device>
  <deviceType>urn:schemas-upnp-org:device:Phone:1</deviceType>
  <friendlyName>Samsung Nexus S</friendlyName>
  <manufacturer>Samsung Electronics</manufacturer>
  <manufacturerURL>http://www.samsung.com</manufacturerURL>
  <modelDescription>Android phone with webinos PZP</modelDescription>
  <modelName>Nexus S</modelName>
  <modelNumber>1.0</modelNumber>
  <modelURL>http://www.google.co.uk/nexus/</modelURL>
  <serialNumber>1498BAZS300038T</serialNumber>
  <UDN>uuid:e5b4f2aa-fe1e-11e0-a4a7-002170f348ec</UDN>
  <serviceList>
   <service>
    <serviceType>urn:schemas-upnp-org:service:PhoneBasic:1</serviceType>
    <serviceId>urn:upnp-org:serviceId:1</serviceId>
    <SCPDURL>/PhoneBasic.xml</SCPDURL>
    <controlURL>/upnp/control/phonercontrol</controlURL>
    <eventSubURL>/phonecontrol</eventSubURL>
   </service>
  </serviceList>
  <presentationURL>/</presentationURL>
 </device>
</root>


text:
class C {
    [Symbol.iterator](x: string): string;
    static [Symbol.iterator](x: number): number;
    [Symbol.iterator](x: any) {
        return undefined;
    }
}


text:
<?php

$GLOBALS['TL_DCA']['tl_settings']['palettes'] = str_replace('useSMTP;', '{templatehint_legend},enableFrontendhint;useSMTP;', $GLOBALS['TL_DCA']['tl_settings']['palettes']);

$GLOBALS['TL_DCA']['tl_settings']['fields']['enableFrontendhint'] = array(
	'label'                   => $GLOBALS['TL_LANG']['tl_settings']['enableFrontendhint'],
	'inputType'               => 'checkbox',
	'eval'                    => array('tl_class' => 'w50', 'doNotSaveEmpty' => true),
	'load_callback' => array(
		array('Guave\Templatehint\Classes\TemplatehintBackend', 'loadFieldValue')
	),
	'save_callback' => array(
		array('Guave\Templatehint\Classes\TemplatehintBackend', 'saveFieldValue')
	)
);


text:
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
//

require_once('../config.php');
require_once($CFG->libdir.'/filelib.php');
require_once('lib.php');
/// Wait as long as it takes for this script to finish
core_php_time_limit::raise();

require_sesskey();
require_login();

// disable blocks in this page
$PAGE->set_pagelayout('embedded');

// general parameters
$action      = optional_param('action', '',        PARAM_ALPHA);
$client_id   = optional_param('client_id', '', PARAM_RAW);    // client ID
$itemid      = optional_param('itemid', '',        PARAM_INT);

// parameters for repository
$callback    = optional_param('callback', '',      PARAM_CLEANHTML);
$contextid   = optional_param('ctx_id',    SYSCONTEXTID, PARAM_INT);    // context ID
$courseid    = optional_param('course',    SITEID, PARAM_INT);    // course ID
$env         = optional_param('env', 'filepicker', PARAM_ALPHA);  // opened in file picker, file manager or html editor
$filename    = optional_param('filename', '',      PARAM_FILE);
$fileurl     = optional_param('fileurl', '',       PARAM_RAW);
$thumbnail   = optional_param('thumbnail', '',     PARAM_RAW);
$targetpath  = optional_param('targetpath', '',    PARAM_PATH);
$repo_id     = optional_param('repo_id', 0,        PARAM_INT);    // repository ID
$req_path    = optional_param('p', '',             PARAM_RAW);    // the path in repository
$curr_page   = optional_param('page', '',          PARAM_RAW);    // What page in repository?
$search_text = optional_param('s', '',             PARAM_CLEANHTML);
$maxfiles    = optional_param('maxfiles', -1,      PARAM_INT);    // maxfiles
$maxbytes    = optional_param('maxbytes',  0,      PARAM_INT);    // maxbytes
$subdirs     = optional_param('subdirs',  0,       PARAM_INT);    // maxbytes
$areamaxbytes   = optional_param('areamaxbytes', FILE_AREA_MAX_BYTES_UNLIMITED, PARAM_INT);    // Area maxbytes.
$accepted_types = optional_param_array('accepted_types', '*', PARAM_RAW);

// the path to save files
$savepath = optional_param('savepath', '/',    PARAM_PATH);
// path in draft area
$draftpath = optional_param('draftpath', '/',    PARAM_PATH);

// user context
$user_context = context_user::instance($USER->id);

$PAGE->set_context($user_context);
if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
    print_error('invalidcourseid');
}
$PAGE->set_course($course);

if ($repo_id) {
    // Get repository instance information
    $repooptions = array(
        'ajax' => false,
        'mimetypes' => $accepted_types
    );
    $repo = repository::get_repository_by_id($repo_id, $contextid, $repooptions);

    // Check permissions
    $repo->check_capability();
}

$context = context::instance_by_id($contextid);

// Make sure maxbytes passed is within site filesize limits.
$maxbytes = get_user_max_upload_file_size($context, $CFG->maxbytes, $course->maxbytes, $maxbytes);

$params = array('ctx_id' => $contextid, 'itemid' => $itemid, 'env' => $env, 'course'=>$courseid, 'maxbytes'=>$maxbytes, 'areamaxbytes'=>$areamaxbytes, 'maxfiles'=>$maxfiles, 'subdirs'=>$subdirs, 'sesskey'=>sesskey());
$params['action'] = 'browse';
$params['draftpath'] = $draftpath;
$home_url = new moodle_url('/repository/draftfiles_manager.php', $params);

$params['savepath'] = $savepath;
$params['repo_id'] = $repo_id;
$url = new moodle_url($CFG->httpswwwroot."/repository/filepicker.php", $params);
$PAGE->set_url('/repository/filepicker.php', $params);

switch ($action) {
case 'upload':
    // The uploaded file has been processed in plugin construct function
    // redirect to default page
    try {
        $repo->upload('', $maxbytes);
        redirect($home_url, get_string('uploadsucc','repository'));
    } catch (moodle_exception $e) {
        // inject target URL
        $e->link = $PAGE->url->out();
        echo $OUTPUT->header(); // hack: we need the embedded header here, standard error printing would not use it
        throw $e;
    }
    break;

case 'search':
    echo '
out() . '">'.get_string('back', 'repository')."
";
    try {
        $search_result = $repo->search($search_text);
        $search_result['issearchresult'] = true;
        $search_result['repo_id'] = $repo_id;

        // TODO: need a better solution
        $purl = new moodle_url($url, array('search_paging' => 1, 'action' => 'search', 'repo_id' => $repo_id));
        $pagingbar = new paging_bar($search_result['total'], $search_result['page'] - 1, $search_result['perpage'], $purl, 'p');
        echo $OUTPUT->render($pagingbar);

        echo '
';
        foreach ($search_result['list'] as $item) {
            echo '
';
            echo '';
            $style = '';
            if (isset($item['thumbnail_height'])) {
                $style .= 'max-height:'.$item['thumbnail_height'].'px;';
            }
            if (isset($item['thumbnail_width'])) {
                $style .= 'max-width:'.$item['thumbnail_width'].'px;';
            }
            echo html_writer::empty_tag('img', array('src' => $item['thumbnail'], 'alt' => '', 'style' => $style));
            echo '	';
            if (!empty($item['url'])) {
                echo html_writer::link($item['url'], s($item['title']), array('target'=>'_blank'));
            } else {
                echo s($item['title']);
            }
            echo '	';
            echo '';
            echo '<form method="post">';
            echo '<input type="hidden" name="fileurl" value="'.s($item['source']).'"/>';
            echo '<input type="hidden" name="action" value="confirm"/>';
            echo '<input type="hidden" name="filename" value="'.s($item['title']).'"/>';
            echo '<input type="hidden" name="thumbnail" value="'.s($item['thumbnail']).'"/>';
            echo '<input type="submit" value="'.s(get_string('select','repository')).'" />';
            echo '</form>';
            echo '	';
            echo '
';
        }
        echo '
';
    } catch (repository_exception $e) {
    }
    break;

case 'list':
case 'sign':
    echo $OUTPUT->header();

    echo $OUTPUT->container_start();
    echo html_writer::link($url, get_string('back', 'repository'));
    echo $OUTPUT->container_end();

    if ($repo->check_login()) {
        $list = $repo->get_listing($req_path, $curr_page);
        $dynload = !empty($list['dynload'])?true:false;
        if (!empty($list['upload'])) {
            echo '<form action="'.$url->out().'" method="post" enctype="multipart/form-data" style="display:inline">';
            echo ''.$list['upload']['label'].': ';
            echo '<input type="file" name="repo_upload_file" />
';
            echo '<input type="hidden" name="action" value="upload" />
';
            echo '<input type="hidden" name="draftpath" value="'.s($draftpath).'" />
';
            echo '<input type="hidden" name="savepath" value="'.s($savepath).'" />
';
            echo '<input type="hidden" name="repo_id" value="'.s($repo_id).'" />
';
            echo '<input type="submit" value="'.s(get_string('upload', 'repository')).'" />';
            echo '</form>';
        } else {
            if (!empty($list['path'])) {
                foreach ($list['path'] as $p) {
                    //echo '<form method="post" style="display:inline">';
                    //echo '<input type="hidden" name="p" value="'.s($p['path']).'"';
                    //echo '<input type="hidden" name="action" value="list"';
                    //echo '<input type="hidden" name="draftpath" value="'.s($draftpath).'" />
';
                    //echo '<input type="hidden" name="savepath" value="'.s($savepath).'" />
';
                    //echo '<input style="display:inline" type="submit" value="'.s($p['name']).'" />';
                    //echo '</form>';

                    $pathurl = new moodle_url($url, array(
                        'p'=>$p['path'],
                        'action'=>'list',
                        'draftpath'=>$draftpath,
                        'savepath'=>$savepath
                        ));
                    echo '' . html_writer::link($pathurl, s($p['name'])) . '';
                    echo ' / ';
                }
            }
            if (!empty($list['page'])) {
                // TODO MDL-28482: need a better solution
                // paging_bar is not a good option because it starts page numbering from 0 and
                // repositories number pages starting from 1.
                $pagingurl = new moodle_url("$CFG->httpswwwroot/repository/filepicker.php?action=list&itemid=$itemid&ctx_id=$contextid&repo_id=$repo_id&course=$courseid&sesskey=".  sesskey());
                if (!isset($list['perpage']) && !isset($list['total'])) {
                    $list['perpage'] = 10; // instead of setting perpage&total we use number of pages, the result is the same
                }
                if (empty($list['total'])) {
                    if ($list['pages'] == -1) {
                        $total = ($list['page'] + 2) * $list['perpage'];
                    } else {
                        $total = $list['pages'] * $list['perpage'];
                    }
                } else {
                    $total = $list['total'];
                }
                echo $OUTPUT->paging_bar($total, $list['page'], $list['perpage'], $pagingurl);
            }
            echo '
';
            foreach ($list['list'] as $item) {
                echo '
';
                echo '';
                $style = '';
                if (isset($item['thumbnail_height'])) {
                    $style .= 'max-height:'.$item['thumbnail_height'].'px;';
                }
                if (isset($item['thumbnail_width'])) {
                    $style .= 'max-width:'.$item['thumbnail_width'].'px;';
                }
                echo html_writer::empty_tag('img', array('src' => $item['thumbnail'], 'style' => $style));
                echo '	';
                if (!empty($item['url'])) {
                    echo html_writer::link($item['url'], s($item['title']), array('target'=>'_blank'));
                } else {
                    echo s($item['title']);
                }
                echo '	';
                echo '';
                if (!isset($item['children'])) {
                    echo '<form method="post">';
                    echo '<input type="hidden" name="fileurl" value="'.s($item['source']).'"/>';
                    echo '<input type="hidden" name="action" value="confirm"/>';
                    echo '<input type="hidden" name="draftpath" value="'.s($draftpath).'" />
';
                    echo '<input type="hidden" name="savepath" value="'.s($savepath).'" />
';
                    echo '<input type="hidden" name="filename" value="'.s($item['title']).'"/>';
                    echo '<input type="hidden" name="thumbnail" value="'.s($item['thumbnail']).'"/>';
                    echo '<input type="submit" value="'.s(get_string('select','repository')).'" />';
                    echo '</form>';
                } else {
                    echo '<form method="post">';
                    echo '<input type="hidden" name="p" value="'.s($item['path']).'"/>';
                    echo '<input type="submit" value="'.s(get_string('enter', 'repository')).'" />';
                    echo '</form>';
                }
                echo '	';
                echo '
';
            }
            echo '
';
        }
    } else {
        echo '<form method="post">';
        echo '<input type="hidden" name="action" value="sign" />';
        echo '<input type="hidden" name="repo_id" value="'.s($repo_id).'" />';
        // HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
        echo prevent_form_autofill_password();
        $repo->print_login();
        echo '</form>';
    }
    echo $OUTPUT->footer();
    break;

case 'download':
    // Check that user has permission to access this file
    if (!$repo->file_is_accessible($fileurl)) {
        print_error('storedfilecannotread');
    }
    $record = new stdClass();
    $reference = $repo->get_file_reference($fileurl);

    $sourcefield = $repo->get_file_source_info($fileurl);
    $record->source = repository::build_source_field($sourcefield);

    // If file is already a reference, set $fileurl = file source, $repo = file repository
    // note that in this case user may not have permission to access the source file directly
    // so no file_browser/file_info can be used below
    if ($repo->has_moodle_files()) {
        $file = repository::get_moodle_file($reference);
        if ($file && $file->is_external_file()) {
            $sourcefield = $file->get_source(); // remember the original source
            $record->source = $repo::build_source_field($sourcefield);
            $reference = $file->get_reference();
            $repo_id = $file->get_repository_id();
            $repo = repository::get_repository_by_id($repo_id, $contextid, $repooptions);
        }
    }

    $record->filepath = $savepath;
    $record->filename = $filename;
    $record->component = 'user';
    $record->filearea = 'draft';
    $record->itemid   = $itemid;
    $record->license  = '';
    $record->author   = '';

    $now = time();
    $record->timecreated  = $now;
    $record->timemodified = $now;
    $record->userid       = $USER->id;
    $record->contextid = $user_context->id;
    $record->sortorder = 0;

    if ($repo->has_moodle_files()) {
        $fileinfo = $repo->copy_to_area($reference, $record, $maxbytes, $areamaxbytes);
        redirect($home_url, get_string('downloadsucc', 'repository'));
    } else {
        $thefile = $repo->get_file($reference, $filename);
        if (!empty($thefile['path'])) {
            $filesize = filesize($thefile['path']);
            if ($maxbytes != -1 && $filesize>$maxbytes) {
                unlink($thefile['path']);
                print_error('maxbytes');
            }
            // Ensure the file will not make the area exceed its size limit.
            if (file_is_draft_area_limit_reached($record->itemid, $areamaxbytes, $filesize)) {
                unlink($thefile['path']);
                print_error('maxareabytes');
            }
            try {
                $info = repository::move_to_filepool($thefile['path'], $record);
                redirect($home_url, get_string('downloadsucc', 'repository'));
            } catch (moodle_exception $e) {
                // inject target URL
                $e->link = $PAGE->url->out();
                echo $OUTPUT->header(); // hack: we need the embedded header here, standard error printing would not use it
                throw $e;
            }
        } else {
            print_error('cannotdownload', 'repository');
        }
    }

    break;

case 'confirm':
    echo $OUTPUT->header();
    echo '
url->out(false)).'">'.get_string('back', 'repository').'
';
    echo '';
    echo '<form method="post">';
    echo '
';
    echo '
';
    echo '    '. html_writer::label(get_string('filename', 'repository'), 'filename'). '	';
    echo '    <input type="text" id="filename" name="filename" value="'.s($filename).'" />	';
    echo '    <input type="hidden" name="fileurl" value="'.s($fileurl).'" />	';
    echo '    <input type="hidden" name="action" value="download" />	';
    echo '    <input type="hidden" name="itemid" value="'.s($itemid).'" />	';
    echo '
';
    echo '
';
    echo '
';
    // the save path
    echo ' <input name="draftpath" type="hidden" value="'.s($draftpath).'" />';
    echo ' <input name="savepath" type="hidden" value="'.s($savepath).'" />';
    echo ' <input type="submit" value="'.s(get_string('download', 'repository')).'" />';
    echo '
';
    echo '</form>';
    echo $OUTPUT->footer();
    break;

default:
case 'plugins':
    $params = array();
    $params['context'] = array($user_context, context_system::instance());
    $params['currentcontext'] = $PAGE->context;
    $params['return_types'] = FILE_INTERNAL;

    $repos = repository::get_instances($params);
    echo $OUTPUT->header();
    echo html_writer::link($home_url->out(false), get_string('backtodraftfiles', 'repository'));
    echo '
';
    echo '
';
    foreach($repos as $repo) {
        $info = $repo->get_meta();

        $aurl = clone($url);
        $aurl->params(array('savepath'=>$savepath, 'action' => 'list', 'repo_id' => $info->id, 'draftpath'=>$draftpath));

        echo '
';
        echo html_writer::empty_tag('img', array('src'=>$info->icon, 'alt'=>$info->name, 'class'=>'icon icon-pre'));
        echo html_writer::link($aurl, s($info->name));
        echo '
';
    }
    echo '
';
    echo '
';
    echo $OUTPUT->footer();
    break;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;

using System.Globalization;

namespace WPFMachine.RTBSubclasses
{
    public class ZRun : Run
    {
        public ZRun(FontFamily Family)
            : this(Family, "")
        { }

        public ZRun(FontFamily Family, String Text)
            : base(Text)
        {
            this.FontStyle = System.Windows.FontStyles.Normal;
            this.FontWeight = System.Windows.FontWeights.Normal;
            this.FontFamily = Family;

        }

        private double? _width = null;
        public double Width
        {
            get
            {
                if (_width == null)
                {
                    _width = DetermineWidth();
                }
                return (double)_width;
            }
        }

        internal event EventHandler WidthChanged;
        protected void OnWidthChanged()
        {
            _width = null;
            if (WidthChanged != null)
            {
                WidthChanged(this, EventArgs.Empty);
            }
        }

        public new FontStyle FontStyle
        {
            get { return base.FontStyle; }
            set {
                if (base.FontStyle != value)
                {
                    OnWidthChanged();
                    base.FontStyle = value;
                }
            }
        }

        public new FontWeight FontWeight
        {
            get { return base.FontWeight; }
            set {
                if (base.FontWeight != value)
                {
                    OnWidthChanged();
                    base.FontWeight = value;
                }
            }
        }

        public new String Text
        {
            get { return base.Text; }
            set {
                if (base.Text != value)
                {
                    OnWidthChanged();
                    base.Text = value;
                }
            }
        }

        private double DetermineWidth()
        {
            NumberSubstitution ns = new NumberSubstitution();
            FormattedText ft = new FormattedText(Text,
            CultureInfo.CurrentCulture,
            FlowDirection.LeftToRight,
            new Typeface(this.FontFamily, this.FontStyle, this.FontWeight, this.FontStretch),
            this.FontSize,
            this.Foreground, ns, TextFormattingMode.Display);

            return ft.Width;
        }
    }
}


text:
class Tadpole < ActiveRecord::Base
  belongs_to :frog
  has_one :pond, through: :frog
  #A belongs_to association cannot have a :through option.
end


text:
#ifndef LSEC_CONTEXT_H
#define LSEC_CONTEXT_H

#include <lua.h>
#include <openssl/ssl.h>

#include "config.h"

#define LSEC_MODE_INVALID 0
#define LSEC_MODE_SERVER  1
#define LSEC_MODE_CLIENT  2

#define LSEC_VERIFY_CONTINUE        1
#define LSEC_VERIFY_IGNORE_PURPOSE  2

typedef struct t_context_ {
  SSL_CTX *context;
  lua_State *L;
  DH *dh_param;
  int mode;
} t_context;
typedef t_context* p_context;

/* Retrieve the SSL context from the Lua stack */
SSL_CTX *lsec_checkcontext(lua_State *L, int idx);
SSL_CTX *lsec_testcontext(lua_State *L, int idx);

/* Retrieve the mode from the context in the Lua stack */
int lsec_getmode(lua_State *L, int idx);

/* Registre the module. */
LSEC_API int luaopen_ssl_context(lua_State *L);

#endif