text:
package io.reactivesw.order.cart.domain.service;

import io.reactivesw.common.exception.*;
import io.reactivesw.order.cart.domain.entity.CartEntity;
import io.reactivesw.order.cart.infrastructure.enums.CartState;
import io.reactivesw.order.cart.infrastructure.repository.CartRepository;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Objects;
import java.util.Optional;

/**
 * Created by umasuo on 16/11/29.
 */
@Service
public class CartService {

  /**
   * logger.
   */
  private static final Logger LOG = LoggerFactory.getLogger(CartService.class);

  /**
   * cart repository.
   */
  @Autowired
  private transient CartRepository cartRepository;

  /**
   * Create an new active cart with sample.
   * Either customer id or anonymous id must be set.
   * Each customer(include anonymous customer) can only have one active cart.
   * If the customer already has an cart, then throw exception.
   *
   * @param sample CartEntity
   * @return CartEntity
   */
  public CartEntity createActiveCartWithSample(CartEntity sample) {
    String customerId = sample.getCustomerId();
    String anonymousId = sample.getAnonymousId();

    if (StringUtils.isBlank(customerId) && StringUtils.isBlank(anonymousId)) {
      throw new ParametersException("Either customer id or anonymous id must be set.");
    }

    List<CartEntity> result = null;
    if (StringUtils.isNotBlank(customerId)) {
      result = this.cartRepository.findByCustomerIdAndCartState(anonymousId,
          CartState.Active);
    } else if (StringUtils.isNotBlank(anonymousId)) {
      result = this.cartRepository.findByCustomerIdAndCartState(anonymousId,
          CartState.Active);
    }

    if (result != null && !result.isEmpty()) {
      throw new AlreadyExistException("The customer already has an active cart. ");
    }

    //TODO recalculate the cart
    return this.cartRepository.save(sample);
  }

  /**
   * get cart by cart Id.
   *
   * @param cartId String
   * @return CartEntity
   */
  public CartEntity getById(String cartId) {
    LOG.debug("CartId:{}", cartId);
    CartEntity entity = this.cartRepository.findOne(cartId);

    if (entity == null) {
      throw new NotExistException("Cart not exist with id: " + cartId);
    }

    return entity;
  }

  /**
   * get cart by customer id and cart state.
   *
   * @param customerId String
   * @param state      CartState
   * @return CartEntity
   */
  public List<CartEntity> getCartByCustomerIdAndState(String customerId, CartState state) {
    return this.cartRepository.findByCustomerIdAndCartState(customerId, state);
  }

  /**
   * Get cart by customer id and cart state.
   * Each customer(include the anonymous customer) can only have one active cart.
   * If can not find one, then create it.
   *
   * @param customerId String
   * @return CartEntity
   */
  public CartEntity getActiveCartByCustomerId(String customerId) {
    LOG.debug("subjectId:{}", customerId);

    List<CartEntity> result = this.cartRepository.findByCustomerIdAndCartState(customerId,
        CartState.Active);
    Optional<CartEntity> op = result.parallelStream().findAny();

    CartEntity entity;
    if (op.isPresent()) {
      //each customer should have one
      entity = op.get();
    } else {
      entity = this.createActiveCartWithCustomerId(customerId);
    }

    return entity;
  }

  /**
   * Get cart by anonymous id and cart state.
   * Each customer(include the anonymous customer) can only have one active cart.
   * If can not find one, then create it.
   *
   * @param anonymousId String
   * @return CartEntity
   */
  public CartEntity getCartByAnonymousId(String anonymousId) {
    LOG.debug("anonymousId:{}", anonymousId);

    CartEntity result = this.cartRepository.findOneByAnonymousId(anonymousId);

    if (result == null) {
      result = this.createActiveCartWithAnonymousId(anonymousId);
    }

    return result;
  }

  /**
   * update cart for with action list.
   *
   * @param id         String of cart id
   * @param version    Integer
   * @param cartEntity CartEntity
   * @return CartEntity
   */
  @Transactional
  public CartEntity updateCart(String id, Integer version, CartEntity cartEntity) {
    CartEntity cart = this.getById(id);

    this.checkVersion(version, cart.getVersion());

    if (cart.getCartState() != CartState.Active) {
      LOG.debug("Only active Cart can be changed, id:{}", id);
      throw new ImmutableException("Only active Cart can be changed");
    }

    return this.cartRepository.save(cartEntity);
  }

  /**
   * setter of the cart repository.
   *
   * @param cartRepository CartRepository
   */
  protected void setCartRepository(CartRepository cartRepository) {
    this.cartRepository = cartRepository;
  }

  /**
   * Create an new cart with customer id.
   * This function should only be called by system, not by customer.
   *
   * @param customerId String
   * @return CartEntity
   */
  private CartEntity createActiveCartWithCustomerId(String customerId) {
    CartEntity entity = new CartEntity();
    entity.setCustomerId(customerId);
    entity.setCartState(CartState.Active);
    entity.setCurrencyCode("USD");
    CartEntity retEntity = cartRepository.save(entity);
    LOG.info("Create a new active cart with subjectId:{}, entity:{}", customerId, retEntity
        .toString());
    return retEntity;
  }

  /**
   * create an new cart with anonymous id.
   * This function should only be called by system, not by customer.
   *
   * @param anonymousId String
   * @return CartEntity
   */
  private CartEntity createActiveCartWithAnonymousId(String anonymousId) {
    LOG.debug("enter, anonymousId: {}", anonymousId);

    CartEntity entity = new CartEntity();
    entity.setAnonymousId(anonymousId);
    entity.setCartState(CartState.Active);
    entity.setCurrencyCode("USD");
    CartEntity retEntity = cartRepository.save(entity);

    LOG.debug("Create a new active cart with anonymousId:{}, entity:{}", anonymousId, retEntity
        .toString());
    return retEntity;
  }

  /**
   * delete cart.
   *
   * @param id      String
   * @param version Integer
   */
  @Transactional
  public void deleteCart(String id, Integer version) {
    LOG.debug("enter, id: {}, version: {}", id, version);
    CartEntity cart = this.getById(id);

    this.checkVersion(version, cart.getVersion());

    if (cart.getCartState() != CartState.Active) {
      LOG.debug("Only active Cart can be changed, id:{}", id);
      throw new ImmutableException("Only active Cart can be changed");
    }

    this.cartRepository.delete(id);
  }

  /**
   * check the version of the discount.
   *
   * @param inputVersion Integer
   * @param savedVersion Integer
   */
  private void checkVersion(Integer inputVersion, Integer savedVersion) {
    if (!Objects.equals(inputVersion, savedVersion)) {
      LOG.debug("Cart version is not correct. inputVersion:{}, savedVersion:{}",
          inputVersion, savedVersion);
      throw new ConflictException("Cart version is not correct.");
    }
  }
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=800px, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link rel="stylesheet" href="../../psblock.css">

    afc
    based on...

Simple Force Layout from JSON data #3

      <svg  width="960" height="500" class="svg"></svg>

Grabs the packages.json from purescript-packages and uses
        force layout to show dependency information contained in it.

        Open <svg height="16" width="12"><path d="M11 10h1v3c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V3c0-0.55 0.45-1 1-1h3v1H1v10h10V10zM6 2l2.25 2.25-3.25 3.25 1.5 1.5 3.25-3.25 2.25 2.25V2H6z"></path></svg>

Code:

The code for this is largely the same
      as the other force layout example but the gist below shows how the JSON
      file is grabbed from Github and automagically decoded to an intermediate
      format and then to the kind of data that D3 expects. The most significant
      thing happening there - and it's just a very small illustration of the
      possibilities - is the creation of "group ID" for each repo in the package
      set, derived from the account of the Github creator. These groups are then
      used to add some colour to the package circles, puresly by way of
      illustration.

Data:

    Copyleft 2016 etc etc

redpajama_set_name: RedPajamaGithub


text:
{{ define "content" }}

ユーザー登録

{{if .Flash}}

  {{.Flash}}

{{end}}

  <form method="post" action="/register">

      アカウント名
      <input type="text" name="account_name">

      パスワード
      <input type="password" name="password">

      <input type="submit" name="submit" value="submit">

  </form>

{{ end }}


text:
NS_ASSUME_NONNULL_BEGIN

@interface TestSwiftMixOCProtocolVO : NSObject

@end

NS_ASSUME_NONNULL_END


text:
@interface MKMapView (AttributionLogo)
- (void) relocateAttributionLogoIfNecessary;
@end


text:
<?php
/**
 * The template for displaying Archive pages.
 *
 * Used to display archive-type pages if nothing more specific matches a query.
 * For example, puts together date-based pages if no date.php file exists.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * Methods for TimberHelper can be found in the /functions sub-directory
 *
 * @package    WordPress
 * @subpackage    Timber
 * @since        Timber 0.2
 */
use Timber\Timber;

$templates = array('pages/archive.twig', 'pages/index.twig');

$data = Timber::get_context();

$data['title'] = 'Archive';
if (is_day()) {
    $data['title'] = 'Archive: ' . get_the_date('D M Y');
} else {
    if (is_month()) {
        $data['title'] = 'Archive: ' . get_the_date('M Y');
    } else {
        if (is_year()) {
            $data['title'] = 'Archive: ' . get_the_date('Y');
        } else {
            if (is_tag()) {
                $data['title'] = single_tag_title('', false);
            } else {
                if (is_category()) {
                    $data['title'] = single_cat_title('', false);
                    array_unshift($templates, 'archive-' . get_query_var('cat') . '.twig');
                } else {
                    if (is_post_type_archive()) {
                        $data['title'] = post_type_archive_title('', false);
                        array_unshift($templates, 'archive-' . get_post_type() . '.twig');
                    }
                }
            }
        }
    }
}

$data['posts'] = Timber::get_posts();

Timber::render($templates, $data);


text:
class Store:
  def __init__(self,name):
    self.name = name
    self.items = []

  def add_items(self, name, price):
    self.items.append({
      'name' : name,
      'price' : price
    })

