text:
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">

  <title>wins.backend.dot11n_backend.Dot11N_Channel</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />

         Trees

         Indices

         Help

WiNS

        Package wins ::
        Package backend ::
        Module dot11n_backend ::
        Class Dot11N_Channel

[hide private]

Class Dot11N_Channel

source code

  <map id="class_hierarchy_for_dot11n_cha" name="class_hierarchy_for_dot11n_cha">
<area shape="rect" href="wins.backend.dot11n_backend.Dot11N_Channel-class.html" title="Dot11N_Channel" alt="" coords="5,61,123,88"/>
<area shape="rect" href="wins.backend.dot11n_backend.MimoChannel-class.html" title="MimoChannel" alt="" coords="15,5,113,32"/>
</map>

Proxy of C++ Dot11N_Channel class

        Nested Classes
        [hide private]

        _s

      Proxy of C++ Channel class

        Instance Methods
        [hide private]

          __setattr__(self,
        name,
        value)

      x.__setattr__('name', value) <==> x.name = value

            source code

          __getattr__(self,
        name)

            source code

      MimoChannel

          __init__(self,
        *args)

      int flag = DOT11N_TGN_DEFAULT) -> Dot11N_Channel

            source code

          __swig_destroy__(...)

      delete_Dot11N_Channel(Dot11N_Channel self)

          __del__(self)

            source code

          setup(self,
        *args)

      setup(self, int model, int ntx, int nrx, int flag = DOT11N_TGN_DEFAULT) -> bool
setup(self, int model, int ntx, int nrx) -> bool

            source code

          set_nrx(self,
        *args)

      set_nrx(self, int ntx, bool update = True)
set_nrx(self, int ntx)

            source code

          set_ntx(self,
        *args)

      set_ntx(self, int nrx, bool update = True)
set_ntx(self, int nrx)

            source code

          set_flags(self,
        *args)

      set_flags(self, int flag, bool update = True)
set_flags(self, int flag)

            source code

          set_model(self,
        *args)

      set_model(self, int model, bool update = True)
set_model(self, int model)

            source code

          set_environmentspeed(self,
        *args)

      set_environmentspeed(self, double v, bool arg1 = True)
set_environmentspeed(self, double v)

            source code

      string

          model(self)

            source code

      int

          ntx(self)

            source code

      int

          nrx(self)

            source code

      int

          maxdelay(self)

            source code

      double

          coherencetime(self)

            source code

      double

          samplefrequency(self)

            source code

      double

          environmentspeed(self)

            source code

      int

          flags(self)

            source code

      int

          nfft(self)

            source code

          update(self,
        *args)

      update(self, double tupdate = -1.0)
update(self)

            source code

      double

          rmsdelay(self)

            source code

      double

          medianpower(self)

            source code

      double

          medianpowerdb(self)

            source code

          __repr__(*args)

      dot11n_channel_py_dot11n_channel__repr(Dot11N_Channel H) -> string

            source code

          __add__(*args)

      dot11n_channel_py_channel__add(Dot11N_Channel A, Dot11N_Channel B) -> Dot11N_Channel
dot11n_channel_py_channel__add(Dot11N_Channel H, std::complex<(double)> x) -> Dot11N_Channel

            source code

          __radd__(*args)

      dot11n_channel_py_channel__add(Dot11N_Channel A, Dot11N_Channel B) -> Dot11N_Channel
dot11n_channel_py_channel__add(Dot11N_Channel H, std::complex<(double)> x) -> Dot11N_Channel

            source code

          __sub__(*args)

      dot11n_channel_py_channel__sub(Dot11N_Channel A, Dot11N_Channel B) -> Dot11N_Channel
dot11n_channel_py_channel__sub(Dot11N_Channel H, std::complex<(double)> x) -> Dot11N_Channel

            source code

          __rsub__(*args)

      dot11n_channel_py_channel__sub(Dot11N_Channel A, Dot11N_Channel B) -> Dot11N_Channel
dot11n_channel_py_channel__sub(Dot11N_Channel H, std::complex<(double)> x) -> Dot11N_Channel

            source code

          __mul__(*args)

      dot11n_channel_py_channel__mul(Dot11N_Channel H, std::complex<(double)> t) -> Dot11N_Channel

            source code

          __rmul__(*args)

      dot11n_channel_py_channel__mul(Dot11N_Channel H, std::complex<(double)> t) -> Dot11N_Channel

            source code

Inherited from MimoChannel:
      __getitem__,
      __len__,
      __setitem__,
      cols,
      conv,
      convolve,
      flatten,
      normalize,
      normpower,
      normpowerdb,
      power,
      powerdb,
      rows,
      taps

Inherited from object:
      __delattr__,
      __format__,
      __getattribute__,
      __hash__,
      __new__,
      __reduce__,
      __reduce_ex__,
      __sizeof__,
      __str__,
      __subclasshook__

        Static Methods
        [hide private]

          calc_rmsdelay(*args)

      calc_rmsdelay(int model, int ntx, int nrx) -> double

            source code

        Class Variables
        [hide private]

        __swig_setmethods__ = {}

        __swig_getmethods__ = {}

        Properties
        [hide private]

Inherited from object:
      __class__

        Method Details
        [hide private]

__setattr__(self,
        name,
        value)

  	source code

  x.__setattr__('name', value) <==> x.name = value

Overrides:
        object.__setattr__

(inherited documentation)

__getattr__(self,
        name)

(Qualification operator)

  	source code

Overrides:
        MimoChannel.__getattr__

__init__(self,
        *args)

(Constructor)

  	source code

__init__(self, int model = DOT11N_TGN_MODEL_A, int ntx = -1, int nrx = -1,

int flag = DOT11N_TGN_DEFAULT) -> Dot11N_Channel

__init__(self, int model = DOT11N_TGN_MODEL_A, int ntx = -1, int nrx = -1) -> Dot11N_Channel
__init__(self, int model = DOT11N_TGN_MODEL_A, int ntx = -1) -> Dot11N_Channel
__init__(self, int model = DOT11N_TGN_MODEL_A) -> Dot11N_Channel
__init__(self) -> Dot11N_Channel

Returns: MimoChannel

Overrides:
        object.__init__

__swig_destroy__(...)

  delete_Dot11N_Channel(Dot11N_Channel self)

Overrides:
        _dot11n_backend'.delete_MimoChannel

__del__(self)

(Destructor)

  	source code

Overrides:
        MimoChannel.__del__

__repr__(*args)

(Representation operator)

  	source code

  dot11n_channel_py_dot11n_channel__repr(Dot11N_Channel H) -> string

Overrides:
        object.__repr__

__add__(*args)

(Addition operator)

  	source code

  dot11n_channel_py_channel__add(Dot11N_Channel A, Dot11N_Channel B) -> Dot11N_Channel
dot11n_channel_py_channel__add(Dot11N_Channel H, std::complex<(double)> x) -> Dot11N_Channel

Overrides:
        channel_py_channel__add

__radd__(*args)

(Right-side addition operator)

  	source code

  dot11n_channel_py_channel__add(Dot11N_Channel A, Dot11N_Channel B) -> Dot11N_Channel
dot11n_channel_py_channel__add(Dot11N_Channel H, std::complex<(double)> x) -> Dot11N_Channel

Overrides:
        channel_py_channel__add

__sub__(*args)

(Subtraction operator)

  	source code

  dot11n_channel_py_channel__sub(Dot11N_Channel A, Dot11N_Channel B) -> Dot11N_Channel
dot11n_channel_py_channel__sub(Dot11N_Channel H, std::complex<(double)> x) -> Dot11N_Channel

Overrides:
        channel_py_channel__sub

__rsub__(*args)

  	source code

  dot11n_channel_py_channel__sub(Dot11N_Channel A, Dot11N_Channel B) -> Dot11N_Channel
dot11n_channel_py_channel__sub(Dot11N_Channel H, std::complex<(double)> x) -> Dot11N_Channel

Overrides:
        channel_py_channel__sub

__mul__(*args)

  	source code

  dot11n_channel_py_channel__mul(Dot11N_Channel H, std::complex<(double)> t) -> Dot11N_Channel

Overrides:
        channel_py_channel__mul

__rmul__(*args)

  	source code

  dot11n_channel_py_channel__mul(Dot11N_Channel H, std::complex<(double)> t) -> Dot11N_Channel

Overrides:
        channel_py_channel__mul

         Trees

         Indices

         Help

WiNS

    Generated by Epydoc
    3.0.1 on Thu Feb 23 16:48:29 2012

      http://epydoc.sourceforge.net


text:
from __future__ import unicode_literals

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('blog', '0004_auto_20161012_1134'),
    ]

    operations = [
        migrations.RenameField(
            model_name='comment',
            old_name='post_id',
            new_name='post',
        ),
        migrations.RenameField(
            model_name='post',
            old_name='author_id',
            new_name='author',
        ),
        migrations.RenameField(
            model_name='post',
            old_name='category_id',
            new_name='category',
        ),
    ]

redpajama_set_name: RedPajamaGithub


text:
package com.refinedmods.refinedstorage.api.storage.disk;

import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.item.ItemStack;

import javax.annotation.Nullable;
import java.util.UUID;

/**
 * Creates a storage disk from NBT or on-demand.
 *
 * @param <T>
 */
public interface IStorageDiskFactory<T> {
    /**
     * Creates a storage disk based on NBT.
     *
     * @param level the level
     * @param tag   the tag
     * @return the storage disk
     */
    IStorageDisk<T> createFromNbt(ServerLevel level, CompoundTag tag);

    /**
     * Creates a storage disk item based on ID.
     *
     * @param disk the disk
     * @param id   the disk id
     * @return the storage disk
     */
    ItemStack createDiskItem(IStorageDisk<T> disk, UUID id);

    /**
     * Creates a storage disk on-demand.
     *
     * @param level    the level
     * @param capacity the capacity
     * @param owner    the owner, or null if no owner
     * @return the storage disk
     */
    IStorageDisk<T> create(ServerLevel level, int capacity, @Nullable UUID owner);
}


text:
const char *filecoding(const char *filename);

#endif


text:
AreYouFunctional
================


text:
import deepFreeze from 'deep-freeze';
import getGenerationDetails from './getGenerationDetails';

it('should return correct values for Neonate', () => {
  const state = {
    character: {
      backgrounds: {
        generation: {
          startingDots: 1
        }
      }
    }
  };

  deepFreeze(state);

  const result = getGenerationDetails(state);

  expect(result).toMatchObject({
    title: 'Neonate',
    bloodPool: 10,
    bloodPerTurn: 1,
    attributeBonus: 1
  });

  expect(result).toHaveProperty('dotCost');
});

it('should return correct values for Luminary Elder', () => {
  const state = {
    character: {
      backgrounds: {
        generation: {
          startingDots: 3,
          dotsPurchased: 2
        }
      }
    }
  };

  deepFreeze(state);

  const result = getGenerationDetails(state);

  expect(result).toMatchObject({
    title: 'Luminary Elder',
    bloodPool: 30,
    bloodPerTurn: 5,
    attributeBonus: 5
  });

  expect(result).toHaveProperty('dotCost');
});


text:
package org.apache.openwhisk.core.controller

import akka.Done
import akka.actor.{ActorSystem, CoordinatedShutdown}
import akka.event.Logging.InfoLevel
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.model.Uri
import akka.http.scaladsl.server.Route
import akka.stream.ActorMaterializer
import kamon.Kamon
import pureconfig._
import pureconfig.generic.auto._
import spray.json.DefaultJsonProtocol._
import spray.json._
import org.apache.openwhisk.common.Https.HttpsConfig
import org.apache.openwhisk.common.{AkkaLogging, ConfigMXBean, Logging, LoggingMarkers, TransactionId}
import org.apache.openwhisk.core.WhiskConfig
import org.apache.openwhisk.core.connector.MessagingProvider
import org.apache.openwhisk.core.containerpool.logging.LogStoreProvider
import org.apache.openwhisk.core.database.{ActivationStoreProvider, CacheChangeNotification, RemoteCacheInvalidation}
import org.apache.openwhisk.core.entitlement._
import org.apache.openwhisk.core.entity.ActivationId.ActivationIdGenerator
import org.apache.openwhisk.core.entity.ExecManifest.Runtimes
import org.apache.openwhisk.core.entity._
import org.apache.openwhisk.core.loadBalancer.{InvokerState, LoadBalancerProvider}
import org.apache.openwhisk.http.{BasicHttpService, BasicRasService}
import org.apache.openwhisk.spi.SpiLoader

