text:
"""Utilities for loading Byte-Compiled Scripts.

@see: Cake Build System (http://sourceforge.net/projects/cake-build)
@copyright: Copyright (c) 2010 Lewis Baker, Stuart McMahon.
@license: Licensed under the MIT license.
"""

import __builtin__
import imp
import marshal
import os
import sys
import struct
import platform

# Magic header written at start of file
_MAGIC = imp.get_magic()
_MAGIC_LEN = len(_MAGIC)
_NOTMAGIC = '\0' * _MAGIC_LEN

assert _MAGIC != _NOTMAGIC

# Define an internal helper according to the platform
if platform.system() in ['Darwin']:
  import MacOS
  def _setCreatorType(file):
    MacOS.SetCreatorAndType(file, 'Pyth', 'PYC ')
else:
  def _setCreatorType(file):
    pass

def loadCode(file, cfile=None, dfile=None, cached=True):
  """Load the code object for the specified python file.

  Uses the bytecode cache file if it exists and matches the timestamp of
  the source file. These files have the same format as the .pyc/.pyo files
  used by Python module import logic.

  @param file: Path of the source file to load.

  @param cfile: If specified, the path of the bytecode cache file.
  Defaults to path of the original file with either 'c' or 'o' appended.

  @param dfile: If specified, the path of the file to show in error
  messages. Defaults to C{file}.

  @param cached: True if the byte code should be cached to a separate
  file for quicker loading next time.
  @type cached: bool

  @return: The code object resulting from compiling the python source file.
  This can be executed by the 'exec' statement/function.
  """
  if cfile is None:
    cfile = file + (__debug__ and 'c' or 'o')

  timestamp = None

  try:
    if sys.dont_write_bytecode:
      cached = False
  except AttributeError:
    # Fallback for Python 2.5 or earlier
    if "PYTHONDONTWRITEBYTECODE" in os.environ:
      cached = False

  if cached:
    # Try to load the cache file if possible, don't sweat if we can't
    try:
      f = open(cfile, 'rb')
      try:
        if f.read(_MAGIC_LEN) == _MAGIC:
          cacheTimestamp = struct.unpack('<I', f.read(4))[0]
          timestamp = long(os.stat(file).st_mtime)
          if timestamp == cacheTimestamp:
            return marshal.load(f)
      finally:
        f.close()
    except Exception:
      # Failed to load the cache file
      pass

  # Load the source file
  f = open(file, 'rU')
  try:
    if timestamp is None:
      try:
        timestamp = long(os.fstat(f.fileno()).st_mtime)
      except AttributeError:
        timestamp = long(os.stat(file).st_mtime)
    codestring = f.read()
  finally:
    f.close()

  # Source needs a trailing newline to compile correctly
  if not codestring.endswith('\n'):
    codestring = codestring + '\n'

  # Compile the source
  codeobject = __builtin__.compile(codestring, dfile or file, 'exec')

  if cached:
    # Try to save the cache file if possible, don't sweat if we can't
    try:
      f = open(cfile, 'wb')
      try:
        f.write(_NOTMAGIC)
        f.write(struct.pack('<I', timestamp))
        marshal.dump(codeobject, f)
        f.flush()
        f.seek(0, 0)
        f.write(_MAGIC)
      finally:
        f.close()
      _setCreatorType(cfile)
    except Exception:
      pass

  return codeobject


text:
using System;
using System.Collections.Generic;
using System.Speech.Synthesis;
using Cradiator.Config;
using Cradiator.Model;

namespace Cradiator.Audio
{
	public class SpeechMaker : IConfigObserver
	{
		readonly TimeSpan OneSecond = new TimeSpan(0, 0, 1);

		readonly ISpeechTextParser _speechTextParser;
		string _brokenBuildText;
		string _fixedBuildText;

		public SpeechMaker(IConfigSettings configSettings, ISpeechTextParser speechTextParser)
		{
			_speechTextParser = speechTextParser;
			_brokenBuildText = configSettings.BrokenBuildText;
			_fixedBuildText = configSettings.FixedBuildText;
			configSettings.AddObserver(this);
		}

		public PromptBuilder BuildIsBroken(IEnumerable<ProjectStatus> projects)
		{
			return MakeSpeech(projects, _brokenBuildText);
		}

		public PromptBuilder BuildIsFixed(IEnumerable<ProjectStatus> projects)
		{
			return MakeSpeech(projects, _fixedBuildText);
		}

		PromptBuilder MakeSpeech(IEnumerable<ProjectStatus> projects, string rawSentence)
		{
			var promptBuilder = new PromptBuilder();

			if (string.IsNullOrEmpty(rawSentence)) return promptBuilder;

			promptBuilder.AppendBreak(OneSecond);
			foreach (var project in projects)
			{
				promptBuilder.AppendBreak(OneSecond);
				promptBuilder.AppendText(_speechTextParser.Parse(rawSentence, project));
			}
			return promptBuilder;
		}

