text:
import datetime
import cherrypy
import jsontemplate
import os
import random
import string
from uuid import uuid4
import ConfigParser
from ConfigParser import SafeConfigParser

def get_base():
    return os.path.dirname(os.path.abspath(__file__))

def cycle(list):
    i = -1
    while True:
        try:
            i = i + 1
            yield list[i]
        except IndexError:
            i = 0
            yield list[i]

class RadioEdit(object):
    """Define methods necessary to make our web page work with cherrypy"""

    # using cron since injected files aren't executable
    base = get_base()
    chars = string.letters + string.digits

    def gen_password(self, length=8):
        pw = ""
        for i in range(length):
            pw += random.choice(self.chars)
        return pw

    def __init__(self, username,
                 apikey, pubkey,
                 prefix="nova",
                 auth_url="https://auth.api.rackspacecloud.com/v1.0",
                 private_key=None,
                 server_size=512):
        from openstack.compute import Compute
        self.prefix = prefix
        self.pubkey = pubkey
        self.first = ""
        self.compute = Compute(username=username,
                               apikey=apikey,
                               auth_url=auth_url)
        self.server_size = server_size
        self.private_key = private_key

    @cherrypy.expose
    def index(self):
        msg = ''
        style = cycle(["odd", "even"])
        try:
            servers = self.list()
            for server in servers:
                server['style'] = style.next()
        except Exception as e:
            msg = "Error: " + str(e)
            servers = []
        tmpl = open(self.base + '/templates/index.html').read()
        return jsontemplate.expand(tmpl, {'servers': servers, 'msg': msg})

    @cherrypy.expose
    def log(self, host, size=25, fn="/var/log/install.log"):
        status = self.compute.servers.find(public_ip=host).status

        if status == "ACTIVE":
            try:
                import paramiko
                privatekeyfile = self.private_key
                mykey = paramiko.RSAKey.from_private_key_file(privatekeyfile)
                ssh = paramiko.SSHClient()
                ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
                ssh.connect(host, username='root', pkey=mykey, timeout=2)
                stdin, stdout, stderr = \
                    ssh.exec_command('tail -n %d "%s"' % (int(size), fn))
                log = stdout.read()
                ssh.close()
            except Exception, e:
                log = "Exception: %s" % e
        else:
            log = "Slice is not ready to be used, we are currently in status: %s" % status

        tmpl = open(self.base + '/templates/log.html').read()
        return jsontemplate.expand(tmpl, {'log': log, 'host': host})

    @cherrypy.expose
    def new(self, name=None, srvtype=None, novascript_url="https://raw.github.com/cloudbuilders/deploy.sh/master/nova.sh"):
        password = self.gen_password()
        img = [i for i in self.compute.images.list()
                if i.name.find("Ubuntu 10.10") != -1][0]
        flav = [f for f in self.compute.flavors.list() \
                    if f.ram == int(self.server_size)][0]
        srvname = self.prefix + "-" + str(uuid4()).replace('-', '')
        if name is None:
            name = srvname
        cron = "* * * * * root /bin/bash /root/install.sh\n"
        install = open(self.base + '/templates/install.sh').read().format(
            password=password,
            pubkey=self.pubkey,
            srvtype=srvtype,
            novascript_url=novascript_url,
            )
        self.compute.servers.create(srvname, img.id, flav.id,
            files={"/etc/cron.d/firstboot": cron,
                   "/root/install.sh": install},
            meta={"created": \
                      datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
                  "name": name,
                  "srvtype": srvtype,
                  "password": password})
        raise cherrypy.HTTPRedirect("/")

    @cherrypy.expose
    def kill(self, name=None, all=None):
        servers = self.compute.servers.list()
        for server in servers:
            if server.name.find(self.prefix) == 0:
                if all or name == server.name:
                    self.compute.servers.delete(server)
        raise cherrypy.HTTPRedirect("/")

    def list(self):
        servers = self.compute.servers.list()

        def info(s):
            return {'ip': s.public_ip,
                     'id': s.name,
                     'age': ago(s.metadata.get('created', None)),
                     'srvtype': s.metadata.get('srvtype', "nova"),
                     'password': s.metadata.get('password', '?'),
                     'name': s.metadata.get('name', '?')}

        stack_servers = \
            [info(s) for s in servers if s.name.find(self.prefix) == 0]
        return sorted(stack_servers, key=lambda s: float(s['age']))