import scala.concurrent.ExecutionContext.Implicits
import scala.concurrent.duration.DurationInt
import scala.concurrent.Await
import scala.util.{Failure, Success}

/**
 * The Controller is the service that provides the REST API for OpenWhisk.
 *
 * It extends the BasicRasService so it includes a ping endpoint for monitoring.
 *
 * Akka sends messages to akka Actors -- the Controller is an Actor, ready to receive messages.
 *
 * It is possible to deploy a hot-standby controller. Each controller needs its own instance. This instance is a
 * consecutive numbering, starting with 0.
 * The state and cache of each controller is not shared to the other controllers.
 * If the base controller crashes, the hot-standby controller will be used. After the base controller is up again,
 * it will be used again. Because of the empty cache after restart, there are no problems with inconsistency.
 * The only problem that could occur is, that the base controller is not reachable, but does not restart. After switching
 * back to the base controller, there could be an inconsistency in the cache (e.g. if a user has updated an action). This
 * inconsistency will be resolved by its own after removing the cached item, 5 minutes after it has been generated.
 *
 * Uses the Akka routing DSL: http://doc.akka.io/docs/akka-http/current/scala/http/routing-dsl/overview.html
 *
 * @param config A set of properties needed to run an instance of the controller service
 * @param instance if running in scale-out, a unique identifier for this instance in the group
 * @param verbosity logging verbosity
 * @param executionContext Scala runtime support for concurrent operations
 */
class Controller(val instance: ControllerInstanceId,
                 runtimes: Runtimes,
                 implicit val whiskConfig: WhiskConfig,
                 implicit val actorSystem: ActorSystem,
                 implicit val materializer: ActorMaterializer,
                 implicit val logging: Logging)
    extends BasicRasService {

  TransactionId.controller.mark(
    this,
    LoggingMarkers.CONTROLLER_STARTUP(instance.asString),
    s"starting controller instance ${instance.asString}",
    logLevel = InfoLevel)

  /**
   * A Route in Akka is technically a function taking a RequestContext as a parameter.
   *
   * The "~" Akka DSL operator composes two independent Routes, building a routing tree structure.
   * @see http://doc.akka.io/docs/akka-http/current/scala/http/routing-dsl/routes.html#composing-routes
   */
  override def routes(implicit transid: TransactionId): Route = {
    super.routes ~ {
      (pathEndOrSingleSlash & get) {
        complete(info)
      }
    } ~ apiV1.routes ~ swagger.swaggerRoutes ~ internalInvokerHealth
  }

  // initialize datastores
  private implicit val authStore = WhiskAuthStore.datastore()
  private implicit val entityStore = WhiskEntityStore.datastore()
  private implicit val cacheChangeNotification = Some(new CacheChangeNotification {
    val remoteCacheInvalidaton = new RemoteCacheInvalidation(whiskConfig, "controller", instance)
    override def apply(k: CacheKey) = {
      remoteCacheInvalidaton.invalidateWhiskActionMetaData(k)
      remoteCacheInvalidaton.notifyOtherInstancesAboutInvalidation(k)
    }
  })

  // initialize backend services
  private implicit val loadBalancer =
    SpiLoader.get[LoadBalancerProvider].instance(whiskConfig, instance)
  logging.info(this, s"loadbalancer initialized: ${loadBalancer.getClass.getSimpleName}")(TransactionId.controller)

  private implicit val entitlementProvider =
    SpiLoader.get[EntitlementSpiProvider].instance(whiskConfig, loadBalancer, instance)
  private implicit val activationIdFactory = new ActivationIdGenerator {}
  private implicit val logStore = SpiLoader.get[LogStoreProvider].instance(actorSystem)
  private implicit val activationStore =
    SpiLoader.get[ActivationStoreProvider].instance(actorSystem, materializer, logging)

  // register collections
  Collection.initialize(entityStore)

  /** The REST APIs. */
  implicit val controllerInstance = instance
  private val apiV1 = new RestAPIVersion(whiskConfig, "api", "v1")
  private val swagger = new SwaggerDocs(Uri.Path.Empty, "infoswagger.json")

  /**
   * Handles GET /invokers
   *             /invokers/healthy/count
   *
   * @return JSON with details of invoker health or count of healthy invokers respectively.
   */
  private val internalInvokerHealth = {
    implicit val executionContext = actorSystem.dispatcher
    (pathPrefix("invokers") & get) {
      pathEndOrSingleSlash {
        complete {
          loadBalancer
            .invokerHealth()
            .map(_.map(i => i.id.toString -> i.status.asString).toMap.toJson.asJsObject)
        }
      } ~ path("healthy" / "count") {
        complete {
          loadBalancer
            .invokerHealth()
            .map(_.count(_.status == InvokerState.Healthy).toJson)
        }
      }
    }
  }

  // controller top level info
  private val info = Controller.info(
    whiskConfig,
    TimeLimit.config,
    MemoryLimit.config,
    LogLimit.config,
    runtimes,
    List(apiV1.basepath()))
}

/**
 * Singleton object provides a factory to create and start an instance of the Controller service.
 */
object Controller {

  protected val protocol = loadConfigOrThrow[String]("whisk.controller.protocol")
  protected val interface = loadConfigOrThrow[String]("whisk.controller.interface")

  // requiredProperties is a Map whose keys define properties that must be bound to
  // a value, and whose values are default values.   A null value in the Map means there is
  // no default value specified, so it must appear in the properties file
  def requiredProperties =
    ExecManifest.requiredProperties ++
      RestApiCommons.requiredProperties ++
      SpiLoader.get[LoadBalancerProvider].requiredProperties ++
      EntitlementProvider.requiredProperties

  private def info(config: WhiskConfig,
                   timeLimit: TimeLimitConfig,
                   memLimit: MemoryLimitConfig,
                   logLimit: MemoryLimitConfig,
                   runtimes: Runtimes,
                   apis: List[String]) =
    JsObject(
      "description" -> "OpenWhisk".toJson,
      "support" -> JsObject(
        "github" -> "https://github.com/apache/openwhisk/issues".toJson,
        "slack" -> "http://slack.openwhisk.org".toJson),
      "api_paths" -> apis.toJson,
      "limits" -> JsObject(
        "actions_per_minute" -> config.actionInvokePerMinuteLimit.toInt.toJson,
        "triggers_per_minute" -> config.triggerFirePerMinuteLimit.toInt.toJson,
        "concurrent_actions" -> config.actionInvokeConcurrentLimit.toInt.toJson,
        "sequence_length" -> config.actionSequenceLimit.toInt.toJson,
        "min_action_duration" -> timeLimit.min.toMillis.toJson,
        "max_action_duration" -> timeLimit.max.toMillis.toJson,
        "min_action_memory" -> memLimit.min.toBytes.toJson,
        "max_action_memory" -> memLimit.max.toBytes.toJson,
        "min_action_logs" -> logLimit.min.toBytes.toJson,
        "max_action_logs" -> logLimit.max.toBytes.toJson),
      "runtimes" -> runtimes.toJson)

  def main(args: Array[String]): Unit = {
    implicit val actorSystem = ActorSystem("controller-actor-system")
    implicit val logger = new AkkaLogging(akka.event.Logging.getLogger(actorSystem, this))
    start(args)
  }

  def start(args: Array[String])(implicit actorSystem: ActorSystem, logger: Logging): Unit = {
    ConfigMXBean.register()
    Kamon.init()

    // Prepare Kamon shutdown
    CoordinatedShutdown(actorSystem).addTask(CoordinatedShutdown.PhaseActorSystemTerminate, "shutdownKamon") { () =>
      logger.info(this, s"Shutting down Kamon with coordinated shutdown")
      Kamon.stopModules().map(_ => Done)(Implicits.global)
    }

    // extract configuration data from the environment
    val config = new WhiskConfig(requiredProperties)
    val port = config.servicePort.toInt

    // if deploying multiple instances (scale out), must pass the instance number as the
    require(args.length >= 1, "controller instance required")
    val instance = ControllerInstanceId(args(0))

    def abort(message: String) = {
      logger.error(this, message)
      actorSystem.terminate()
      Await.result(actorSystem.whenTerminated, 30.seconds)
      sys.exit(1)
    }

    if (!config.isValid) {
      abort("Bad configuration, cannot start.")
    }

    val msgProvider = SpiLoader.get[MessagingProvider]

    Seq(
      ("completed" + instance.asString, "completed", Some(ActivationEntityLimit.MAX_ACTIVATION_LIMIT)),
      ("health", "health", None),
      ("cacheInvalidation", "cache-invalidation", None),
      ("events", "events", None)).foreach {
      case (topic, topicConfigurationKey, maxMessageBytes) =>
        if (msgProvider.ensureTopic(config, topic, topicConfigurationKey, maxMessageBytes).isFailure) {
          abort(s"failure during msgProvider.ensureTopic for topic $topic")
        }
    }

    ExecManifest.initialize(config) match {
      case Success(_) =>
        val controller = new Controller(
          instance,
          ExecManifest.runtimesManifest,
          config,
          actorSystem,
          ActorMaterializer.create(actorSystem),
          logger)

        val httpsConfig =
          if (Controller.protocol == "https") Some(loadConfigOrThrow[HttpsConfig]("whisk.controller.https")) else None

        BasicHttpService.startHttpService(controller.route, port, httpsConfig, interface)(
          actorSystem,
          controller.materializer)

      case Failure(t) =>
        abort(s"Invalid runtimes manifest: $t")
    }
  }
}


text:
Contributing and getting help
=============================

Contributing
------------

Contributions are welcomed from anyone, including posting issues or
submitting pull requests to the `pyro github <https://github.com/python-hydro/pyro2>`_.

Users who make significant contributions will be listed as developers
in the pyro acknowledgements and be included in any future code
papers.

Issues
------

Creating an issue on github is a good way to request new features,
file a bug report, or notify us of any difficulties that arise using
pyro.

To request support using pyro, please create an issue on the pyro
github and the developers will be happy to assist you.

If you are reporting a bug, please indicate any information necessary
to reproduce the bug including your version of python.

Pull Requests
-------------

*Any contributions that have the potential to change answers should be
done via pull requests.* A pull request should be generated from your
fork of pyro and target the `master` branch.

The unit and regression tests will run automatically once the PR is
submitted, and then one of the pyro developers will review the PR and
if needed, suggest modifications prior to merging the PR.

If there are a number of small commits making up the PR, we may wish
to squash commits upon merge to have a clean history.  *Please ensure
that your PR title and first post are descriptive, since these will be
used for a squashed commit message.*

Mailing list
------------

There is a public mailing list for discussing pyro. Visit the
`pyro-code@googlegroups.com
<https://groups.google.com/forum/#!forum/pyro-code>`_ and
subscribe. You can then send questions to that list.


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

/** api: (define)
 *  module = Heron.widgets.search
 *  class = SearchCenterPanel
 *  base_link = `GeoExt.form.FormPanel <http://www.geoext.org/lib/GeoExt/widgets/form/FormPanel.html>`_
 */