  def stock_price(self):
    total = 0
    for item in self.items:
      total+=item['price']
    return total

  @classmethod
  def franchise(cls, store):
    # Return another store, with the same name as the argument name + " - franchise"
    return Store(store.name+" - Franchise")
    # = return cls(store.name.' - franchise')

  @staticmethod
  def store_detail(store):
    #return a string representing the argument
    #it should be in the format 'NAME, total stock price : TOTAL'
    return '{}, total stock price : {}'.format(store.name, int(store.stock_price() ))

store = Store("Test")
store2 = Store("Amazon")
store2.add_items("Keybord",160)
store.franchise(store)
store.franchise(store2)
store.store_detail(store)
store.store_detail(store2)


text: <!DOCTYPE html><meta charset="utf-8"><title>Redirecting...</title><link rel="canonical" href="/v2/guide/"><meta http-equiv="refresh" content="0; url=/v2/guide/">


text:
int main() {

    // Set wrong rounding mode to test modular arithmetic
    CGAL::Protect_FPU_rounding<true> pfr(CGAL_FE_UPWARD);

    CGAL::set_pretty_mode(std::cout);

#ifdef CGAL_USE_CORE
    {
        typedef CGAL::CORE_arithmetic_kernel AT;
        test_AT<AT>();
    }
#endif

    return 0;
}


text:
ZeroSuggestPrefetchTabHelper::ZeroSuggestPrefetchTabHelper(
    content::WebContents* web_contents)
    : content::WebContentsObserver(web_contents),
      content::WebContentsUserData<ZeroSuggestPrefetchTabHelper>(
          *web_contents) {}

ZeroSuggestPrefetchTabHelper::~ZeroSuggestPrefetchTabHelper() = default;

void ZeroSuggestPrefetchTabHelper::PrimaryPageChanged(content::Page& page) {
  // Make sure to observe the TabStripModel, if not already, in order to get
  // notified when a New Tab Page is switched to.
  // Note that this is done here, i.e., after the New Tab Page is navigated to,
  // as opposed to the tab helper constructor which would have allowed us to get
  // notified when a new tab is opened in the foreground in the same
  // TabStripModelObserver callback. We are however not interested to start
  // prefetching that early since the AutocompleteController machinery gets
  // started and stopped multiple times since a new tab is opened and until the
  // New Tab Page is navigated to; invalidating prefetch requests prematurely.
  auto* browser = chrome::FindBrowserWithWebContents(web_contents());
  if (browser && !TabStripModelObserver::IsObservingAny(this)) {
    browser->tab_strip_model()->AddObserver(this);
  }

  StartPrefetch();
}

void ZeroSuggestPrefetchTabHelper::OnTabStripModelChanged(
    TabStripModel* tab_strip_model,
    const TabStripModelChange& change,
    const TabStripSelectionChange& selection) {
  if (!selection.active_tab_changed() ||
      web_contents() != selection.new_contents) {
    return;
  }

  // We get here when a New Tab Page is brought to foreground (aka switched to).
  StartPrefetch();
}

void ZeroSuggestPrefetchTabHelper::StartPrefetch() {
  auto* omnibox_view = search::GetOmniboxView(web_contents());
  if (!omnibox_view) {
    return;
  }

  auto* omnibox_edit_model = omnibox_view->model();
  if (!omnibox_edit_model) {
    return;
  }

  omnibox_edit_model->StartPrefetch();
}

WEB_CONTENTS_USER_DATA_KEY_IMPL(ZeroSuggestPrefetchTabHelper);


text:
package naivebayes.probability;

import naivebayes.classification.Classification;
import naivebayes.vocabulary.Vocabulary;

public interface ProbabilityCalculator {

