text:
//---------------------------------------------------------------------
// <copyright file="UriUtil.cs" company="Microsoft">
//      Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------

#if ASTORIA_CLIENT
namespace Microsoft.OData.Client
#else
namespace Microsoft.OData.Service
#endif
{
    #region Namespaces

    using System;
    using System.Diagnostics;
    using System.Diagnostics.CodeAnalysis;
    using System.Globalization;
    #endregion Namespaces

    ///
    /// static utility functions for uris
    ///
    internal static class UriUtil
    {
#if ASTORIA_CLIENT
        /// forward slash char array for triming uris
        internal static readonly char[] ForwardSlash = new char[1] { '/' };
#endif

        ///
        /// Turn Uri instance into string representation
        /// This is needed because Uri.ToString unescapes the string
        ///
        /// <param name="uri">The uri instance</param>
        /// <returns>The string representation of the uri</returns>
        [SuppressMessage("DataWeb.Usage", "AC0010", Justification = "Usage of OriginalString is safe in this context")]
        internal static string UriToString(Uri uri)
        {
            Debug.Assert(uri != null, "uri != null");
            return uri.IsAbsoluteUri ? uri.AbsoluteUri : uri.OriginalString;
        }

#if ASTORIA_CLIENT
        /// new Uri(string uriString, UriKind uriKind)
        /// <param name="value">value</param>
        /// <param name="kind">kind</param>
        /// <returns>new Uri(value, kind)</returns>
        internal static Uri CreateUri(string value, UriKind kind)
        {
            return value == null ? null : new Uri(value, kind);
        }

        /// new Uri(Uri baseUri, Uri requestUri)
        /// <param name="baseUri">baseUri</param>
        /// <param name="requestUri">relativeUri</param>
        /// <returns>new Uri(baseUri, requestUri)</returns>
        internal static Uri CreateUri(Uri baseUri, Uri requestUri)
        {
            Debug.Assert(baseUri != null, "baseUri != null");
            Util.CheckArgumentNull(requestUri, "requestUri");

            if (!baseUri.IsAbsoluteUri)
            {
                return CreateUri(UriToString(baseUri) + UriHelper.FORWARDSLASH + UriToString(requestUri), UriKind.Relative);
            }

            Debug.Assert(String.IsNullOrEmpty(baseUri.Query) && String.IsNullOrEmpty(baseUri.Fragment), "baseUri has query or fragment");

            // there is a bug in (new Uri(Uri,Uri)) which corrupts the port of the result if out relativeUri is also absolute
            if (requestUri.IsAbsoluteUri)
            {
                return requestUri;
            }

            return AppendBaseUriAndRelativeUri(baseUri, requestUri);
        }
#else
        ///
        /// Read the identifier from the uri segment value
        ///
        /// <param name="segment">One of the segments as returned by Uri.Segments method.</param>
        /// <returns>The segment identifier after stripping the last '/' character and unescaping the identifier.</returns>
        internal static string ReadSegmentValue(string segment)
        {
            if (segment.Length != 0 && segment != "/")
            {
                if (segment[segment.Length - 1] == '/')
                {
                    segment = segment.Substring(0, segment.Length - 1);
                }

                return Uri.UnescapeDataString(segment);
            }

            return null;
        }

        /// is the serviceRoot the base of the request uri
        /// <param name="baseUriWithSlash">baseUriWithSlash</param>
        /// <param name="requestUri">requestUri</param>
        /// <returns>true if the serviceRoot is the base of the request uri</returns>
        internal static bool IsBaseOf(Uri baseUriWithSlash, Uri requestUri)
        {
            return baseUriWithSlash.IsBaseOf(requestUri);
        }

        ///
        /// Determines whether the <paramref name="current"/> Uri instance is a
        /// base of the specified Uri instance.
        ///
        /// <param name="current">Candidate base URI.</param>
        /// <param name="uri">The specified Uri instance to test.</param>
        /// <returns>true if the current Uri instance is a base of uri; otherwise, false.</returns>
        internal static bool UriInvariantInsensitiveIsBaseOf(Uri current, Uri uri)
        {
            Debug.Assert(current != null, "current != null");
            Debug.Assert(uri != null, "uri != null");

            Uri upperCurrent = CreateBaseComparableUri(current);
            Uri upperUri = CreateBaseComparableUri(uri);

            return IsBaseOf(upperCurrent, upperUri);
        }
#endif

#if ASTORIA_CLIENT
        ///
        /// Appends the absolute baseUri with the relativeUri to create a new absolute uri
        ///
        /// <param name="baseUri">An absolute Uri</param>
        /// <param name="relativeUri">A relative Uri</param>
        /// <returns>An absolute Uri that is the combination of the base and relative Uris passed in.</returns>
        private static Uri AppendBaseUriAndRelativeUri(Uri baseUri, Uri relativeUri)
        {
            Debug.Assert(baseUri != null, "baseUri != null");
            Debug.Assert(baseUri.IsAbsoluteUri, "relativeUri is not relative");
            Debug.Assert(relativeUri != null, "relativeUri != null");
            Debug.Assert(!relativeUri.IsAbsoluteUri, "relativeUri is not relative");

            string baseUriString = UriToString(baseUri);
            string relativeUriString = UriToString(relativeUri);

            if (baseUriString.EndsWith("/", StringComparison.Ordinal))
            {
                if (relativeUriString.StartsWith("/", StringComparison.Ordinal))
                {
                    relativeUri = new Uri(baseUri, CreateUri(relativeUriString.TrimStart(ForwardSlash), UriKind.Relative));
                }
                else
                {
                    relativeUri = new Uri(baseUri, relativeUri);
                }
            }
            else
            {
                relativeUri = CreateUri(baseUriString + "/" + relativeUriString.TrimStart(ForwardSlash), UriKind.Absolute);
            }

            return relativeUri;
        }
#else
         /// Creates a URI suitable for host-agnostic comparison purposes.
        /// <param name="uri">URI to compare.</param>
        /// <returns>URI suitable for comparison.</returns>
        private static Uri CreateBaseComparableUri(Uri uri)
        {
            Debug.Assert(uri != null, "uri != null");

            uri = new Uri(UriToString(uri).ToUpper(CultureInfo.InvariantCulture), UriKind.RelativeOrAbsolute);

            UriBuilder builder = new UriBuilder(uri);
            builder.Host = "h";
            builder.Port = 80;
            builder.Scheme = "http";
            return builder.Uri;
        }
#endif
    }
}