/** api: example
 *  Sample code showing how to configure a Heron SearchCenterPanel.
 *  Note that the  config here contains both a Heron FormSearchPanel object (search form) and a Heron FeaturePanel
 *  (result panel). Other possible SearchPanels to use are: SpatialSearchPanel and  GXP_QueryPanel.
 *
 *  .. code-block:: javascript

     {
        xtype: 'hr_searchcenterpanel',
        id: 'hr-searchcenterpanel',
        title: __('Search'),

        hropts: {
            searchPanel: {
                xtype: 'hr_formsearchpanel',
                id: 'hr-formsearchpanel',
                header: false,
                bodyStyle: 'padding: 6px',
                style: {
                    fontFamily: 'Verdana, Arial, Helvetica, sans-serif',
                    fontSize: '12px'
                },
                protocol: new OpenLayers.Protocol.WFS({
                    version: "1.1.0",
                    url: "http://kademo.nl/gs2/wfs?",
                    srsName: "EPSG:28992",
                    featureType: "hockeyclubs",
                    featureNS: "http://innovatie.kadaster.nl"
                }),
                items: [
                    {
                        xtype: "textfield",
                        name: "name__like",
                        value: 'H.C*',
                        fieldLabel: "  name"
                    },
                    {
                        xtype: "label",
                        id: "helplabel",
                        html: 'Type name of an NL hockeyclub, use * as wildcard<br/>',
                        style: {
                            fontSize: '10px',
                            color: '#AAAAAA'
                        }
                    }
                ],
                hropts: {
                    onSearchCompleteZoom : 11
                }
            },
            resultPanel: {
                xtype: 'hr_featurepanel',
                id: 'hr-featurepanel',
                title: __('Search'),
                header: false,
                columns: [
                    {
                        header: "Name",
                        width: 100,
                        dataIndex: "name",
                        type: 'string'
                    },
                    {
                        header: "Desc",
                        width: 200,
                        dataIndex: "cmt",
                        type: 'string'
                    }
                ],
                 hropts: {
                      zoomOnRowDoubleClick : true,
                     zoomOnFeatureSelect : true,
                     zoomLevelPointSelect : 8
                 }

            }
        }
    }
 */

/** api: constructor
 *  .. class:: SearchCenterPanel(config)
 *
 *  A panel designed to hold a (geo-)search form plus results (features) in grid and on map.
 *  Combines both the FeaturePanel and SearchPanel widgets
 */
Heron.widgets.search.SearchCenterPanel = Ext.extend(Ext.Panel, {

	initComponent: function () {
		var self = this;

		// Define SearchPanel and lazily the ResultPanel in card layout.
		Ext.apply(this, {
			layout: 'card',
			activeItem: 0,
			bbar: [
				{
					text: __('< Search'),
					ref: '../prevButton',
					disabled: true,
					handler: function () {
						self.showSearchPanel(self);
					}
				},
				'->',
				{
					text: __('Result >'),
					ref: '../nextButton',
					disabled: true,
					handler: function () {
						self.showResultGridPanel(self);
					}
				}
			]
		});

		// Items may have been set by subclass
		if (!this.items) {
			this.items = [this.hropts.searchPanel];
		}

		// Cleanup.
		if (this.ownerCt) {
			// If we are contained in Window act on hide/show
			this.ownerCt.addListener("hide", this.onParentHide, this);
			this.ownerCt.addListener("show", this.onParentShow, this);

			// Setup our own events
			this.addEvents({
				"parenthide": true,
				"parentshow": true
			});
		}

		Heron.widgets.search.SearchCenterPanel.superclass.initComponent.call(this);

		this.addListener("afterrender", this.onRendered, this);
	},

	/***
	 * Display search form.
	 */
	showSearchPanel: function (self) {
		self.getLayout().setActiveItem(this.searchPanel);
		self.prevButton.disable();
		self.nextButton.disable();
        if (this.resultPanel && this.resultPanel.hasFeatures()) {
            self.nextButton.enable();
        }
	},

	/***
	 * Display result grid.
	 */
	showResultGridPanel: function (self) {
		self.getLayout().setActiveItem(this.resultPanel);
		self.prevButton.enable();
		self.nextButton.disable();
	},

	/***
	 * Callback when our Panel has been rendered.
	 */
	onRendered: function () {
		this.searchPanel = this.getComponent(0);
		if (this.searchPanel) {
			this.searchPanel.addListener('searchissued', this.onSearchIssued, this);
			this.searchPanel.addListener('searchsuccess', this.onSearchSuccess, this);
			this.searchPanel.addListener('searchcomplete', this.onSearchComplete, this);
            this.searchPanel.addListener('searchreset', this.onSearchReset, this);
		}
	},

	/***
	 * Callback from SearchPanel when search just issued.
	 */
	onSearchIssued: function (searchPanel) {
		this.showSearchPanel(this);
		this.nextButton.disable();
	},

	/***
	 * Callback from SearchPanel when search just issued.
	 */
	onSearchComplete: function (searchPanel) {
	},

    /***
   	 * Callback from SearchPanel when searchform reset.
   	 */
   	onSearchReset: function (searchPanel) {
        if (this.resultPanel) {
            this.resultPanel.removeFeatures();
        }
   	},

	/***
	 * Callback from SearchPanel on successful search.
	 */
	onSearchSuccess: function (searchPanel, result) {
		if (this.hropts.resultPanel.autoConfig && this.resultPanel) {
			this.resultPanel.cleanup();
			this.remove(this.resultPanel);
			this.resultPanel = null;
		}

        var features = result.olResponse.features;
		if (!this.resultPanel) {
			// Create Result Panel the first time
			// For autoConfig the features are used to setup grid columns
			this.hropts.resultPanel.features = features;
            this.hropts.resultPanel.downloadInfo = result.downloadInfo;
            this.hropts.resultPanel.featureType = searchPanel.getFeatureType();
			this.resultPanel = new Heron.widgets.search.FeaturePanel(this.hropts.resultPanel);

			// Will be item(1) in card layout
			this.add(this.resultPanel);
		}

		// Show result in card layout
		this.resultPanel.loadFeatures(features, searchPanel.getFeatureType());
		if (features && features.length > 0) {
			this.showResultGridPanel(this);
		}
	},

	/** private: method[onParentShow]
	 * Called usually before our panel is created.
	 */
	onParentShow: function () {
		if (this.resultPanel) {
			this.showSearchPanel(this);
		}
		this.fireEvent('parentshow');
	},

	/** private: method[onParentHide]
	 * Cleanup usually before our panel is hidden.
	 */
	onParentHide: function () {
		this.fireEvent('parenthide');
	}
});

/** api: xtype = hr_searchcenterpanel */
Ext.reg('hr_searchcenterpanel', Heron.widgets.search.SearchCenterPanel);

/** Compatibilty with pre 0.73. renamed Heron.widgets.FeatSelSearchPanel to Heron.widgets.search.SearchCenterPanel */
Ext.reg('hr_featselsearchpanel', Heron.widgets.search.SearchCenterPanel);


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Package fr.fablabmars.model.dao</title>
<meta name="date" content="2015-04-24">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
fr.fablabmars.model.dao

Packages that use fr.fablabmars.model.dao

Package
Description

fr.fablabmars.controler.formulaire

Package réunissant les classes permettant de contrôler des données provenant de formulaires

fr.fablabmars.model.dao

Package réunissant les classes responsables d'accéder à la BDD

Classes in fr.fablabmars.model.dao used by fr.fablabmars.controler.formulaire

Class and Description

DAO

Classe abstraite modélisant un objet d'accès aux données.

Classes in fr.fablabmars.model.dao used by fr.fablabmars.model.dao

Class and Description

DAO

Classe abstraite modélisant un objet d'accès aux données.

UtilisateurDAO

Objet d'accès aux données Utilisateur (MySQL)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
import { TestConfigModule } from "../../../../test/test-config.module";
import { BudgetsModule } from "../../budgets/budgets.module";
import { SharedModule } from "../../shared/shared.module";
import { ReportingModule } from "../reporting.module";

import { ReportsComponent } from "./reports.component";