		public void ConfigUpdated(ConfigSettings newSettings)
		{
			_brokenBuildText = newSettings.BrokenBuildText;
			_fixedBuildText = newSettings.FixedBuildText;
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
import sys
import logging
import json as JSON
from network import Client
from PyQt4.QtCore import SIGNAL, QObject, QString, pyqtSignal
from basecontroller import BaseController

SERVICE_NAME = 'GameService'
GET_GAME_LIST_ID = "GET_GAME_LIST"

class GameController(BaseController):
    game_list_signal = pyqtSignal(unicode)

    def __init__(self):
        BaseController.__init__(self, service_name=SERVICE_NAME)
        self.game_list = None
        # self.c.register(GET_GAME_LIST_ID, self.get_game_list_callback)

    def add_polling_game_list_task(self):
        client = self.get_client()
        client.set_periodic_task(self.get_game_list, (), self.get_game_list_callback, GET_GAME_LIST_ID)

    def get_game_list(self):
        req = {}
        client = self.get_client()
        client.send(service_name=SERVICE_NAME, method=GET_GAME_LIST_ID, msg=req)

    def get_game_list_callback(self, data):
        if data and data.get('code') == 200:
            game_list = data.get(u'list')
            logging.debug("get_game_list_callback %s", game_list)
            self.game_list = game_list
            self.connector.emit(SIGNAL('game_list_clear'))
            for game in game_list:
                txt = '{} vs {}'.format(game.get('host_name'), game.get('guest_name'))
                id = game.get('id')
                if id is None:
                    logging.debug("Invalid format %s", game)
                    continue
                self.connector.emit(SIGNAL('game_list'), QString(txt), QString(id))
                logging.debug("ret : %s", txt)

    def testEmit(self):
        self.game_list_signal.emit(unicode('123'))


text:
@implementation NSBundle (VeeContactPicker)

+ (NSBundle *)veeContactPickerBundle {
    return [NSBundle bundleForClass:VeeCommons.class];
}

@end


text:
@interface YDBMenuViewController : UIViewController

@end


text:
namespace BusDriver.Commands
{
	public interface Command
	{
		bool Execute();
	}
}


text:
set -e
xargs=$(which gxargs || which xargs)

# Validate settings.
[ "$TRACE" ] && set -x

CONFIG=$@

for line in $CONFIG; do
  eval "$line"
done

# Define variables.
GH_API="https://api.github.com"
GH_REPO="$GH_API/repos/fastavro/fastavro"
GH_TAGS="$GH_REPO/releases/tags/$tag"
AUTH="Authorization: token $github_api_token"
WGET_ARGS="--content-disposition --auth-no-challenge --no-cookie"
CURL_ARGS="-LJO#"
filename=$(eval ls "$filename")

# Validate token.
curl -o /dev/null -sH "$AUTH" $GH_REPO || { echo "Error: Invalid repo, token or network issue!";  exit 1; }

# Read asset tags.
response=$(curl -sH "$AUTH" $GH_TAGS)

# Get ID of the asset based on given filename.
eval $(echo "$response" | grep -m 1 "id.:" | grep -w id | tr : = | tr -cd '[[:alnum:]]=')
[ "$id" ] || { echo "Error: Failed to get release id for tag: $tag"; echo "$response" | awk 'length($0)<100' >&2; exit 1; }

# Upload asset
echo "Uploading asset... "

# Construct url
GH_ASSET="https://uploads.github.com/repos/fastavro/fastavro/releases/$id/assets?name=$(basename $filename)"

curl "$GITHUB_OAUTH_BASIC" --data-binary @"$filename" -H "Authorization: token $github_api_token" -H "Content-Type: application/octet-stream" $GH_ASSET


text:
/**
 * @module Ajax客户端[AjaxClient]
 * @description Ajax客户端
 *
 * @author:
 * @date: 2013-08-29 下午1:48
 */
define([
    "core/js/Class",
    "core/js/rpc/AjaxRequest",
    "core/js/rpc/JsonResponse",
    "jquery.fileDownload"], function (Class, AjaxRequest, JsonResponse) {
    var AjaxClient = Class.extend({
        /**
         * 服务地址
         */
        serverUrl: null,

        ctor: function (serverUrl) {
            this.serverUrl = serverUrl;
        },
        buildClientRequest: function (methodName, methodVersion, ignoreNull) {
            return new AjaxRequest(this, methodName, methodVersion, ignoreNull);
        },
        buildJsonResponse: function (transport, callback, responseData) {
            return new JsonResponse(transport, callback, responseData);
        },
        getServerUrl: function () {
            return this.serverUrl;
        },
        setServerUrl: function (serverUrl) {
            this.serverUrl = serverUrl;
        },

        /**
         * 导出文件
         *
         * @param methodName
         * @param methodVersion
         * @param attachParams
         */
        exportFile: function (methodName, methodVersion, attachParams) {
            if (typeof methodName == "object") {
                attachParams = methodName;
                methodName = attachParams["methodName"];
                methodVersion = attachParams["methodVersion"];
                $.fileDownload(methodName, {
                    prepareCallback:attachParams["prepareCallback"],
                    successCallback:attachParams["successCallback"],
                    failCallback:attachParams["failCallback"]
                    //preparingMessageHtml: "We are preparing your report, please wait...",
                    //failMessageHtml: "There was a problem generating your report, please try again."
                });
            }else{
                $.fileDownload(methodName);
            }
        },
        get: function (methodName, methodVersion, data, callback, ajaxResponse, async, dataType, cache, contentType, timeout, interceptSystemException, ignoreNull) {
            return this.method("get", methodName, methodVersion, data, callback, ajaxResponse, async, dataType, cache, contentType, timeout, interceptSystemException, ignoreNull);
        },
        post: function (methodName, methodVersion, data, callback, ajaxResponse, async, dataType, cache, contentType, timeout, interceptSystemException, ignoreNull) {
            return this.method("post", methodName, methodVersion, data, callback, ajaxResponse, async, dataType, cache, contentType, timeout, interceptSystemException, ignoreNull);
        },
        method: function (ajaxMethod, methodName, methodVersion, data, callback, ajaxResponse, async, dataType, cache, contentType, timeout, interceptSystemException, ignoreNull) {
            if (typeof methodName == "object") {
                var opts = methodName;
                methodName = opts["methodName"];
                methodVersion = opts["methodVersion"];
                ignoreNull = opts["ignoreNull"];
                data = opts["data"];
                dataType = opts["dataType"];              //add by cw 2013.12.25
                callback = opts;
            }

            var options = this._getOptions(callback, ajaxResponse, async, dataType, cache, contentType, timeout, interceptSystemException);

            return this.buildClientRequest(methodName, methodVersion, ignoreNull)
                .addParams(data)
                .method(ajaxMethod, options);
        },
        _getOptions: function (callback, ajaxResponse, async, dataType, cache, contentType, timeout, interceptSystemException) {
            if (typeof callback == "object") {
                var opts = callback;
                callback = opts["complete"];
                ajaxResponse = opts["ajaxResponse"];
                async = opts["async"];
                dataType = opts["dataType"];
                cache = opts["cache"];
                contentType = opts["contentType"];
                timeout = opts["timeout"];
                interceptSystemException = opts["interceptSystemException"];
            }

            var result = {
                complete: callback,
                ajaxResponse: ajaxResponse,
                async: async,
                dataType: dataType,
                cache: cache,
                contentType: contentType,
                timeout: timeout,
                interceptSystemException: interceptSystemException
            }

            return result;
        },

    });

    return AjaxClient;
});


text:
@implementation GGTestObject

-(NSMutableDictionary *)toJsonDicWithViews:(NSArray *)views{
    NSMutableDictionary *ret=[super toJsonDicWithViews:views];

    [ret setInt:self.intField forKey:jskIntValue];
    [ret setFloat:self.floatField forKey:jskFloatValue];
    [ret setString:self.stringField forKey:jskStringValue];
    [ret setDate:self.dateField forKey:jskDateValue];
    [ret setDate:self.dateTimeField forKey:jskDateTimeValue];
    [ret setDateInTimestampFormat:self.dateFromTimestampField forKey:jskDateFromTimestampValue];
    [ret setBoolean:self.booleanField forKey:jskBooleanValue];
    [ret setJsoneableObject:self.child forKey:jskchild withWiews:views];
    [ret setObjectArray:self.childArray forKey:jskchildArray withWiews:views];
    return ret;
}
-(instancetype)initWithJsonDic:(NSDictionary *)json{
    self = [super init];
    if(self){
        self.intField=[json getIntForKey:jskIntValue];
        self.floatField=[json getFloatForKey:jskFloatValue];
        self.stringField=[json getStringForKey:jskStringValue];
        self.dateField=[json getDateForKey:jskDateValue];
        self.dateTimeField=[json getDateForKey:jskDateTimeValue];
        self.dateFromTimestampField=[json getDateForKey:jskDateFromTimestampValue];
        self.booleanField=[json getBooleanForKey:jskBooleanValue];
        self.child=[json getObjectForKey:jskchild ofType:[GGTestObject class]];
        self.childArray=[json getObjectArrayForKey:jskchildArray ofType:[GGTestObject class]];
    }
    return self;
}

@end


text:
package de.proteinms.omxparser.util;

import java.io.Serializable;

/**
 * Iosotopic type of ion.
 *

 * Please see "OMSSA.mod.xsd" for further information:
 *

 * See http://www.ncbi.nlm.nih.gov/data_specs/schema/OMSSA.mod.xsd
 *
 * @author Steffen Huber
 * @author Harald Barsnes
 */
public class MSIon_isotope implements Serializable {

    /**
     * Iosotopic type of ion.
     *

     * Hint: To get the isotopic ion type as text use the OmssaEnumerators class.
     */
    public int MSIonIsotopicType;

    /**
     * Sets the MSIonIsotopicType value.
     *
     * @param s the MSIonIsotopicType value as a String
     */
    public void setMSIonIsotopicType(String s) {
        this.MSIonIsotopicType = Integer.valueOf(s);
    }
}


text:
/*
 * Do not modify this file. This file is generated from the dynamodb-2012-08-10.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;

using Amazon.DynamoDBv2.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;

namespace Amazon.DynamoDBv2.Model.Internal.MarshallTransformations
{
    /// <summary>
    /// Response Unmarshaller for AttributeValue Object
    /// </summary>
    public class AttributeValueUnmarshaller : IUnmarshaller<AttributeValue, XmlUnmarshallerContext>, IUnmarshaller<AttributeValue, JsonUnmarshallerContext>
    {
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        AttributeValue IUnmarshaller<AttributeValue, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public AttributeValue Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
                return null;

            AttributeValue unmarshalledObject = new AttributeValue();

            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("B", targetDepth))
                {
                    var unmarshaller = MemoryStreamUnmarshaller.Instance;
                    unmarshalledObject.B = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("BOOL", targetDepth))
                {
                    var unmarshaller = BoolUnmarshaller.Instance;
                    unmarshalledObject.BOOL = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("BS", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller<MemoryStream, MemoryStreamUnmarshaller>(MemoryStreamUnmarshaller.Instance);
                    unmarshalledObject.BS = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("L", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller<AttributeValue, AttributeValueUnmarshaller>(AttributeValueUnmarshaller.Instance);
                    unmarshalledObject.L = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("M", targetDepth))
                {
                    var unmarshaller = new DictionaryUnmarshaller<string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller>(StringUnmarshaller.Instance, AttributeValueUnmarshaller.Instance);
                    unmarshalledObject.M = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("N", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    unmarshalledObject.N = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("NS", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
                    unmarshalledObject.NS = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("NULL", targetDepth))
                {
                    var unmarshaller = BoolUnmarshaller.Instance;
                    unmarshalledObject.NULL = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("S", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    unmarshalledObject.S = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("SS", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
                    unmarshalledObject.SS = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return unmarshalledObject;
        }

        private static AttributeValueUnmarshaller _instance = new AttributeValueUnmarshaller();

        /// <summary>
        /// Gets the singleton.
        /// </summary>
        public static AttributeValueUnmarshaller Instance
        {
            get
            {
                return _instance;
            }
        }
    }
}


text:
package cloudwatch

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs"
)

// New creates a new instance of the cloudwatchlogs client
func New(awsEndpointURL *string, awsProfile *string, awsRegion *string, log *log.Logger) *cloudwatchlogs.Client {
	//workaround to figure out the user actual home dir within a SNAP (rather than the sandboxed one)
	//and access the  .aws folder in its default location
	if os.Getenv("SNAP_INSTANCE_NAME") != "" {
		log.Printf("Snap Identified")
		realUserHomeDir := fmt.Sprintf("/home/%s", os.Getenv("USER"))
		if os.Getenv("AWS_SHARED_CREDENTIALS_FILE") == "" {
			credentialsPath := fmt.Sprintf("%s/.aws/credentials", realUserHomeDir)
			log.Printf("No custom credentials file location. Overriding to %s", credentialsPath)
			os.Setenv("AWS_SHARED_CREDENTIALS_FILE", credentialsPath)
		}
		if os.Getenv("AWS_CONFIG_FILE") == "" {
			configPath := fmt.Sprintf("%s/.aws/config", realUserHomeDir)
			log.Printf("No custom config file location. Overriding to %s", configPath)
			os.Setenv("AWS_CONFIG_FILE", configPath)
		}
	}

	profile := ""
	region := ""
	if awsProfile != nil && *awsProfile != "" {
		profile = *awsProfile
	}
	if awsRegion != nil && *awsRegion != "" {
		region = *awsRegion
	}

	log.Printf("awsProfile: %s, awsRegion: %s endpoint: %s\n", profile, region, *awsEndpointURL)

	customResolver := aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) {
		if awsEndpointURL != nil && *awsEndpointURL != "" {
			log.Printf("awsEndpointURL:%s", *awsEndpointURL)
			return aws.Endpoint{
				PartitionID:   "aws",
				URL:           *awsEndpointURL,
				SigningRegion: region,
				SigningName:   "logs",
			}, nil
		}
		// returning EndpointNotFoundError will allow the service to fallback to it's default resolution
		return aws.Endpoint{}, &aws.EndpointNotFoundError{}
	})

	cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithSharedConfigProfile(profile),
		config.WithEndpointResolver(customResolver), config.WithRegion(region))
	if err != nil {
		os.Exit(1)
	}
	return cloudwatchlogs.NewFromConfig(cfg)
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Requirements</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/bootstrap-theme.css" rel="stylesheet">

    <link href="css/elegant-icons-style.css" rel="stylesheet" />
    <link href="css/font-awesome.min.css" rel="stylesheet" />

    <link href="assets/fullcalendar/fullcalendar/bootstrap-fullcalendar.css" rel="stylesheet" />
    <link href="assets/fullcalendar/fullcalendar/fullcalendar.css" rel="stylesheet" />

    <link href="assets/jquery-easy-pie-chart/jquery.easy-pie-chart.css" rel="stylesheet" type="text/css" media="screen"/>

    <link rel="stylesheet" href="css/owl.carousel.css" type="text/css">
    <link href="css/jquery-jvectormap-1.2.2.css" rel="stylesheet">

    <link rel="stylesheet" href="css/fullcalendar.css">
    <link href="css/widgets.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link href="css/style-responsive.css" rel="stylesheet" />
    <link href="css/xcharts.min.css" rel=" stylesheet">
    <link href="css/jquery-ui-1.10.4.min.css" rel="stylesheet">

      <link href="css/custom.css" rel="stylesheet" type="text/css" media="screen">
    <link rel="stylesheet" href="static/stylesheets/app.css">

    <link href="custom.css" rel="stylesheet" type="text/css" media="screen">

           Jennifer Alba

Hi, Jennifer

           Home

              Roster

           Requirements

           Shifts

 <form class="form-horizontal">
<fieldset>

<legend>Jennifer Smith- Outreach Volunteer</legend>

  Shadow

      <input type="radio" name="radios" id="radios-0" value="1" checked="checked">
      1

      <input type="radio" name="radios" id="radios-1" value="2">
      2

      <input type="radio" name="radios" id="radios-2" value="3">
      3

  Intro Portion

      <input type="radio" name="radios" id="radios-0" value="1" checked="checked">
      Yes

      <input type="radio" name="radios" id="radios-1" value="2">
      No

  Lead Alone

      <input type="radio" name="radios" id="radios-0" value="1" checked="checked">
      Yes

      <input type="radio" name="radios" id="radios-1" value="2">
      No

  Offsite Displays

      <input type="radio" name="radios" id="radios-0" value="1" checked="checked">
      Yes

      <input type="radio" name="radios" id="radios-1" value="2">
      No

  Reptile Handling Overview

  <input id="" name="" type="text" placeholder="Notes" class="form-control input-md">

    <select id="" name="" class="form-control" multiple="multiple">
      <option value="1">Reptile 1</option>
      <option value="2">Reptile 2</option>
      <option value="3">Reptile 3</option>
      <option value="4">Reptile 4</option>
    </select>

  Raptors Handling Overview

  <input id="" name="" type="text" placeholder="Notes" class="form-control input-md">

  Falconer's Knot

    <select id="" name="" class="form-control">
      <option value="1">Yes</option>
      <option value="2">No</option>
    </select>

    <select id="" name="" class="form-control" multiple="multiple">
      <option value="1">Bird 1</option>
      <option value="2">Bird 2</option>
      <option value="3">Bird 3</option>
      <option value="4">Bird 4</option>
      <option value="5">Bird 5</option>
    </select>

</fieldset>
</form>

    <button id="" name="" class="btn btn-primary">Update</button>


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.ascaria.zoneofuprising.cameras;

import com.jme3.input.InputManager;
import com.jme3.math.FastMath;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.renderer.Camera;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import cz.ascaria.zoneofuprising.ZoneOfUprising;
import cz.ascaria.zoneofuprising.controls.ControlAdapter;
import cz.ascaria.zoneofuprising.input.OrbitCameraInputListener;

/**
 * @author Ascaria
 */
public class OrbitCamera extends ControlAdapter implements CameraControl
{
    private Camera cam;
    private InputManager inputManager;

    private Node parent;
    private Vector3f oldTranslation = new Vector3f();
    private float sensivity;
    private float distance;

    private Vector3f parentUp = new Vector3f(0f, 1f, 0);
    private Vector2f pitchYaw = new Vector2f();

    private Node camNode;

    private OrbitCameraInputListener listener;

    /**
     * Initialize camera.
     * @param cam
     * @param camerasManager
     * @param sensivity
     */
    public void initialize(CamerasManager camerasManager, ZoneOfUprising app, float sensivity) {
        this.cam = camerasManager.getCamera();
        this.inputManager = camerasManager.getInputManager();
        this.sensivity = sensivity;
    }

    @Override
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);

        if(enabled) {
            oldTranslation.set(parent.getWorldTranslation());

            listener = new OrbitCameraInputListener(this, inputManager);
            listener.registerInputs();
        } else if(null != listener) {
            listener.clearInputs();
            listener = null;
        }
    }