def ago(date_string, date_format="%Y-%m-%d %H:%M:%S"):
    try:
        d = datetime.datetime.strptime(date_string, date_format)
        n = datetime.datetime.now()
        diff = n - d
        return "%0.2f" % ((diff.days * 24) + (diff.seconds / 3600.0))
    except:
        return '0'

def setup_radio_edit(cfg=None):
    etc_cfg = "/etc/radioedit.cfg"
    cwd_path_cfg = os.path.join(
        get_base(),
        "radioedit.cfg")

    if not cfg and os.path.exists(etc_cfg):
        cfg = etc_cfg
    elif not cfg and os.path.exists(cwd_path_cfg):
        cfg = cwd_path_cfg
    else:
        raise Exception("No config file.")

    cp = SafeConfigParser()
    cp.read([cfg])
    username = cp.get("rackspacecloud", "user")
    apikey = cp.get("rackspacecloud", "apikey")
    prefix = cp.get("radioedit", "prefix")
    pubkey = cp.get("radioedit", "pubkey")
    try:
        server_size = cp.get("rackspacecloud", "server_size")
    except KeyError:
        server_size = 512
    except ConfigParser.NoOptionError:
        server_size = 512

    config_slash = {}
    password_protected = False
    try:
        if cp.get("radioedit", "password_protected").lower() in \
                ('no', 'false', 'off', '0'):
            password_protected = False
    except(KeyError, ConfigParser.NoOptionError):
        password_protected = True
    if password_protected:
        re_admin = cp.get("radioedit", "admin")
        re_admin_pass = cp.get("radioedit", "adminpass")
        users = {re_admin: re_admin_pass}
        config_slash = {'tools.basic_auth.on': True,
                        'tools.basic_auth.realm': 'Radioedit',
                        'tools.basic_auth.users': users,
                        'tools.basic_auth.encrypt': lambda x: x}

    try:
        auth_url = cp.get("rackspacecloud", "auth_url")
    except(KeyError, ConfigParser.NoOptionError):
        auth_url = "https://auth.api.rackspacecloud.com/v1.0"

    try:
        private_key = cp.get("radioedit", "privatekey")
    except(KeyError, ConfigParser.NoOptionError):
        private_key = os.path.expanduser('~/.ssh/id_rsa')

    conf = {'/': config_slash,
            '/static':
                 {'tools.staticdir.on': True,
                  'tools.staticdir.root': get_base(),
                  'tools.staticdir.dir': "static"},
           }
    return cherrypy.Application(
               RadioEdit(username,
                         apikey,
                         pubkey,
                         prefix=prefix,
                         auth_url=auth_url,
                         server_size=server_size,
                         private_key=private_key,
                         ),
               script_name=None, config=conf)

application = setup_radio_edit()

if __name__ == '__main__':
    cherrypy.quickstart(application.root, '/', application.config)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Stud. Mycol. 27: 192 (1985)

#### Original name
Stilbum byssisedum Berk. & M.A. Curtis

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
/**
 * @name Spinner Dialog
 * @description
 * @usage
 * ```typescript
 * import { SpinnerDialog } from 'ionic-native';
 *
 *
 * SpinnerDialog.show();
 *
 * SpinnerDialog.hide();
 * ```
 */
export declare class SpinnerDialog {
    /**
     * Shows the spinner dialog
     * @param title {string} Spinner title (shows on Android only)
     * @param message {string} Spinner message
     * @param cancelCallback {boolean|function} Set to true to set spinner not cancelable. Or provide a function to call when the user cancels the spinner.
     * @param iOSOptions {object} Options for iOS only
     */
    static show(title?: string, message?: string, cancelCallback?: any, iOSOptions?: SpinnerDialogIOSOptions): void;
    /**
     * Hides the spinner dialog if visible
     */
    static hide(): void;
}
export interface SpinnerDialogIOSOptions {
    overlayOpacity?: number;
    textColorRed?: number;
    textColorGreen?: number;
    textColorBlue?: number;
}