describe("ReportsComponent", () => {
  let component: ReportsComponent;
  let fixture: ComponentFixture<ReportsComponent>;

  beforeEach(waitForAsync(() => {
    TestBed.configureTestingModule({
      imports: [TestConfigModule, SharedModule.forRoot(), ReportingModule]
      // declarations: [ ReportsComponent ]
    }).compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(ReportsComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it("should create", () => {
    expect(component).toBeTruthy();
  });
});


text:
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
using Microsoft.SharePoint.Client;
using System;
using System.Management.Automation;
using SharePointPnP.PowerShell.CmdletHelpAttributes;

namespace SharePointPnP.PowerShell.Commands
{
    [Cmdlet(VerbsCommon.Remove, "SPOField", SupportsShouldProcess = true)]
    [CmdletHelp("Removes a field from a list or a site",
        Category = CmdletHelpCategory.Fields)]
    public class RemoveField : SPOWebCmdlet
    {
        [Parameter(Mandatory = true, ValueFromPipeline = true, Position = 0)]
        public FieldPipeBind Identity = new FieldPipeBind();

        [Parameter(Mandatory = false, ValueFromPipeline = true, Position = 1)]
        public ListPipeBind List;

        [Parameter(Mandatory = false)]
        public SwitchParameter Force;

        protected override void ExecuteCmdlet()
        {
            if (List != null)
            {
                var list = List.GetList(SelectedWeb);

                var f = Identity.Field;
                if (list != null)
                {
                    if (f == null)
                    {
                        if (Identity.Id != Guid.Empty)
                        {
                            f = list.Fields.GetById(Identity.Id);
                        }
                        else if (!string.IsNullOrEmpty(Identity.Name))
                        {
                            f = list.Fields.GetByInternalNameOrTitle(Identity.Name);
                        }
                    }
                    ClientContext.Load(f);
                    ClientContext.ExecuteQueryRetry();
                    if (f != null && f.IsPropertyAvailable("InternalName"))
                    {
                        if (Force || ShouldContinue(string.Format(Properties.Resources.DeleteField0, f.InternalName), Properties.Resources.Confirm))
                        {
                            f.DeleteObject();
                            ClientContext.ExecuteQueryRetry();
                        }
                    }
                }
            }
            else
            {
                var f = Identity.Field;

                if (f == null)
                {
                    if (Identity.Id != Guid.Empty)
                    {
                        f = SelectedWeb.Fields.GetById(Identity.Id);
                    }
                    else if (!string.IsNullOrEmpty(Identity.Name))
                    {
                        f = SelectedWeb.Fields.GetByInternalNameOrTitle(Identity.Name);
                    }
                }
                ClientContext.Load(f);
                ClientContext.ExecuteQueryRetry();

                if (f != null && f.IsPropertyAvailable("InternalName"))
                {
                    if (Force || ShouldContinue(string.Format(Properties.Resources.DeleteField0, f.InternalName), Properties.Resources.Confirm))
                    {
                        f.DeleteObject();
                        ClientContext.ExecuteQueryRetry();
                    }
                }
            }
        }
    }

}


text:
package org.fastcatsearch.notification;

import org.fastcatsearch.env.Environment;
import org.fastcatsearch.module.AbstractModule;
import org.fastcatsearch.module.ModuleException;
import org.fastcatsearch.notification.message.Notification;
import org.fastcatsearch.settings.Settings;

public class EmailNotificationModule extends AbstractModule {

	public EmailNotificationModule(Environment environment, Settings settings) {
		super(environment, settings);
	}

	@Override
	protected boolean doLoad() throws ModuleException {
		return false;
	}

	@Override
	protected boolean doUnload() throws ModuleException {
		return false;
	}

	public void sendEmail(Notification notification){

	}
}


text:
#include "x3.h"
#include "x3common.h"

/* Globals for managing sync */

#define VERBOSE

#define kX3ViewClassID CFSTR("com.levien.x3.X3View")
#define kX3ViewPrivate 'X3_v'

/* Some utility-type functions. */

UInt32 x3mkmultichar(const char *s)
{
    int len = strlen(s);
    int i;
    UInt32 result = 0;

    for (i = 0; i < (len > 4 ? 4 : len); i++)
	result = (result << 8) + (unsigned char)s[i];
    for (; i < 4; i++)
	result = (result << 8) + ' ';
    return result;
}

char *x3multicharstr(UInt32 mc, char buf[5])
{
    int i, len;

    for (i = 0; i < 4; i++)
	if (((mc >> (8 * i)) & 0xff) != ' ') break;
    len = 4 - i;
    for (i = 0; i < len; i++)
	buf[i] = (mc >> (24 - 8 * i)) & 0xff;
    buf[len] = 0;
    return buf;
}

void x3widget_init(x3widget *w, const x3type *type)
{
    w->type = type;
    w->name = NULL;
    w->parent = NULL;
    w->var = x3carbonnone;
    w->u.window = NULL;
    w->n_children = 0;
    w->children = NULL;
}

static x3widget *x3widget_new_container(x3widget *parent, char *name,
					const x3type *type)
{
    x3widget *result = (x3widget *)malloc(sizeof(x3widget));
    x3widget_init(result, type);
    result->name = name ? strdup(name) : NULL;
    x3add(parent, result);
    x3qsizereq(result);
    return result;
}

static x3widget *x3widget_new_hiview(x3widget *parent, char *name,
				     const x3type *type,
				     HIViewRef hiview)
{
    x3widget *result = (x3widget *)malloc(sizeof(x3widget));
    x3widget_init(result, type);
    result->name = name ? strdup(name) : NULL;
    result->var = x3carbonhiview;
    result->u.hiview = hiview;
    x3add(parent, result);
    x3qsizereq(result);
    return result;
}

static x3widget *x3widget_new_menu(x3widget *parent,
				     const x3type *type,
				     MenuRef menu)
{
    x3widget *result = (x3widget *)malloc(sizeof(x3widget));
    x3widget_init(result, type);
    result->var = x3carbonmenu;
    result->u.menu = menu;
    x3add(parent, result);
    return result;
}

static x3widget *x3widget_new_menuitem(x3widget *parent,
					const x3type *type, int index)
{
    x3widget *result = (x3widget *)malloc(sizeof(x3widget));
    x3widget_init(result, type);
    x3add(parent, result);
    result->var = x3carbonmenuitem;
    result->u.menuitem = index;
    return result;
}

void x3init(int *pargc, char ***pargv)
{
    ProcessSerialNumber psn;

    /* Most apps get this done from loading the menu bar from the NIB.
       Prior to 10.3, there was an undocumented call. This one is official
       for 10.3 and later. */
    GetCurrentProcess(&psn);
    TransformProcessType(&psn, kProcessTransformToForegroundApplication);
    SetFrontProcess(&psn);

    x3initqs();
}

void x3main(void)
{
    x3sync();
    RunApplicationEventLoop();
}

void x3_window_show(x3widget *mainwin)
{
    ControlRef root;
#if 0
    TransitionWindow(mainwin->u.window, kWindowZoomTransitionEffect,
		     kWindowShowTransitionAction, NULL);
#endif

#if 0
    CreateRootControl(mainwin->u.window, &root);
#endif
    //RepositionWindow(mainwin->u.window, NULL, kWindowCascadeOnMainScreen);
    ShowWindow(mainwin->u.window);
    SelectWindow(mainwin->u.window);
}

static WindowRef x3window_of(x3widget *w)
{
    while (w->parent) w = w->parent;
    return w->var == x3carbonwindow ? w->u.window : NULL;
}

typedef struct {
    x3widget base;
    x3window_callback callback;
    void *callback_data;
} x3widget_window;

pascal OSStatus x3carbonWindowEventHandler(EventHandlerCallRef cr,
					   EventRef inEvent, void *data)
{
    x3widget_window *z = (x3widget_window *)data;
    OSStatus result = noErr;
    UInt32 eclass = GetEventClass(inEvent);
    UInt32 ekind = GetEventKind(inEvent);
    char multicharbuf[5];

    if (eclass == kEventClassCommand && ekind == kEventCommandProcess) {
	HICommand command;
	int status;

	GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand,
			  NULL, sizeof(HICommand), NULL, &command);
	status = z->callback(&z->base, z->callback_data,
			     x3multicharstr(command.commandID, multicharbuf),
			     "command", NULL, NULL);
	if (status == 1)
	    result = eventNotHandledErr;
    } else if (eclass = kEventClassWindow && ekind == kEventWindowBoundsChanged) {
	/* todo: only queue size request when size changes, not just pos */
	x3qsizereq(&z->base);
	x3sync();
    } else {
	printf("My handler is getting called %s %d!\n",
	       x3multicharstr(eclass, multicharbuf),
	       GetEventKind(inEvent));
    }
    result = eventNotHandledErr;
    return result;
}

void x3window_sizereq(x3widget *w)
{
}

void x3window_sizealloc(x3widget *w, x3rect *r)
{
    int i;
    Rect bounds;
    x3rect child_r;

    GetWindowBounds(w->u.window, kWindowContentRgn, &bounds);
    child_r.x0 = 0;
    child_r.x1 = bounds.right - bounds.left;
    child_r.y0 = 0;
    child_r.y1 = bounds.bottom - bounds.top;
    printf("x3window_sizealloc (%d, %d) - (%d, %d)\n",
	   bounds.left, bounds.top, bounds.right, bounds.bottom);
    for (i = 0; i < w->n_children; i++) {
	x3widget *child = w->children[i];
	if (child->type->sizealloc)
	    child->type->sizealloc(child, &child_r);
	child->flags &= ~x3flag_needsizealloc;
    }
}

x3type x3windowtype = { x3window_sizereq,
			x3window_sizealloc,
			x3add_default };

x3widget *x3window(x3windowflags flags, char *label,
		   x3window_callback callback, void *data)
{
    WindowRef window;
    Rect bounds = { 100, 100, 400, 600 };
    EventHandlerRef handlerRef;
    WindowAttributes attrs =
	kWindowCompositingAttribute |
	kWindowLiveResizeAttribute |
	kWindowInWindowMenuAttribute |
	kWindowFrameworkScaledAttribute |
	kWindowStandardHandlerAttribute;
    EventTypeSpec windowEvents[] = {
		{ kEventClassCommand,	kEventCommandProcess },
		//{ kEventClassCommand,	kEventCommandUpdateStatus },

		//{ kEventClassMouse,	kEventMouseDown },

		//{ kEventClassWindow,	kEventWindowClose },
		//{ kEventClassWindow,	kEventWindowGetIdealSize },
		{ kEventClassWindow,	kEventWindowBoundsChanged },
		//{ kEventClassWindow,	kEventWindowGetClickActivation },
		//{ kEventClassWindow,	kEventWindowContextualMenuSelect }
	};
    CFStringRef cflabel = CFStringCreateWithCString(NULL, label,
						    kCFStringEncodingUTF8);
    x3widget *result = (x3widget *)malloc(sizeof(x3widget_window));

    if (flags & x3window_main)
	attrs |= kWindowStandardDocumentAttributes;

    OSStatus err = CreateNewWindow(kDocumentWindowClass, attrs,
				   &bounds, &window);

    SetWindowTitleWithCFString(window, cflabel);
    CFRelease(cflabel);
    x3widget_init(result, &x3windowtype);
    result->var = x3carbonwindow;
    result->u.window = window;
    ((x3widget_window *)result)->callback = callback;
    ((x3widget_window *)result)->callback_data = data;

    InstallWindowEventHandler(window, NewEventHandlerUPP(x3carbonWindowEventHandler),
			      sizeof(windowEvents)/sizeof(EventTypeSpec),
			      windowEvents, result, &handlerRef);

    x3qshow(result);
    return result;
}

x3type x3menutype = { NULL, NULL, x3add_default };

x3widget *x3menu(x3widget *parent, char *name)
{
    static int id = 1; /* Note: menu id should probably be kept per-window */
    MenuRef menu;
    CFStringRef cflabel = CFStringCreateWithCString(NULL, name,
						    kCFStringEncodingUTF8);

    CreateNewMenu(id++, 0, &menu);
    SetMenuTitleWithCFString(menu, cflabel);
    CFRelease(cflabel);
    InsertMenu(menu, 0);
    return x3widget_new_menu(parent, &x3menutype, menu);
}

int x3parseshortcut(const char *shortcut, UInt16 *pkey, UInt8 *pmods)
{
    UInt16 key;
    UInt8 mods = kMenuNoCommandModifier;
    int i = 0;

    while (shortcut[i] == '<') {
	if (!strncmp(shortcut + i, "<cmd>", 5)) {
	    mods &= ~kMenuNoCommandModifier;
	    i += 5;
	} else if (!strncmp(shortcut + i, "<shift>", 7)) {
	    mods |= kMenuShiftModifier;
	    i += 7;
	} else if (!strncmp(shortcut + i, "<option>", 8)) {
	    mods |= kMenuOptionModifier;
	    i += 8;
	} else if (!strncmp(shortcut + i, "<ctrl>", 6)) {
	    mods |= kMenuControlModifier;
	    i += 6;
	} else
	    return false;
    }
    if (shortcut[i] && shortcut[i + 1] == 0) {
	key = shortcut[i];
	if (key >= 'a' && key <= 'z') key -= 'a' - 'A';
	else if (key >= 'A' && key <= 'Z') mods |= kMenuShiftModifier;
    } else
	return false;

    *pkey = key;
    *pmods = mods;
    return true;
}

x3type x3menuitemtype = { NULL, NULL, x3add_default };

x3widget *x3menuitem(x3widget *parent, char *name, char *cmd, char *shortcut)
{
    CFStringRef cflabel = CFStringCreateWithCString(NULL, name,
						    kCFStringEncodingUTF8);
    MenuItemIndex index;

    AppendMenuItemTextWithCFString(parent->u.menu, cflabel,
				   0,
				   x3mkmultichar(cmd), &index);
    if (shortcut) {
	UInt16 key;
	UInt8 mods;

	if (x3parseshortcut(shortcut, &key, &mods)) {
	    SetMenuItemCommandKey(parent->u.menu, index, false, key);
	    SetMenuItemModifiers(parent->u.menu, index, mods);
	}
    }
    CFRelease(cflabel);
    return x3widget_new_menuitem(parent, &x3menuitemtype, index);
}

x3widget *x3menusep(x3widget *parent)
{
    Str255 str = {1, '-'};

    AppendMenu(parent->u.menu, str);
    return x3widget_new_menuitem(parent, &x3menuitemtype, -1);
}

void x3button_sizereq(x3widget *w)
{
    SInt16 offset;
    Rect r = { 0, 0, 0, 0 };

    GetBestControlRect(w->u.hiview, &r, &offset);
    w->sizerequest.x0 = r.left;
    w->sizerequest.y0 = r.top;
    w->sizerequest.x1 = r.right;
    w->sizerequest.y1 = r.bottom;
#ifdef VERBOSE
    printf("button sizereq = (%g, %g) - (%g, %g)\n",
	   w->sizerequest.x0, w->sizerequest.y0,
	   w->sizerequest.x1, w->sizerequest.y1);
#endif
}

void x3button_sizealloc(x3widget *w, x3rect *r)
{
    Rect bounds;

    bounds.left = r->x0;
    bounds.top = r->y0;
    bounds.right = r->x1;
    bounds.bottom = r->y1;
    /* TODO probably want to use HIViewSetFrame instead */
    printf("button sizealloc = (%g, %g) - (%g, %g)\n",
	   r->x0, r->y0, r->x1, r->y1);
    SetControlBounds(w->u.hiview, &bounds);
}

x3type x3buttontype = { x3button_sizereq,
			x3button_sizealloc,
			x3add_default };

x3widget *x3button(x3widget *parent, char *cmd, char *label)
{
    WindowRef window = x3window_of(parent);
    Rect r = {10, 10, 30, 100};
    ControlRef control;
    OSStatus err;
    CFStringRef cflabel = CFStringCreateWithCString(NULL, label,
						    kCFStringEncodingUTF8);

    err = CreatePushButtonControl(window, &r, cflabel, &control);
    CFRelease(cflabel);
    SetControlCommandID(control, x3mkmultichar(cmd));
    //SetWindowDefaultButton(window, control);
    return x3widget_new_hiview(parent, cmd, &x3buttontype, control);
}

x3widget *x3label(x3widget *parent, char *text)
{
    WindowRef window = x3window_of(parent);
    Rect r = {10, 10, 30, 100};
    ControlRef control;
    OSStatus err;
    Boolean singleline = true;
    CFStringRef cftext = CFStringCreateWithCString(NULL, text,
						    kCFStringEncodingUTF8);

    err = CreateStaticTextControl(window, &r, cftext,
				  NULL, &control);
    CFRelease(cftext);
#if 0
    SetControlData(control, kControlEntireControl,
		   kControlEditTextSingleLineTag, sizeof(Boolean),
		   &singleline);
#endif
    return x3widget_new_hiview(parent, NULL, &x3buttontype, control);
}

x3widget *x3edittext(x3widget *parent, char *cmd)
{
    WindowRef window = x3window_of(parent);
    Rect r = {10, 10, 30, 100};
    ControlRef control;
    OSStatus err;
    Boolean singleline = true;

    err = CreateEditUnicodeTextControl(window, &r, CFSTR(""),
				  false, NULL, &control);
    SetControlCommandID(control, x3mkmultichar(cmd));
#if 0
    SetControlData(control, kControlEntireControl,
		   kControlEditTextSingleLineTag, sizeof(Boolean),
		   &singleline);
#endif
    return x3widget_new_hiview(parent, cmd, &x3buttontype, control);
}

x3widget *x3hpane(x3widget *parent)
{
    return NULL;
}

x3widget *x3vpane(x3widget *parent)
{
    return NULL;
}

typedef struct
{
    HIViewRef view;
    x3viewflags flags;
    x3viewclient *vc;
} x3view_data;

static OSStatus
x3view_construct(EventRef inEvent)
{
    OSStatus err;
    x3view_data *data;

    data = (x3view_data *)malloc(sizeof(x3view_data));
    require_action(data != NULL, CantMalloc, err = memFullErr);
    err = GetEventParameter(inEvent, kEventParamHIObjectInstance,
			    typeHIObjectRef, NULL, sizeof(HIObjectRef), NULL,
			    (HIObjectRef *)&data->view);
    require_noerr(err, ParameterMissing);
    err = SetEventParameter(inEvent, kEventParamHIObjectInstance,
			    typeVoidPtr, sizeof(x3view_data *), &data);

    data->vc = NULL;

 ParameterMissing:
    if (err != noErr)
	free(data);

 CantMalloc:
    return err;
}

static OSStatus
x3view_destruct(EventRef inEvent, x3view_data *inData)
{
    free(inData);
    return noErr;
}

static OSStatus
x3view_initialize(EventHandlerCallRef inCallRef, EventRef inEvent,
		  x3view_data *inData)
{
    OSStatus err;
    HIRect bounds;

    err = CallNextEventHandler(inCallRef, inEvent);
    require_noerr(err, TroubleInSuperClass);

    err = GetEventParameter(inEvent, 'Boun', typeHIRect,
			    NULL, sizeof(HIRect), NULL, &bounds);
    require_noerr(err, ParameterMissing);

    HIViewSetFrame(inData->view, &bounds);

 ParameterMissing:
 TroubleInSuperClass:
    return err;
}

static OSStatus
x3view_draw(EventRef inEvent, x3view_data *inData)
{
    OSStatus err;
    CGContextRef ctx;

    err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef,
			    NULL, sizeof(CGContextRef), NULL, &ctx);
    require_noerr(err, ParameterMissing);

#ifdef VERBOSE
    printf("x3view_draw!\n");
#endif

    if (inData->vc && inData->vc->draw) {
	x3dc dc;

	/* set up bounds */
	if (inData->flags & x3view_2d) {
	    dc.ctx = ctx;
	    dc.path = NULL;
	    dc.buf = NULL;

	    inData->vc->draw(inData->vc, &dc);
	    if (dc.path) {
		CGPathRelease(dc.path);
	    }
	} else if (inData->flags & x3view_rgb) {
	    /* todo */
	}
    }

 ParameterMissing:
    return err;
}

static OSStatus
x3view_get_data(EventRef inEvent, x3view_data *inData)
{
    OSStatus err;
    OSType tag;
    Ptr ptr;
    Size outSize;

    /* Probably could use a bit more error checking here, for type
       and size match. Also, just returning an x3view_data seems a
       little hacky. */
    err = GetEventParameter(inEvent, kEventParamControlDataTag, typeEnumeration,
			    NULL, sizeof(OSType), NULL, &tag);
    require_noerr(err, ParameterMissing);

    err = GetEventParameter(inEvent, kEventParamControlDataBuffer, typePtr,
			    NULL, sizeof(Ptr), NULL, &ptr);

    if (tag == kX3ViewPrivate) {
	*((x3view_data **)ptr) = inData;
	outSize = sizeof(x3view_data *);
    } else
	err = errDataNotSupported;

    if (err == noErr)
	err = SetEventParameter(inEvent, kEventParamControlDataBufferSize, typeLongInteger,
				sizeof(Size), &outSize);

 ParameterMissing:
    return err;
}

static OSStatus
x3view_set_data(EventRef inEvent, x3view_data *inData)
{
    OSStatus err;
    Ptr ptr;
    OSType tag;

    err = GetEventParameter(inEvent, kEventParamControlDataTag, typeEnumeration,
			    NULL, sizeof(OSType), NULL, &tag);
    require_noerr(err, ParameterMissing);

    err = GetEventParameter(inEvent, kEventParamControlDataBuffer, typePtr,
			    NULL, sizeof(Ptr), NULL, &ptr);
    require_noerr(err, ParameterMissing);

    if (tag == 'X3vc') {
	inData->vc = *(x3viewclient **)ptr;
    } else if (tag == 'X3vf') {
	inData->flags = *(x3viewflags *)ptr;
    } else
	err = errDataNotSupported;

 ParameterMissing:
    return err;
}

static OSStatus
x3view_hittest(EventRef inEvent, x3view_data *inData)
{
    OSStatus err;
    HIPoint where;
    HIRect bounds;
    ControlPartCode part;

    err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint,
			    NULL, sizeof(HIPoint), NULL, &where);
    require_noerr(err, ParameterMissing);

    err = HIViewGetBounds(inData->view, &bounds);
    require_noerr(err, ParameterMissing);

    if (CGRectContainsPoint(bounds, where))
	part = 1;
    else
	part = kControlNoPart;
    err = SetEventParameter(inEvent, kEventParamControlPart,
			    typeControlPartCode, sizeof(ControlPartCode),
			    &part);
    printf("hittest %g, %g!\n", where.x, where.y);

 ParameterMissing:
    return err;
}

/*
  If we need more sophisticated tracking (like mixing key events), there's
  a good discussion here:
  http://lists.apple.com/archives/Carbon-development/2001/Apr/msg01688.html
*/
static OSStatus
x3view_track(EventRef inEvent, x3view_data *inData)
{
    OSStatus err;
    HIPoint where;
    MouseTrackingResult mouseStatus;
    HIRect bounds;
    Rect windBounds;
    Point theQDPoint;
    UInt32 mods;

    err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint,
			    NULL, sizeof(HIPoint), NULL, &where);
    require_noerr(err, ParameterMissing);

    err = GetEventParameter(inEvent, kEventParamKeyModifiers, typeUInt32,
			    NULL, sizeof(UInt32), NULL, &mods);
    require_noerr(err, ParameterMissing);

    err = HIViewGetBounds(inData->view, &bounds);
    require_noerr(err, ParameterMissing);

    GetWindowBounds(GetControlOwner(inData->view), kWindowStructureRgn, &windBounds);

    if (inData->vc && inData->vc->mouse)
	inData->vc->mouse(inData->vc, 1, mods, where.x, where.y);

#ifdef VERBOSE
    printf("press: %g, %g!\n", where.x, where.y);
#endif
    //pe_view_button_press(inData, where.x, where.y, 0);

    mouseStatus = kMouseTrackingMouseDown;
    while (mouseStatus != kMouseTrackingMouseUp) {
	TrackMouseLocation(NULL, &theQDPoint, &mouseStatus);
	where.x = theQDPoint.h - windBounds.left;
	where.y = theQDPoint.v - windBounds.top;
	HIViewConvertPoint(&where, NULL, inData->view);
#ifdef VERBOSE
	printf("track %d: %g, %g!\n", mouseStatus, where.x, where.y);
#endif
	if (mouseStatus == kMouseTrackingMouseUp) {
	    if (inData->vc && inData->vc->mouse)
		inData->vc->mouse(inData->vc, -1, mods, where.x, where.y);
	} else if (mouseStatus == kMouseTrackingKeyModifiersChanged) {
	    mods = GetCurrentEventKeyModifiers();
	    if (inData->vc && inData->vc->mouse)
		inData->vc->mouse(inData->vc, 0, mods, where.x, where.y);
	} else {
	    if (inData->vc && inData->vc->mouse)
		inData->vc->mouse(inData->vc, 0, mods, where.x, where.y);
	}
    }

 ParameterMissing:
    return err;
}