	double calculate(Vocabulary vocabulary, Classification classification);

}


text:
package org.metaborg.spoofax.core.outline;

import javax.annotation.Nullable;

import org.metaborg.spoofax.core.esv.ESVReader;
import org.spoofax.interpreter.terms.IStrategoAppl;
import org.spoofax.interpreter.terms.IStrategoTerm;
import org.spoofax.terms.util.TermUtils;

public class OutlineFacetFromESV {
    public static @Nullable OutlineFacet create(IStrategoAppl esv) {
        final IStrategoAppl outlineTerm = ESVReader.findTerm(esv, "OutlineView");
        if(outlineTerm == null) {
            return null;
        }
        final String strategyName = ESVReader.termContents(outlineTerm.getSubterm(0));

        final int expandTo;
        final IStrategoAppl expandToTerm = ESVReader.findTerm(esv, "ExpandToLevel");
        if(expandToTerm == null) {
            expandTo = 0;
        } else {
            final IStrategoTerm expandToNumberTerm = expandToTerm.getSubterm(0);
            if(TermUtils.isInt(expandToNumberTerm)) {
                expandTo = TermUtils.toJavaInt(expandToNumberTerm);
            } else if(TermUtils.isString(expandToNumberTerm)) {
                expandTo = Integer.parseInt(TermUtils.toJavaString(expandToNumberTerm));
            } else {
                expandTo = 0;
            }
        }

        return new OutlineFacet(strategyName, expandTo);
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>hum-beancake</artifactId>
        <groupId>com.humbinal.beancake</groupId>
        <version>1.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>hum-web</artifactId>
    <packaging>pom</packaging>

    <name>hum-web</name>
    <modules>
        <module>spring-mvc</module>
        <module>java-web</module>
        <module>hum-ssm</module>
        <module>hum-sbm</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>1.5.4.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>


text:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
             xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

  <persistence-unit name="jpacacheeviction">
    <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
    <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
    <properties>
      <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
      <property name="hibernate.cache.use_second_level_cache" value="true"/>
      <property name="hibernate.cache.use_query_cache" value="true"/>
    </properties>
  </persistence-unit>

</persistence>


text:
<!DOCTYPE html>
<html>
    <!--
        Morgan (Reece) Phillips @linuxpoetry mrrrgn.com @2014
    -->
    <body>
        <video id="my-video" autoplay></video>
        <script src="lib/pixelWatcher.js"></script>
        <script src="lib/webcam.js"></script>
        <script>
            // PixelWatcher must be initialized with a video or canvas object
            var videoObj = document.getElementById("my-video");
            new WebCam(videoObj);
            var pixelWatcher = undefined;

            videoObj.addEventListener("loadeddata", function() {
                // Creates our pixel watcher
                pixelWatcher = new PixelWatcher({videoObject: videoObj});

                // Sets up listening for motion events
                pixelWatcher.addEventListener("motion", function() {
                    var msg = document.createElement("span");
                    msg.innerText = "Motion Detected" + new Date() + ", ";
                    document.body.appendChild(msg);
                });

                // Start pixelWatcher running
                pixelWatcher.start();
            });
        </script>
    </body>
</html>


text: .. cmake-module:: ../../Modules/FindArmadillo.cmake


text:
package com.clxcommunications.xms.api;

import java.util.Set;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import org.immutables.value.Value;
import org.threeten.bp.OffsetDateTime;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

/**
 * Objects of this class contain information about a group. The information
 * includes creation time stamp and group identifier and it must therefore be
 * populated by XMS, which is the source of such information.
 */
@Value.Immutable
@ValueStylePackage
@JsonDeserialize(builder = GroupResult.Builder.class)
@JsonInclude(Include.NON_EMPTY)
public abstract class GroupResult {

	/**
	 * A builder of group results.
	 */
	public static final class Builder extends GroupResultImpl.Builder {

		Builder() {
		}

	}

	/**
	 * Creates a builder of {@link GroupResult} instances.
	 *
	 * @return a builder
	 */
	@Nonnull
	public static final GroupResult.Builder builder() {
		return new Builder();
	}

	/**
	 * The unique group ID that identifies this group.
	 *
	 * @return a non-null group ID
	 */
	public abstract GroupId id();

	/**
	 * The group name.
	 *
	 * @return a non-null group name
	 */
	@Nullable
	public abstract String name();

	/**
	 * The number of members in the group.
	 *
	 * @return a non-negative group size
	 */
	public abstract int size();

	/**
	 * This group's child groups.
	 *
	 * @return a non-null list of child groups
	 */
	@JsonProperty("child_groups")
	public abstract Set<GroupId> childGroups();

	/**
	 * Describes how this group is auto updated through user interaction. Is
	 * null if the group is not auto updated.
	 *
	 * @return an auto update description
	 */
	@JsonProperty("auto_update")
	@Nullable
	public abstract AutoUpdate autoUpdate();

	/**
	 * The time at which this group was created
	 *
	 * @return a date time
	 */
	@JsonProperty("created_at")
	public abstract OffsetDateTime createdAt();

	/**
	 * The time at which this group was last modified.
	 *
	 * @return a date time
	 */
	@JsonProperty("modified_at")
	public abstract OffsetDateTime modifiedAt();

}


text:
/** @constructor */
ScalaJS.c.scala_concurrent_duration_Deadline$ = (function() {
  ScalaJS.c.java_lang_Object.call(this)
});
ScalaJS.c.scala_concurrent_duration_Deadline$.prototype = new ScalaJS.inheritable.java_lang_Object();
ScalaJS.c.scala_concurrent_duration_Deadline$.prototype.constructor = ScalaJS.c.scala_concurrent_duration_Deadline$;
ScalaJS.c.scala_concurrent_duration_Deadline$.prototype.now__Lscala_concurrent_duration_Deadline = (function() {
  return new ScalaJS.c.scala_concurrent_duration_Deadline().init___Lscala_concurrent_duration_FiniteDuration(ScalaJS.modules.scala_concurrent_duration_Duration().apply__J__Ljava_util_concurrent_TimeUnit__Lscala_concurrent_duration_FiniteDuration(ScalaJS.modules.java_lang_System().nanoTime__J(), ScalaJS.modules.java_util_concurrent_TimeUnit().NANOSECONDS__Ljava_util_concurrent_TimeUnit()))
});
ScalaJS.c.scala_concurrent_duration_Deadline$.prototype.apply__Lscala_concurrent_duration_FiniteDuration__Lscala_concurrent_duration_Deadline = (function(time) {
  return new ScalaJS.c.scala_concurrent_duration_Deadline().init___Lscala_concurrent_duration_FiniteDuration(time)
});
ScalaJS.c.scala_concurrent_duration_Deadline$.prototype.unapply__Lscala_concurrent_duration_Deadline__Lscala_Option = (function(x$0) {
  if (ScalaJS.anyRefEqEq(x$0, null)) {
    return ScalaJS.modules.scala_None()
  } else {
    return new ScalaJS.c.scala_Some().init___O(x$0.time__Lscala_concurrent_duration_FiniteDuration())
  }
});
ScalaJS.c.scala_concurrent_duration_Deadline$.prototype.readResolve__p1__O = (function() {
  return ScalaJS.modules.scala_concurrent_duration_Deadline()
});
ScalaJS.c.scala_concurrent_duration_Deadline$.prototype.unapply__Lscala_concurrent_duration_Deadline__ = (function(x$0) {
  return this.unapply__Lscala_concurrent_duration_Deadline__Lscala_Option(x$0)
});
ScalaJS.c.scala_concurrent_duration_Deadline$.prototype.apply__Lscala_concurrent_duration_FiniteDuration__ = (function(time) {
  return this.apply__Lscala_concurrent_duration_FiniteDuration__Lscala_concurrent_duration_Deadline(time)
});
ScalaJS.c.scala_concurrent_duration_Deadline$.prototype.now__ = (function() {
  return this.now__Lscala_concurrent_duration_Deadline()
});
/** @constructor */
ScalaJS.inheritable.scala_concurrent_duration_Deadline$ = (function() {
  /*<skip>*/
});
ScalaJS.inheritable.scala_concurrent_duration_Deadline$.prototype = ScalaJS.c.scala_concurrent_duration_Deadline$.prototype;
ScalaJS.is.scala_concurrent_duration_Deadline$ = (function(obj) {
  return (!(!((obj && obj.$classData) && obj.$classData.ancestors.scala_concurrent_duration_Deadline$)))
});
ScalaJS.as.scala_concurrent_duration_Deadline$ = (function(obj) {
  if ((ScalaJS.is.scala_concurrent_duration_Deadline$(obj) || (obj === null))) {
    return obj
  } else {
    ScalaJS.throwClassCastException(obj, "scala.concurrent.duration.Deadline")
  }
});
ScalaJS.isArrayOf.scala_concurrent_duration_Deadline$ = (function(obj, depth) {
  return (!(!(((obj && obj.$classData) && (obj.$classData.arrayDepth === depth)) && obj.$classData.arrayBase.ancestors.scala_concurrent_duration_Deadline$)))
});
ScalaJS.asArrayOf.scala_concurrent_duration_Deadline$ = (function(obj, depth) {
  if ((ScalaJS.isArrayOf.scala_concurrent_duration_Deadline$(obj, depth) || (obj === null))) {
    return obj
  } else {
    ScalaJS.throwArrayCastException(obj, "Lscala.concurrent.duration.Deadline;", depth)
  }
});
ScalaJS.data.scala_concurrent_duration_Deadline$ = new ScalaJS.ClassTypeData({
  scala_concurrent_duration_Deadline$: 0
}, false, "scala.concurrent.duration.Deadline$", ScalaJS.data.java_lang_Object, {
  scala_concurrent_duration_Deadline$: 1,
  scala_Serializable: 1,
  java_io_Serializable: 1,
  java_lang_Object: 1
});
ScalaJS.c.scala_concurrent_duration_Deadline$.prototype.$classData = ScalaJS.data.scala_concurrent_duration_Deadline$;
ScalaJS.moduleInstances.scala_concurrent_duration_Deadline = undefined;
ScalaJS.modules.scala_concurrent_duration_Deadline = (function() {
  if ((!ScalaJS.moduleInstances.scala_concurrent_duration_Deadline)) {
    ScalaJS.moduleInstances.scala_concurrent_duration_Deadline = new ScalaJS.c.scala_concurrent_duration_Deadline$().init___()
  };
  return ScalaJS.moduleInstances.scala_concurrent_duration_Deadline
});
//@ sourceMappingURL=Deadline$.js.map


text:
package org.apache.reef.bridge.client;

import org.apache.avro.io.DecoderFactory;
import org.apache.avro.io.JsonDecoder;
import org.apache.avro.specific.SpecificDatumReader;
import org.apache.reef.reef.bridge.client.avro.AvroAzureBatchJobSubmissionParameters;
import org.apache.reef.runtime.common.client.DriverConfigurationProvider;
import org.apache.reef.runtime.common.driver.parameters.ClientRemoteIdentifier;
import org.apache.reef.tang.Configuration;

import javax.inject.Inject;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * This is the Java Driver configuration generator for .NET Drivers that generates
 * the Driver configuration at runtime. Called by {@link AzureBatchBootstrapREEFLauncher}.
 */
final class AzureBatchBootstrapDriverConfigGenerator {

  private static final Logger LOG = Logger.getLogger(AzureBatchBootstrapDriverConfigGenerator.class.getName());

  private final DriverConfigurationProvider driverConfigurationProvider;

  @Inject
  private AzureBatchBootstrapDriverConfigGenerator(final DriverConfigurationProvider driverConfigurationProvider) {
    this.driverConfigurationProvider = driverConfigurationProvider;
  }

  Configuration getDriverConfigurationFromParams(final String bootstrapJobArgsLocation) throws IOException {

    final File bootstrapJobArgsFile = new File(bootstrapJobArgsLocation).getCanonicalFile();

    final AvroAzureBatchJobSubmissionParameters azureBatchBootstrapJobArgs =
        readAzureBatchJobSubmissionParametersFromFile(bootstrapJobArgsFile);

    final String jobId = azureBatchBootstrapJobArgs.getSharedJobSubmissionParameters().getJobId().toString();
    final File jobFolder = new File(azureBatchBootstrapJobArgs
        .getSharedJobSubmissionParameters().getJobSubmissionFolder().toString());

    LOG.log(Level.INFO, "jobFolder {0} jobId {1}.", new Object[]{jobFolder.toURI(), jobId});

    return this.driverConfigurationProvider.getDriverConfiguration(
        jobFolder.toURI(), ClientRemoteIdentifier.NONE, jobId,
        Constants.DRIVER_CONFIGURATION_WITH_HTTP_AND_NAMESERVER);
  }

  private AvroAzureBatchJobSubmissionParameters readAzureBatchJobSubmissionParametersFromFile(final File file)
      throws IOException {
    try (final FileInputStream fileInputStream = new FileInputStream(file)) {
      return readAzureBatchSubmissionParametersFromInputStream(fileInputStream);
    }
  }

  private static AvroAzureBatchJobSubmissionParameters readAzureBatchSubmissionParametersFromInputStream(
      final InputStream inputStream) throws IOException {
    final JsonDecoder decoder = DecoderFactory.get().jsonDecoder(
        AvroAzureBatchJobSubmissionParameters.getClassSchema(), inputStream);
    final SpecificDatumReader<AvroAzureBatchJobSubmissionParameters> reader = new SpecificDatumReader<>(
        AvroAzureBatchJobSubmissionParameters.class);
    return reader.read(null, decoder);
  }
}


text:
<?php session_start();
if (isset($_GET['dec'])){
    session_destroy();
    header("location: /connexion");
}
?>
<!doctype html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title><?php echo $Controller->getPageTitle() ?></title>
    <meta name="description" contain="<?php echo $Controller->getPageDesc(); ?>">
    <link rel="stylesheet" href="../Asset/css/bootstrap.min.css">
    <link rel="stylesheet" href="../Asset/css/business-casual.css">
</head>
<body>
<div class="container-fluid">


text:
std::vector<wstr> list_distros();
wstr get_default_distro();
void set_default_distro(crwstr name);
void register_distro(crwstr name, crwstr path, uint32_t version);
void unregister_distro(crwstr name);
wstr get_distro_dir(crwstr name);
void set_distro_dir(crwstr name, crwstr value);
uint32_t get_distro_version(crwstr name);

enum config_item_flags {
	config_env = 1,
	config_uid = 2,
	config_kernel_cmd = 4,
	config_flags = 8,
	config_all = 15
};

class reg_config {
	static const uint32_t flags_mask = 7, flag_wsl2 = 8;
	uint32_t flags;
public:
	std::vector<wstr> env;
	wstr kernel_cmd;
	uint32_t uid;

	explicit reg_config(bool is_wsl2 = false);
	void load_file(crwstr path);
	void save_file(crwstr path) const;
	void load_distro(crwstr name, config_item_flags desired);
	void configure_distro(crwstr name, config_item_flags desired) const;
	[[nodiscard]] uint32_t get_flags() const;
	void set_flags(uint32_t value);
	[[nodiscard]] bool is_wsl2() const;
};


text:
<?php
    /**
     * File: Upgrader
     * A task-based general-purpose Chyrp upgrader.
     *
     * Performs upgrade functions based on individual tasks, and checks whether or not they need to be done.
     *
     * Version-agnostic. Completely safe to be run at all times, by anyone.
     */

    header("Content-type: text/html; charset=UTF-8");

    define('DEBUG',        true);
    define('CACHE_TWIG',   false);
    define('JAVASCRIPT',   false);
    define('ADMIN',        false);
    define('AJAX',         false);
    define('XML_RPC',      false);
    define('TRACKBACK',    false);
    define('UPGRADING',    true);
    define('INSTALLING',   false);
    define('TESTER',       true);
    define('INDEX',        false);
    define('MAIN_DIR',     dirname(__FILE__));
    define('INCLUDES_DIR', dirname(__FILE__)."/includes");
    define('MODULES_DIR', MAIN_DIR."/modules");
    define('FEATHERS_DIR', MAIN_DIR."/feathers");
    define('THEMES_DIR', MAIN_DIR."/themes");

    if (!AJAX and
        extension_loaded("zlib") and
        !ini_get("zlib.output_compression") and
        isset($_SERVER['HTTP_ACCEPT_ENCODING']) and
        substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], "gzip") and
        USE_ZLIB) {
        ob_start("ob_gzhandler");
        header("Content-Encoding: gzip");
    } else
        ob_start();