text:
package com.amazonaws.services.networkmanager.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.networkmanager.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * AWSLocationMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class AWSLocationMarshaller {

    private static final MarshallingInfo<String> ZONE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Zone").build();
    private static final MarshallingInfo<String> SUBNETARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("SubnetArn").build();

    private static final AWSLocationMarshaller instance = new AWSLocationMarshaller();

    public static AWSLocationMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(AWSLocation aWSLocation, ProtocolMarshaller protocolMarshaller) {

        if (aWSLocation == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(aWSLocation.getZone(), ZONE_BINDING);
            protocolMarshaller.marshall(aWSLocation.getSubnetArn(), SUBNETARN_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

module.exports = class Runnable {
    constructor(parent, options) {
        options = options || {};

        this.type = options.type;
        this.title = options.title || 'some-runnable';
        this.fn = options.fn;
        this.parent = parent;
        this.ctx = parent && parent.ctx || {};
    }

    static create(parent, options) {
        return new this(parent, options);
    }

    fullTitle() {
        return `${this.parent.title} ${this.title}`.trim();
    }

    run() {
        return this.fn.call(this.ctx);
    }

    timeout(val) {
        if (val === undefined) {
            return this._timeout;
        }

        this._timeout = val;
    }
};


text:
export const INCREMENT_COUNTER = 'INCREMENT_COUNTER'
export const DECREMENT_COUNTER = 'DECREMENT_COUNTER'

export function increment() {
  return {
    type: INCREMENT_COUNTER
  }
}

export function decrement() {
  return {
    type: DECREMENT_COUNTER
  }
}

export function incrementIfOdd() {
  return (dispatch, getState) => {
    const { counter } = getState()

    if (counter % 2 === 0) {
      return
    }

    dispatch(increment())
  }
}

export function incrementAsync(delay = 1000) {
  return dispatch => {
    setTimeout(() => {
      dispatch(increment())
    }, delay)
  }
}


text:
	<?php
	class communityclass  {
	public $internalDB;
	function communityclass($db) // Constructor
	{
		$this->internalDB=$db;
		//$this->EventVisibility=new EventVisibilityType;
	}
	/* -----------------------------------------------------------------------------*/
	function updatecommunity($entity,$eventids)
	{
		$response =include 'community/savecommunity.php'	;
		return $response;
	}
	/*---------------------------------------------------------------*/
	function getallcommunityLists($pages,$rows,$searchobj){
		$searchobj=($searchobj!=null)?json_decode($searchobj):null;
		$returnvalue=include 'community/getallcommunities.php';
		return $returnvalue;

	}
	function getcommunitybyid($communityid){
		$eventdata= $this->internalDB->queryFirstRow("SELECT * FROM communities where id=$communityid");
	return $eventdata;

	}
	function archivecommunity(){

	}
	function deletecommunity(){

	}
	function getAllCommunityNames(){
		$response =include 'community/getallcommunitynames.php'	;
		return $response;
	}
	function getTotalCommunities($searchobj){
		$searchobj=($searchobj!=null)?json_decode($searchobj):null;
		$returnvalue=include 'community/gettotalcommunities.php';
		return $returnvalue;
	}

	function getSelectedState($communityid){
			$selectedState= $this->internalDB->queryFirstColumn("SELECT state_id FROM community_locations where community_id=$communityid");
	return $selectedState;
	}
	function getSelectedZone($communityid){
			$selectedZone= $this->internalDB->queryFirstColumn("SELECT zone_id FROM community_locations where community_id=$communityid");
	return $selectedZone;
	}
}


text:
<!DOCTYPE html>

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

  <title>JustHost a prueba</title>
  <meta name="description" content="Las Cosas son como deben, no como deberían Ser.">
  <meta name="author" content="Mauricio Navarro Miranda">
  <meta name="HandheldFriendly" content="True">
  <meta name="MobileOptimized" content="320">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  <meta name="twitter:card" content="summary">
  <meta name="twitter:title" content="El rincón de mautemático">
  <meta name="twitter:description" content="Las Cosas son como deben, no como deberían Ser.">

  <meta property="og:type" content="article">
  <meta property="og:title" content="El rincón de mautemático">
  <meta property="og:description" content="Las Cosas son como deben, no como deberían Ser.">

  <link rel="apple-touch-icon" sizes="57x57" href="/images/favicons/apple-touch-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="60x60" href="/images/favicons/apple-touch-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="72x72" href="/images/favicons/apple-touch-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="76x76" href="/images/favicons/apple-touch-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="114x114" href="/images/favicons/apple-touch-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="120x120" href="/images/favicons/apple-touch-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="144x144" href="/images/favicons/apple-touch-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="152x152" href="/images/favicons/apple-touch-icon-152x152.png">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/favicons/apple-touch-icon-180x180.png">
  <link rel="icon" type="image/png" href="/images/favicons/favicon-32x32.png" sizes="32x32">
  <link rel="icon" type="image/png" href="/images/favicons/favicon-194x194.png" sizes="194x194">
  <link rel="icon" type="image/png" href="/images/favicons/favicon-96x96.png" sizes="96x96">
  <link rel="icon" type="image/png" href="/images/favicons/android-chrome-192x192.png" sizes="192x192">
  <link rel="icon" type="image/png" href="/images/favicons/favicon-16x16.png" sizes="16x16">
  <link rel="manifest" href="/images/favicons/manifest.json">
  <link rel="shortcut icon" href="/images/favicons/favicon.ico">
  <meta name="msapplication-TileColor" content="#ffc40d">
  <meta name="msapplication-TileImage" content="/images/favicons/mstile-144x144.png">
  <meta name="theme-color" content="#ffffff">

  <link rel="stylesheet" href="/css/main.css">
  <link rel="canonical" href="https://blog.mautematico.com//2011/justhost-a-prueba.html">
  <link rel="alternate" type="application/rss+xml" title="El rincón de mautemático" href="/feed.xml">

El rincón de mautemático

Las Cosas son como deben, no como deberían Ser.

Blog

                  Twitter

                  GitHub

                  Email

                RSS

      <time datetime="14 Apr 2011" class="post-meta__date date">14 Apr 2011</time> • on

JustHost a prueba

No soy, ni de lejos, el juez pesadilla para JustHost, seguramente mis blogs no exijan demasiado a lo que promete ser mi hosting para la vida. Pero no me importa! De todos modos, para mí es noticia, y de vez en vez comparto los aconteceres de mi vida, así que…

Noticia es por la quizás aparente traición. Si más de alguno recuerda aquel proyecto de Web Hosting Gratis Dosmilonce, podría resultarle medio raro que acabo de contratar una cuenta por un año con JustHost, ya saben, de esos hostings compartidos que te prometen todo ilimitado.

Bue!… Por el mundo hay crédulos de todo e incrédulos de todo, un claro ejemplo acá son los shared hosting, “all” unlimited. Ya saben, los típicos:

Ilimitado no existe, que si existiera, forobeta se cambiaría para allá.

Ilimitado es estafa, que si lo hacen así, no es negocio

Ilimitado = Dinero perdido. Ven a verme al rato, cuando te des cuenta que NADIE regala nada…

Y más blablabla del mismo estilo. Antes de continuar con JustHost, quiseira que nos acordemos de otro punto de discordia en Interné: Free Web Hosting. Y ya recordaron, los mismos pleitos:

Gratis no existe, sino de donde comen?

Gratis nada, NADIE regala nada…

Hagamos una pausa. No, no es spam, pero creo que un claro ejemplo del mal enfoque en ambos casos son los multiples resellers de web hosting free de Byet que hay por ahi (atinaron, Dosmilonce es uno de ellos). Yo invierto tiempo, y no cobro por tener ahi el reseller. Byet no me cobra por tener el reseller. Es “gratis”.

Lo que muchos alegan es que de algo se tiene que ganar, y no están equivocados, para nada.

Su servidor (me refiero a mi, no al computador) tiene la posibilidad de agregar código HTML al final de cada página de cada cuenta registrada bajo el reseller que “manejo”, y ya sabemos que entre otras cosas, se puede hacer algo de dinero con ciertos códigos HTML (publicidad, pues). Ahí está una de las formas en que yo puedo obtener ganancia.

Luego, Byet se dedica a vender hosting, y sin demasiada pena puede darse el lujo de ir por el mundo ofreciendo lo que serían “pruebas gratis”, que es lo que hace. De hecho, en cierta forma podemos decir que tiene gente trabajandole de a grapa (yo, por ejemplo), los resellers de hosting free que brindamos soporte básico a nuestros “clientes”, y bueno, cuando el host free les queda corto, la primer opción que considerarán seguro será Byet. (Incluso es una de las primeras que yo consideré). Ahí gana Byet.

Entonces, quedamos en que gratis sí es, aunque no todo. Vamos, que si quieres más y mejor, terminas pagando.

Luego, regresemos a JustHost: Ellos, como bastantes más, ofrecen Espacio en disco Ilimitado, Transferencia mensual (ancho de banda) ilimitado, Bases de datos MySQL, cuentas FTP, email…. muchas cosas, Ilimitado.

El truco? No, no hay truco. Bueno sí:

Sujeto a términos de uso razonable

Más o menos así rezan los términos y condiciones del servicio, que no muchos leemos.

Pero, en buena onda, no me parece que sea truco. Estás contratando un web hosting, no un hosting de archivos, me explico? No vas a montar un servidor para descargar películas en JustHost, porque no cabe dentro de lo que contrataste.

Luego, lo principal por lo que seguramente forobeta no se muda a JustHost, por ejemplo, será el limite de conexiones concurrentes al servidor de base de datos (50, creo recordar), fácilmente superado por un foro como aquel.

No que no había truco? Insisto, no lo hay. La cosa está en el enfoque de cada servicio. Yo mismo usé hosting free por buen rato (varios años), y sin quejas. De hecho me mudé a JustHost más por comodidad que por necesitar espacio o ancho de banda, ya saben como soy. El problema está en la interpretación de Ilimitado que cada uno pueda tener, y que ésta esté más o menos cerca de lo que realmente significa. En mi caso, significa que no van a suspender mi cuenta por generar un altisimo tráfico web, pero SÍ la suspenderán si, en el proceso, cargo la CPU correspondiente a mi web (y otras webs, porque es compartido) en más del 10% del total.

Recomendar? todavia no lo se. Aún no me arriesgo. La verdad es que prmete bastante, y no tengo quejas hasta el momento, pero tendré que ver como va con mis blogsitos antes de animarme a recomendarlo (=.

Ai si yu sun.

  © 2020 Mauricio Navarro Miranda. All rights reserved.


text:
import os
import yaml

from bcbio import utils
from bcbio.install import _get_data_dir
from bcbio.distributed import clargs
from bcbio.provenance import system
import bcbio.distributed.resources as res
from bcbio.distributed.ipython import create
# from bcbio import log
import log
from cluster_helper import cluster as ipc

config_default = {'name': 'std', 'mem': 8, 'cores': 1}

def get_cluster_view(args):
    if not os.path.exists("ipython"):
        utils.safe_makedir("ipython")
        utils.safe_makedir("checkpoint")
    return ipc.cluster_view(args['scheduler'], args['queue'],
                            args['num_jobs'], args['cores_per_job'],
                            start_wait=args['timeout'],
                            profile="ipython",
                            extra_params={"resources": args['resources'],
                                          "mem": args['mem'],
                                          "tag": "ichwrapper",
                                          "run_local": args['run_local']})

def wait_until_complete(jobs):
    return [[j.get()] for j in jobs]

def is_done(step):
    if os.path.exists(os.path.join("checkpoint", step)):
        return True
    return False

def flag_done(step):
    with open(os.path.join("checkpoint", step), "w") as handle:
        handle.write("done")

def _calculate_resources(data, args, resources):
    parallel = clargs.to_parallel(args)
    config = data[0][0]['config']
    config['resources'].update({resources['name']: {'memory': "%sg" % resources['mem'], 'cores': resources['cores']}})
    parallel.update({'progs': [resources['name']]})
    # parallel = log.create_base_logger(config, parallel)
    # log.setup_local_logging(config, parallel)
    log.setup_log(config, parallel)
    dirs = {'work': os.path.abspath(os.getcwd())}
    system.write_info(dirs, parallel, config)
    sysinfo = system.machine_info()[0]
    log.logger.info("Number of items %s" % len(data))
    parallel = res.calculate(parallel, data, sysinfo, config)
    log.logger.info(parallel)
    # print parallel
    # raise
    return parallel

def _check_items(data):
    """
    First check items are as expected
    """
    msg = ("\nYou can use ichwrapper.cluster.update_samples to add the config structure."
           "\nExample of list of samples to parallelize:"
           "\n[sample1, sample2, sample3]"
           "\nsample1=[{..., 'config':{'algorithm', ...}}]")
    assert isinstance(data,  list), "data needs to be a list"
    assert isinstance(data[0], list), "each item inside data needs to be like this [{}]"
    assert data[0][0]['config'], "each item inside data needs to have a config key with the info from galaxy/bcbio_system.yaml." + msg
    assert data[0][0]['config']['algorithm'], "config key inside item dict needs to have algorithm key." + msg

def send_job(fn, data, args, resources=None):
    """decide if send jobs with ipython or run locally"""
    utils.safe_makedir("checkpoint")
    _check_items(data)
    res = []
    dirs = {'work': os.path.abspath(os.getcwd())}
    config = data[0][0]['config']
    if not resources:
        resources = config_default
    step = resources['name']
    if 'mem' not in resources or 'cores' not in resources:
        raise ValueError("resources without mem or cores keys: %s" % resources)
    par = _calculate_resources(data, args, resources)
    # args.memory_per_job = resources['mem']
    # args.cores_per_job = resources['cores']
    # log.setup_log(args)
    log.logger.debug("doing %s" % step)
    if par['type'] == "ipython" and not is_done(step):
        with create(par, dirs, config) as view:
            for sample in data:
                res.append(view.apply_async(fn, sample[0], args))
            res = wait_until_complete(res)
        flag_done(step)
        return res
    for sample in data:
        res.append([fn(sample[0], args)])
    return res

def update_samples(data, resources, args):
    """
    Update algorithm dict with new cores set
    """
    if args.galaxy:
        system_config = args.galaxy
    else:
        system_config = os.path.join(_get_data_dir(), "galaxy", "bcbio_system.yaml")
    config = yaml.load(open(system_config))
    config['algorithm'] = {}

    new_data = []
    for sample in data:
        sample['config'] = config
        sample['config']['algorithm'] = resources
        new_data.append([sample])
    return new_data


text:
package org.scalaide.logging

import org.scalaide.core.internal.logging.LogManager
import org.scalaide.core.internal.logging.EclipseLogger

/**
 * Classes can mix this trait for having access to both the "default" {{{logger}}}
 * and the {{{eclipseLog}}}. The {{{eclipseLog}}} is a handle on the
 * {{{org.eclipse.core.runtime.Plugin.getLog}} instance.
 *
 * Clients can inject different loggers if needed.
 */
trait HasLogger {
  /** The Scala IDE logger.
   *  To use to log messages in the Scala IDE log.
   */
  protected[this] lazy val logger: Logger = {
    val clazz = this.getClass
    LogManager.getLogger(clazz)
  }

  /** The Eclipse platform logger.
   *  To use to log messages in the platform log.
   */
  protected[this] def eclipseLog: Logger = EclipseLogger
}


text:
<?php

use humhub\compat\CActiveForm;
use humhub\compat\CHtml;
use yii\helpers\Html;
use humhub\models\Setting;
use yii\helpers\Url;
?>

<?php
            if ($prefix == "") {
                echo Yii::t('AdminModule.views_setting_oembed_edit', 'Add OEmbed Provider');
            } else {
                echo Yii::t('AdminModule.views_setting_oembed_edit', 'Edit OEmbed Provider');
            }
            ?>

        <?php $form = CActiveForm::begin(['id' => 'authentication-settings-form']); ?>

        <?php echo $form->errorSummary($model); ?>

            <?php echo $form->labelEx($model, 'prefix'); ?>
            <?php echo $form->textField($model, 'prefix', array('class' => 'form-control')); ?>

<?php echo Yii::t('AdminModule.views_setting_oembed_edit', 'Url Prefix without http:// or https:// (e.g. youtube.com)'); ?>

            <?php echo $form->labelEx($model, 'endpoint'); ?>
            <?php echo $form->textField($model, 'endpoint', array('class' => 'form-control')); ?>

<?php echo Yii::t('AdminModule.views_setting_oembed_edit', 'Use %url% as placeholder for URL. Format needs to be JSON. (e.g. http://www.youtube.com/oembed?url=%url%&format=json)'); ?>

        <?php echo CHtml::submitButton(Yii::t('AdminModule.views_setting_oembed_edit', 'Save'), array('class' => 'btn btn-primary')); ?>
        <?php CActiveForm::end(); ?>

        <?php if ($prefix != ""): ?>
            <?php echo Html::a(Yii::t('AdminModule.views_setting_oembed_edit', 'Delete'), Url::to(['oembed-delete', 'prefix' => $prefix]), array('class' => 'btn btn-danger pull-right', 'data-method' => 'POST')); ?>
        <?php endif; ?>


text:
<ion-view view-title="Debugging">
	<ion-nav-bar class="bar-positive">
		<ion-nav-back-button></ion-nav-back-button>
		<ion-nav-buttons side="right">
			<button class="button" data-ng-click="save()">
				Save
			</button>
		</ion-nav-buttons>
	</ion-nav-bar>

	<ion-content>

				Notifications

				<button class="button">Update notifications</button>

Item: {{ ItemService.get(reminder) }}

Start at: {{ reminder.at * 1000 | date:'yyyy-MM-ddTHH:mmZ' }}

Every: {{ reminder.every }}m

	</ion-content>
</ion-view>


text:
package ddl

import (
	"context"

	. "github.com/pingcap/check"
	"github.com/pingcap/errors"
	"github.com/pingcap/parser/model"
	"github.com/pingcap/parser/mysql"
	"github.com/pingcap/tidb/kv"
	"github.com/pingcap/tidb/meta"
	"github.com/pingcap/tidb/sessionctx"
	"github.com/pingcap/tidb/table"
	"github.com/pingcap/tidb/types"
)

var _ = Suite(&testIndexChangeSuite{})

type testIndexChangeSuite struct {
	store  kv.Storage
	dbInfo *model.DBInfo
}

func (s *testIndexChangeSuite) SetUpSuite(c *C) {
	s.store = testCreateStore(c, "test_index_change")
	s.dbInfo = &model.DBInfo{
		Name: model.NewCIStr("test_index_change"),
		ID:   1,
	}
	err := kv.RunInNewTxn(s.store, true, func(txn kv.Transaction) error {
		t := meta.NewMeta(txn)
		return errors.Trace(t.CreateDatabase(s.dbInfo))
	})
	c.Check(err, IsNil, Commentf("err %v", errors.ErrorStack(err)))
}

func (s *testIndexChangeSuite) TearDownSuite(c *C) {
	s.store.Close()
}

func (s *testIndexChangeSuite) TestIndexChange(c *C) {
	d := newDDL(
		context.Background(),
		WithStore(s.store),
		WithLease(testLease),
	)
	defer d.Stop()
	// create table t (c1 int primary key, c2 int);
	tblInfo := testTableInfo(c, d, "t", 2)
	tblInfo.Columns[0].Flag = mysql.PriKeyFlag | mysql.NotNullFlag
	tblInfo.PKIsHandle = true
	ctx := testNewContext(d)
	err := ctx.NewTxn(context.Background())
	c.Assert(err, IsNil)
	testCreateTable(c, ctx, d, s.dbInfo, tblInfo)
	originTable := testGetTable(c, d, s.dbInfo.ID, tblInfo.ID)

	// insert t values (1, 1), (2, 2), (3, 3)
	_, err = originTable.AddRecord(ctx, types.MakeDatums(1, 1))
	c.Assert(err, IsNil)
	_, err = originTable.AddRecord(ctx, types.MakeDatums(2, 2))
	c.Assert(err, IsNil)
	_, err = originTable.AddRecord(ctx, types.MakeDatums(3, 3))
	c.Assert(err, IsNil)

	txn, err := ctx.Txn(true)
	c.Assert(err, IsNil)
	err = txn.Commit(context.Background())
	c.Assert(err, IsNil)

	tc := &TestDDLCallback{}
	// set up hook
	prevState := model.StateNone
	var (
		deleteOnlyTable table.Table
		writeOnlyTable  table.Table
		publicTable     table.Table
		checkErr        error
	)
	tc.onJobUpdated = func(job *model.Job) {
		if job.SchemaState == prevState {
			return
		}
		ctx1 := testNewContext(d)
		prevState = job.SchemaState
		switch job.SchemaState {
		case model.StateDeleteOnly:
			deleteOnlyTable, err = getCurrentTable(d, s.dbInfo.ID, tblInfo.ID)
			if err != nil {
				checkErr = errors.Trace(err)
			}
		case model.StateWriteOnly:
			writeOnlyTable, err = getCurrentTable(d, s.dbInfo.ID, tblInfo.ID)
			if err != nil {
				checkErr = errors.Trace(err)
			}
			err = s.checkAddWriteOnly(d, ctx1, deleteOnlyTable, writeOnlyTable)
			if err != nil {
				checkErr = errors.Trace(err)
			}
		case model.StatePublic:
			if job.GetRowCount() != 3 {
				checkErr = errors.Errorf("job's row count %d != 3", job.GetRowCount())
			}
			publicTable, err = getCurrentTable(d, s.dbInfo.ID, tblInfo.ID)
			if err != nil {
				checkErr = errors.Trace(err)
			}
			err = s.checkAddPublic(d, ctx1, writeOnlyTable, publicTable)
			if err != nil {
				checkErr = errors.Trace(err)
			}
		}
	}
	d.SetHook(tc)
	testCreateIndex(c, ctx, d, s.dbInfo, originTable.Meta(), false, "c2", "c2")
	c.Check(errors.ErrorStack(checkErr), Equals, "")
	txn, err = ctx.Txn(true)
	c.Assert(err, IsNil)
	c.Assert(txn.Commit(context.Background()), IsNil)
	d.Stop()
	prevState = model.StateNone
	var noneTable table.Table
	tc.onJobUpdated = func(job *model.Job) {
		if job.SchemaState == prevState {
			return
		}
		prevState = job.SchemaState
		var err error
		ctx1 := testNewContext(d)
		switch job.SchemaState {
		case model.StateWriteOnly:
			writeOnlyTable, err = getCurrentTable(d, s.dbInfo.ID, tblInfo.ID)
			if err != nil {
				checkErr = errors.Trace(err)
			}
			err = s.checkDropWriteOnly(d, ctx1, publicTable, writeOnlyTable)
			if err != nil {
				checkErr = errors.Trace(err)
			}
		case model.StateDeleteOnly:
			deleteOnlyTable, err = getCurrentTable(d, s.dbInfo.ID, tblInfo.ID)
			if err != nil {
				checkErr = errors.Trace(err)
			}
			err = s.checkDropDeleteOnly(d, ctx1, writeOnlyTable, deleteOnlyTable)
			if err != nil {
				checkErr = errors.Trace(err)
			}
		case model.StateNone:
			noneTable, err = getCurrentTable(d, s.dbInfo.ID, tblInfo.ID)
			if err != nil {
				checkErr = errors.Trace(err)
			}
			if len(noneTable.Indices()) != 0 {
				checkErr = errors.New("index should have been dropped")
			}
		}
	}
	d.start(context.Background(), nil)
	testDropIndex(c, ctx, d, s.dbInfo, publicTable.Meta(), "c2")
	c.Check(errors.ErrorStack(checkErr), Equals, "")
}

func checkIndexExists(ctx sessionctx.Context, tbl table.Table, indexValue interface{}, handle int64, exists bool) error {
	idx := tbl.Indices()[0]
	txn, err := ctx.Txn(true)
	if err != nil {
		return errors.Trace(err)
	}
	doesExist, _, err := idx.Exist(ctx.GetSessionVars().StmtCtx, txn, types.MakeDatums(indexValue), handle)
	if err != nil {
		return errors.Trace(err)
	}
	if exists != doesExist {
		if exists {
			return errors.New("index should exists")
		}
		return errors.New("index should not exists")
	}
	return nil
}

func (s *testIndexChangeSuite) checkAddWriteOnly(d *ddl, ctx sessionctx.Context, delOnlyTbl, writeOnlyTbl table.Table) error {
	// DeleteOnlyTable: insert t values (4, 4);
	err := ctx.NewTxn(context.Background())
	if err != nil {
		return errors.Trace(err)
	}
	_, err = delOnlyTbl.AddRecord(ctx, types.MakeDatums(4, 4))
	if err != nil {
		return errors.Trace(err)
	}
	err = checkIndexExists(ctx, writeOnlyTbl, 4, 4, false)
	if err != nil {
		return errors.Trace(err)
	}

	// WriteOnlyTable: insert t values (5, 5);
	_, err = writeOnlyTbl.AddRecord(ctx, types.MakeDatums(5, 5))
	if err != nil {
		return errors.Trace(err)
	}
	err = checkIndexExists(ctx, writeOnlyTbl, 5, 5, true)
	if err != nil {
		return errors.Trace(err)
	}

	// WriteOnlyTable: update t set c2 = 1 where c1 = 4 and c2 = 4
	err = writeOnlyTbl.UpdateRecord(ctx, 4, types.MakeDatums(4, 4), types.MakeDatums(4, 1), touchedSlice(writeOnlyTbl))
	if err != nil {
		return errors.Trace(err)
	}
	err = checkIndexExists(ctx, writeOnlyTbl, 1, 4, true)
	if err != nil {
		return errors.Trace(err)
	}

	// DeleteOnlyTable: update t set c2 = 3 where c1 = 4 and c2 = 1
	err = delOnlyTbl.UpdateRecord(ctx, 4, types.MakeDatums(4, 1), types.MakeDatums(4, 3), touchedSlice(writeOnlyTbl))
	if err != nil {
		return errors.Trace(err)
	}
	// old value index not exists.
	err = checkIndexExists(ctx, writeOnlyTbl, 1, 4, false)
	if err != nil {
		return errors.Trace(err)
	}
	// new value index not exists.
	err = checkIndexExists(ctx, writeOnlyTbl, 3, 4, false)
	if err != nil {
		return errors.Trace(err)
	}

	// WriteOnlyTable: delete t where c1 = 4 and c2 = 3
	err = writeOnlyTbl.RemoveRecord(ctx, 4, types.MakeDatums(4, 3))
	if err != nil {
		return errors.Trace(err)
	}
	err = checkIndexExists(ctx, writeOnlyTbl, 3, 4, false)
	if err != nil {
		return errors.Trace(err)
	}

	// DeleteOnlyTable: delete t where c1 = 5
	err = delOnlyTbl.RemoveRecord(ctx, 5, types.MakeDatums(5, 5))
	if err != nil {
		return errors.Trace(err)
	}
	err = checkIndexExists(ctx, writeOnlyTbl, 5, 5, false)
	if err != nil {
		return errors.Trace(err)
	}
	return nil
}

func (s *testIndexChangeSuite) checkAddPublic(d *ddl, ctx sessionctx.Context, writeTbl, publicTbl table.Table) error {
	// WriteOnlyTable: insert t values (6, 6)
	err := ctx.NewTxn(context.Background())
	if err != nil {
		return errors.Trace(err)
	}
	_, err = writeTbl.AddRecord(ctx, types.MakeDatums(6, 6))
	if err != nil {
		return errors.Trace(err)
	}
	err = checkIndexExists(ctx, publicTbl, 6, 6, true)
	if err != nil {
		return errors.Trace(err)
	}
	// PublicTable: insert t values (7, 7)
	_, err = publicTbl.AddRecord(ctx, types.MakeDatums(7, 7))
	if err != nil {
		return errors.Trace(err)
	}
	err = checkIndexExists(ctx, publicTbl, 7, 7, true)
	if err != nil {
		return errors.Trace(err)
	}

	// WriteOnlyTable: update t set c2 = 5 where c1 = 7 and c2 = 7
	err = writeTbl.UpdateRecord(ctx, 7, types.MakeDatums(7, 7), types.MakeDatums(7, 5), touchedSlice(writeTbl))
	if err != nil {
		return errors.Trace(err)
	}
	err = checkIndexExists(ctx, publicTbl, 5, 7, true)
	if err != nil {
		return errors.Trace(err)
	}
	err = checkIndexExists(ctx, publicTbl, 7, 7, false)
	if err != nil {
		return errors.Trace(err)
	}
	// WriteOnlyTable: delete t where c1 = 6
	err = writeTbl.RemoveRecord(ctx, 6, types.MakeDatums(6, 6))
	if err != nil {
		return errors.Trace(err)
	}
	err = checkIndexExists(ctx, publicTbl, 6, 6, false)
	if err != nil {
		return errors.Trace(err)
	}

	var rows [][]types.Datum
	publicTbl.IterRecords(ctx, publicTbl.FirstKey(), publicTbl.Cols(),
		func(h int64, data []types.Datum, cols []*table.Column) (bool, error) {
			rows = append(rows, data)
			return true, nil
		})
	if len(rows) == 0 {
		return errors.New("table is empty")
	}
	for _, row := range rows {
		idxVal := row[1].GetInt64()
		handle := row[0].GetInt64()
		err = checkIndexExists(ctx, publicTbl, idxVal, handle, true)
		if err != nil {
			return errors.Trace(err)
		}
	}
	txn, err := ctx.Txn(true)
	if err != nil {
		return errors.Trace(err)
	}
	return txn.Commit(context.Background())
}

func (s *testIndexChangeSuite) checkDropWriteOnly(d *ddl, ctx sessionctx.Context, publicTbl, writeTbl table.Table) error {
	// WriteOnlyTable insert t values (8, 8)
	err := ctx.NewTxn(context.Background())
	if err != nil {
		return errors.Trace(err)
	}
	_, err = writeTbl.AddRecord(ctx, types.MakeDatums(8, 8))
	if err != nil {
		return errors.Trace(err)
	}

	err = checkIndexExists(ctx, publicTbl, 8, 8, true)
	if err != nil {
		return errors.Trace(err)
	}

	// WriteOnlyTable update t set c2 = 7 where c1 = 8 and c2 = 8
	err = writeTbl.UpdateRecord(ctx, 8, types.MakeDatums(8, 8), types.MakeDatums(8, 7), touchedSlice(writeTbl))
	if err != nil {
		return errors.Trace(err)
	}

	err = checkIndexExists(ctx, publicTbl, 7, 8, true)
	if err != nil {
		return errors.Trace(err)
	}

	// WriteOnlyTable delete t where c1 = 8
	err = writeTbl.RemoveRecord(ctx, 8, types.MakeDatums(8, 7))
	if err != nil {
		return errors.Trace(err)
	}

	err = checkIndexExists(ctx, publicTbl, 7, 8, false)
	if err != nil {
		return errors.Trace(err)
	}
	txn, err := ctx.Txn(true)
	if err != nil {
		return errors.Trace(err)
	}
	return txn.Commit(context.Background())
}

func (s *testIndexChangeSuite) checkDropDeleteOnly(d *ddl, ctx sessionctx.Context, writeTbl, delTbl table.Table) error {
	// WriteOnlyTable insert t values (9, 9)
	err := ctx.NewTxn(context.Background())
	if err != nil {
		return errors.Trace(err)
	}
	_, err = writeTbl.AddRecord(ctx, types.MakeDatums(9, 9))
	if err != nil {
		return errors.Trace(err)
	}

	err = checkIndexExists(ctx, writeTbl, 9, 9, true)
	if err != nil {
		return errors.Trace(err)
	}

	// DeleteOnlyTable insert t values (10, 10)
	_, err = delTbl.AddRecord(ctx, types.MakeDatums(10, 10))
	if err != nil {
		return errors.Trace(err)
	}

	err = checkIndexExists(ctx, writeTbl, 10, 10, false)
	if err != nil {
		return errors.Trace(err)
	}

	// DeleteOnlyTable update t set c2 = 10 where c1 = 9
	err = delTbl.UpdateRecord(ctx, 9, types.MakeDatums(9, 9), types.MakeDatums(9, 10), touchedSlice(delTbl))
	if err != nil {
		return errors.Trace(err)
	}

	err = checkIndexExists(ctx, writeTbl, 9, 9, false)
	if err != nil {
		return errors.Trace(err)
	}

	err = checkIndexExists(ctx, writeTbl, 10, 9, false)
	if err != nil {
		return errors.Trace(err)
	}
	txn, err := ctx.Txn(true)
	if err != nil {
		return errors.Trace(err)
	}
	return txn.Commit(context.Background())
}


text:
package com.specmate.emfjson;

import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EStructuralFeature;

/**
 * Predicate that describes where to stop the EMF to JSON serialization
 * @author junkerm
 *
 */
public interface ISerializerStopPredicate {

	/**
	 * @param feature
	 * @return true if the serialization should stop at feature feature
	 */
	public abstract boolean stopAtFeature(EStructuralFeature feature);

	/**
	 * @param clazz
	 * @return true if the serialization should stop at classifier clazz
	 */
	public abstract boolean stopAtClass(EClassifier clazz);

	/**
	 *
	 * @param depth
	 * @return true if the serialization should stop at depth depth
	 */
	public abstract boolean stopAtDepth(int depth);

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Namespaces | Hyperledger Indy .NET Wrapper </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Namespaces | Hyperledger Indy .NET Wrapper ">
    <meta name="generator" content="docfx 2.25.1.0">

    <link rel="shortcut icon" href="../images/favicon.png">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

    <meta property="docfx:rel" content="../">
    <meta property="docfx:newtab" content="true">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Namespaces

The Indy SDK wrapper for .NET is separated into a series of namespaces that contain types for performing specific
types of interactions.  The list of these namespaces and their function can be found below and the you can access the types
can be accessed by selecting the namespace from the sidebar.

Hyperledger.Indy

General types that relate to the .NET wrapper as a whole.  This includes exception types that are common to all interactions.

See the Hyperledger.Indy Namespace topic for details.

Hyperledger.Indy.AnonCredsApi

Types for generating and managing anonymous credentials including claims, claim schema, proofs, etc.

See the Hyperledger.Indy.AnonCredsApi Namespace topic for details.

Hyperledger.Indy.BlobStorageApi

Types for reading and writing Binary Large OBjects to and from storage.

See the Hyperledger.Indy.BlobStorageApi Namespace topic for details.

Hyperledger.Indy.CryptoApi

Types for performing common pure cryptographic functions that are not specific to the Did functionality such as generating
key-pairs, signing, verifying and anonymous encryption.

See the Hyperledger.Indy.CryptoApi Namespace topic for details.

Hyperledger.Indy.DidApi

Types for creating and managing DIDs, key management, encryption, decryption, digital signatures, etc.

See the Hyperledger.Indy.DidApi Namespace topic for details.

Hyperledger.Indy.LedgerApi

Types for generating transaction messages as well as signing and sending them to a ledger pool.

See the Hyperledger.Indy.LedgerApi Namespace topic for details.

Hyperledger.Indy.PairwiseApi

Types for managing pairwise relationships between DIDs.

See the Hyperledger.Indy.PairwiseApi Namespace topic for details.

Hyperledger.Indy.PoolApi

Types for managing connections to node pools that host ledgers.

See the Hyperledger.Indy.PoolApi Namespace topic for details.

Hyperledger.Indy.WalletApi

Types for managing wallets which can contain DIDs, their associated keys and other key/value data.

See the Hyperledger.Indy.WalletApi Namespace topic for details.

              Back to top

            Copyright © 2017 The Linux Foundation®


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

using System;
using System.Threading;
using System.Threading.Tasks;
using Object = Google.Apis.Storage.v1.Data.Object;

namespace Google.Storage.V1
{
    public abstract partial class StorageClient
    {
        /// <summary>
        /// Patches the metadata for an object in storage synchronously.
        /// </summary>
        /// <param name="obj">Object to update. Must not be null, and must have populated <c>Name</c> and
        /// <c>Bucket</c> properties.</param>
        /// <param name="options">Additional options for the update. May be null, in which case appropriate
        /// defaults will be used.</param>
        /// <returns>The <see cref="Object"/> representation of the updated storage object.</returns>
        public virtual Object PatchObject(
            Object obj,
            PatchObjectOptions options = null)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Patches the metadata for an object in storage asynchronously.
        /// </summary>
        /// <param name="obj">Object to update. Must not be null, and must have populated <c>Name</c> and
        /// <c>Bucket</c> properties.</param>
        /// <param name="options">Additional options for the update. May be null, in which case appropriate
        /// defaults will be used.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <returns>A task representing the asynchronous operation, with a result returning the
        /// <see cref="Object"/> representation of the updated storage object.</returns>
        public virtual Task<Object> PatchObjectAsync(
            Object obj,
            PatchObjectOptions options = null,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            throw new NotImplementedException();
        }
    }
}


text:
/* DO NOT EDIT */
/* This file was generated from team_log_generated.stone */

package com.dropbox.core.v2.teamlog;

import com.dropbox.core.stone.StoneDeserializerLogger;
import com.dropbox.core.stone.StoneSerializers;
import com.dropbox.core.stone.StructSerializer;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;

import java.io.IOException;

/**
 * Approved user's request to join team.
 */
public class DomainInvitesApproveRequestToJoinTeamDetails {
    // struct team_log.DomainInvitesApproveRequestToJoinTeamDetails (team_log_generated.stone)

    /**
     * Approved user's request to join team.
     */
    public DomainInvitesApproveRequestToJoinTeamDetails() {
    }

    @Override
    public int hashCode() {
        // attempt to deal with inheritance
        return getClass().toString().hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        // be careful with inheritance
        else if (obj.getClass().equals(this.getClass())) {
            DomainInvitesApproveRequestToJoinTeamDetails other = (DomainInvitesApproveRequestToJoinTeamDetails) obj;
            return true;
        }
        else {
            return false;
        }
    }

    @Override
    public String toString() {
        return Serializer.INSTANCE.serialize(this, false);
    }

    /**
     * Returns a String representation of this object formatted for easier
     * readability.
     *
     * <p> The returned String may contain newlines. </p>
     *
     * @return Formatted, multiline String representation of this object
     */
    public String toStringMultiline() {
        return Serializer.INSTANCE.serialize(this, true);
    }

    /**
     * For internal use only.
     */
    static class Serializer extends StructSerializer<DomainInvitesApproveRequestToJoinTeamDetails> {
        public static final Serializer INSTANCE = new Serializer();

        @Override
        public void serialize(DomainInvitesApproveRequestToJoinTeamDetails value, JsonGenerator g, boolean collapse) throws IOException, JsonGenerationException {
            if (!collapse) {
                g.writeStartObject();
            }
            if (!collapse) {
                g.writeEndObject();
            }
        }

        @Override
        public DomainInvitesApproveRequestToJoinTeamDetails deserialize(JsonParser p, boolean collapsed) throws IOException, JsonParseException {
            DomainInvitesApproveRequestToJoinTeamDetails value;
            String tag = null;
            if (!collapsed) {
                expectStartObject(p);
                tag = readTag(p);
            }
            if (tag == null) {
                value = new DomainInvitesApproveRequestToJoinTeamDetails();
            }
            else {
                throw new JsonParseException(p, "No subtype found that matches tag: \"" + tag + "\"");
            }
            if (!collapsed) {
                expectEndObject(p);
            }
            StoneDeserializerLogger.log(value, value.toStringMultiline());
            return value;
        }
    }
}


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

namespace ObservationValidator
{
    public static class RuleReader
    {
        private static readonly string RuleFileName = "ValidationRules.txt";

        public static List<Rule> ReadFromDefaultFile()
        {
            var rules = new List<Rule>();
            var fullPath = GetRuleFileFullPath();

            var allLines = File.ReadAllLines(fullPath);

            foreach (var line in allLines)
            {
                if (IsCommentLine(line) || string.IsNullOrWhiteSpace(line))
                    continue;

                var rule = ParseRuleOrThrow(line);

                rules.Add(rule);
            }

            return rules;
        }

        private static string GetRuleFileFullPath()
        {
            return FilePathHelper.GetFullPathOfFileInExecutableFolder(RuleFileName);
        }

        private static bool IsCommentLine(string line)
        {
            return line.Trim().StartsWith("#");
        }

        private static Rule ParseRuleOrThrow(string line)
        {
            var parts = Regex.Split(line, "([><=]{1,2})", RegexOptions.CultureInvariant);

            if (parts.Length != 3)
            {
                throw new ArgumentException($"Invalid rule '{line}'");
            }

            return new Rule(parts[0].Trim(), parts[1].Trim(), parts[2].Trim());
        }
    }
}


text:
from collections import namedtuple
import hashlib
import io
import struct
import zlib

from . import sbon
from .btreedb5 import BTreeDB5
from .sbasset6 import SBAsset6

# Override range with xrange when running Python 2.x.
try:
    range = xrange
except:
    pass

class CelestialChunks(BTreeDB5):
    def get(self, key):
        key = hashlib.sha256(key.encode('utf-8')).digest()
        data = super(CelestialChunks, self).get(key)
        data = zlib.decompress(data)
        stream = io.BytesIO(data)
        return read_versioned_json(stream)

    def read_header(self):
        super(CelestialChunks, self).read_header()
        assert self.name == 'Celestial2', 'Invalid header'

Tile = namedtuple('Tile', [
    'foreground_material',
    'foreground_hue_shift',
    'foreground_variant',
    'foreground_mod',
    'foreground_mod_hue_shift',
    'background_material',
    'background_hue_shift',
    'background_variant',
    'background_mod',
    'background_mod_hue_shift',
    'liquid',
    'liquid_level',
    'liquid_pressure',
    'liquid_infinite',
    'collision',
    'dungeon_id',
    'biome',
    'biome_2',
    'indestructible',
])

VersionedJSON = namedtuple('VersionedJSON', ['name', 'version', 'data'])

class World(BTreeDB5):
    def get(self, layer, x, y):
        # World keys are based on a layer followed by X and Y coordinates.
        data = super(World, self).get(struct.pack('>BHH', layer, x, y))
        return zlib.decompress(data)

    def get_entities(self, x, y):
        stream = io.BytesIO(self.get(2, x, y))
        count = sbon.read_varint(stream)
        return [read_versioned_json(stream) for _ in range(count)]

    def get_tiles(self, x, y):
        stream = io.BytesIO(self.get(1, x, y))
        # TODO: Figure out what this means.
        unknown = stream.read(3)
        # There are 1024 (32x32) tiles in a region.
        return [self.read_tile(stream) for _ in range(1024)]

    def read_header(self):
        super(World, self).read_header()
        assert self.name == 'World4', 'Not a World4 file'

    def read_metadata(self):
        # World metadata is held at a special layer/x/y combination.
        stream = io.BytesIO(self.get(0, 0, 0))
        self.width, self.height = struct.unpack('>ii', stream.read(8))
        name, version, data = read_versioned_json(stream)
        assert name == 'WorldMetadata', 'Invalid world data'
        self.metadata = data
        self.metadata_version = version

    @classmethod
    def read_tile(cls, stream):
        values = struct.unpack('>hBBhBhBBhBBffBBHBB?', stream.read(30))
        return Tile(*values)

def read_sbvj01(stream):
    assert stream.read(6) == b'SBVJ01', 'Invalid header'
    return read_versioned_json(stream)

def read_versioned_json(stream):
    name = sbon.read_string(stream)
    # Not sure what this part is.
    assert stream.read(1) == b'\x01'
    version, = struct.unpack('>i', stream.read(4))
    data = sbon.read_dynamic(stream)
    return VersionedJSON(name, version, data)

def write_sbvj01(stream, vj):
    stream.write(b'SBVJ01')
    write_versioned_json(stream, vj)

def write_versioned_json(stream, vj):
    sbon.write_string(stream, vj.name)
    stream.write(struct.pack('>bi', 1, vj.version))
    sbon.write_dynamic(stream, vj.data)