pascal OSStatus
x3view_handler(EventHandlerCallRef inCallRef,
		EventRef inEvent,
		void* inUserData )
{
    OSStatus err = eventNotHandledErr;
    UInt32 eventClass = GetEventClass(inEvent);
    UInt32 eventKind = GetEventKind(inEvent);
    x3view_data *data = (x3view_data *)inUserData;

    printf("view handler %c%c%c%c %d\n",
	   (eventClass >> 24) & 0xff,
	   (eventClass >> 16) & 0xff,
	   (eventClass >> 8) & 0xff,
	   (eventClass >> 0) & 0xff,
	   eventKind);
    switch (eventClass) {
    case kEventClassHIObject:
	switch (eventKind) {
	case kEventHIObjectConstruct:
	    err = x3view_construct(inEvent);
	    break;
	case kEventHIObjectInitialize:
	    err = x3view_initialize(inCallRef, inEvent, data);
	    break;
	case kEventHIObjectDestruct:
	    err = x3view_destruct(inEvent, data);
	    break;
	}
	break;
    case kEventClassControl:
	switch (eventKind) {
	case kEventControlInitialize:
	    err = noErr;
	    break;
	case kEventControlDraw:
	    err = x3view_draw(inEvent, data);
	    break;
	case kEventControlGetData:
	    err = x3view_get_data(inEvent, data);
	    break;
	case kEventControlSetData:
	    err = x3view_set_data(inEvent, data);
	    break;
	case kEventControlTrack:
	    err = x3view_track(inEvent, data);
	    break;
	case kEventControlHitTest:
	    err = x3view_hittest(inEvent, data);
	    break;
	case kEventControlClick:
	    printf("click event\n");
	    break;
	    /*...*/
	}
	break;
    }
    return err;
}

static OSStatus
x3view_register(void)
{
    OSStatus err = noErr;
    static HIObjectClassRef x3view_ClassRef = NULL;

    if (x3view_ClassRef == NULL) {
	EventTypeSpec eventList[] = {
	    { kEventClassHIObject, kEventHIObjectConstruct },
	    { kEventClassHIObject, kEventHIObjectInitialize },
	    { kEventClassHIObject, kEventHIObjectDestruct },

	    { kEventClassControl, kEventControlActivate },
	    { kEventClassControl, kEventControlDeactivate },
	    { kEventClassControl, kEventControlDraw },
	    { kEventClassControl, kEventControlHiliteChanged },
	    { kEventClassControl, kEventControlHitTest },
	    { kEventClassControl, kEventControlInitialize },
	    { kEventClassControl, kEventControlGetData },
	    { kEventClassControl, kEventControlSetData },
	    { kEventClassControl, kEventControlTrack },
	    { kEventClassControl, kEventControlClick }
	};
	err = HIObjectRegisterSubclass(kX3ViewClassID,
				       kHIViewClassID,
				       0,
				       x3view_handler,
				       GetEventTypeCount(eventList),
				       eventList,
				       NULL,
				       &x3view_ClassRef);
    }
    return err;
}