text:
package elastic

import (
	"context"
	"encoding/json"
	"fmt"
	"net/url"

	"github.com/olivere/elastic/uritemplates"
)

// XpackWatcherPutWatchService is documented at http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html.
type XpackWatcherPutWatchService struct {
	client        *Client
	pretty        bool
	id            string
	active        *bool
	masterTimeout string
	bodyJson      interface{}
	bodyString    string
}

// NewXpackWatcherPutWatchService creates a new XpackWatcherPutWatchService.
func NewXpackWatcherPutWatchService(client *Client) *XpackWatcherPutWatchService {
	return &XpackWatcherPutWatchService{
		client: client,
	}
}

// Id is documented as: Watch ID.
func (s *XpackWatcherPutWatchService) Id(id string) *XpackWatcherPutWatchService {
	s.id = id
	return s
}

// Active is documented as: Specify whether the watch is in/active by default.
func (s *XpackWatcherPutWatchService) Active(active bool) *XpackWatcherPutWatchService {
	s.active = &active
	return s
}

// MasterTimeout is documented as: Explicit operation timeout for connection to master node.
func (s *XpackWatcherPutWatchService) MasterTimeout(masterTimeout string) *XpackWatcherPutWatchService {
	s.masterTimeout = masterTimeout
	return s
}

// Pretty indicates that the JSON response be indented and human readable.
func (s *XpackWatcherPutWatchService) Pretty(pretty bool) *XpackWatcherPutWatchService {
	s.pretty = pretty
	return s
}

// BodyJson is documented as: The watch.
func (s *XpackWatcherPutWatchService) BodyJson(body interface{}) *XpackWatcherPutWatchService {
	s.bodyJson = body
	return s
}

// BodyString is documented as: The watch.
func (s *XpackWatcherPutWatchService) BodyString(body string) *XpackWatcherPutWatchService {
	s.bodyString = body
	return s
}

// buildURL builds the URL for the operation.
func (s *XpackWatcherPutWatchService) buildURL() (string, url.Values, error) {
	// Build URL
	path, err := uritemplates.Expand("/_xpack/watcher/watch/{id}", map[string]string{
		"id": s.id,
	})
	if err != nil {
		return "", url.Values{}, err
	}

	// Add query string parameters
	params := url.Values{}
	if s.pretty {
		params.Set("pretty", "1")
	}
	if s.active != nil {
		params.Set("active", fmt.Sprintf("%v", *s.active))
	}
	if s.masterTimeout != "" {
		params.Set("master_timeout", s.masterTimeout)
	}
	return path, params, nil
}

// Validate checks if the operation is valid.
func (s *XpackWatcherPutWatchService) Validate() error {
	var invalid []string
	if s.id == "" {
		invalid = append(invalid, "Id")
	}
	if s.bodyString == "" && s.bodyJson == nil {
		invalid = append(invalid, "BodyJson")
	}
	if len(invalid) > 0 {
		return fmt.Errorf("missing required fields: %v", invalid)
	}
	return nil
}

// Do executes the operation.
func (s *XpackWatcherPutWatchService) Do(ctx context.Context) (*XpackWatcherPutWatchResponse, error) {
	// Check pre-conditions
	if err := s.Validate(); err != nil {
		return nil, err
	}

	// Get URL for request
	path, params, err := s.buildURL()
	if err != nil {
		return nil, err
	}

	// Setup HTTP request body
	var body interface{}
	if s.bodyJson != nil {
		body = s.bodyJson
	} else {
		body = s.bodyString
	}

	// Get HTTP response
	res, err := s.client.PerformRequest(ctx, PerformRequestOptions{
		Method: "PUT",
		Path:   path,
		Params: params,
		Body:   body,
	})
	if err != nil {
		return nil, err
	}

	// Return operation response
	ret := new(XpackWatcherPutWatchResponse)
	if err := json.Unmarshal(res.Body, ret); err != nil {
		return nil, err
	}
	return ret, nil
}

// XpackWatcherPutWatchResponse is the response of XpackWatcherPutWatchService.Do.
type XpackWatcherPutWatchResponse struct {
}


text:
/*
 * @author Valentin Simonov / http://va.lent.in/
 */