    /**
     * Sets the spatial for the camera control, should only be used internally.
     * @param spatial
     */
    @Override
    public void setSpatial(Spatial spatial) {
        super.setSpatial(spatial);

        // Disable camera
        enabled = false;

        // Remove cam node if exist
        if(null != camNode) {
            camNode.removeFromParent();
            camNode = null;
        }

        // Initialize or cleanup camera
        if(spatial != null) {
            parent = spatial.getParent();
            distance = spatial.getLocalTranslation().length();

            parent.attachChild(camNode = new Node());
            camNode.setLocalTranslation(spatial.getLocalTranslation());
            camNode.lookAt(parent.getWorldTranslation(), parent.getWorldRotation().getRotationColumn(1));
        } else {
            if(null != listener) {
                listener.clearInputs();
                listener = null;
            }

            distance = 1f;
            parent = null;
        }
    }

    @Override
    protected void controlUpdate(float tpf)
    {
        if(enabled && null != camNode && null != parent) {

            // Count with location change
            cam.setLocation(cam.getLocation().add(parent.getWorldTranslation().subtract(oldTranslation)));
            oldTranslation.set(parent.getWorldTranslation());

            // Store up vector
            // TODO: lepsi je prej mult(vector.y)
            parent.getWorldRotation().getRotationColumn(1, parentUp);

            // Rotate spatial
            camNode.rotate(pitchYaw.x, pitchYaw.y, 0f);
            pitchYaw.zero();

            // Limit pitch
            float[] a = camNode.getLocalRotation().toAngles(null);
            a[0] = FastMath.clamp(a[0], -70f * FastMath.DEG_TO_RAD, 70f * FastMath.DEG_TO_RAD);
            camNode.setLocalRotation(new Quaternion().fromAngles(a));

            // Move spatial to desired location
            camNode.setLocalTranslation(camNode.getLocalRotation().mult(new Vector3f(0f, 0f, -distance)));

            // Look at parent (to fix up-axis)
            camNode.lookAt(parent.getWorldTranslation(), parentUp);

            Quaternion lerp = new Quaternion(cam.getRotation(), camNode.getWorldRotation(), tpf * 2f);
            Vector3f interp = new Vector3f();
            interp.interpolate(cam.getLocation(), camNode.getWorldTranslation(), tpf * 2f);

            cam.setRotation(lerp);
            cam.setLocation(interp);
            //cam.setRotation(camNode.getWorldRotation());
            //cam.setLocation(camNode.getWorldTranslation());
        }
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        throw new CloneNotSupportedException(this.getClass().getSimpleName() + " cannot be cloned.");
    }

    public void pitch(float value) {
        pitchYaw.x += FastMath.clamp(value, -0.15f, 0.15f) * sensivity;
    }

    public void yaw(float value) {
        pitchYaw.y += FastMath.clamp(value, -0.15f, 0.15f) * sensivity;
    }

    public void zoom(float value) {
        distance = FastMath.clamp(distance + value, 12f, 50f);
    }
}


text:
<?php

namespace Main\ClasseBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Classe
 *
 * @ORM\Table(name="calendrier")
 * @ORM\Entity(repositoryClass="Main\ClasseBundle\Entity\CalendrierRepository")
 */
class Calendrier
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

	/**
	 * @ORM\ManyToOne(targetEntity="Main\ClasseBundle\Entity\Classe",inversedBy="calendrier")
	 * @ORM\JoinColumn(name="classe_id", referencedColumnName="id", onDelete="CASCADE")
	*/
	protected $classe;

	/**
	 * @ORM\ManyToOne(targetEntity="Main\SavoirBundle\Entity\Savoir")
	 * @ORM\JoinColumn(name="savoir_id", referencedColumnName="id", onDelete="CASCADE")
	*/
	protected $savoir;

	/**
     * @var string
     *
     * @ORM\Column(name="start", type="date")
     */
    private $start;

	/**
     * @var string
     *
     * @ORM\Column(name="end", type="date")
     */
    private $end;

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

    /**
     * Set start
     *
     * @param \DateTime $start
     * @return Calendrier
     */
    public function setStart($start)
    {
        $this->start = $start;

        return $this;
    }

    /**
     * Get start
     *
     * @return \DateTime
     */
    public function getStart()
    {
        return $this->start;
    }

    /**
     * Set end
     *
     * @param \DateTime $end
     * @return Calendrier
     */
    public function setEnd($end)
    {
        $this->end = $end;

        return $this;
    }

    /**
     * Get end
     *
     * @return \DateTime
     */
    public function getEnd()
    {
        return $this->end;
    }

    /**
     * Set classe
     *
     * @param \Main\ClasseBundle\Entity\Classe $classe
     * @return Calendrier
     */
    public function setClasse(\Main\ClasseBundle\Entity\Classe $classe = null)
    {
        $this->classe = $classe;

        return $this;
    }

    /**
     * Get classe
     *
     * @return \Main\ClasseBundle\Entity\Classe
     */
    public function getClasse()
    {
        return $this->classe;
    }

    /**
     * Set savoir
     *
     * @param \Main\SavoirBundle\Entity\Savoir $savoir
     * @return Calendrier
     */
    public function setSavoir(\Main\SavoirBundle\Entity\Savoir $savoir = null)
    {
        $this->savoir = $savoir;

        return $this;
    }

    /**
     * Get savoir
     *
     * @return \Main\SavoirBundle\Entity\Savoir
     */
    public function getSavoir()
    {
        return $this->savoir;
    }
}