OSStatus x3view_create(
	WindowRef		inWindow,
	const HIRect*		inBounds,
	HIViewRef*		outView)
{
    OSStatus err;
    EventRef event;

    err = x3view_register();
    require_noerr(err, CantRegister);

    err = CreateEvent(NULL, kEventClassHIObject, kEventHIObjectInitialize,
		      GetCurrentEventTime(), 0, &event);
    require_noerr(err, CantCreateEvent);

    if (inBounds != NULL) {
	err = SetEventParameter(event, 'Boun', typeHIRect, sizeof(HIRect),
				inBounds);
	require_noerr(err, CantSetParameter);
    }

    err = HIObjectCreate(kX3ViewClassID, event, (HIObjectRef*)outView);
    require_noerr(err, CantCreate);

    if (inWindow != NULL) {
	HIViewRef root;
	err = GetRootControl(inWindow, &root);
	require_noerr(err, CantGetRootView);
	err = HIViewAddSubview(root, *outView);
    }
 CantCreate:
 CantGetRootView:
 CantSetParameter:
 CantCreateEvent:
    ReleaseEvent(event);
 CantRegister:
    return err;
}

x3widget *x3view(x3widget *parent, x3viewflags flags, x3viewclient *vc)
{
    WindowRef window = x3window_of(parent);
    HIRect r = { {10, 10}, {30, 100} };
    OSStatus err;
    HIViewRef view;

    err = x3view_create(window, &r, &view);
    err = SetControlData(view, 1, 'X3vc', sizeof(x3view_data *), &vc);
    err = SetControlData(view, 1, 'X3vf', sizeof(x3viewflags), &flags);
    HIViewSetVisible(view, true);
    return x3widget_new_hiview(parent, NULL, &x3buttontype, view);
}

void
x3view_dirty(x3widget *w)
{
    if (w->var == x3carbonhiview)
	HIViewSetNeedsDisplay(w->u.hiview, true);
}

void x3view_scrollto(x3widget *w, int x, int y, int width, int height)
{
    /* todo */
}

void x3viewclient_init(x3viewclient *vc)
{
    vc->destroy = NULL;
    vc->mouse = NULL;
    vc->key = NULL;
    vc->draw = NULL;
}

/* Functions for manipulating widget state - some fairly polymorphic. */

void x3setactive(x3widget *w, int active)
{
    if (w->var == x3carbonmenuitem) {
	MenuRef menu = w->parent->u.menu;
	if (active)
	    EnableMenuItem(menu, w->u.menuitem);
	else
	    DisableMenuItem(menu, w->u.menuitem);
	/* According to Carbon docs, we need to redraw menu. */
    } else if (w->var == x3carbonhiview) {
	if (active)
	    ActivateControl(w->u.hiview);
	else
	    DeactivateControl(w->u.hiview);
    }
}

int x3hasfocus(x3widget *w)
{
    if (w->var == x3carbonhiview) {
	return HIViewSubtreeContainsFocus(w->u.hiview);
    } else
	return 0;
}

/* 2d drawing functions, implemented using Quartz */

void
x3moveto(x3dc *dc, double x, double y)
{
    if (dc->path == NULL) {
	dc->path = CGPathCreateMutable();
    }
    CGPathMoveToPoint(dc->path, NULL, x, y);
}

void
x3lineto(x3dc *dc, double x, double y)
{
    CGPathAddLineToPoint(dc->path, NULL, x, y);
}

void
x3curveto(x3dc *dc,
	  double x1, double y1,
	  double x2, double y2,
	  double x3, double y3)
{
    CGPathAddCurveToPoint(dc->path, NULL, x1, y1, x2, y2, x3, y3);
}

void
x3closepath(x3dc *dc)
{
    CGPathCloseSubpath(dc->path);
}

void
x3rectangle(x3dc *dc, double x, double y, double width, double height)
{
    CGRect rect;

    if (dc->path == NULL) {
	dc->path = CGPathCreateMutable();
    }
    rect.origin.x = x;
    rect.origin.y = y;
    rect.size.width = width;
    rect.size.height = height;
    CGPathAddRect(dc->path, NULL, rect);
}

void
x3getcurrentpoint(x3dc *dc, double *px, double *py)
{
    CGPoint point = CGPathGetCurrentPoint(dc->path);

    *px = point.x;
    *py = point.y;
}

void
x3setrgba(x3dc *dc, unsigned int rgba)
{
    CGContextSetRGBFillColor(dc->ctx,
			     ((rgba >> 24) & 0xff) * (1.0/255),
			     ((rgba >> 16) & 0xff) * (1.0/255),
			     ((rgba >> 8) & 0xff) * (1.0/255),
			     (rgba & 0xff) * (1.0/255));
    CGContextSetRGBStrokeColor(dc->ctx,
			       ((rgba >> 24) & 0xff) * (1.0/255),
			       ((rgba >> 16) & 0xff) * (1.0/255),
			       ((rgba >> 8) & 0xff) * (1.0/255),
			       (rgba & 0xff) * (1.0/255));
}

void
x3setlinewidth(x3dc *dc, double w)
{
    CGContextSetLineWidth(dc->ctx, w);
}

void
x3fill(x3dc *dc)
{
    CGContextAddPath(dc->ctx, dc->path);
    CGPathRelease(dc->path);
    dc->path = NULL;
    CGContextFillPath(dc->ctx);
}

void
x3stroke(x3dc *dc)
{
    CGContextAddPath(dc->ctx, dc->path);
    CGPathRelease(dc->path);
    dc->path = NULL;
    CGContextStrokePath(dc->ctx);
}

void
x3selectfont(x3dc *dc, char *fontname, int slant, int weight)
{
    CGContextSelectFont(dc->ctx, fontname, 8.0, kCGEncodingMacRoman);
}

void
x3setfontsize(x3dc *dc, double size)
{
    CGContextSetFontSize(dc->ctx, size);
}

void
x3showtext(x3dc *dc, char *text)
{
    CGPoint point = CGPathGetCurrentPoint(dc->path);
    CGAffineTransform textmat;

    textmat = CGAffineTransformMakeScale(1, -1);
    CGContextSetTextMatrix(dc->ctx, textmat);
    CGContextShowTextAtPoint(dc->ctx, point.x, point.y, text, strlen(text));
}

void x3textextents(x3dc *dc, char *text, x3extents *extents)
{
    /* todo */
}


text:
<?php
/**
*	Developed and Maintained By: USPF ICT Systems Development Team
*		Sr. Developer: Boi Archievald Ranay
*		Jr. Developer: John Andrie Pareja
* 	Yr: 2016
*/

/**
*	This Class is used for logging Processes/Actions/Warnings/Errors
*
*	To Configure:
*		Please check the app_config.php to configure the log file dir
*
*   To initialize this class:
*			NOTE: include first the app_config.php before including this class
*				It will Generate Errors!
*
*		include(\file\dicectory\Logger.php);
*
*	To use the functions:
*
*		Logger::Info($ErrorMessage);
*
*		echo Logger::Info($ErrorMessage, true);
*/
class Logger {

	/**
	*	Log Level Discriptions
	*
	*/
	const LL = array(
		0 => 'EMERGENCY', 	// system is unusable
		1 => 'ALERT',		// action must be taken immediately
		2 => 'CRITICAL',	// critical conditions
		3 => 'ERROR',		// error conditions
		4 => 'WARNING',		// warning conditions
		5 => 'NOTICE',		// normal but significant condition
		6 => 'INFO',		// informational messages
		7 => 'DEBUG'		// debug-level messages
	);

	/**
	*	Gets the Log Level returns false if parameter is not
	*	an integer
	*
	*	@param int $level
	*
	*	@return string LogLevel
	*/
	private function getLogLevel($level) {

		return (is_integer($level)) ? self::LL[$level] : false;

	}

	/**
	*	Appends to an existing log file; and if no file found
	*	it will create a new empty Log File.
	*
	*	@param int		$loglevel
	*	@param string   $ErrorMessage
	*	@param date		$date = ''
	*/
	private function LogThis($LogLevel, $ErrorMessage, $date = '') {

		$date = (empty($date)) ? "[".date("Y-d-m h:m:s")."]" : "[".$date."]";

		$FileHandl = fopen(LOG_DIR.LOG_FILE, 'a');

		$level = "[".self::getLogLevel($LogLevel)."]";

		$dataToInsert = $date.$level.": ".$ErrorMessage.PHP_EOL;

		fwrite($FileHandl,$dataToInsert);

		fclose($FileHandl);
	}

	/**
	* 	Appends to an existing log file then returns
	*	the log Massage
	*
	*	@param int $loglevel
	*	@param string $ErrorMessage
	*
	*	@return string
	*/
	private function LogAndGet($LogLevel, $ErrorMessage) {

		self::LogThis($LogLevel, $ErrorMessage);

		$data = "[".self::getLogLevel($LogLevel)."] ". $ErrorMessage;

		return $data;

	}

	/**
	* 	Public Methods
	*/

	/**
	* 	Sends or returns an Debug Log
	*
	*	@param string $message
	*	@param boolean $print = true
	*/
	public static function Debug($message, $print = false) {

		if(is_bool($print)) {

			if(!$print) {

				self::LogThis(7,$message);

			} else {

				return self::LogAndGet(7,$message);
			}
		}

	}

	public static function Info($message, $print = false) {

		if(is_bool($print)) {

			if(!$print) {

				self::LogThis(6,$message);

			} else {

				return self::LogAndGet(6,$message);
			}
		}

	}

	public static function Notice($message, $print = false) {

		if(is_bool($print)) {

			if(!$print) {

				self::LogThis(5,$message);

			} else {

				return self::LogAndGet(5,$message);
			}
		}

	}

	public static function Warning($message, $print = false) {

		if(is_bool($print)) {

			if(!$print) {

				self::LogThis(4,$message);

			} else {

				return self::LogAndGet(4,$message);
			}
		}

	}

	public static function Error($message, $print = false) {

		if(is_bool($print)) {

			if(!$print) {

				self::LogThis(3,$message);

			} else {

				return self::LogAndGet(3,$message);
			}
		}

	}

	public static function Critical($message, $print = false) {

		if(is_bool($print)) {

			if(!$print) {

				self::LogThis(2,$message);

			} else {

				return self::LogAndGet(2,$message);
			}
		}

	}

	public static function Alert($message, $print = false) {

		if(is_bool($print)) {

			if(!$print) {

				self::LogThis(1,$message);

			} else {

				return self::LogAndGet(1,$message);
			}
		}
	}

	public static function Emergency($message, $print = false) {

		if(is_bool($print)) {

			if(!$print) {

				self::LogThis(0,$message);

			} else {

				return self::LogAndGet(0,$message);
			}
		}
	}

}

// checking file if not exists
if(!file_exists(LOG_DIR.LOG_FILE)) {

	$FileHandl = fopen(LOG_DIR.LOG_FILE, 'w+');

	$write = "/* --------------------------------------------------------------------------".PHP_EOL.
			 "/* THE PREVIOUS LOG FILE CANNOT BE FOUND: EITHER DELETED OR NOT YET GENERATED".PHP_EOL.
			 "/* THIS LOG FILE WAS GENERATED ON: [".date("m-d-Y h:m:s")."]".PHP_EOL.
			 "/* --------------------------------------------------------------------------".PHP_EOL;

	fwrite($FileHandl, $write);

	fclose($FileHandl);

}

?>


text:
import sys
import os

from importlib.abc import Loader, MetaPathFinder
from importlib.machinery import ModuleSpec

if sys.version_info >= (3, 5):
    from importlib import _bootstrap_external
else:
    from importlib import _bootstrap as _bootstrap_external

sys.platform = "android"

class AndroidExtensionFinder(MetaPathFinder):
    @classmethod
    def find_spec(cls, fullname, path=None, target=None):
        soname = 'libpy.' + fullname + '.so'
        path = os.path.join(sys._native_library_dir, soname)

        if os.path.exists(path):
            loader = _bootstrap_external.ExtensionFileLoader(fullname, path)
            return ModuleSpec(fullname, loader, origin=path)

def main():
    """Adds the site-packages directory to the sys.path.
    Also, registers the import hook for extension modules."""

    sys.path.append('{0}/lib/python{1}.{2}/site-packages'.format(sys.prefix, *sys.version_info))
    sys.meta_path.append(AndroidExtensionFinder)

if not sys.flags.no_site:
    main()