using System;
using UnityEngine;
using TouchScript.Gestures;
using Random = UnityEngine.Random;

namespace TouchScript.Examples.Tap
{
    public class Break : MonoBehaviour
    {
        public float Power = 10.0f;

        private LongPressGesture longPressGesture;
        private PressGesture pressGesture;
        private MeshRenderer rnd;
        private bool growing = false;
        private float growingTime = 0;

        private Vector3[] directions =
        {
            new Vector3(1, -1, 1),
            new Vector3(-1, -1, 1),
            new Vector3(-1, -1, -1),
            new Vector3(1, -1, -1),
            new Vector3(1, 1, 1),
            new Vector3(-1, 1, 1),
            new Vector3(-1, 1, -1),
            new Vector3(1, 1, -1)
        };

        private void OnEnable()
        {
            rnd = GetComponent<MeshRenderer>();
            longPressGesture = GetComponent<LongPressGesture>();
            pressGesture = GetComponent<PressGesture>();

            longPressGesture.StateChanged += longPressedHandler;
            pressGesture.Pressed += pressedHandler;
        }

        private void OnDisable()
        {
            longPressGesture.StateChanged -= longPressedHandler;
            pressGesture.Pressed -= pressedHandler;
        }

        private void Update()
        {
            if (growing)
            {
                growingTime += Time.deltaTime;
                rnd.material.color = Color.Lerp(Color.white, Color.red, growingTime);
            }
        }

        private void startGrowing()
        {
            growing = true;
        }

        private void stopGrowing()
        {
            growing = false;
            growingTime = 0;
            rnd.material.color = Color.white;
        }

        private void pressedHandler(object sender, EventArgs e)
        {
            startGrowing();
        }

        private void longPressedHandler(object sender, GestureStateChangeEventArgs e)
        {
            if (e.State == Gesture.GestureState.Recognized)
            {
                // if we are not too small
                if (transform.localScale.x > 0.05f)
                {
                    // break this cube into 8 parts
                    for (int i = 0; i < 8; i++)
                    {
                        var obj = Instantiate(gameObject) as GameObject;
                        var cube = obj.transform;
                        cube.parent = transform.parent;
                        cube.name = "Cube";
                        cube.localScale = 0.5f*transform.localScale;
                        cube.position = transform.TransformPoint(directions[i]/4);
                        cube.GetComponent<Rigidbody>().AddForce(Power*Random.insideUnitSphere, ForceMode.Impulse);
                        cube.GetComponent<Renderer>().material.color = Color.white;
                    }
                    Destroy(gameObject);
                }
            }
            else if (e.State == Gesture.GestureState.Failed)
            {
                stopGrowing();
            }
        }
    }
}


text:
using System;
using System.Runtime.InteropServices;

namespace GDToolkit.Graphics.Text
{
	[StructLayout(LayoutKind.Sequential)]
	public struct FontGlyphCollection
	{
		#region --- Field Variables ---

		// Variables
		public FontGlyph	regular;
		public FontGlyph	bold;
		public FontGlyph	italic;
		public FontGlyph	boldItalic;
		internal bool	pRegular;
		internal bool	pBold;
		internal bool	pItalic;
		internal bool	pBoldItalic;

		#endregion // Field Variables

		#region --- Properties ---

		// Gets if the regular font glyph exists
		public bool bRegular
		{
			get	{	return pRegular;	}
		}

		// Gets if the bold font glyph exists
		public bool bBold
		{
			get	{	return pBold;	}
		}

		// Gets if the italic font glyph exists
		public bool bItalic
		{
			get	{	return pItalic;	}
		}

		// Gets if the bold italic font glyph exists
		public bool bBoldItalic
		{
			get	{	return bBoldItalic;	}
		}

		#endregion // Properties
	}
}

// End of File


text:
package semantic

import (
	"github.com/ark-lang/ark/src/parser"
)

type AttributeCheck struct {
}

func (v *AttributeCheck) EnterScope(s *SemanticAnalyzer) {}
func (v *AttributeCheck) ExitScope(s *SemanticAnalyzer)  {}

func (v *AttributeCheck) PostVisit(s *SemanticAnalyzer, n parser.Node) {}