    /**
     * Function: config_file
     * Returns what config file their install is set up for.
     */
    function config_file() {
        if (file_exists(INCLUDES_DIR."/config.yaml.php"))
            return INCLUDES_DIR."/config.yaml.php";

        if (file_exists(INCLUDES_DIR."/config.yml.php"))
            return INCLUDES_DIR."/config.yml.php";

        if (file_exists(INCLUDES_DIR."/config.php"))
            return INCLUDES_DIR."/config.php";

        exit("Config file not found.");
    }

    /**
     * Function: database_file
     * Returns what database config file their install is set up for.
     */
    function database_file() {
        if (file_exists(INCLUDES_DIR."/database.yaml.php"))
            return INCLUDES_DIR."/database.yaml.php";

        if (file_exists(INCLUDES_DIR."/database.yml.php"))
            return INCLUDES_DIR."/database.yml.php";

        if (file_exists(INCLUDES_DIR."/database.php"))
            return INCLUDES_DIR."/database.php";

        return false;
    }

    /**
     * Function: using_yaml
     * Are they using YAML config storage?
     */
    function using_yaml() {
        return (basename(config_file()) != "config.php" and basename(database_file()) != "database.php") or !database_file();
    }

    # Evaluate the code in their config files, but with the classes renamed, so we can safely retrieve the values.
    if (!using_yaml()) {
        eval(str_replace(array("<?php", "?>", "Config"),
                         array("", "", "OldConfig"),
                         file_get_contents(config_file())));

        if (database_file())
            eval(str_replace(array("<?php", "?>", "SQL"),
                             array("", "", "OldSQL"),
                             file_get_contents(database_file())));
    }

    # File: Helpers
    # Various functions used throughout Chyrp's code.
    require_once INCLUDES_DIR."/helpers.php";

    # File: Gettext
    # Gettext library.
    require_once INCLUDES_DIR."/lib/gettext/gettext.php";

    # File: Streams
    # Streams library.
    require_once INCLUDES_DIR."/lib/gettext/streams.php";

    # File: YAML
    # Horde YAML parsing library.
    require_once INCLUDES_DIR."/lib/YAML.php";

    # File: SQL
    # See Also:
    #     <SQL>
    require INCLUDES_DIR."/class/SQL.php";

    /**
     * Class: Config
     * Handles writing to whichever config file they're using.
     */
    class Config {
        # Array: $yaml
        # Stores all of the YAML data.
        static $yaml = array("config" => array(),
                             "database" => array());

        /**
         * Function: get
         * Returns a config setting.
         *
         * Parameters:
         *     $setting - The setting to return.
         */
        static function get($setting) {
            return (isset(Config::$yaml["config"][$setting])) ? Config::$yaml["config"][$setting] : false ;
        }

        /**
         * Function: set
         * Sets a config setting.
         *
         * Parameters:
         *     $setting - The config setting to set.
         *     $value - The value for the setting.
         *     $message - The message to display with test().
         */
        static function set($setting, $value, $message = null) {
            if (self::get($setting) == $value) return;

            if (!isset($message))
                $message = _f("Setting %s to %s...", array($setting, normalize(print_r($value, true))));

            Config::$yaml["config"][$setting] = $value;

            $protection = "<?php header(\"Status: 403\"); exit(\"Access denied.\"); ?>\n";

            $dump = $protection.YAML::dump(Config::$yaml["config"]);

            echo $message.test(@file_put_contents(INCLUDES_DIR."/config.yaml.php", $dump));
        }

        /**
         * Function: check
         * Goes a config exist?
         *
         * Parameters:
         *     $setting - Name of the config to check.
         */
        static function check($setting) {
            return (isset(Config::$yaml["config"][$setting]));
        }

        /**
         * Function: fallback
         * Sets a config setting to $value if it does not exist.
         *
         * Parameters:
         *     $setting - The config setting to set.
         *     $value - The value for the setting.
         *     $message - The message to display with test().
         */
        static function fallback($setting, $value, $message = null) {
            if (!isset($message))
                $message = _f("Adding %s setting...", array($setting));

            if (!self::check($setting))
                echo self::set($setting, $value, $message);
        }

        /**
         * Function: remove
         * Removes a setting if it exists.
         *
         * Parameters:
         *     $setting - The setting to remove.
         */
        static function remove($setting) {
            if (!self::check($setting)) return;

            unset(Config::$yaml["config"][$setting]);

            $protection = "<?php header(\"Status: 403\"); exit(\"Access denied.\"); ?>\n";

            $dump = $protection.YAML::dump(Config::$yaml["config"]);

            echo _f("Removing %s setting...", array($setting)).
                 test(@file_put_contents(INCLUDES_DIR."/config.yaml.php", $dump));
        }
    }

    if (using_yaml()) {
        Config::$yaml["config"] = YAML::load(preg_replace("/<\?php(.+)\?>\n?/s", "", file_get_contents(config_file())));

        if (database_file())
            Config::$yaml["database"] = YAML::load(preg_replace("/<\?php(.+)\?>\n?/s",
                                                                        "",
                                                                        file_get_contents(database_file())));
        else
            Config::$yaml["database"] = oneof(@Config::$yaml["config"]["sql"], array());
    } else {
        # $config and $sql here are loaded from the eval()'s above.

        foreach ($config as $name => $val)
            Config::$yaml["config"][$name] = $val;

        foreach ($sql as $name => $val)
            Config::$yaml["database"][$name] = $val;
    }

    load_translator("chyrp", INCLUDES_DIR."/locale/".Config::get("locale").".mo");

    /**
     * Function: test
     * Attempts to perform a task, and displays a "success" or "failed" message determined by the outcome.
     *
     * Parameters:
     *     $try - The task to attempt. Should return something that evaluates to true or false.
     *     $message - Message to display for the test.
     */
    function test($try, $message = "") {
        $sql = SQL::current();

        if (!empty($sql->error)) {
            $message.= "\n".$sql->error."\n\n";
            $sql->error = "";
        }

        $info = $message;

        if ($try)
            return " ".__("success!")."\n";
        else
            return " ".__("failed!")."\n".$info;
    }

    #---------------------------------------------
    # Upgrading Actions
    #---------------------------------------------

    /**
     * Function: fix_htaccess
     * Repairs their .htaccess file.
     */
    function fix_htaccess() {
        $url = "http://".$_SERVER['HTTP_HOST'].str_replace("/upgrade.php", "", $_SERVER['REQUEST_URI']);
        $index = (parse_url($url, PHP_URL_PATH)) ? "/".trim(parse_url($url, PHP_URL_PATH), "/")."/" : "/" ;

        $path = preg_quote($index, "/");
        $htaccess_has_chyrp = (file_exists(MAIN_DIR."/.htaccess") and preg_match("/<IfModule mod_rewrite\.c>\n([\s]*)RewriteEngine On\n([\s]*)RewriteBase {$path}\n([\s]*)RewriteCond %\{REQUEST_FILENAME\} !-f\n([\s]*)RewriteCond %\{REQUEST_FILENAME\} !-d\n([\s]*)RewriteRule (\^\.\+\\$|\!\\.\(gif\|jpg\|png\|css\)) index\.php \[L\]\n([\s]*)RewriteRule \^\.\+\\\.twig\\$ index\.php \[L\]\n([\s]*)<\/IfModule>/", file_get_contents(MAIN_DIR."/.htaccess")));
        if ($htaccess_has_chyrp)
            return;

        $htaccess = "<IfModule mod_rewrite.c>\nRewriteEngine On\nRewriteBase {$index}\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^.+\$ index.php [L]\nRewriteRule ^.+\\.twig\$ index.php [L]\n</IfModule>";

        if (!file_exists(MAIN_DIR."/.htaccess"))
            echo __("Generating .htaccess file...").
                 test(@file_put_contents(MAIN_DIR."/.htaccess", $htaccess), __("Try creating the file and/or CHMODding it to 777 temporarily."));
        else
            echo __("Appending to .htaccess file...").
                 test(@file_put_contents(MAIN_DIR."/.htaccess", "\n\n".$htaccess, FILE_APPEND), __("Try creating the file and/or CHMODding it to 777 temporarily."));
    }

    /**
     * Function: tweets_to_posts
     * Enacts the "tweet" to "post" rename.
     *
     * Versions: 1.0.2 => 1.0.3
     */
    function tweets_to_posts() {
        if (SQL::current()->query("SELECT * FROM __tweets"))
            echo __("Renaming tweets table to posts...").
                 test(SQL::current()->query("RENAME TABLE __tweets TO __posts"));

        if (SQL::current()->query("SELECT add_tweet FROM __groups"))
            echo __("Renaming add_tweet permission to add_post...").
                 test(SQL::current()->query("ALTER TABLE __groups CHANGE add_tweet add_post TINYINT(1) NOT NULL DEFAULT '0'"));

        if (SQL::current()->query("SELECT edit_tweet FROM __groups"))
            echo __("Renaming edit_tweet permission to edit_post...").
                 test(SQL::current()->query("ALTER TABLE __groups CHANGE edit_tweet edit_post TINYINT(1) NOT NULL DEFAULT '0'"));

        if (SQL::current()->query("SELECT delete_tweet FROM __groups"))
            echo __("Renaming delete_tweet permission to delete_post...").
                 test(SQL::current()->query("ALTER TABLE __groups CHANGE delete_tweet delete_post TINYINT(1) NOT NULL DEFAULT '0'"));

        if (Config::check("tweets_per_page")) {
            Config::fallback("posts_per_page", Config::get("tweets_per_page"));
            Config::remove("tweets_per_page");
        }

        if (Config::check("tweet_url")) {
            Config::fallback("post_url", Config::get("tweet_url"));
            Config::remove("tweet_url");
        }

        if (Config::check("rss_tweets")) {
            Config::fallback("rss_posts", Config::get("rss_posts"));
            Config::remove("rss_tweets");
        }
    }