text:
"""Utilities for XLA-specific Python types."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import collections

import numpy as _np  # Avoids becoming a part of public Tensorflow API.

from tensorflow.compiler.xla import xla_data_pb2
from tensorflow.python.framework import dtypes

# Records correspondence between a XLA primitive type and Python/Numpy types.
#
# primitive_type: value of type xla_data_pb2.PrimitiveType
# numpy_dtype: corresponding Numpy "dtype" (like np.float32)
# literal_field_name: name of the field in the LiteralProto message elements
# of this type go into.
# literal_field_type: type of the field named 'literal_field_name'.
#
# TODO(eliben): figure out how to avoid knowing the extra Python type and the
# astype cast when writing into Literals.
TypeConversionRecord = collections.namedtuple('TypeConversionRecord', [
    'primitive_type', 'numpy_dtype', 'literal_field_name', 'literal_field_type'
])

# Maps from XLA primitive types to TypeConversionRecord.
MAP_XLA_TYPE_TO_RECORD = {
    xla_data_pb2.BF16:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.BF16,
            numpy_dtype=dtypes.bfloat16.as_numpy_dtype,
            literal_field_name='bf16s',
            literal_field_type=float),
    xla_data_pb2.F16:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.F16,
            numpy_dtype=_np.float16,
            literal_field_name='f16s',
            literal_field_type=float),
    xla_data_pb2.F32:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.F32,
            numpy_dtype=_np.float32,
            literal_field_name='f32s',
            literal_field_type=float),
    xla_data_pb2.F64:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.F64,
            numpy_dtype=_np.float64,
            literal_field_name='f64s',
            literal_field_type=float),
    xla_data_pb2.S8:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.S8,
            numpy_dtype=_np.int8,
            literal_field_name='s8s',
            literal_field_type=int),
    xla_data_pb2.S16:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.S16,
            numpy_dtype=_np.int16,
            literal_field_name='s16s',
            literal_field_type=int),
    xla_data_pb2.S32:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.S32,
            numpy_dtype=_np.int32,
            literal_field_name='s32s',
            literal_field_type=int),
    xla_data_pb2.S64:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.S64,
            numpy_dtype=_np.int64,
            literal_field_name='s64s',
            literal_field_type=int),
    xla_data_pb2.U8:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.U8,
            numpy_dtype=_np.uint8,
            literal_field_name='s8s',
            literal_field_type=int),
    xla_data_pb2.U16:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.U16,
            numpy_dtype=_np.uint16,
            literal_field_name='s16s',
            literal_field_type=int),
    xla_data_pb2.U32:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.U32,
            numpy_dtype=_np.uint32,
            literal_field_name='s32s',
            literal_field_type=int),
    xla_data_pb2.U64:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.U64,
            numpy_dtype=_np.uint64,
            literal_field_name='s64s',
            literal_field_type=int),
    xla_data_pb2.PRED:
        TypeConversionRecord(
            primitive_type=xla_data_pb2.PRED,
            numpy_dtype=_np.bool,
            literal_field_name='preds',
            literal_field_type=bool)
}

# Maps from Numpy dtypes to TypeConversionRecord.
# Note the conversion on the key. Numpy has a known issue wherein dtype hashing
# doesn't work as expected (https://github.com/numpy/numpy/issues/7242). Thus,
# when keying by dtype in this dict, we use the string form of dtypes.
MAP_DTYPE_TO_RECORD = {
    str(_np.dtype(record.numpy_dtype)): record
    for record in MAP_XLA_TYPE_TO_RECORD.values()
}


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

  <parent>
    <groupId>jetbrains.jetpad</groupId>
    <artifactId>dependencies</artifactId>
    <version>1.1-SNAPSHOT</version>
    <relativePath>dependencies/pom.xml</relativePath>
  </parent>

  <groupId>jetbrains.jetpad.mapper</groupId>
  <artifactId>container</artifactId>
  <version>1.1-SNAPSHOT</version>
  <packaging>pom</packaging>

  <modules>
    <module>dependencies</module>

    <module>mapper</module>
    <module>model</module>
    <module>model-gwt</module>
    <module>gwt-util</module>

    <module>util/test</module>
    <module>util/base</module>
    <module>util/values</module>
    <module>util/json</module>
    <module>util/geometry</module>

    <module>samples/todo</module>
  </modules>

  <build>
    <resources>
      <resource>
        <directory>src/main/java</directory>
        <includes>
          <include>**/*.java</include>
          <include>**/*.gwt.xml</include>
        </includes>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>javancss-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>javancss-maven-plugin</artifactId>
        <version>${javancss.version}</version>
      </plugin>
    </plugins>
  </reporting>

  <distributionManagement>
    <repository>
      <id>repository.jetbrains.com</id>
      <name>repository.jetbrains.com-releases</name>
      <url>http://repository.jetbrains.com/jetpad</url>
    </repository>
    <snapshotRepository>
      <id>repository.jetbrains.com</id>
      <name>repository.jetbrains.com-snapshots</name>
      <url>http://repository.jetbrains.com/jetpad</url>
    </snapshotRepository>
  </distributionManagement>

  <scm>
    <developerConnection>scm:git:https://github.com/JetBrains/jetpad-mapper.git</developerConnection>
    <tag>HEAD</tag>
  </scm>

</project>


text:
package com.hpe.caf.util.rabbitmq;

import com.rabbitmq.client.Envelope;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;

public class DefaultRabbitConsumerTest
{
    @Test
    public void testProcessDelivery()
        throws InterruptedException, IOException
    {
        BlockingQueue<Event<QueueConsumer>> events = new LinkedBlockingQueue<>();
        CountDownLatch latch = new CountDownLatch(1);
        TestQueueConsumerImpl impl = new TestQueueConsumerImpl(latch);
        DefaultRabbitConsumer con = new DefaultRabbitConsumer(events, impl);
        new Thread(con).start();
        long tag = 100L;
        byte[] body = "data".getBytes(StandardCharsets.UTF_8);
        Envelope env = Mockito.mock(Envelope.class);
        Mockito.when(env.getDeliveryTag()).thenReturn(tag);
        events.offer(new ConsumerDeliverEvent(new Delivery(env, body)));
        Assert.assertTrue(latch.await(DefaultRabbitConsumer.POLL_PERIOD, TimeUnit.MILLISECONDS));
        Assert.assertArrayEquals(body, impl.getLastDelivery().getMessageData());
    }

    @Test
    public void testProcessAck()
        throws InterruptedException
    {
        BlockingQueue<Event<QueueConsumer>> events = new LinkedBlockingQueue<>();
        CountDownLatch latch = new CountDownLatch(1);
        TestQueueConsumerImpl impl = new TestQueueConsumerImpl(latch);
        DefaultRabbitConsumer con = new DefaultRabbitConsumer(events, impl);
        new Thread(con).start();
        long tag = 100L;
        events.offer(new ConsumerAckEvent(tag));
        Assert.assertTrue(latch.await(DefaultRabbitConsumer.POLL_PERIOD, TimeUnit.MILLISECONDS));
        Assert.assertEquals(tag, impl.getLastTag());
    }

    @Test
    public void testProcessReject()
        throws InterruptedException
    {
        BlockingQueue<Event<QueueConsumer>> events = new LinkedBlockingQueue<>();
        CountDownLatch latch = new CountDownLatch(1);
        TestQueueConsumerImpl impl = new TestQueueConsumerImpl(latch);
        DefaultRabbitConsumer con = new DefaultRabbitConsumer(events, impl);
        new Thread(con).start();
        long tag = 100L;
        events.offer(new ConsumerRejectEvent(tag));
        Assert.assertTrue(latch.await(DefaultRabbitConsumer.POLL_PERIOD, TimeUnit.MILLISECONDS));
        Assert.assertEquals(tag, impl.getLastTag());
    }

    @Test
    public void testProcessDrop()
        throws InterruptedException
    {
        BlockingQueue<Event<QueueConsumer>> events = new LinkedBlockingQueue<>();
        CountDownLatch latch = new CountDownLatch(1);
        TestQueueConsumerImpl impl = new TestQueueConsumerImpl(latch);
        DefaultRabbitConsumer con = new DefaultRabbitConsumer(events, impl);
        new Thread(con).start();
        long tag = 100L;
        events.offer(new ConsumerDropEvent(tag));
        Assert.assertTrue(latch.await(DefaultRabbitConsumer.POLL_PERIOD, TimeUnit.MILLISECONDS));
        Assert.assertEquals(tag, impl.getLastTag());
    }

    @Test
    public void testHandleShutdown()
        throws InterruptedException
    {
        BlockingQueue<Event<QueueConsumer>> events = new LinkedBlockingQueue<>();
        CountDownLatch latch = new CountDownLatch(1);
        TestQueueConsumerImpl impl = new TestQueueConsumerImpl(latch);
        DefaultRabbitConsumer con = new DefaultRabbitConsumer(events, impl);
        new Thread(con).start();
        long tag = 100L;
        con.shutdown();
        events.offer(new ConsumerDropEvent(tag));
        Assert.assertFalse(latch.await(DefaultRabbitConsumer.POLL_PERIOD, TimeUnit.MILLISECONDS));
    }

    private static class TestQueueConsumerImpl implements QueueConsumer
    {
        private final CountDownLatch latch;
        private Delivery lastDelivery;
        private long lastTag;

        public TestQueueConsumerImpl(final CountDownLatch latch)
        {
            this.latch = Objects.requireNonNull(latch);
        }

        @Override
        public void processDelivery(Delivery delivery)
        {
            lastDelivery = delivery;
            latch.countDown();
        }

        @Override
        public void processAck(long tag)
        {
            lastTag = tag;
            latch.countDown();
        }

        @Override
        public void processReject(long tag)
        {
            lastTag = tag;
            latch.countDown();
        }

        @Override
        public void processDrop(long tag)
        {
            lastTag = tag;
            latch.countDown();
        }

        public Delivery getLastDelivery()
        {
            return lastDelivery;
        }

        public long getLastTag()
        {
            return lastTag;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NMF.Models.Repository;
using NMF.Serialization;
using System.ComponentModel;

namespace NMF.Models.Evolution
{
    [XmlConstructor(1)]
    public class ElementDeletion : IModelChange
    {
        [XmlConstructorParameter(0)]
        public Uri AbsoluteUri { get; set; }

        public ElementDeletion(Uri absoluteUri)
        {
            if (absoluteUri == null)
                throw new ArgumentException(nameof(absoluteUri));

            AbsoluteUri = absoluteUri;
        }

        public void Apply(IModelRepository repository)
        {
            var element = repository.Resolve(AbsoluteUri);
            element.Delete();
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
                return true;
            var other = obj as ElementDeletion;
            if (other == null)
                return false;
            else
                return this.AbsoluteUri.Equals(other.AbsoluteUri);
        }

        public override int GetHashCode()
        {
            return AbsoluteUri?.GetHashCode() ?? 0
                ^ -1; // so it's not the same as ElementCreation
        }
    }
}


text:
cask "dialpad" do
  version "18.81.9"
  sha256 :no_check

  url "https://storage.googleapis.com/dialpad_native/osx/Dialpad.dmg",
      verified: "storage.googleapis.com/dialpad_native/osx/"
  name "Dialpad"
  homepage "https://dialpad.com/download"

  app "Dialpad.app"
end


text:
package slack

// Event is a type alias for string to differentiate Slack event types.
type Event string

// Slack constants
const (
	// APIScheme is the protocol used to communicate with slack.
	APIScheme = "https"
	// APIEndpoint is the host used to communicate with slack.
	APIEndpoint = "slack.com"

	// ErrorNotAuthed : No authentication token provided.
	ErrorNotAuthed = "not_authed"
	// ErrorInvalidAuth : Invalid authentication token
	ErrorInvalidAuth = "invalid_auth"
	// ErrorAccountInactive : Authentication token is for a deleted user or team.
	ErrorAccountInactive = "account_inactive"
	// ErrorInvalidArrayArg : The method was passed a PHP-style array argument (e.g. with a name like foo[7]). These are never valid with the Slack API.
	ErrorInvalidArrayArg = "invalid_array_arg"
	// ErrorInvalidCharset : The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 or iso-8859-1.
	ErrorInvalidCharset = "invalid_charset"
	// ErrorInvalidFormData : The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
	ErrorInvalidFormData = "invalid_form_data"
	// ErrorInvalidPostType : The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
	ErrorInvalidPostType = "invalid_post_type"
	// ErrorMissingPostType : The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
	ErrorMissingPostType = "missing_post_type"
	// ErrorRequestTimeout : The method was called via a POST request, but the POST data was either missing or truncated.
	ErrorRequestTimeout = "request_timeout"
	// ErrorMessageNotFound No message exists with the requested timestamp.
	ErrorMessageNotFound = "message_not_found"
	// ErrorChannelNotFound : Value passed for channel was invalid.
	ErrorChannelNotFound = "channel_not_found"
	// ErrorCantDeleteMessage : Authenticated user does not have permission to delete this message.
	ErrorCantDeleteMessage = "cant_delete_message"
	// ErrorUserIsBot : Authenticated user is a bot and is restricted in it's use of certain api endpoints.
	ErrorUserIsBot = "user_is_bot"
	// ErrorBadTimestamp : Value passed for timestamp was invalid.
	ErrorBadTimestamp = "bad_timestamp"
	// ErrorFileNotFound : File specified by file does not exist.
	ErrorFileNotFound = "file_not_found"
	// ErrorFileCommentNotFound : File comment specified by file_comment does not exist.
	ErrorFileCommentNotFound = "file_comment_not_found"
	// ErrorNoItemSpecified : file, file_comment, or combination of channel and timestamp was not specified.
	ErrorNoItemSpecified = "no_item_specified"
	// ErrorInvalidName : Value passed for name was invalid.
	ErrorInvalidName = "invalid_name"
	// ErrorAlreadyReacted : The specified item already has the user/reaction combination.
	ErrorAlreadyReacted = "already_reacted"
	// ErrorTooManyEmoji : The limit for distinct reactions (i.e emoji) on the item has been reached.
	ErrorTooManyEmoji = "too_many_emoji"
	// ErrorTooManyReactions : 	The limit for reactions a person may add to the item has been reached.
	ErrorTooManyReactions = "too_many_reactions"

	// EventHello is an enumerated event.
	EventHello Event = "hello"
	// EventPing is an enumerated event.
	EventPing Event = "ping"
	// EventPong is an enumerated event.
	EventPong Event = "pong"
	// EventMessage is an enumerated event.
	EventMessage Event = "message"
	// EventMessageACK is a new enumerated event.
	EventMessageACK Event = "message_ack"
	// EventUserTyping is an enumerated event.
	EventUserTyping Event = "user_typing"
	// EventChannelMarked is an enumerated event.
	EventChannelMarked Event = "channel_marked"
	// EventChannelJoined is an enumerated event.
	EventChannelJoined Event = "channel_joined"
	// EventChannelLeft is an enumerated event.
	EventChannelLeft Event = "channel_left"
	// EventChannelDeleted is an enumerated event.
	EventChannelDeleted Event = "channel_deleted"
	// EventChannelRename is an enumerated event.
	EventChannelRename Event = "channel_rename"
	// EventChannelArchive is an enumerated event.
	EventChannelArchive Event = "channel_archive"
	// EventChannelUnArchive is an enumerated event.
	EventChannelUnArchive Event = "channel_unarchive"
	// EventChannelHistoryChanged is an enumerated event.
	EventChannelHistoryChanged Event = "channel_history_changed"
	// EventDNDUpdated is an enumerated event.
	EventDNDUpdated Event = "dnd_updated"
	// EventDNDUpdatedUser is an enumerated event.
	EventDNDUpdatedUser Event = "dnd_updated_user"
	// EventIMCreated is an enumerated event.
	EventIMCreated Event = "im_created"
	// EventImOpen is an enumerated event.
	EventImOpen Event = "im_open"
	// EventImClose is an enumerated event.
	EventImClose Event = "im_close"
	// EventImMarked is an enumerated event.
	EventImMarked Event = "im_marked"
	// EventImHistoryChanged is an enumerated event.
	EventImHistoryChanged Event = "im_history_changed"
	// EventGroupJoined is an enumerated event.
	EventGroupJoined Event = "group_joined"
	// EventGroupLeft is an enumerated event.
	EventGroupLeft Event = "group_left"
	// EventGroupOpen is an enumerated event.
	EventGroupOpen Event = "group_open"
	// EventGroupClose is an enumerated event.
	EventGroupClose Event = "group_close"
	// EventGroupArchive is an enumerated event.
	EventGroupArchive Event = "group_archive"
	// EventGroupUnarchive is an enumerated event.
	EventGroupUnarchive Event = "group_unarchive"
	// EventGroupRename is an enumerated event.
	EventGroupRename Event = "group_rename"
	// EventGroupMarked is an enumerated event.
	EventGroupMarked Event = "group_marked"
	// EventGroupHistoryChanged is an enumerated event.
	EventGroupHistoryChanged Event = "group_history_changed"
	// EventFileCreated is an enumerated event.
	EventFileCreated Event = "file_created"
	// EventFileShared is an enumerated event.
	EventFileShared Event = "file_shared"
	// EventFileUnshared is an enumerated event.
	EventFileUnshared Event = "file_unshared"
	// EventFilePublic is an enumerated event.
	EventFilePublic Event = "file_public"
	// EventFilePrivate is an enumerated event.
	EventFilePrivate Event = "file_private"
	// EventFileChange is an enumerated event.
	EventFileChange Event = "file_change"
	// EventFileDeleted is an enumerated event.
	EventFileDeleted Event = "file_deleted"
	// EventFileCommentAdded is an enumerated event.
	EventFileCommentAdded Event = "file_comment_added"
	// EventFileCommentEdited is an enumerated event.
	EventFileCommentEdited Event = "file_comment_edited"
	// EventFileCommentDeleted is an enumerated event.
	EventFileCommentDeleted Event = "file_comment_deleted"
	// EventPinAdded is an enumerated event.
	EventPinAdded Event = "pin_added"
	// EventPinRemoved is an enumerated event.
	EventPinRemoved Event = "pin_removed"
	// EventPresenceChange is an enumerated event.
	EventPresenceChange Event = "presence_change"
	// EventManualPresenceChange is an enumerated event.
	EventManualPresenceChange Event = "manual_presence_change"
	// EventPrefChange is an enumerated event.
	EventPrefChange Event = "pref_change"
	// EventUserChange is an enumerated event.
	EventUserChange Event = "user_change"
	// EventTeamJoin is an enumerated event.
	EventTeamJoin Event = "team_join"
	// EventStarAdded is an enumerated event.
	EventStarAdded Event = "star_added"
	// EventStarRemoved is an enumerated event.
	EventStarRemoved Event = "star_removed"
	// EventReactionAdded is an enumerated event.
	EventReactionAdded Event = "reaction_added"
	// EventReactionRemoved is an enumerated event.
	EventReactionRemoved Event = "reaction_removed"
	// EventEmojiChanged is an enumerated event.
	EventEmojiChanged Event = "emoji_changed"
	// EventCommandsChanged is an enumerated event.
	EventCommandsChanged Event = "commands_changed"
	// EventTeamPlanChanged is an enumerated event.
	EventTeamPlanChanged Event = "team_plan_changed"
	// EventTeamPrefChanged is an enumerated event.
	EventTeamPrefChanged Event = "team_pref_changed"
	// EventEmailDomainChanged is an enumerated event.
	EventEmailDomainChanged Event = "email_domain_changed"
	// EventTeamProfileChange is an enumerated event.
	EventTeamProfileChange Event = "team_profile_change"
	// EventTeamProfileDelete is an enumerated event.
	EventTeamProfileDelete Event = "team_profile_delete"
	// EventTeamProfileReorder is an enumerated event.
	EventTeamProfileReorder Event = "team_profile_reorder"
	// EventBotAdded is an enumerated event.
	EventBotAdded Event = "bot_added"
	// EventBotChanged is an enumerated event.
	EventBotChanged Event = "bot_changed"
	// EventAccountsChanged is an enumerated event.
	EventAccountsChanged Event = "accounts_changed"
	// EventTeamMigrationStarted is an enumerated event.
	EventTeamMigrationStarted Event = "team_migration_started"

	// EventSubtypeBotMessage is an enumerated sub event.
	EventSubtypeBotMessage Event = "bot_message"
	// EventSubtypeMeMessage is an enumerated sub event.
	EventSubtypeMeMessage Event = "me_message"
	// EventSubtypeMessageChanged is an enumerated sub event.
	EventSubtypeMessageChanged Event = "message_changed"
	// EventSubtypeMessageDeleted is an enumerated sub event.
	EventSubtypeMessageDeleted Event = "message_deleted"
	// EventSubtypeChannelJoin is an enumerated sub event.
	EventSubtypeChannelJoin Event = "channel_join"
	// EventSubtypeChannelLeave is an enumerated sub event.
	EventSubtypeChannelLeave Event = "channel_leave"
	// EventSubtypeChannelTopic is an enumerated sub event.
	EventSubtypeChannelTopic Event = "channel_topic"
	// EventSubtypeChannelPurpose is an enumerated sub event.
	EventSubtypeChannelPurpose Event = "channel_purpose"
	// EventSubtypeChannelName is an enumerated sub event.
	EventSubtypeChannelName Event = "channel_name"
	// EventSubtypeChannelArchive is an enumerated sub event.
	EventSubtypeChannelArchive Event = "channel_archive"
	// EventSubtypeChannelUnarchive is an enumerated sub event.
	EventSubtypeChannelUnarchive Event = "channel_unarchive"
)


text:
$import("js.awt.Component");

Class.forName({
  name: "class js.awt.Label extends js.awt.Component",
  "public Label": function() {

  }
});


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<enumeration>
    <option description="A generic relation type, more concrete link should be used where possible" iconURL="" id="relates_to" name="relates to" oppositeName="is related to" sortOrder="1"/>
    <option iconURL="" id="depends_on" name="depends on" oppositeName="is depended on by" sortOrder="2"/>
    <option iconURL="" id="duplicates" name="duplicates" oppositeName="is duplicated by" sortOrder="3"/>
    <option iconURL="" id="parent" name="has parent" oppositeName="is parent of" parent="true" sortOrder="4"/>
    <option iconURL="" id="follow_up" name="has follow-up" oppositeName="is follow-up of" sortOrder="5"/>
    <option description="Used for traceability from Tasks to Requirements" iconURL="" id="implements" name="implements" oppositeName="is implemented by" sortOrder="6"/>
<option id="refines" name="refines" oppositeName="is refined by" parent="true" sortOrder="7"/>
    <option id="derived_from" name="is derived from" oppositeName="is derived by" sortOrder="8"/>
</enumeration>


text:
if [ -z $ONE_LOCATION ]; then
    DB_LOCATION="/var/lib/one/one.db"
    LOG_LOCATION="/var/log/one"
    AUTH_LOCATION="/var/lib/one/.one"
else
    DB_LOCATION="$ONE_LOCATION/var/one.db"
    LOG_LOCATION="$ONE_LOCATION/var"
    AUTH_LOCATION="$ONE_LOCATION/var/.one"
fi

if [ -f $DB_LOCATION ]; then
    echo "$DB_LOCATION has to be overwritten, move it to a safe place."
    exit -1
fi

echo "========================================================================="
echo "Doing $1"
echo "========================================================================="

rm -rf $AUTH_LOCATION

PID=$$

oned -f &

sleep 2;

until grep 'Datastore default (1) successfully monitored' $LOG_LOCATION/oned.log; do
    sleep 1;
done

echo 'SAFE_DIRS = "/"' > /tmp/one-javatest-ds.txt
onedatastore update --append 1 /tmp/one-javatest-ds.txt

java -cp ../lib/*:../jar/*:. org.junit.runner.JUnitCore $1

CODE=$?

pkill -P $PID oned
sleep 4s;
pkill -9 -P $PID oned
rm -f $DB_LOCATION

exit $CODE