func (v *AttributeCheck) Visit(s *SemanticAnalyzer, n parser.Node) {
	switch n.(type) {
	case *parser.TypeDecl:
		typ := n.(*parser.TypeDecl).NamedType.Type
		switch typ.(type) {
		case *parser.StructType:
			v.CheckStructType(s, typ.(*parser.StructType))
		}

	case *parser.FunctionDecl:
		v.CheckFunctionDecl(s, n.(*parser.FunctionDecl))
	//case *parser.TraitDecl:
	//	v.CheckTraitDecl(s, n.(*parser.TraitDecl))

	case *parser.VariableDecl:
		v.CheckVariableDecl(s, n.(*parser.VariableDecl))
	}
}

func (v *AttributeCheck) CheckFunctionDecl(s *SemanticAnalyzer, n *parser.FunctionDecl) {
	v.CheckAttrsDistanceFromLine(s, n.Function.Attrs, n.Pos().Line, "function", n.Function.Name)

	for _, attr := range n.Function.Attrs {
		switch attr.Key {
		case "deprecated":
		case "unused":
		case "c":
		default:
			s.Err(attr, "Invalid function attribute key `%s`", attr.Key)
		}
	}
}

func (v *AttributeCheck) CheckStructType(s *SemanticAnalyzer, n *parser.StructType) {
	for _, attr := range n.Attrs() {
		switch attr.Key {
		case "packed":
			if attr.Value != "" {
				s.Err(attr, "Struct attribute `%s` doesn't expect value", attr.Key)
			}
		case "deprecated":
			// value is optional, nothing to check
		default:
			s.Err(attr, "Invalid struct attribute key `%s`", attr.Key)
		}
	}
}

/*func (v *AttributeCheck) CheckTraitDecl(s *SemanticAnalyzer, n *parser.TraitDecl) {
	v.CheckAttrsDistanceFromLine(s, n.Trait.Attrs(), n.Pos().Line, "type", n.Trait.TypeName())

	for _, attr := range n.Trait.Attrs() {
		if attr.Key != "deprecated" {
			s.Err(attr, "Invalid trait attribute key `%s`", attr.Key)
		}
	}
}*/

func (v *AttributeCheck) CheckVariableDecl(s *SemanticAnalyzer, n *parser.VariableDecl) {
	v.CheckAttrsDistanceFromLine(s, n.Variable.Attrs, n.Pos().Line, "variable", n.Variable.Name)

	for _, attr := range n.Variable.Attrs {
		switch attr.Key {
		case "deprecated":
			// value is optional, nothing to check
		case "unused":
		default:
			s.Err(attr, "Invalid variable attribute key `%s`", attr.Key)
		}
	}
}

func (v *AttributeCheck) CheckAttrsDistanceFromLine(s *SemanticAnalyzer, attrs parser.AttrGroup, line int, declType, declName string) {
	// Turn map into a list sorted by line number
	var sorted []*parser.Attr
	for _, attr := range attrs {
		index := 0
		for idx, innerAttr := range sorted {
			if attr.Pos().Line >= innerAttr.Pos().Line {
				index = idx
			}
		}

		sorted = append(sorted, nil)
		copy(sorted[index+1:], sorted[index:])
		sorted[index] = attr
	}

	for i := len(sorted) - 1; i >= 0; i-- {
		if sorted[i].Pos().Line < line-1 {
			// mute warnings from attribute blocks
			if !sorted[i].FromBlock {
				s.Warn(sorted[i], "Gap of %d lines between declaration of %s `%s` and `%s` attribute", line-sorted[i].Pos().Line, declType, declName, sorted[i].Key)
			}
		}
		line = sorted[i].Pos().Line
	}
}


text:
title: 'OpenShift #2 - Using Azure DevOps with OpenShift'
tags:
  - .NET Core
  - Raiffeisen
  - C#
  - linux
  - .NET
  - OpenShift
  - Azure DevOps
---