    /**
     * Function: pages_parent_id_column
     * Adds the @parent_id@ column to the "pages" table.
     *
     * Versions: 1.0.3 => 1.0.4
     */
    function pages_parent_id_column() {
        if (SQL::current()->query("SELECT parent_id FROM __pages"))
            return;

        echo __("Adding parent_id column to pages table...").
             test(SQL::current()->query("ALTER TABLE __pages ADD parent_id INT(11) NOT NULL DEFAULT '0' AFTER user_id"));
    }

    /**
     * Function: pages_list_order_column
     * Adds the @list_order@ column to the "pages" table.
     *
     * Versions: 1.0.4 => 1.1.0
     */
    function pages_list_order_column() {
        if (SQL::current()->query("SELECT list_order FROM __pages"))
            return;

        echo __("Adding list_order column to pages table...").
             test(SQL::current()->query("ALTER TABLE __pages ADD list_order INT(11) NOT NULL DEFAULT '0' AFTER show_in_list"));
    }

    /**
     * Function: remove_beginning_slash_from_post_url
     * Removes the slash at the beginning of the post URL setting.
     */
    function remove_beginning_slash_from_post_url() {
        if (substr(Config::get("post_url"), 0, 1) == "/")
            Config::set("post_url", ltrim(Config::get("post_url"), "/"));
    }

    /**
     * Function: move_yml_yaml
     * Renames config.yml.php to config.yaml.php.
     *
     * Versions: 1.1.2 => 1.1.3
     */
    function move_yml_yaml() {
        if (file_exists(INCLUDES_DIR."/config.yml.php"))
            echo __("Moving /includes/config.yml.php to /includes/config.yaml.php...").
                 test(@rename(INCLUDES_DIR."/config.yml.php", INCLUDES_DIR."/config.yaml.php"), __("Try CHMODding the file to 777."));
    }

    /**
     * Function: update_protection
     * Updates the PHP protection code in the config file.
     */
    function update_protection() {
        if (!file_exists(INCLUDES_DIR."/config.yaml.php") or
            substr_count(file_get_contents(INCLUDES_DIR."/config.yaml.php"),
                         "<?php header(\"Status: 403\"); exit(\"Access denied.\"); ?>"))
            return;

        $contents = file_get_contents(INCLUDES_DIR."/config.yaml.php");
        $new_error = preg_replace("/<\?php (.+) \?>/",
                             "<?php header(\"Status: 403\"); exit(\"Access denied.\"); ?>",
                             $contents);

        echo __("Updating protection code in config.yaml.php...").
             test(@file_put_contents(INCLUDES_DIR."/config.yaml.php", $new_error), __("Try CHMODding the file to 777."));
    }

    /**
     * Function: theme_default_to_stardust
     * Changes their theme from "default" to "stardust", or leaves it alone if they're not using "default".
     *
     * Versions: 1.1.3.2 => 2.0
     */
    function theme_default_to_stardust() {
        if (Config::get("theme") != "default") return;
        Config::set("theme", "stardust");
    }

    /**
     * Function: default_db_adapter_to_mysql
     * Adds an "adapter" SQL setting if it doesn't exist, and sets it to "mysql".
     *
     * Versions: 1.1.3.2 => 2.0
     */
    function default_db_adapter_to_mysql() {
        $sql = SQL::current();
        if (isset($sql->adapter)) return;
        $sql->set("adapter", "mysql");
    }

    /**
     * Function: move_upload
     * Renames the "upload" directory to "uploads".
     */
    function move_upload() {
        if (file_exists(MAIN_DIR."/upload") and !file_exists(MAIN_DIR."/uploads"))
            echo __("Renaming /upload directory to /uploads...").test(@rename(MAIN_DIR."/upload", MAIN_DIR."/uploads"), __("Try CHMODding the directory to 777."));
    }

    /**
     * Function: make_posts_xml
     * Updates all of the post XML data to well-formed non-CDATAized XML.
     *
     * Versions: 1.1.3.2 => 2.0
     */
    function make_posts_safe() {
        if (!$posts = SQL::current()->query("SELECT * FROM __posts"))
            return;

        if (!SQL::current()->query("SELECT xml FROM __posts"))
            return;

        function clean_xml(&$input) {
            $input = trim($input);
        }

        while ($post = $posts->fetchObject()) {
            if (!substr_count($post->xml, "<![CDATA["))
                continue;

            $post->xml = str_replace("<![CDATA[]]>", "", $post->xml);

            $xml = simplexml_load_string($post->xml, "SimpleXMLElement", LIBXML_NOCDATA);

            $parse = xml2arr($xml);

            array_walk_recursive($parse, "clean_xml");

            $new_xml = new SimpleXMLElement("<post></post>");
            arr2xml($new_xml, $parse);

            echo _f("Sanitizing XML data of post #%d...", array($post->id)).
                 test(SQL::current()->update("posts",
                                             array("id" => $post->id),
                                             array("xml" => $new_xml->asXML())));
        }
    }

    /**
     * Function: rss_posts_to_feed_items
     * Rename the feed items setting.
     *
     * Versions: 1.1.3.2 => 2.0
     */
    function rss_posts_to_feed_items() {
        if (!Config::check("rss_posts"))
            return;

        Config::fallback("feed_items", Config::get("rss_posts"));
        Config::remove("rss_posts");
    }

    /**
     * Function: update_groups_to_yaml
     * Updates the groups to use YAML-based permissions instead of table columns.
     *
     * Versions: 1.1.3.2 => 2.0
     */
    function update_groups_to_yaml() {
        if (!SQL::current()->query("SELECT view_site FROM __groups")) return;

        $get_groups = SQL::current()->query("SELECT * FROM __groups");
        echo __("Backing up current groups table...").test($get_groups);
        if (!$get_groups) return;

        $groups = array();
        # Generate an array of groups, name => permissions.
        while ($group = $get_groups->fetchObject()) {
            $groups[$group->name] = array("permissions" => array());
            foreach ($group as $key => $val)
                if ($key != "name" and $key != "id" and $val)
                    $groups[$group->name]["permissions"][] = $key;
                elseif ($key == "id")
                    $groups[$group->name]["id"] = $val;
        }

        # Convert permissions array to a YAML dump.
        foreach ($groups as $key => &$val)
            $val["permissions"] = YAML::dump($val["permissions"]);

        $drop_groups = SQL::current()->query("DROP TABLE __groups");
        echo __("Dropping old groups table...").test($drop_groups);
        if (!$drop_groups) return;

        $groups_table = SQL::current()->query("CREATE TABLE __groups (
                                                   id INTEGER PRIMARY KEY AUTO_INCREMENT,
                                                   name VARCHAR(100) DEFAULT '',
                                                   permissions LONGTEXT,
                                                   UNIQUE (name)
                                               ) DEFAULT CHARSET=utf8");
        echo __("Creating new groups table...").test($groups_table);
        if (!$groups_table) return;

        foreach($groups as $name => $values)
            echo _f("Restoring group \"%s\"...", array($name)).
                 test(SQL::current()->insert("groups",
                                             array("id" => $values["id"],
                                                   "name" => $name,
                                                   "permissions" => $values["permissions"])));
    }

    /**
     * Function: add_permissions_table
     * Creates the "permissions" table and fills it in with the default set.
     *
     * Versions: 1.1.3.2 => 2.0
     */
    function add_permissions_table() {
        if (SQL::current()->query("SELECT * FROM __permissions")) return;

        $permissions_table = SQL::current()->query("CREATE TABLE __permissions (
                                                        id VARCHAR(100) DEFAULT '' PRIMARY KEY,
                                                        name VARCHAR(100) DEFAULT ''
                                                    ) DEFAULT CHARSET=utf8");
        echo __("Creating new permissions table...").test($permissions_table);
        if (!$permissions_table) return;

        $permissions = array("change_settings" => "Change Settings",
                             "toggle_extensions" => "Toggle Extensions",
                             "view_site" => "View Site",
                             "view_private" => "View Private Posts",
                             "view_draft" => "View Drafts",
                             "view_own_draft" => "View Own Drafts",
                             "add_post" => "Add Posts",
                             "add_draft" => "Add Drafts",
                             "edit_post" => "Edit Posts",
                             "edit_draft" => "Edit Drafts",
                             "edit_own_post" => "Edit Own Posts",
                             "edit_own_draft" => "Edit Own Drafts",
                             "delete_post" => "Delete Posts",
                             "delete_draft" => "Delete Drafts",
                             "delete_own_post" => "Delete Own Posts",
                             "delete_own_draft" => "Delete Own Drafts",
                             "add_page" => "Add Pages",
                             "edit_page" => "Edit Pages",
                             "delete_page" => "Delete Pages",
                             "add_user" => "Add Users",
                             "edit_user" => "Edit Users",
                             "delete_user" => "Delete Users",
                             "add_group" => "Add Groups",
                             "edit_group" => "Edit Groups",
                             "delete_group" => "Delete Groups");

        foreach ($permissions as $id => $name)
            echo _f("Inserting permission \"%s\"...", array($name)).
                 test(SQL::current()->insert("permissions",
                                             array("id" => $id,
                                                   "name" => $name)));
    }