text:
using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace Unity_Studio
{
    class OpenFolderDialog
    {
        /// <summary>
        /// Gets/sets folder in which dialog will be open.
        /// </summary>
        public string InitialFolder { get; set; }

        /// <summary>
        /// Gets/sets directory in which dialog will be open if there is no recent directory available.
        /// </summary>
        public string DefaultFolder { get; set; }

        /// <summary>
        /// Gets selected folder.
        /// </summary>
        public string Folder { get; private set; }

        internal DialogResult ShowDialog(IWin32Window owner)
        {
            if (Environment.OSVersion.Version.Major >= 6)
            {
                return ShowVistaDialog(owner);
            }
            else
            {
                return ShowLegacyDialog(owner);
            }
        }

        private DialogResult ShowVistaDialog(IWin32Window owner)
        {
            var frm = (NativeMethods.IFileDialog)(new NativeMethods.FileOpenDialogRCW());
            uint options;
            frm.GetOptions(out options);
            options |= NativeMethods.FOS_PICKFOLDERS | NativeMethods.FOS_FORCEFILESYSTEM | NativeMethods.FOS_NOVALIDATE | NativeMethods.FOS_NOTESTFILECREATE | NativeMethods.FOS_DONTADDTORECENT;
            frm.SetOptions(options);
            if (this.InitialFolder != null)
            {
                NativeMethods.IShellItem directoryShellItem;
                var riid = new Guid("43826D1E-E718-42EE-BC55-A1E261C37BFE"); //IShellItem
                if (NativeMethods.SHCreateItemFromParsingName(this.InitialFolder, IntPtr.Zero, ref riid, out directoryShellItem) == NativeMethods.S_OK)
                {
                    frm.SetFolder(directoryShellItem);
                }
            }
            if (this.DefaultFolder != null)
            {
                NativeMethods.IShellItem directoryShellItem;
                var riid = new Guid("43826D1E-E718-42EE-BC55-A1E261C37BFE"); //IShellItem
                if (NativeMethods.SHCreateItemFromParsingName(this.DefaultFolder, IntPtr.Zero, ref riid, out directoryShellItem) == NativeMethods.S_OK)
                {
                    frm.SetDefaultFolder(directoryShellItem);
                }
            }

            if (frm.Show(owner.Handle) == NativeMethods.S_OK)
            {
                NativeMethods.IShellItem shellItem;
                if (frm.GetResult(out shellItem) == NativeMethods.S_OK)
                {
                    IntPtr pszString;
                    if (shellItem.GetDisplayName(NativeMethods.SIGDN_FILESYSPATH, out pszString) == NativeMethods.S_OK)
                    {
                        if (pszString != IntPtr.Zero)
                        {
                            try
                            {
                                this.Folder = Marshal.PtrToStringAuto(pszString);
                                return DialogResult.OK;
                            }
                            finally
                            {
                                Marshal.FreeCoTaskMem(pszString);
                            }
                        }
                    }
                }
            }
            return DialogResult.Cancel;
        }

        private DialogResult ShowLegacyDialog(IWin32Window owner)
        {
            using (var frm = new FolderBrowserDialog())
            {
                if (this.InitialFolder != null) { frm.SelectedPath = this.InitialFolder; }
                if (frm.ShowDialog(owner) == DialogResult.OK)
                {
                    this.Folder = Path.GetDirectoryName(frm.SelectedPath);
                    return DialogResult.OK;
                }
                else
                {
                    return DialogResult.Cancel;
                }
            }
        }
    }

    internal static class NativeMethods
    {

        #region Constants

        public const uint FOS_PICKFOLDERS = 0x00000020;
        public const uint FOS_FORCEFILESYSTEM = 0x00000040;
        public const uint FOS_NOVALIDATE = 0x00000100;
        public const uint FOS_NOTESTFILECREATE = 0x00010000;
        public const uint FOS_DONTADDTORECENT = 0x02000000;

        public const uint S_OK = 0x0000;

        public const uint SIGDN_FILESYSPATH = 0x80058000;

        #endregion

        #region COM

        [ComImport, ClassInterface(ClassInterfaceType.None), TypeLibType(TypeLibTypeFlags.FCanCreate), Guid("DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7")]
        internal class FileOpenDialogRCW { }

        [ComImport(), Guid("42F85136-DB7E-439C-85F1-E4075D135FC8"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
        internal interface IFileDialog
        {
            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            [PreserveSig()]
            uint Show([In, Optional] IntPtr hwndOwner); //IModalWindow

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint SetFileTypes([In] uint cFileTypes, [In, MarshalAs(UnmanagedType.LPArray)] IntPtr rgFilterSpec);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint SetFileTypeIndex([In] uint iFileType);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint GetFileTypeIndex(out uint piFileType);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint Advise([In, MarshalAs(UnmanagedType.Interface)] IntPtr pfde, out uint pdwCookie);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint Unadvise([In] uint dwCookie);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint SetOptions([In] uint fos);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint GetOptions(out uint fos);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            void SetDefaultFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint SetFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint GetFolder([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint GetCurrentSelection([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint SetFileName([In, MarshalAs(UnmanagedType.LPWStr)] string pszName);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint GetFileName([MarshalAs(UnmanagedType.LPWStr)] out string pszName);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint SetTitle([In, MarshalAs(UnmanagedType.LPWStr)] string pszTitle);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint SetOkButtonLabel([In, MarshalAs(UnmanagedType.LPWStr)] string pszText);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint SetFileNameLabel([In, MarshalAs(UnmanagedType.LPWStr)] string pszLabel);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint GetResult([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint AddPlace([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi, uint fdap);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint SetDefaultExtension([In, MarshalAs(UnmanagedType.LPWStr)] string pszDefaultExtension);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint Close([MarshalAs(UnmanagedType.Error)] uint hr);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint SetClientGuid([In] ref Guid guid);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint ClearClientData();

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint SetFilter([MarshalAs(UnmanagedType.Interface)] IntPtr pFilter);
        }

        [ComImport, Guid("43826D1E-E718-42EE-BC55-A1E261C37BFE"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
        internal interface IShellItem
        {
            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint BindToHandler([In] IntPtr pbc, [In] ref Guid rbhid, [In] ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out IntPtr ppvOut);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint GetParent([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint GetDisplayName([In] uint sigdnName, out IntPtr ppszName);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint GetAttributes([In] uint sfgaoMask, out uint psfgaoAttribs);

            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
            uint Compare([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi, [In] uint hint, out int piOrder);
        }

        #endregion

        [DllImport("shell32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        internal static extern int SHCreateItemFromParsingName([MarshalAs(UnmanagedType.LPWStr)] string pszPath, IntPtr pbc, ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out IShellItem ppv);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<!--

 Copyright 2003 - 2009 The eFaps Team

 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.

 Author:          The eFaps Team
 Revision:        $Rev$
 Last Changed:    $Date$
 Last Changed By: $Author$

-->

<ui-table xmlns="http://www.efaps.org/xsd"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd">
    <uuid>406f313a-9c50-4937-8a88-d98219684930</uuid>
    <file-application>eFapsApp-Products</file-application>
    <file-revision>$Rev$</file-revision>
    <definition>
        <version-expression>(version==latest)</version-expression>
        <name>Products_PriceListTable</name>
        <!-- fields -->
        <field name="name">
            <property name="SelectAlternateOID">linkto[ProductPricelist].linkto[ProductAbstractLink].oid</property>
            <property name="HRef">${COMMONURL}/MenuTree.jsp</property>
            <property name="Select">linkto[ProductPricelist].linkto[ProductAbstractLink].attribute[Name]</property>
            <property name="Label">Products_PriceListTable.name.Label</property>
            </field>
        <field name="description">
            <property name="Select">linkto[ProductPricelist].linkto[ProductAbstractLink].attribute[Description]</property>
            <property name="Label">Products_PriceListTable.description.Label</property>
        </field>
        <field name="active">
            <property name="Select">linkto[ProductPricelist].linkto[ProductAbstractLink].attribute[Active]</property>
            <property name="Label">Products_PriceListTable.active.Label</property>
        </field>
        <field name="dimension">
            <property name="Select">linkto[ProductPricelist].linkto[ProductAbstractLink].linkto[Dimension].attribute[Name]</property>
            <property name="Label">Products_PriceListTable.dimension.Label</property>
        </field>
        <field name="validFrom">
            <property name="Select">linkto[ProductPricelist].attribute[ValidFrom]</property>
            <property name="Label">Products_PriceListTable.validFrom.Label</property>
        </field>
        <field name="validUntil">
            <property name="Select">linkto[ProductPricelist].attribute[ValidUntil]</property>
            <property name="Label">Products_PriceListTable.validUntil.Label</property>
        </field>
        <field name="price">
            <property name="Attribute">Price</property>
            <property name="Label">Products_ProductPricelistPosition/Price.Label</property>
            <property name="Align">right</property>
        </field>
        <field name="currencyId">
            <property name="Select">linkto[CurrencyId].attribute[Name]</property>
            <property name="Label">Products_ProductPricelistPosition/CurrencyId.Label</property>
        </field>
    </definition>
</ui-table>


text:
"""Create tasks and evaluate submissions, implemented as taskqueues to work in the background"""

from auth import get_auth_service
from models import Submission
from utils import base_url

import cStringIO
import Image
import numpy
import logging
import random
import webapp2
from apiclient.errors import HttpError
from google.appengine.api import files
from google.appengine.api import taskqueue
from google.appengine.api.images import get_serving_url
from google.appengine.ext import blobstore
from google.appengine.ext import ndb
from oauth2client.client import AccessTokenRefreshError

COLORS = {
    "red": {"name": "Red", "hue": 0, "min": -15, "max": 15},
    "orange": {"name": "Orange", "hue": 30, "min": 15, "max": 45},
    "yellow": {"name": "Yellow", "hue": 60, "min": 40, "max": 90},
    "green": {"name": "Green", "hue": 120, "min": 90, "max": 180},
    "blue": {"name": "Blue", "hue": 240, "min": 180, "max": 260},
    "indigo": {"name": "Indigo", "hue": 280, "min": 250, "max": 310},
    "violet": {"name": "Violet", "hue": 320, "min": 300, "max": 345}
}

SOURCE_ITEM_ID = "colours_of_the_world_task"

class CreateTaskWorker(webapp2.RequestHandler):
    """
    Creates a new task for a user
    """

    def post(self):

        gplus_id = self.request.get("user")
        test = self.request.get("test")
        if test == "" or test == "None":
            test = None

        service = get_auth_service(gplus_id, test)
        if service is None:
            logging.error("User not authenticated")
            return

        if test is not None:
            user = ndb.Key("TestUser", gplus_id).get()
        else:
            user = ndb.Key("User", gplus_id).get()

        if user is None:
            logging.error("User not found")
            return

        col = random.choice(COLORS.keys())

        user.currentTask = col
        user.put()

        card = {
            "html": ("
"
                     "  "
                     "

"
                     "
"
                     "
Current Task: " + COLORS[col]["name"] + "
"
                     "
"
                     "
"),
            "menuItems": [
                {
                    "action": "CUSTOM",
                    "id": "giveup",
                    "values": [{
                        "displayName": "Give Up",
                        "iconUrl": "https://mirror-api.appspot.com/glass/images/error.png"
                    }]
                },
                {
                    "action": "TOGGLE_PINNED"
                }
            ],
            "sourceItemId": SOURCE_ITEM_ID
        }

        result = service.timeline().list(sourceItemId=SOURCE_ITEM_ID).execute()
        if "items" in result and len(result["items"]) > 0:
            request = service.timeline().update(id=result["items"][0]["id"], body=card)
        else:
            request = service.timeline().insert(body=card)

        try:
            request.execute()
        except AccessTokenRefreshError:
            logging.error("Failed to refresh access token.")
            return
        except HttpError as e:
            logging.error("Failed to execute request. %s" % e)
            return

class EvaluateWorker(webapp2.RequestHandler):
    """
    Creates a new task for a user
    """

    def post(self):

        gplus_id = self.request.get("user")
        test = self.request.get("test")
        if test == "" or test == "None":
            test = None

        item_id = self.request.get("item")

        service = get_auth_service(gplus_id, test)

        if service is None:
            logging.error("No valid credentials")
            return

        if test is not None:
            user = ndb.Key("TestUser", gplus_id).get()
        else:
            user = ndb.Key("User", gplus_id).get()

        if user.currentTask is None:
            logging.info("User has no current task")
            return

        item = service.timeline().get(id=item_id).execute()

        imageId = None
        if "attachments" in item:
            for att in item["attachments"]:
                if att["contentType"].startswith("image/"):
                    imageId = att["id"]
                    break

        if imageId is None:
            logging.info("No suitable attachment")
            return

        attachment_metadata = service.timeline().attachments().get(
            itemId=item["id"], attachmentId=imageId).execute()
        content_url = attachment_metadata.get("contentUrl")
        content_type = attachment_metadata.get("contentType")
        resp, content = service._http.request(content_url)

        if resp.status != 200:
            logging.info("Couldn't fetch attachment")

        tempimg = cStringIO.StringIO(content)
        i = Image.open(tempimg).convert("RGB").resize((200, 200), Image.ANTIALIAS)
        a = numpy.asarray(i, int)

        R, G, B = a.T

        m = numpy.min(a, 2).T
        M = numpy.max(a, 2).T

        #Chroma
        C = M - m
        Cmsk = C != 0

        # Hue
        H = numpy.zeros(R.shape, int)
        mask = (M == R) & Cmsk
        H[mask] = numpy.mod(60*(G-B)/C, 360)[mask]
        mask = (M == G) & Cmsk
        H[mask] = (60*(B-R)/C + 120)[mask]
        mask = (M == B) & Cmsk
        H[mask] = (60*(R-G)/C + 240)[mask]

        # Value
        V = M

        # Saturation
        S = numpy.zeros(R.shape, int)
        S[Cmsk] = ((255*C)/V)[Cmsk]

        mask = (V > 100) & (S > 100)

        count = {}
        for col in COLORS:
            count[col] = 0
            v1 = COLORS[col]["min"]
            v2 = COLORS[col]["max"]
            if (v1 < 0):
                col_mask = ((H < v2) | (H > 360 + v1)) & mask
            else:
                col_mask = ((H > v1) & (H < v2)) & mask
            Col = numpy.zeros(R.shape, int)
            Col[col_mask] = numpy.ones(R.shape, int)[col_mask]
            count[col] = numpy.count_nonzero(Col)

        sum = 0
        for col in count:
            if count[col] < 1000:
                count[col] = 0
            else:
                sum = sum + count[col]

        if sum == 0:
            item["text"] = "No colours recognized."
            service.timeline().update(id=item_id, body=item).execute()
            return

        recognized = []
        correct = False
        task = user.currentTask
        for col in count:
            count[col] = count[col] * 100 / sum
            if count[col] > 40:
                if col == task:
                    correct = True
                    break
                recognized.append(col)

        if correct:
            item["text"] = "Congratulations!"
            service.timeline().update(id=item_id, body=item).execute()
            user.currentTask = None
            user.put()

            # Insert submission
            file_name = files.blobstore.create(mime_type=content_type)
            with files.open(file_name, 'a') as f:
                f.write(content)
            files.finalize(file_name)
            blob_key = files.blobstore.get_blob_key(file_name)
            url = get_serving_url(blob_key, secure_url=True, size=640)

            submission = Submission(colour=task,
                                    hue=COLORS[task]["hue"],
                                    blobkey=blob_key,
                                    url=url,
                                    parent=user.key)
            submission.put()

            # TODO: Update scores/achievements

            # Create next task
            taskqueue.add(url="/tasks/createtask",
                          params={"user": gplus_id, "test": test},
                          method="POST")

        else:
            if len(recognized) == 0:
                item["text"] = "No colours recognized."
            else:
                item["text"] = "Recognized " + ", ".join(recognized) + " but your current task is " + user.currentTask

            service.timeline().update(id=item_id, body=item).execute()

TASK_ROUTES = [
    ("/tasks/createtask", CreateTaskWorker),
    ("/tasks/evaluate", EvaluateWorker)
]


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

namespace System.Drawing.Html
{
    /// <summary>
    /// Represents a line of text.
    /// </summary>
    /// <remarks>
    /// To learn more about line-boxes see CSS spec:
    /// http://www.w3.org/TR/CSS21/visuren.html
    /// </remarks>
    internal class CssLineBox
    {

        #region Fields

        private List<CssBoxWord> _words;
        private CssBox _ownerBox;
        private Dictionary<CssBox, RectangleF> _rects;
        private List<CssBox> _relatedBoxes;

        #endregion

        #region Ctors

        /// <summary>
        /// Creates a new LineBox
        /// </summary>
        public CssLineBox(CssBox ownerBox)
        {
            _rects = new Dictionary<CssBox, RectangleF>();
            _relatedBoxes = new List<CssBox>();
            _words = new List<CssBoxWord>();
            _ownerBox = ownerBox;
            _ownerBox.LineBoxes.Add(this);
        }

        #endregion

        #region Props

        /// <summary>
        /// Gets a list of boxes related with the linebox.
        /// To know the words of the box inside this linebox, use the <see cref="WordsOf"/> method.
        /// </summary>
        public List<CssBox> RelatedBoxes
        {
            get { return _relatedBoxes; }
        }

        /// <summary>
        /// Gets the words inside the linebox
        /// </summary>
        public List<CssBoxWord> Words
        {
            get { return _words; }
        }

        /// <summary>
        /// Gets the owner box
        /// </summary>
        public CssBox OwnerBox
        {
            get { return _ownerBox; }
        }

        /// <summary>
        /// Gets a List of rectangles that are to be painted on this linebox
        /// </summary>
        public Dictionary<CssBox, RectangleF> Rectangles
        {
            get { return _rects; }
        }

        #endregion

        #region Methods

        /// <summary>
        /// Gets the maximum bottom of the words
        /// </summary>
        /// <returns></returns>
        public float GetMaxWordBottom()
        {
            float res = float.MinValue;

            foreach (CssBoxWord word in Words)
            {
                res = Math.Max(res, word.Bottom);
            }

            return res;
        }

        #endregion

        /// <summary>
        /// Lets the linebox add the word an its box to their lists if necessary.
        /// </summary>
        /// <param name="word"></param>
        internal void ReportExistanceOf(CssBoxWord word)
        {
            if (!Words.Contains(word))
            {
                Words.Add(word);
            }

            if (!RelatedBoxes.Contains(word.OwnerBox))
            {
                RelatedBoxes.Add(word.OwnerBox);
            }
        }

        /// <summary>
        /// Return the words of the specified box that live in this linebox
        /// </summary>
        /// <param name="box"></param>
        /// <returns></returns>
        internal List<CssBoxWord> WordsOf(CssBox box)
        {
            List<CssBoxWord> r = new List<CssBoxWord>();

            foreach (CssBoxWord word in Words)
                if (word.OwnerBox.Equals(box)) r.Add(word);

            return r;
        }

        /// <summary>
        /// Updates the specified rectangle of the specified box.
        /// </summary>
        /// <param name="box"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="r"></param>
        /// <param name="b"></param>
        internal void UpdateRectangle(CssBox box, float x, float y, float r, float b)
        {
            float leftspacing = box.ActualBorderLeftWidth + box.ActualPaddingLeft;
            float rightspacing = box.ActualBorderRightWidth + box.ActualPaddingRight;
            float topspacing = box.ActualBorderTopWidth + box.ActualPaddingTop;
            float bottomspacing = box.ActualBorderBottomWidth + box.ActualPaddingTop;

            if ((box.FirstHostingLineBox != null && box.FirstHostingLineBox.Equals(this)) || box.IsImage) x -= leftspacing;
            if ((box.LastHostingLineBox != null && box.LastHostingLineBox.Equals(this)) || box.IsImage) r += rightspacing;

            if (!box.IsImage)
            {
                y -= topspacing;
                b += bottomspacing;
            }

            if (!Rectangles.ContainsKey(box))
            {
                Rectangles.Add(box, RectangleF.FromLTRB(x, y, r, b));
            }
            else
            {
                RectangleF f = Rectangles[box];
                Rectangles[box] = RectangleF.FromLTRB(
                    Math.Min(f.X, x), Math.Min(f.Y, y),
                    Math.Max(f.Right, r), Math.Max(f.Bottom, b));
            }

            if (box.ParentBox != null && box.ParentBox.Display == CssConstants.Inline)
            {
                UpdateRectangle(box.ParentBox, x, y, r, b);
            }
        }

        /// <summary>
        /// Copies the rectangles to their specified box
        /// </summary>
        internal void AssignRectanglesToBoxes()
        {
            foreach (CssBox b in Rectangles.Keys)
            {
                b.Rectangles.Add(this, Rectangles[b]);
            }
        }

        /// <summary>
        /// Draws the rectangles for debug purposes
        /// </summary>
        /// <param name="g"></param>
        internal void DrawRectangles(Graphics g)
        {
            foreach (CssBox b in Rectangles.Keys)
            {
                if (float.IsInfinity(Rectangles[b].Width))
                    continue;
                g.FillRectangle(new SolidBrush(Color.FromArgb(50, Color.Black)),
                    Rectangle.Round(Rectangles[b]));
                g.DrawRectangle(Pens.Red, Rectangle.Round(Rectangles[b]));
            }
        }

        /// <summary>
        /// Gets the baseline Height of the rectangle
        /// </summary>
        /// <param name="g"></param>
        /// <returns></returns>
        public float GetBaseLineHeight(CssBox b, Graphics g)
        {
            Font f = b.ActualFont;
            FontFamily ff = f.FontFamily;
            FontStyle s = f.Style;
            return f.GetHeight(g) * ff.GetCellAscent(s) / ff.GetLineSpacing(s);
        }

        /// <summary>
        /// Sets the baseline of the words of the specified box to certain height
        /// </summary>
        /// <param name="g">Device info</param>
        /// <param name="b">box to check words</param>
        /// <param name="baseline">baseline</param>
        internal void SetBaseLine(Graphics g,CssBox b, float baseline)
        {
            //TODO: Aqui me quede, checar poniendo "by the" con un font-size de 3em
            List<CssBoxWord> ws = WordsOf(b);

            if (!Rectangles.ContainsKey(b)) return;

            RectangleF r = Rectangles[b];

            //Save top of words related to the top of rectangle
            float gap = 0f;

            if (ws.Count > 0)
            {
                gap = ws[0].Top - r.Top;
            }
            else
            {
                CssBoxWord firstw = b.FirstWordOccourence(b, this);

                if (firstw != null)
                {
                    gap = firstw.Top - r.Top;
                }
            }

            //New top that words will have
            //float newtop = baseline - (Height - OwnerBox.FontDescent - 3); //OLD
            float newtop = baseline - GetBaseLineHeight(b, g); //OLD

            if (b.ParentBox != null &&
                b.ParentBox.Rectangles.ContainsKey(this) &&
                r.Height < b.ParentBox.Rectangles[this].Height)
            {
                //Do this only if rectangle is shorter than parent's
                float recttop = newtop - gap;
                RectangleF newr = new RectangleF(r.X, recttop, r.Width, r.Height);
                Rectangles[b] = newr;
                b.OffsetRectangle(this, gap);
            }
            foreach (CssBoxWord w in ws)
                if (!w.IsImage)
                    w.Top = newtop;
        }

        /// <summary>
        /// Returns the words of the linebox
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            string[] ws = new string[Words.Count];
            for (int i = 0; i < ws.Length; i++)
            {
                ws[i] = Words[i].Text;
            }
            return string.Join(" ", ws);
        }
    }
}


text:
/* $Name: Blau wie das Meer.$ */
.powered-by {
    position: fixed;
    bottom: 23px;
    right: 10px;
    width: 127px;
    height: 25px;
    z-index: 101;
    background-image:url(../images/blue/PoweredBy_ZF_4LightBG.png);
    margin-right: 10px;
}
.powered-by a {
    display: block;
    width: 127px;
    height: 25px;
}
body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 13px;
    padding-top: 25px;
    padding-right: 50px;
    padding-left: 50px;
    margin: 0;
}
h3 {
    vertical-align: middle;
}
#pageSpacer {
    height: 25px;
}
.nav-top {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    height: 21px;
    width: 100%;
    vertical-align: middle;
    background-image:url(../images/blue/nav-top.png);
    background-repeat: repeat-x;
    color: #FFFFFF;
    padding-left: 50px;
}
.nav-top .navigation {
    float: left;
    margin-top: 1px;
}
.nav-top .account{
    float:right;
    margin-top: 1px;
    margin-right:60px;
    text-align:right;
}
.nav-bottom {
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 100;
    height: 21px;
    width: 100%;
    vertical-align: middle;
    background-image:url(../images/blue/nav-bottom.png);
    background-repeat: repeat-x;
    color: #FFFFFF;
    padding-left: 50px;
}
.nav-bottom .navigation {
    float:left;
    margin-top: 2px;
}
.nav-bottom .version {
    float:right;
    text-align:right;
    margin-right:60px;
    margin-top: 2px;
}
.center-content {
    position:absolute;
    top:22px;
    bottom:22px;
    left:1px;
    right:1px;
    overflow:auto;
    padding-left: 20px;
}
.nav-hint {
    font-size: 0.8em;
    font-style: italic;
    padding-top:4px;
    font-weight: bold;
    color: #FFFF00;
}
.bold {
    font-weight: bold;
}
.italic {
    font-style: italic;
}
.underline {
    text-decoration: underline;
}
.nav-top a,
.nav-top a:link,
.nav-top a:visited,
.nav-bottom a,
.nav-bottom a:link,
.nav-bottom a:visited {
    color: #FFFFFF;
    font-weight: bold;
    text-decoration: none;
}
.nav-top a:hover,
.nav-bottom a:hover{
    color: #99CCFF;
    text-decoration: none;
}
#planetChanger {
    position: fixed;
    right: 10px;
    top: 0;
    z-index: 101;
    vertical-align: middle;
}
.ttCategory {

}
.messageInfo a,
.messageInfo a:link,
.messageInfo a:visited,
.messageInfo a:active,
.ttCategory a,
.ttCategory a:link,
.ttCategory a:visited,
.ttCategory a:active {
    color: #000080;
    text-decoration: none;
}
.messageInfo a:hover,
.ttCategory a:hover {
    color: #A0A000;
    text-decoration: none;
}
.errorCategory {

}
.errorCategory a,.errorCategory a:link,.errorCategory a:visited {
    color: #000080;
    text-decoration: none;
}
.errorCategory a:hover {
    color: #A0A000;
    text-decoration: none;
}
.ttCategoryTitle {
    font-size: 1.2em;
    font-weight: bold;
    padding: 2px;
}
.subCategory {
    width: 500px;
    border: 1px solid #9999FF;
    background-color: #DDEEFF;
    padding-left: 5px;
    padding-top: 5px;
    padding-right: 5px;
    padding-bottom: 10px;
    margin:10px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}
.errorCategory .subCategory {
    /*width: 700px;*/
    display:table;
    border: 1px solid #9999FF;
    background-color: #DDEEFF;
    padding-left: 5px;
    padding-top: 5px;
    padding-right: 5px;
    padding-bottom: 10px;
    margin:10px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}
.subCategoryTitle {
    padding: 5px;
    font-size: 1em;
    font-weight: bold;
}
.h16 {
    height:16px;
}
.subCategory .l1 {
    font-size: 1.2em;
    font-weight: bold;
    padding: 2px 3px 2px 3px;
    margin: 0 7px 0 2px;
}
.subCategory .l2 {
    font-size: 1em;
    font-weight: bold;
    padding: 2px 3px 2px 3px;
    margin: 0 7px 0 22px;
}
.subCategory .l3 {
    font-size: 1em;
    font-weight: normal;
    padding: 2px 3px 2px 3px;
    margin: 0 7px 0 42px;
}
.subCategoryItem {
    font-size: 1em;
    font-weight: normal;
    padding: 2px 0 2px 3px;
    margin: 0 10px 0 17px;
}
.subCategoryItemDark {
    font-size: 1em;
    font-weight: normal;
    padding: 2px 0 2px 3px;
    margin: 0 10px 0 17px;
    background-color: #CCDDFF;
}
.dark {
    background-color: #CCDDFF;
}
.level-info {
    float:right;
    text-align:right;
    font-size:0.7em;
    height:16px;
    width:50px;
    margin-top:2px;
}
.planetSelect {
    position: fixed;
    top:20px;
    right:15px;
    display:table;
    border: 1px solid #9999FF;
    background-color: #DDEEFF;
    padding-left: 5px;
    padding-top: 5px;
    padding-right: 5px;
    padding-bottom: 10px;
    margin:10px;
    width:171px;
    height:46px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}
.red {
    color: #FF0000;
}
.small {
    font-size: 0.7em;
}
.nowrap {
    white-space: nowrap;
}
.dark {
    background-color: #CCDDFF;
}
.toolbutton { /*display:block;*/
    min-width: 25px;
    background-color: #CCDDFF;
    border: 1px solid #9999FF;
    padding: 1px;
    margin-top: 2px;
    margin-bottom: 2px;
    margin-left: 0;
    margin-right: 1px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
}
.toolbutton:hover { /*display:block;*/
    background-color: #CCCCFF;
    border: 1px solid #555599;
}
form select.detaillink {
    width: 300px;
}
.fixed-font {
    font-family: 'Courier New',Courier,monospace;
}
.float-left {
    float:left;
}
.float-right {
    float:right;
}
.align-left {
    text-align:left;
}
.align-right {
    text-align:right;
}
.green {
    color: #080;
}
.setPass {
    display:none;
}
a img {
    border: 0 solid #000;
}
.clear {
    clear:both;
}
.depencyName {
    width:375px;
    float:left;
}
.depencyLevel {
    float:left;
    width:50px;
    text-align:right;
}
.revDepencyName {
    width:385px;
    float:left;
}
.revDepencyLevel {
    float:left;
    width:50px;
    text-align:right;
}
.depencyOk {
    float:left;
    width:10px;
    margin: 3px 0 0 3px;
    background: url(../images/check2.png) 0 0 no-repeat;
    height:10px;
}
.depencyFail {
    float:left;
    width:10px;
    margin: 3px 0 0 3px;
    background: url(../images/delete2.png) 0 0 no-repeat;
    height:10px;
}
.detailLinks {
    display:none;
}
.form-input-label {
    float: left;
    width:110px;
}
.form-input {
    float:left;
    width:350px;
}
.w300 {
    width:300px;
}
#requirements {
    width:400px;
}
#importDialog {
    display:none;
}
.bugsLabel {
    float:left;
    width:130px;
}
.bugsValue {
    float:left;
    width:300px;
}
.bugs .form-input-label {
    float:left;
    width:140px;
}
.bugs .form-input {
    float:left;
    width:300px;
}
.subCategoryTitle.bugTitle {
    height:32px;
    padding:0 0 0 35px;
    margin:0 0 8px 0;
}
.subCategoryTitle.bugTitle.open {
    background:url(../images/open.png) no-repeat;
}
.subCategoryTitle.bugTitle.progress {
    background:url(../images/progress.png) no-repeat;
}
.subCategoryTitle.bugTitle.feedback {
    background:url(../images/feedback.png) no-repeat;
}
.subCategoryTitle.bugTitle.resolved {
    background:url(../images/resolved.png) no-repeat;
}
.subCategoryTitle.bugTitle.closed {
    background:url(../images/closed.png) no-repeat;
}
.subCategoryTitle.bugTitle.wontFix {
    background:url(../images/wontfix.png) no-repeat;
}
.messageInfo {
    position:fixed;
    top:103px;
    right:15px;
    width:171px;
    display:table;
    border: 1px solid #9999FF;
    background-color: #DDEEFF;
    padding-left: 5px;
    padding-top: 5px;
    padding-right: 5px;
    padding-bottom: 10px;
    margin:10px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}
.messageInfo .title {
    font-weight:bold;
}
.messageInfo #totalMsgs {
    background:url(../images/mail-mark-unread.png) no-repeat;
    padding-left:19px;
    float:left;
    margin-right:10px;
    width:24px;
}
.messageInfo #newMsgs {
    background:url(../images/mail-mark-unread-new.png) no-repeat;
    padding-left:19px;
    float:left;
    width:24px;
}
.messageInfo .messageSummary {
    padding:10px 37px 5px 38px;
}
.messageTable {
    width:500px;
}
.messageTable > div,
.messageTable .header > div {
    float:left;
}
.messageTable .message {
    cursor:pointer;
    margin:0;
    padding:0;
    width:500px;
}
.messageTable .message > div {
    padding:3px;
    vertical-align:top;
    float:left;
}
.messageTable .status {
    width:32px;
    background-position:2px 3px;
}
.messageTable .message .status {
    background-image:url(../images/mail-mark-unread.png);
    background-repeat:no-repeat;
    height:16px;
    width:16px;
}
.messageTable .message .status.new {
    background-image:url(../images/mail-mark-unread-new.png);
}
.messageTable .message .from {
    width:120px;
}
.messageTable .message .subject {
    width:250px;
}
.messageTable .message .date {
    text-align:center;
    width:74px;
}
.messageTable .msgContent {
    display:none;
    padding:5px;
    width:490px;
}
.messageTable .msgContent .msgBody {
    padding:3px;
}
.messageTable .msgContent .actions {
    float:right;
    margin-top:5px;
}
.ajax-loader {
    width:220px;
    height:19px;
    background:url(../images/blue/ajax-loader.gif) no-repeat;
}
.toolbutton.action {
    height:14px;
    float:left;
    cursor:pointer;
    padding-left:19px;
    padding-right:3px;
    padding-top:3px;
    font-size:0.8em;
    margin:0 3px;
}
.toolbutton.action:hover { /*display:block;*/
    background-color: #CCCCFF;
    border: 1px solid #555599;
}
.toolbutton.action.reply {
    background:url(../images/mail-reply-sender.png) no-repeat 1px 1px;
}
.toolbutton.action.delete {
    background:url(../images/edit-delete.png) no-repeat 1px 1px;
}
.msgContent .msgReply {
    display:none;
}
.ui-widget-overlay {
    color:#FFF;
    text-align:center;
    vertical-align:middle;
}
.messageTable .ajax-loader {
    display:none;
}
.ui-widget-overlay .ajax-loader {
    opacity:1;
    margin:auto;
}
.toolbutton.action.newMessage {
    background:url(../images/mail-message-new.png) no-repeat 1px 1px;
}
.toolbutton.action.newBugComment {
    background:url(../images/mail-tagged.png) no-repeat 1px 1px;
}
hr {
    height:1px;
    border-top:1px solid #99F;
    border-left:0;
    border-bottom:0;
    border-right:0;
}
.bugComment {
    display:none;
}


text:
const getAppId     = require('../../config').getAppId;
const getSocketURL = require('../../config').getSocketURL;

const Endpoint = (function() {
    const init = function() {
        $('#server_url').val(getSocketURL().split('/')[2]);
        $('#app_id').val(getAppId());

        $('#frm_endpoint').on('submit', function(e) {
            e.preventDefault();
            const server_url = (($('#server_url').val() || '').trim().toLowerCase()).replace(/[><()\"\']/g, ''),
                app_id = ($('#app_id').val() || '').trim();
            if (server_url) {
                localStorage.setItem('config.server_url', server_url);
            }
            if (app_id && !isNaN(app_id)) localStorage.setItem('config.app_id', parseInt(app_id));
            window.location.reload();
        });

        $('#reset_endpoint').on('click', function () {
            localStorage.removeItem('config.server_url');
            localStorage.removeItem('config.app_id');
            window.location.reload();
        });
    };

    return {
        init: init,
    };
})();

module.exports = {
    Endpoint: Endpoint,
};


text:
using System;

namespace YetAnotherListApp.Exceptions
{
    public sealed class NoBasketsFoundException : Exception
    {
        public NoBasketsFoundException(string userName) : base("No baskets found: " + userName)
        {
        }
    }
}


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

namespace GoogleMeasurementProtocol.Parameters.EventTracking
{
    /// <summary>
    /// Specifies the event action. Must not be empty.
    /// </summary>
    public class EventAction : Parameter
    {
        public EventAction(string value)
            : base(value)
        {
            if (string.IsNullOrEmpty(value))
            {
                throw new ArgumentException("Value must not be empty.",nameof(value));
            }
        }

        public override string Name => "ea";

        public override List<string> SupportedHitTypes => new List<string> { HitTypes.Event };
    }
}


text:
package Q1_01_Is_Unique;

public class Tester {

	public static void main(String[] args) {
		String[] words = {"abcde", "hello", "apple", "kite", "padle"};
		for (String word : words) {
			boolean wordA =  QuestionA.isUniqueChars(word);
			boolean wordB =  QuestionB.isUniqueChars(word);
			if (wordA == wordB) {
				System.out.println(word + ": " + wordA);
			} else {
				System.out.println(word + ": " + wordA + " vs " + wordB);
			}
		}
	}
}


text:
import { ContentDialogState } from './content-dialog-state';
import { ContentsSearchDialogState } from './contents-search-dialog-state';
import { HelpDialogState } from './help-dialog-state';
import { ViewDialogState } from './view-dialog-state';
export declare class ViewerState {
    viewDialogState: ViewDialogState;
    contentDialogState: ContentDialogState;
    contentsSearchDialogState: ContentsSearchDialogState;
    helpDialogState: HelpDialogState;
    constructor(fields?: {
        viewDialogState?: ViewDialogState;
        contentDialogState?: ContentDialogState;
        contentsSearchDialogState?: ContentsSearchDialogState;
        helpDialogState?: HelpDialogState;
    });
}


text:
"""Wrapper around setuptools' pkg_resources with more Google-like names.

This module is not very useful on its own, but many Google open-source projects
are used to a different naming scheme, and this module makes the transition
easier.
"""

__author__ = 'dborowitz@google.com (Dave Borowitz)'

import atexit

import pkg_resources

def _Call(func, name):
  """Call a pkg_resources function.

  Args:
    func: A function from pkg_resources that takes the arguments
          (package_or_requirement, resource_name); for more info,
          see http://peak.telecommunity.com/DevCenter/PkgResources
    name: A name of the form 'module.name:path/to/resource'; this should
          generally be built from __name__ in the calling module.

  Returns:
    The result of calling the function on the split resource name.
  """
  pkg_name, resource_name = name.split(':', 1)
  return func(pkg_name, resource_name)

def GetResource(name):
  """Get a resource as a string; see _Call."""
  return _Call(pkg_resources.resource_string, name)

def GetResourceAsFile(name):
  """Get a resource as a file-like object; see _Call."""
  return _Call(pkg_resources.resource_stream, name)

_extracted_files = False

def GetResourceFilename(name):
  """Get a filename for a resource; see _Call."""
  global _extracted_files  # pylint: disable-msg=W0603
  if not _extracted_files:
    atexit.register(pkg_resources.cleanup_resources)
    _extracted_files = True

  return _Call(pkg_resources.resource_filename, name)


text:
SEMVER=./node_modules/semver/bin/semver
OLD_VERSION=$(node -pe 'require("./package.json").version')
CHANGELOG=./CHANGELOG.md
PROG=$(basename $0)
RELEASE_BRANCH=gh-pages # NOTE: this script will force push over this branch. Def. don't use master!
CHANGES=$(git log $OLD_VERSION...master --no-merges --pretty=format:"  * (%an) %s" | head -n -1)
OLD_CHANGES=$(cat $CHANGELOG)

NEW_VERSION='' # will be populated later by script

# for printing friendly status messages
function report () {
  local msg="$1"
  # make it cyan
  echo "$(tput setaf 6)$PROG: $msg$(tput sgr0)"
}

function error () {
  local msg="$1"
  # red this time
  echo "$(tput setaf 1)$PROG: Fatal: $msg$(tput sgr0)"
  exit 1
}

# ensure there are any uncommited files in the current directory
function ensure_clean_directory () {
  report "ensuring directory is clean..."
  git diff --exit-code > /dev/null || {
    error 'git working directory must be clean before running this script, bailing like a lion.'
  }
}

function ensure_on_master_branch () {
  report "ensuring we're on master branch..."
	[[ $(git rev-parse --abbrev-ref HEAD) == 'master' ]] || {
		error 'must be on master branch to cut a release, bailing like a sea turtle.'
	}
}

# The $RELEASE_BRANCH branch will end up existing on github, but not ever locally.
# This way we won't be tempted to tamper with it. Also it makes sense.
function ensure_no_gh_pages_branch () {
  report "ensuring there isn't already a $RELEASE_BRANCH branch..."
	[[ $(git branch | grep $RELEASE_BRANCH) ]] && {
    error "looks like a $RELEASE_BRANCH branch already exists, this is wrong. Bailing like a zebra."
	}
}

function ensure_changes_since_last_release () {
  report "ensuring there have been changes since the last release..."
  [[ $CHANGES ]] || {
    error "looks like there aren't any changes since the last release, bailing like a cowardly swordfish."
  }
}

# ensure the version we're gonna try to write doesn't already exist
function ensure_unique_version () {
  local tag=$1
  report "ensuring the new version isn't already taken..."
  [[ $(git tag | grep $tag) ]] && {
    error "looks like that tag is already taken :/ Best remove it from git tag list, or use a higher one. Make sure it doesn't exist on GH as well."
  }
}

# Prompt for new version (if not provided)
function get_new_version () {
  report "grabbing new version..."

  local proposed_version=$($SEMVER -i patch $OLD_VERSION)

  echo "Enter next version after $OLD_VERSION ($proposed_version):"
  read NEW_VERSION

  [ -z $NEW_VERSION ] && NEW_VERSION=$proposed_version
}

function print_to_changelog () {
  report "writing changes to changelog..."
  local new_version=$1
  printf "### [$new_version](https://github.com/aaronik/tones/releases/tag/$new_version)\n\n$CHANGES\n\n$OLD_CHANGES" > $CHANGELOG
}

function build () {
  npm run build

  if [[ $? != 0 ]]; then
    report "Wuh oh, something went wrong with the build, bailing hard. To undo what's been done, just remove the $RELEASE_BRANCH branch."
  fi
}

# now nuke the build from disk and git
# This method keeps the master branch clean of builds.
function clean_build () {
  report "removing build before merging back into master..."

  git rm -r dist/
  rm -rf dist/
  git commit --amend --no-edit
}

### Main

ensure_changes_since_last_release
ensure_clean_directory
ensure_on_master_branch
ensure_no_gh_pages_branch

# get the new version number
get_new_version

# make sure we haven't used that version
ensure_unique_version $NEW_VERSION

# nothing should be failing from here on out
set -e

# copy branch onto $RELEASE_BRANCH.
# Scheme is as follows: Do release commit, tag, etc. on $RELEASE_BRANCH branch.
# If something borks in this script, cleaning up is as easy as removing the branch.
# Once all's done and pushed to GH, we'll merge this branch back into master.
report "creating branch $RELEASE_BRANCH..."
git checkout -b $RELEASE_BRANCH

# modify package to have new version number. Deps on .npmrc existing
report "writing new npm version $NEW_VERSION..."
npm version $NEW_VERSION

# Add to changelog
print_to_changelog $NEW_VERSION

# cut a tag with new version number
report "cutting new git tag..."
git tag $NEW_VERSION

# run build
build

# commit the changes (package.json and CHANGELOG.md)
report "writing new git release..."
git add -A
git commit -am "release: $NEW_VERSION"

# push to the hub
report "pushing the latest..."
# force push b/c master is the source of truth
git push origin $RELEASE_BRANCH -f --tags

# now we need to clean out the build before we go back to master
clean_build

# checkout back to master
report "back to master..."
git checkout master

# now merge $RELEASE_BRANCH release commit into master branch
report "merging $RELEASE_BRANCH release commit into master for fully updated-ness..."
git merge $RELEASE_BRANCH

# we're all done, clean up
report "all done! cleaning up after ourselves..."
git branch -d $RELEASE_BRANCH


text:
source ../common/common.sh

NAME=libgpuarray
GIT_REPO=https://github.com/Theano/libgpuarray.git

init_vars

checkout_git

module purge
module load CMake
module load anaconda3
module load Cython

pushd "${GIT_PATH}"
rm -rf ~/.local/lib/libgpuarray* ~/.local/include/gpuarray
rm -rf build Build "${INSTALL_DIR}"
mkdir -p Build "${INSTALL_DIR}"
pushd Build
CXX=g++ CC=gcc cmake .. -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" -DCMAKE_BUILD_TYPE=Release
make
make install
popd
rm -rf Build

export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${INSTALL_DIR}/lib64"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${INSTALL_DIR}/lib"
export LIBRARY_PATH="${LIBRARY_PATH}:${INSTALL_DIR}/lib64"
export LIBRARY_PATH="${LIBRARY_PATH}:${INSTALL_DIR}/lib"
export CPATH="${CPATH}:${INSTALL_DIR}/include"
export PYTHONPATH="${INSTALL_DIR}/${PYTHON3_PACKAGE_SUBDIR}:${PYTHONPATH}"

mkdir -p "${INSTALL_DIR}/${PYTHON3_PACKAGE_SUBDIR}"
python3 setup.py build_ext -L "${INSTALL_DIR}/lib" -I "${INSTALL_DIR}/include"
python3 setup.py install --prefix="${INSTALL_DIR}"
popd

BIN_PATH="${INSTALL_DIR}/bin"
LIB_PATH="${INSTALL_DIR}/lib"

read -d '' EXTRA_LINES <<EOF || true
module add      GCC/5.4.0-2.25
module add      anaconda3
append-path     PYTHONPATH "${INSTALL_DIR}/${PYTHON3_PACKAGE_SUBDIR}"
append-path     LD_LIBRARY_PATH "${INSTALL_DIR}/lib64"
append-path     LD_LIBRARY_PATH "${INSTALL_DIR}/lib"
append-path     LIBRARY_PATH "${INSTALL_DIR}/lib64"
append-path     LIBRARY_PATH "${INSTALL_DIR}/lib"
append-path     CPATH "${INSTALL_DIR}/include"
EOF

write_module


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/>.

class block_librarysearch extends block_base
{
    public function init() {
        $this->title = get_string('pluginname', 'block_librarysearch');
    }

    public function applicable_formats() {
        return array(
            'all' => true
        );
    }

    public function get_content () {
        if ($this->content !== null) {
            return $this->content;
        }

        $url = new \moodle_url("/blocks/librarysearch/redirect.php");
        $sesskey = sesskey();

        $this->content = new stdClass();
        $this->content->footer = '';
        $this->content->text = <<<HTML5

            <form action="${url}" method="POST" target="_blank">
                <input type="hidden" name="sesskey" value="${sesskey}">

                    <input type="text" name="q" class="form-control" placeholder="Library search">

                        <button class="btn btn-default" type="button"></button>

            </form>

HTML5;

        return $this->content;
    }
}


text:
require 'spec_helper'

describe 'nxlog::config::input', type: :define do
  context 'On Windows' do
    let :facts do
      {
        kernel: 'windows',
        osfamily: 'windows',
        operatingsystem: 'windows',
        concat_basedir: File.join(Puppet[:vardir], 'concat'),
      }
    end

    let :pre_condition do
      "class {'nxlog':
        conf_dir     => 'C:/nxlog/conf',
        conf_file    => 'nxlog.conf',
        input_execs  => [
          'delete($Keywords)',
          '$raw_event = to_json()',
        ],
        input_module => 'im_msvistalog',
        nxlog_root   => 'C:/nxlog'
      }"
    end

    let(:title) { 'eventlog_json' }

    describe 'builds an Input section for the config file which' do
      it { is_expected.to contain_concat__fragment('input_eventlog_json').with_content(%r{<Input eventlog_json>\r\n}) }
      it { is_expected.to contain_concat__fragment('input_eventlog_json').with_content(%r{\s\sModule\s+im_msvistalog\r\n}) }
      it { is_expected.to contain_concat__fragment('input_eventlog_json').with_content(%r{\s\sExec\s+delete\(\$Keywords\);\r\n}) }
      it { is_expected.to contain_concat__fragment('input_eventlog_json').with_content(%r{\s\sExec\s+\$raw_event\s\=\sto_json\(\);\r\n}) }
      it { is_expected.to contain_concat__fragment('input_eventlog_json').with_content(%r{</Input>\r\n}) }
    end

    describe 'inputting from a local file' do
      let :pre_condition do
        "class {'nxlog':
          conf_dir        => 'C:/nxlog/conf',
          conf_file       => 'nxlog.conf',
          nxlog_root      => 'C:/nxlog',
          input_file_path => 'C:/logfile.log',
          input_module    => 'im_file',
          input_type      => 'multiline',
        }"
      end

      let(:title) { 'logfile' }

      describe 'builds an Input section for the config file which' do
        it { is_expected.to contain_concat__fragment('input_logfile').with_content(%r{<Input logfile>\r\n}) }
        it { is_expected.to contain_concat__fragment('input_logfile').with_content(%r{\s\sModule\s+im_file\r\n}) }
        it { is_expected.to contain_concat__fragment('input_logfile').with_content(%r{\s\sFile\s+'C:/logfile\.log'\r\n}) }
        it { is_expected.to contain_concat__fragment('input_logfile').with_content(%r{\s\sInputType\s+multiline\r\n}) }
        it { is_expected.to contain_concat__fragment('input_logfile').with_content(%r{</Input>\r\n}) }
      end
    end
  end

  context 'On Linux' do
    let :facts do
      {
        kernel: 'Linux',
        osfamily: 'RedHat',
        operatingsystem: 'Redhat',
        concat_basedir: File.join(Puppet[:vardir], 'concat'),
      }
    end

    let :pre_condition do
      "class {'nxlog':
        conf_dir     => '/etc',
        conf_file    => 'nxlog.conf',
        input_execs  => [
          'delete($Keywords)',
          '$raw_event = to_json()',
        ],
        input_module => 'im_msvistalog',
        nxlog_root   => '/etc'
      }"
    end

    let(:title) { 'eventlog_json' }

    describe 'builds an Input section for the config file which' do
      it { is_expected.to contain_concat__fragment('input_eventlog_json').with_content(%r{<Input eventlog_json>\n}) }
      it { is_expected.to contain_concat__fragment('input_eventlog_json').with_content(%r{\s\sModule\s+im_msvistalog\n}) }
      it { is_expected.to contain_concat__fragment('input_eventlog_json').with_content(%r{\s\sExec\s+delete\(\$Keywords\);\n}) }
      it { is_expected.to contain_concat__fragment('input_eventlog_json').with_content(%r{\s\sExec\s+\$raw_event\s\=\sto_json\(\);\n}) }
      it { is_expected.to contain_concat__fragment('input_eventlog_json').with_content(%r{</Input>\n}) }
    end

    describe 'inputting from a local file' do
      let :pre_condition do
        "class {'nxlog':
          conf_dir        => '/etc',
          conf_file       => 'nxlog.conf',
          nxlog_root      => '/etc',
          input_file_path => '/etc/logfile.log',
          input_module    => 'im_file',
          input_type      => 'multiline',
        }"
      end

      let(:title) { 'logfile' }

      describe 'builds an Input section for the config file which' do
        it { is_expected.to contain_concat__fragment('input_logfile').with_content(%r{<Input logfile>\n}) }
        it { is_expected.to contain_concat__fragment('input_logfile').with_content(%r{\s\sModule\s+im_file\n}) }
        it { is_expected.to contain_concat__fragment('input_logfile').with_content(%r{\s\sFile\s+'/etc/logfile\.log'\n}) }
        it { is_expected.to contain_concat__fragment('input_logfile').with_content(%r{\s\sInputType\s+multiline\n}) }
        it { is_expected.to contain_concat__fragment('input_logfile').with_content(%r{</Input>\n}) }
      end
    end
  end
end


text:
Сборка ```generators``` под Ubuntu
```
cd generators
mkdir build
cd build
cmake ..
make
```


text:
<!doctype html>

  <meta charset="utf-8">
  <title></title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width">

  <link rel="stylesheet" href="bower_components/angular-material/angular-material.css" />

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

<cinema-header></cinema-header>

<cinema-footer></cinema-footer>


text:
<?php

/**
 * This file is a part of a nekland library
 *
 * (c) Nekland <nekland.fr@gmail.fr>
 *
 * For the full license, take a look to the LICENSE file
 * on the root directory of this project
 */

namespace Nekland\Woketo\Exception\Utils;

class NotLongEnoughException extends \InvalidArgumentException
{

}


text:
package service

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/ottenwbe/golook/broker/models"
	"github.com/ottenwbe/golook/broker/routing"
	"github.com/sirupsen/logrus"
	"reflect"
)

var _ = Describe("The query service", func() {
	It("creates a local query service by default", func() {
		q := newQueryService(localQueries, &router{routing.NewMockedRouter()})
		Expect(q).ToNot(BeNil())
		Expect(reflect.TypeOf(q)).To(Equal(reflect.TypeOf(&localQueryService{})))
	})

	It("creates broadcast query service when bCastQueries is specified", func() {
		q := newQueryService(bCastQueries, &router{routing.NewMockedRouter()})
		Expect(q).ToNot(BeNil())
		Expect(reflect.TypeOf(q)).To(Equal(reflect.TypeOf(&broadcastQueryService{})))
	})

	It("calls the routing service to initiate the query", func() {

		q := broadcastQueryService{router: &router{routing.NewMockedRouter()}}
		q.query("test.txt")

		Expect(q.router.Router.(*routing.MockRouter).Visited).To(Equal(1))
		Expect(q.router.Router.(*routing.MockRouter).VisitedMethod).To(Equal(fileQuery))

	})

	It("merges files responses", func() {

		f, err := models.NewFile("query_service_test")
		if err != nil {
			logrus.Fatal("Cannot create file.")
		}

		var expectedResult = fileQueryData{
			"a": {
				f,
			},
			"b": {
				f,
			},
		}

		var testResult = mergeFileQuery(
			testMerge{
				data: &fileQueryData{
					"a": {
						f,
					},
				},
			},
			testMerge{
				data: &fileQueryData{
					"b": {
						f,
					},
				},
			},
		)

		Expect(testResult.(fileQueryData)).To(Equal(expectedResult))

	})
})

type testMerge struct {
	data *fileQueryData
}

func (m testMerge) Unmarshal(v interface{}) error {
	tmp := reflect.ValueOf(v).Elem()
	tmp.Set(reflect.ValueOf(m.data).Elem())
	return nil
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>statsmodels.genmod.families.links.Link — statsmodels 0.8.0 documentation</title>

    <link rel="stylesheet" href="../_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/statsmodels_hybi_favico.ico"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="prev" title="statsmodels.genmod.families.family.Tweedie.weights" href="statsmodels.genmod.families.family.Tweedie.weights.html" />
<link rel="stylesheet" href="../_static/examples.css" type="text/css" />
<link rel="stylesheet" href="../_static/facebox.css" type="text/css" />

Navigation

          index

          modules |

          previous |

Install
  |

Support
  |

Bugs
  |

Develop
  |

Examples
  |

FAQ
  |

Generalized Linear Models |

statsmodels.genmod.families.links.Link¶

class statsmodels.genmod.families.links.Link[source]¶

A generic link function for one-parameter exponential family.

Link does nothing, but lays out the methods expected of any subclass.

Methods

<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>

__call__(p)
Return the value of the link function.

deriv(p)
Derivative of the link function g’(p).

deriv2(p)
Second derivative of the link function g’‘(p)

inverse(z)
Inverse of the link function.

inverse_deriv(z)
Derivative of the inverse link function g^(-1)(z).

Methods

<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>

deriv(p)
Derivative of the link function g’(p).

deriv2(p)
Second derivative of the link function g’‘(p)

inverse(z)
Inverse of the link function.

inverse_deriv(z)
Derivative of the inverse link function g^(-1)(z).

Previous topic

statsmodels.genmod.families.family.Tweedie.weights

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

        © Copyright 2009-2017, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.
      Created using Sphinx 1.5.3.


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

var port = process.env.PORT || 3000;

app.get('/', function(req, res) {
	res.send('
Hello world!
');
});

app.get('/person/:id', function(req, res) {
	res.send('
Person: ' + req.params.id + '
');
});

app.get('/api', function(req, res) {
	res.json({ firstname: 'John', lastname: 'Doe' });
});

app.listen(port);