text:
.selectize-control.form-control.single {
    width: 170px;
    height: 30px;
    border-radius: 4px;
    color: white;
    padding-left: 6px;
    font-size: 13px;
    font-family: 'Roboto-Regular', Arial;
    margin-left: 11px;
    background: 130px center rgba(255, 255, 255, 0.2);
    cursor: pointer;
    float: left;
    outline: none;
    -webkit-appearance: none;
    line-height: 30px;
    border: 1px solid transparent;
}
.control-form-appended{
    width: 170px;
    height: 30px;
    border-radius: 4px;
    color: white;
    padding-left: 8px;
    font-size: 13px;
    font-family: 'Roboto-Regular', Arial;
    margin-left: 9px;
    background: 130px center rgba(255, 255, 255, 0.2);
    cursor: pointer;
    float: right;
    outline: none;
    -webkit-appearance: none;
    line-height: 30px;
    border: 1px solid transparent;
    display: inline-block;
    position: relative;
    right: 112px;
    overflow: hidden;
}
.selectize-input.items.full.has-options.has-items.focus.dropdown-active.input-active {
    background: #000;
    margin-left: -10px;
    border-radius: 4px;
    padding-left: 10px;
    border: 1px solid #7D36A3;
}
.selectize-control .selectize-input input{
    display: none;
}
.selectize-dropdown.single.form-control {
    border-radius: 4px;
    width:180px!important;
    background: #fff;
    margin-left: -10px;
    margin-top: 5px;
    color: #000;
    position: absolute;
    z-index: 10;
    border-radius: 8px;
}
.option {
    padding-left: 10px;
}
.option:hover {
    background: #7D36A3;
    color: #fff;
}
.selectize-dropdown-content {
    max-height: 220px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 8px;
}
.selectize-input.items.full.has-options.has-items.focus.dropdown-active.input-active {

}
.add-to-setting-list-btn {
    width: 15px;
    position: relative;
    height: 15px;
    right: -768px;
    top: -33px;
    background: #000;
}
.user-settings-ul{
    position: relative;
    left: 5px;
    display: inline-block;
    list-style: none;
}
.user-settings-ul li{
    width: 170px;
    height: 30px;
    border-radius: 4px;
    color: white;
    padding-left: 10px;
    font-size: 13px;
    font-family: 'Roboto-Regular', Arial;
    background: 130px center rgba(255, 255, 255, 0.2);
    cursor: pointer;
    float: left;
    outline: none;
    -webkit-appearance: none;
    line-height: 30px;
    border: 1px solid transparent;
    margin-left: 8px;
    margin-bottom: 8px;
}

.control-form-appended span{
    position: absolute;
    left: 145px;
    width: 30px;
    text-align: center;
    border-left: 1px solid #000;
    height: 32px;
    top: -1px;
    display: block;
}

.inputs-search div:nth-child(12){
    background: #7E57C6;
}
.inputs-search div:nth-child(13){
    background: #AF0061;
}
.inputs-search div:nth-child(14){
    background: #FF6D10;
}
.inputs-search div:nth-child(15){
    background: #993DBC;
}
.inputs-search div:nth-child(16){
    background: #008FBF;
}
.inputs-search div:nth-child(17){
    background: #00AFAB;
}
.selectize-dropdown-content div{
    background: #fff!important;
    font-family: roboto-medium;
}
.selectize-dropdown-content div:hover{
    background: #7D36A3!important;
}

.checkboxes-search .form-group label {
    font-family: roboto-Regular;
    font-size: 13px;
}
.item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0px 1px 1px #b6b6b6;
}
.inputs-search .form-group .selectize-control{
    width:170px!important;
}
.inputs-search .form-group .selectize-control .selectize-dropdown .selectize-dropdown-content{
    max-height: 145px!important;
}
.selectize-dropdown-content:after {
    position: absolute;
    content: " ";
    width: 0;
    height: 0;
    border: 7px solid transparent;
    border-bottom: 7px solid #fff;
    margin: auto;
    left: 87px;
    top: -13px;
}
.inputs-search {
    margin-left: -5px;
}
span.reset-all {
    position: absolute;
    top: 124px;
    right: 22px;
    opacity: 0.5;
    font-family: roboto-light;
    font-size: 14px;
    cursor: pointer;
}
span.reset-all:hover {
    opacity: 1;
}
span.reset-all a {
    font-family: roboto-light;
    font-size: 14px;
    color: #fff;
    text-decoration: none;
}