    /**
     * Function: add_sessions_table
     * Creates the "sessions" table.
     *
     * Versions: 1.1.3.2 => 2.0
     */
    function add_sessions_table() {
        if (SQL::current()->query("SELECT * FROM __sessions")) return;

        echo __("Creating `sessions` table...").
             test(SQL::current()->query("CREATE TABLE __sessions (
                                             id VARCHAR(40) DEFAULT '',
                                             data LONGTEXT,
                                             user_id INTEGER DEFAULT '0',
                                             created_at DATETIME DEFAULT NULL,
                                             updated_at DATETIME DEFAULT NULL,
                                             PRIMARY KEY (id)
                                         ) DEFAULT CHARSET=utf8") or die(mysql_error()));
    }

    /**
     * Function: update_permissions_table
     * Updates the "permissions" table from ## (id) => foo_bar (name) to foo_bar (id) => Foo Bar (name).
     *
     * Versions: 2.0b => 2.0
     */
    function update_permissions_table() {
        # If there are any non-numeric IDs in the permissions database, assume this is already done.
        $check = SQL::current()->query("SELECT * FROM __permissions");
        while ($row = $check->fetchObject())
            if (!is_numeric($row->id))
                return;

        $permissions_backup = array();
        $get_permissions = SQL::current()->query("SELECT * FROM __permissions");
        echo __("Backing up current permissions table...").test($get_permissions);
        if (!$get_permissions) return;

        while ($permission = $get_permissions->fetchObject())
            $permissions_backup[] = $permission->name;

        $drop_permissions = SQL::current()->query("DROP TABLE __permissions");
        echo __("Dropping old permissions table...").test($drop_permissions);
        if (!$drop_permissions) return;

        echo __("Creating new permissions table...").
             test(SQL::current()->query("CREATE TABLE IF NOT EXISTS __permissions (
                                             id VARCHAR(100) DEFAULT '' PRIMARY KEY,
                                             name VARCHAR(100) DEFAULT ''
                                         ) DEFAULT CHARSET=utf8"));

        $permissions = array("change_settings" => "Change Settings",
                             "toggle_extensions" => "Toggle Extensions",
                             "view_site" => "View Site",
                             "view_private" => "View Private Posts",
                             "view_draft" => "View Drafts",
                             "view_own_draft" => "View Own Drafts",
                             "add_post" => "Add Posts",
                             "add_draft" => "Add Drafts",
                             "edit_post" => "Edit Posts",
                             "edit_draft" => "Edit Drafts",
                             "edit_own_post" => "Edit Own Posts",
                             "edit_own_draft" => "Edit Own Drafts",
                             "delete_post" => "Delete Posts",
                             "delete_draft" => "Delete Drafts",
                             "delete_own_post" => "Delete Own Posts",
                             "delete_own_draft" => "Delete Own Drafts",
                             "add_page" => "Add Pages",
                             "edit_page" => "Edit Pages",
                             "delete_page" => "Delete Pages",
                             "add_user" => "Add Users",
                             "edit_user" => "Edit Users",
                             "delete_user" => "Delete Users",
                             "add_group" => "Add Groups",
                             "edit_group" => "Edit Groups",
                             "delete_group" => "Delete Groups");

        foreach ($permissions_backup as $id) {
            $name = isset($permissions[$id]) ? $permissions[$id] : camelize($id, true);
            echo _f("Restoring permission \"%s\"...", array($name)).
                 test(SQL::current()->insert("permissions",
                                             array("id" => $id,
                                                   "name" => $name)));
        }

    }

    /**
     * Function: update_custom_routes
     * Updates the custom routes to be path => action instead of # => path.
     *
     * Versions: 2.0rc1 => 2.0rc2
     */
    function update_custom_routes() {
        $custom_routes = Config::get("routes");
        if (empty($custom_routes)) return;

        $new_routes = array();
        foreach ($custom_routes as $key => $route) {
            if (!is_int($key))
                return;

            $split = array_filter(explode("/", $route));

            if (!isset($split[0]))
                return;

            echo _f("Updating custom route %s to new format...", array($route)).
                 test(isset($split[0]) and $new_routes[$route] = $split[0]);
        }

        Config::set("routes", $new_routes, "Setting new custom routes configuration...");
    }

    /**
     * Function: remove_database_config_file
     * Removes the database.yaml.php file, which is merged into config.yaml.php.
     *
     * Versions: 2.0rc1 => 2.0rc2
     */
    function remove_database_config_file() {
        if (file_exists(INCLUDES_DIR."/database.yaml.php"))
            echo __("Removing database.yaml.php file...").
                 test(@unlink(INCLUDES_DIR."/database.yaml.php"), __("Try deleting it manually."));
    }

    /**
     * Function: rename_database_setting_to_sql
     * Renames the "database" config setting to "sql".
     */
    function rename_database_setting_to_sql() {
        if (Config::check("sql")) return;
        Config::set("sql", Config::get("database"));
        Config::remove("database");
    }

    /**
     * Function: update_post_status_column
     * Updates the @status@ column on the "posts" table to be a generic varchar field instead of enum.
     *
     * Versions: 2.0rc1 => 2.0rc2
     */
    function update_post_status_column() {
        $sql = SQL::current();
        if (!$column = $sql->query("SHOW COLUMNS FROM __posts WHERE Field = 'status'"))
             return;

        if ($column->fetchObject()->Type == "varchar(32)")
            return;

        echo __("Updating `status` column on `posts` table...")."\n";

        echo " - ".__("Backing up `posts` table...").
             test($backup = $sql->select("posts"));

        if (!$backup)
            return;

        $backups = $backup->fetchAll();

        echo " - ".__("Dropping `posts` table...").
             test($drop = $sql->query("DROP TABLE __posts"));

        if (!$drop)
            return;

        echo " - ".__("Creating `posts` table...").
             test($create = $sql->query("CREATE TABLE IF NOT EXISTS __posts (
                                             id INTEGER PRIMARY KEY AUTO_INCREMENT,
                                             xml LONGTEXT,
                                             feather VARCHAR(32) DEFAULT '',
                                             clean VARCHAR(128) DEFAULT '',
                                             url VARCHAR(128) DEFAULT '',
                                             pinned TINYINT(1) DEFAULT 0,
                                             status VARCHAR(32) DEFAULT 'public',
                                             user_id INTEGER DEFAULT 0,
                                             created_at DATETIME DEFAULT NULL,
                                             updated_at DATETIME DEFAULT NULL
                                         ) DEFAULT CHARSET=utf8"));

        if (!$create) {
            echo " -".test(false, _f("Backup written to %s.", array("./_posts.bak.txt")));
            return file_put_contents("./_posts.bak.txt", var_export($backups, true));
        }

        foreach ($backups as $backup) {
            echo " - "._f("Restoring post #%d...", array($backup["id"])).
                 test($insert = $sql->insert("posts", $backup), _f("Backup written to %s.", array("./_posts.bak.txt")));

            if (!$insert)
                return file_put_contents("./_posts.bak.txt", var_export($backups, true));
        }

        echo " -".test(true);
    }

    /**
     * Function: add_post_attributes_table
     * Adds the "post_attributes" table.
     *
     * Versions: 2.0rc1 => 2.0rc2
     */
    function add_post_attributes_table() {
        $sql = SQL::current();
        if ($sql->select("post_attributes"))
            return;

        echo __("Creating `post_attributes` table...").
             test($sql->query("CREATE TABLE __post_attributes (
                                   post_id INTEGER NOT NULL ,
                                   name VARCHAR(100) DEFAULT '',
                                   value LONGTEXT,
                                   PRIMARY KEY (post_id, name)
                               ) DEFAULT CHARSET=utf8"));
    }

    /**
     * Function: post_xml_to_db
     * Migrates the XML post attributes to the "post_attributes" table.
     *
     * Versions: 2.0rc1 => 2.0rc2
     */
    function post_xml_to_db() {
        $sql = SQL::current();
        if (!$rows = $sql->query("SELECT id, xml FROM __posts"))
            return;

        function insert_attributes($sql, $row, $xml, &$inserts) {
            foreach ($xml as $name => $value) {
                if (is_array($value))
                    $value = YAML::dump($value);

                if (!$sql->insert("post_attributes",
                                  array("post_id" => $row["id"],
                                        "name" => $name,
                                        "value" => $value))) {
                    # Clear successful attribute insertions so the
                    # user can try again without primary key conflicts.
                    foreach ($inserts as $insertion)
                        $sql->delete("post_attributes",
                                     array("post_id" => $insertion["id"],
                                           "name" => $insertion["name"]));

                    return false;
                } else
                    $inserts[] = array("id" => $row["id"],
                                       "name" => $name);
            }

            return true;
        }

        $results = array();
        foreach ($rows->fetchAll() as $row) {
            if (empty($row["xml"]))
                continue;

            $xml = xml2arr(new SimpleXMLElement($row["xml"]));
            $inserts = array();
            echo _f("Migrating attributes of post #%d...", array($row["id"])).
                 test($results[] = insert_attributes($sql, $row, $xml, $inserts));
        }

        if (!in_array(false, $results)) {
            echo __("Removing `xml` column from `posts` table...")."\n";

            echo " - ".__("Backing up `posts` table...").
                 test($backup = $sql->select("posts"));

            if (!$backup)
                return;

            $backups = $backup->fetchAll();

            echo " - ".__("Dropping `posts` table...").
                 test($drop = $sql->query("DROP TABLE __posts"));

            if (!$drop)
                return;

            echo " - ".__("Creating `posts` table...").
                 test($create = $sql->query("CREATE TABLE IF NOT EXISTS __posts (
                                                 id INTEGER PRIMARY KEY AUTO_INCREMENT,
                                                 feather VARCHAR(32) DEFAULT '',
                                                 clean VARCHAR(128) DEFAULT '',
                                                 url VARCHAR(128) DEFAULT '',
                                                 pinned TINYINT(1) DEFAULT 0,
                                                 status VARCHAR(32) DEFAULT 'public',
                                                 user_id INTEGER DEFAULT 0,
                                                 created_at DATETIME DEFAULT NULL,
                                                 updated_at DATETIME DEFAULT NULL
                                             ) DEFAULT CHARSET=utf8"));

            if (!$create)
                return file_put_contents("./_posts.bak.txt", var_export($backups, true));

            foreach ($backups as $backup) {
                unset($backup["xml"]);
                echo " - "._f("Restoring post #%d...", array($backup["id"])).
                     test($insert = $sql->insert("posts", $backup));

                if (!$insert)
                    return file_put_contents("./_posts.bak.txt", var_export($backups, true));
            }

            echo " -".test(true);
        }
    }

    /**
     * Function: add_group_id_to_permissions
     * Adds the @group_id@ column to the "permissions" table.
     *
     * Versions: 2.0rc1 => 2.0rc2
     */
    function add_group_id_to_permissions() {
        $sql = SQL::current();
        if ($sql->select("permissions", "group_id"))
            return;

        echo __("Backing up permissions...").
             test($permissions = $sql->select("permissions"));

        if (!$permissions)
            return;

        $backup = $permissions->fetchAll();

        echo __("Dropping `permissions` table...").
             test($sql->query("DROP TABLE __permissions"));

        echo __("Creating `permissions` table...").
             test($sql->query("CREATE TABLE __permissions (
                                   id VARCHAR(100) DEFAULT '',
                                   name VARCHAR(100) DEFAULT '',
                                   group_id INTEGER DEFAULT 0,
                                   PRIMARY KEY (id, group_id)
                               ) DEFAULT CHARSET=utf8"));

        foreach ($backup as $permission)
            echo _f("Restoring permission `%s`...", array($permission["name"])).
                 test($sql->insert("permissions",
                                   array("id" => $permission["id"],
                                         "name" => $permission["name"],
                                         "group_id" => 0)));
    }

    /**
     * Function: group_permissions_to_db
     * Migrates the group permissions from a YAML column to the "permissions" table.
     *
     * Versions: 2.0rc1 => 2.0rc2
     */
    function group_permissions_to_db() {
        $sql = SQL::current();
        if (!$sql->select("groups", "permissions"))
            return;

        echo __("Backing up groups...").
             test($groups = $sql->select("groups"));

        if (!$groups)
            return;

        $backup = $groups->fetchAll();

        $names = array();
        foreach($backup as $group) {
            $names[$group["id"]] = $group["name"];
            $permissions[$group["id"]] = empty($group["permissions"]) ? array() : YAML::load($group["permissions"]) ;
        }

        echo __("Dropping `groups` table...").
             test($sql->query("DROP TABLE __groups"));

        echo __("Creating `groups` table...").
             test($sql->query("CREATE TABLE __groups (
                                   id INTEGER PRIMARY KEY AUTO_INCREMENT,
                                   name VARCHAR(100) DEFAULT '',
                                   UNIQUE (name)
                               ) DEFAULT CHARSET=utf8"));

        foreach ($names as $id => $name)
            echo _f("Restoring group `%s`...", array($name)).
                 test($sql->insert("groups",
                                   array("id" => $id,
                                        "name" => $name)));

        foreach ($permissions as $id => $permissions)
            foreach ($permissions as $permission)
                echo _f("Restoring permission `%s` on group `%s`...", array($permission, $names[$id])).
                     test($sql->insert("permissions",
                                       array("id" => $permission,
                                             "name" => $sql->select("permissions", "name", array("id" => $permission))->fetchColumn(),
                                             "group_id" => $id)));
    }

    /**
     * Function: remove_old_files
     * Removes old/unused files from previous installs.
     */
    function remove_old_files() {
        if (file_exists(INCLUDES_DIR."/config.php"))
            echo __("Removing `includes/config.php` file...").
                 test(@unlink(INCLUDES_DIR."/config.php"));

        if (file_exists(INCLUDES_DIR."/database.php"))
            echo __("Removing `includes/database.php` file...").
                 test(@unlink(INCLUDES_DIR."/database.php"));

        if (file_exists(INCLUDES_DIR."/rss.php"))
            echo __("Removing `includes/rss.php` file...").
                 test(@unlink(INCLUDES_DIR."/rss.php"));

        if (file_exists(INCLUDES_DIR."/bookmarklet.php"))
            echo __("Removing `includes/bookmarklet.php` file...").
                 test(@unlink(INCLUDES_DIR."/bookmarklet.php"));
    }

    /**
     * Function: update_user_password_column
     * Updates the @password@ column on the "users" table to have a length of 60.
     *
     * Versions: 2.0rc3 => 2.0
     */
    function update_user_password_column() {
        $sql = SQL::current();
        if (!$column = $sql->query("SHOW COLUMNS FROM __users WHERE Field = 'password'"))
             return;

        if ($column->fetchObject()->Type == "varchar(60)")
            return;

        echo __("Updating `password` column on `users` table...")."\n";

        echo " - ".__("Backing up `users` table...").
             test($backup = $sql->select("users"));

        if (!$backup)
            return;

        $backups = $backup->fetchAll();

        echo " - ".__("Dropping `users` table...").
             test($drop = $sql->query("DROP TABLE __users"));

        if (!$drop)
            return;

        echo " - ".__("Creating `users` table...").
             test($create = $sql->query("CREATE TABLE IF NOT EXISTS `__users` (
                                            `id` int(11) NOT NULL AUTO_INCREMENT,
                                            `login` varchar(64) DEFAULT '',
                                            `password` varchar(60) DEFAULT NULL,
                                            `full_name` varchar(250) DEFAULT '',
                                            `email` varchar(128) DEFAULT '',
                                            `website` varchar(128) DEFAULT '',
                                            `group_id` int(11) DEFAULT '0',
                                            `joined_at` datetime DEFAULT NULL,
                                            PRIMARY KEY (`id`),
                                            UNIQUE KEY `login` (`login`)
                                        ) DEFAULT CHARSET=utf8"));

        if (!$create) {
            echo " -".test(false, _f("Backup written to %s.", array("./_users.bak.txt")));
            return file_put_contents("./_users.bak.txt", var_export($backups, true));
        }

        foreach ($backups as $backup) {
            echo " - "._f("Restoring user #%d...", array($backup["id"])).
                 test($insert = $sql->insert("users", $backup), _f("Backup written to %s.", array("./_users.bak.txt")));

            if (!$insert)
                return file_put_contents("./_users.bak.txt", var_export($backups, true));
        }

        echo " -".test(true);
    }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <title><?php echo __("Chyrp Upgrader"); ?></title>

<?php if (!empty($_POST) and $_POST['upgrade'] == "yes"): ?>

<?php
        # Begin with file/config upgrade tasks.

        fix_htaccess();

        remove_beginning_slash_from_post_url();

        move_yml_yaml();

        update_protection();

        theme_default_to_stardust();

        Config::fallback("routes", array());
        Config::fallback("secure_hashkey", md5(random(32, true)));
        Config::fallback("enable_xmlrpc", true);
        Config::fallback("enable_ajax", true);
        Config::fallback("uploads_path", "/uploads/");
        Config::fallback("chyrp_url", Config::get("url"));
        Config::fallback("sql", Config::$yaml["database"]);
        Config::fallback("timezone", "America/New_York");

        Config::remove("rss_posts");
        Config::remove("time_offset");

        move_upload();

        remove_database_config_file();

        rename_database_setting_to_sql();

        update_custom_routes();

        default_db_adapter_to_mysql();

        # Perform database upgrade tasks after all the files/config upgrade tasks are done.

        # Prepare the SQL interface.
        $sql = SQL::current();

        # Set the SQL info.
        foreach (Config::$yaml["config"]["sql"] as $name => $value)
            $sql->$name = $value;

        # Initialize connection to SQL server.
        $sql->connect();

        tweets_to_posts();

        pages_parent_id_column();

        pages_list_order_column();

        make_posts_safe();

        rss_posts_to_feed_items();

        update_groups_to_yaml();

        add_permissions_table();

        add_sessions_table();

        update_permissions_table();

        update_post_status_column();

        add_post_attributes_table();

        post_xml_to_db();

        add_group_id_to_permissions();

        group_permissions_to_db();

        remove_old_files();

        update_user_password_column();

        # Perform Module/Feather upgrades.

        foreach ((array) Config::get("enabled_modules") as $module)
            if (file_exists(MAIN_DIR."/modules/".$module."/upgrades.php")) {
                ob_start();
                echo $begin = _f("Calling %s Module's upgrader...", array($module))."\n";
                require MAIN_DIR."/modules/".$module."/upgrades.php";
                $buf = ob_get_contents();
                if (ob_get_contents() == $begin)
                    ob_end_clean();
                else
                    ob_end_flush();
            }

        foreach ((array) Config::get("enabled_feathers") as $feather)
            if (file_exists(MAIN_DIR."/feathers/".$feather."/upgrades.php")) {
                ob_start();
                echo $begin = _f("Calling %s Feather's upgrader...", array($feather))."\n";
                require MAIN_DIR."/feathers/".$feather."/upgrades.php";
                $buf = ob_get_contents();
                if (ob_get_contents() == $begin)
                    ob_end_clean();
                else
                    ob_end_flush();
            }
?>

<?php echo __("Done!"); ?>

<?php echo __("What now?"); ?>

<?php echo __("Look through the results up there for any failed tasks. If you see any and you can't figure out why, you can ask for help at the Chyrp Community."); ?>

<?php echo __("If any of your Modules or Feathers have new versions available for this release, check if an upgrades.php file exists in their main directory. If that file exists, run this upgrader again after enabling the Module or Feather and it will run the upgrade tasks."); ?>

<?php echo __("When you are done, you can delete this file. It doesn't pose any real threat on its own, but you should delete it anyway, just to be sure."); ?>

<?php echo __("Tips"); ?>

<?php echo __("If the admin area looks weird, try clearing your cache."); ?>

<?php echo __("As of v2.0, Chyrp uses time zones to determine timestamps. Please set your installation to the correct timezone at General Settings."); ?>

<?php echo __("Check the group permissions – they might have changed, and certain Admin functionality would be disabled until you enabled the permissions for the particular groups. Manage Groups →"); ?>

            <a class="big" href="<?php echo (Config::check("url") ? Config::get("url") : Config::get("chyrp_url")); ?>"><?php echo __("All done!"); ?>
<?php else: ?>

<?php echo __("Halt!"); ?>

<?php echo __("That button may look ready for a-clickin’, but please take these preemptive measures before indulging:"); ?>

<?php echo __("Make a backup of your installation. You never know."); ?>

<?php echo __("Disable any third-party Modules and Feathers."); ?>

<?php echo __("Ensure that the Chyrp installation directory is writable by the server."); ?>

<?php echo __("If any of the upgrade processes fail, you can safely keep refreshing – it will only attempt to do tasks that are not already successfully completed. If you cannot figure something out, please make a topic (with details!) at the Chyrp Community."); ?>

            <form action="upgrade.php" method="post">
                <button type="submit" name="upgrade" value="yes"><?php echo __("Upgrade me!"); ?></button>
            </form>
<?php endif; ?>


text:
Rails.application.routes.draw do
  resources :comments, only: [:index, :show, :create]
  root 'comments#index'
end


text:
/// <reference types="Cypress" />
import {
    ContentBuilder,
    DocumentTypeBuilder,
} from 'umbraco-cypress-testhelpers';

context('Recycle bin', () => {

    beforeEach(() => {
        cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
    });

    function refreshContentTree() {
        // Refresh to update the tree
        cy.get('li .umb-tree-root:contains("Content")').should("be.visible").rightclick();
        cy.umbracoContextMenuAction("action-refreshNode").click();
        // We have to wait in case the execution is slow, otherwise we'll try and click the item before it appears in the UI
        cy.get('.umb-tree-item__inner').should('exist', { timeout: 10000 });
    }

    it('Can delete content from recycle bin', () => {
        const contentToDeleteName = "DeleteMe";
        const contentToNotDeleteName = "DontDelete";
        const testType = "TestType";

        cy.umbracoEnsureDocumentTypeNameNotExists(testType);
        cy.deleteAllContent();

        const docType = new DocumentTypeBuilder()
            .withName(testType)
            .build();

        cy.saveDocumentType(docType).then((savedDocType) => {
            const contentToDelete = new ContentBuilder()
                .withContentTypeAlias(savedDocType.alias)
                .withAction("saveNew")
                .addVariant()
                    .withName(contentToDeleteName)
                    .withSave(true)
                .done()
                .build();

            const contentToNotDelete = new ContentBuilder()
                .withContentTypeAlias(savedDocType.alias)
                .withAction("saveNew")
                .addVariant()
                    .withName(contentToNotDeleteName)
                    .withSave(true)
                .done()
                .build();

            // Put it in the recycle bin
            cy.saveContent(contentToDelete).then(savedToDelete => {
                cy.deleteContentById(savedToDelete.id);
            });
            cy.saveContent(contentToNotDelete).then(savedNotToDelete => {
                cy.deleteContentById(savedNotToDelete.id)
            });
        });

        refreshContentTree();
        cy.umbracoTreeItem('content', ["Recycle Bin"]).click();
        cy.get('.umb-content-grid__content').contains(contentToDeleteName).closest('div').click();
        cy.umbracoButtonByLabelKey('actions_delete').click();
        cy.umbracoButtonByLabelKey('contentTypeEditor_yesDelete').click();

        cy.umbracoSuccessNotification().should('be.visible');

        cy.get('.umb-content-grid__content').contains(contentToDeleteName).should('not.exist');
        cy.umbracoTreeItem('content', ["Recycle Bin", contentToDeleteName]).should('not.exist');

        cy.get('.umb-content-grid__content').contains(contentToNotDeleteName).should('be.visible');
        cy.umbracoTreeItem('content', ["Recycle Bin", contentToNotDeleteName]).should('be.visible');

        cy.deleteAllContent();
        cy.umbracoEnsureDocumentTypeNameNotExists(testType);
    });
});


text:
package org.jboss.weld.tests.interceptors.interceptorsOrderWithExclusions;

import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;

/**
 * @author Marius Bogoevici
 */
public class EjbInterceptor2 {
    static int count;

    @AroundInvoke
    public Object doInTransaction(InvocationContext invocationContext) throws Exception {
        count = Counter.next();
        return invocationContext.proceed();
    }
}


text:
///////////////////////////////////////////////////////////////////
//                                                               //
// AddCaloHFEpp                                                  //
// Author: T. Suzuki Univ. of Tsukuba                            //
//                                                               //
///////////////////////////////////////////////////////////////////
class AliAnalysisDataContainer;

AliAnalysisTaskCaloHFEpp* AddTaskCaloHFEpp(TString name = "name",
		TString dataname = "dataname",
		Bool_t flagEG1 = kTRUE,
		Bool_t flagEG2 = kFALSE,
		Bool_t flagDG1 = kFALSE,
		Bool_t flagDG2 = kFALSE,
		Bool_t SetFlagClsTypeEMC = kTRUE,
		Bool_t SetFlagClsTypeDCAL = kFALSE,
		Bool_t fMC = kFALSE,
		Double_t TrackEtaMin = -0.6,
		Double_t TrackEtaMax = 0.6,
		Int_t NTPCClust = 80,
		Int_t NITSClust = 3,
		Int_t NCrossedRow = 100,
		Double_t DCAxy = 2.4,
		Double_t DCAz = 3.2,
		Double_t NsigmaMin = -1.0,
		Double_t NsigmaMax = 3.0,
		Double_t M20Min = 0.015,
		Double_t M20Max = 0.35,
		Double_t EopMin = 0.85,
		Double_t EopMax = 1.3,
		Double_t coneR = 0.3,
		Double_t ptAsso = 0.2,
		Double_t mimcle = 0.2,
		TString  pte = "pte",
		Double_t MassMin = 0.15,
		Double_t nref = 12,
		Double_t nrefV0 = 258,
		TString estimatorFilename = "alien:///alice/cern.ch/user/s/ssakai/Multiplicity_pp13/estimator.root",
		Int_t minNtr = 0,
		Int_t maxNtr = 200,
                Int_t mtype = 0)
{
    // get the manager via the static access member. since it's static, you don't need
    // an instance of the class to call the function
    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
    if (!mgr) {
        return 0x0;
    }
    // get the input event handler, again via a static method.
    // this handler is part of the managing system and feeds events
    // to your task
    if (!mgr->GetInputEventHandler()) {
        return 0x0;
    }

    // by default, a file is open for writing. here, we get the filename
    TString fileName = AliAnalysisManager::GetCommonFileName();
    fileName += ":CaloHFEpp";      // create a subfolder in the file
    // now we create an instance of your task
    AliAnalysisTaskCaloHFEpp* task = new AliAnalysisTaskCaloHFEpp(name.Data());
    task -> SetEG1(flagEG1);
    task -> SetEG2(flagEG2);
    task -> SetDG1(flagDG1);
    task -> SetDG2(flagDG2);
    task -> SetfFlagClsTypeEMC(SetFlagClsTypeEMC);
    task -> SetfFlagClsTypeDCAL(SetFlagClsTypeDCAL);

    task -> SetTrackEta(TrackEtaMin,TrackEtaMax);
    task -> SetTrackClust(NTPCClust,NITSClust,NCrossedRow);
    task -> SetDCA(DCAxy,DCAz);
    task -> SetNsigma(NsigmaMin,NsigmaMax);
    task -> SetM20(M20Min,M20Max);
    task -> SetEop(EopMin,EopMax);
    task -> SetConeR(coneR);
    task -> SetptAsso(ptAsso);
    task -> SetMimClE(mimcle);
    task -> SetptCut(pte);
    task -> SetMassMin(MassMin);
    task -> SetNref(nref);
    task -> SetNrefV0(nrefV0);
    task -> SetMinNtr(minNtr);
    task -> SetMaxNtr(maxNtr);
    task -> SetEstimatorFile(estimatorFilename);
    task -> SetMultType(mtype);

    /*
    TFile* fEstimator=TFile::Open(estimatorFilename.Data());
    if(!fEstimator){
	    AliFatal("File with multiplicity estimator not found\n");
	    return;
    }

    // Get weight for N_{tracklet}
    TH1D* weightNtrkl = (TH1D*)fEstimator->Get("weightNtrkl")->Clone("weightNtrkl_clone");
    if(!weightNtrkl){
	    AliFatal("Multiplicity estimator for weight not found! Please check your estimator file");
	    return;
    }
    task->SetWeightNtrkl(weightNtrkl);
   */

    if(!task) return 0x0;

    // add your task to the manager
    mgr->AddTask(task);

    TString containerName = mgr->GetCommonFileName();
    containerName += ":PWGHF_hfeCalpp";
    TString SubcontainerName = Form("hfeCalpp");
    SubcontainerName += name;
    AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
    AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(SubcontainerName, TList::Class(),AliAnalysisManager::kOutputContainer, containerName.Data());
    mgr->ConnectInput(task, 0, cinput);
    mgr->ConnectOutput(task, 1, coutput1);

    return task;
}


text:
package org.digitalcraftsman.book;

import java.util.Collection;

/**
 * Created by xabier on 21/11/2014.
 */
public interface Pageable<T> {

    int getPageNumber();

    int getPageSize();

    Collection<T> getPageContents();
}


text:
<!DOCTYPE html>
<html>
<head>
    <title>Proton Example</title>
    <script type="text/javascript" src="../build/ProtonLoader.js"></script>
    <script type="text/javascript" src="./three.min.js"></script>
    <script type="text/javascript" src="./three.proton.min.js"></script>
    <script type="text/javascript" src="./OrbitControls.js"></script>
    <script type="text/javascript" src="./exampleFramework.js"></script>
    <style type="text/css">
        body {
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
<script>
    function example() {
        camera.position.z = 12;
        particles = new ProtonLoader(Proton);
        particles.createParticles({
            container: scene,
            renderType: 'SpriteRender',
            body: {
                type: 'sprite',
                texture: 'images/particle.png'
            },
            particleProps: {
                rate: [10, 20],
                position: 7,
                mass: 1,
                life: 1,
                alpha: [1, 0],
                scale: [0.8, 0.1],
                colors: [0xFFFFFF, 0x0000FF],
                velocity: {
                    speed: 10,
                    direction: [0, 1, 0],
                    variance: 180,
                },
            },
        });
    }
</script>
</body>
</html>