text:
"*Software* ***Multitenancy*** *refers to a software* ***architecture***
*in which a* ***single instance*** *of a software runs on a server and
serves ***multiple tenants***. A tenant is a group of users who share
a common access with specific privileges to the software instance. With
a multitenant architecture, a software application is designed to
provide every tenant a ***dedicated share of the instance including its
data***, configuration, user management, tenant individual
functionality and non-functional properties. Multitenancy contrasts with
multi-instance architectures, where separate software instances operate
on behalf of different tenants*"
([Wikipedia](https://en.wikipedia.org/wiki/Multitenancy))

In short, multi-tenancy is a technique that is used to create **SaaS**
(Software as-a Service) applications.

#### Database & Deployment Architectures

There are some different multi-tenant database & deployment approaches:

##### Multiple Deployment - Multiple Database

This is **not multi-tenancy** actually, but if we run **one instance**
of the application **for each** customer (tenant) with a **separated
database**, we can serve **multiple tenants** on a single server. We
just have to make sure that multiple instances of the application don't
**conflict** with each other on the same server environment.

This can also be possible for an **existing application** which is not
designed as multi-tenant. It's easier to create such an application since
the application is not aware of multitenancy. There are, however, setup,
utilization and maintenance problems in this approach.

##### Single Deployment - Multiple Database

ln this approach, we run a **single instance** of the application on
a server. We have a **master** (host) database to store tenant metadata
(like tenant name and subdomain) and a **separate database** for each
tenant. Once we identify the **current tenant** (for example; from
subdomain or from a user login form), then we can **switch** to that
tenant's database to perform operations.

In this approach, the application should be designed as multi-tenant at some
level, but most of the application can remain independent from it.

We create and maintain a **separate database** for each tenant,
this includes **database migrations**. If we have many customers with
dedicated databases, it may take a long time to migrate the database schema during
an application update. Since we have a separated database for each tenant, we
can **backup** its database separately from other tenants. We can also
**move** the tenant database to a stronger server if that tenant needs
it.

##### Single Deployment - Single Database

This is the **most ideal multi-tenancy** architecture: We only deploy a
**single instance** of the application with a **single database** on to a
**single server**. We have a **TenantId** (or similar) field in each
table (for a RDBMS) which is used to isolate a tenant's data from
others.

This type of application is easy to setup and maintain, but harder to create.
This is because we must prevent a Tenant from reading or writing to other
tenant data. We may add a **TenantId filter** for each database read
(select) operation. We may also check it every time we write, to see if this entity is
related to the **current tenant**. This is tedious and error-prone. However,
ASP.NET Boilerplate helps us here by using **automatic [data
filtering](Data-Filters.md)**.

This approach may have performance problems if we have many tenants with
large data sets. We can use table partitioning or other database features to
overcome this problem.

##### Single Deployment - Hybrid Databases

We may want to store tenants in a single databases normally, but may want to
create a separate database for desired tenants. For example, we can
store tenants with big data in their own databases, but store all other
tenants in a single database.

##### Multiple Deployment - Single/Multiple/Hybrid Database

Finally, we may want to deploy our application to more than one server
(like web farms) for better application performance, high
availability, and/or scalability. This is independent from the database
approach.

### Multi-Tenancy in ASP.NET Boilerplate

ASP.NET Boilerplate can work with all the scenarios described above.

#### Enabling Multi-Tenancy

Multi-tenancy is disabled by default for Framework level. We can enable it in PreInitialize method
of our module as shown below:

    Configuration.MultiTenancy.IsEnabled = true;

**Note:** Multi-tenancy is enabled in both ASP.NET Core and ASP.NET MVC 5.x startup templates.

#### Ignore Feature Check For Host Users

There is another configuration to ignore feature check for host users. We can enable it in PreInitialize method
of our module as shown below:

    Configuration.MultiTenancy.IgnoreFeatureCheckForHostUsers = true;

**Note:** `IgnoreFeatureCheckForHostUsers` default value is `false`;

#### Host vs Tenant

We define two terms used in a multi-tenant system:

-   **Tenant**: A customer which has its own users, roles,
    permissions, settings... and uses the application completely
    isolated from other tenants. A multi-tenant application will have
    one or more tenants. If this is a CRM application, different tenants
    also have their own accounts, contacts, products and orders. So
    when we say a '**tenant user**', we mean a user owned by a tenant.
-   **Host**: The Host is singleton (there is a single host). The Host is
    responsible for creating and managing tenants. A '**host user**' is at a
    higher level and independent from all tenants and can control them.

#### Session

ASP.NET Boilerplate defines the **IAbpSession** interface to obtain the current
**user** and **tenant** ids. This interface is used in multi-tenancy to
get the current tenant's id by default. Thus, it can filter data based on the
current tenant's id. Here are the rules:

-   If both the UserId and the TenantId is null, then the current user is **not
    logged in** to the system. We can not know if it's a host user
    or tenant user. In this case, the user can not access
    [authorized](/Pages/Documents/Authorization) content.
-   If the UserId is not null and the TenantId is null, then we know that
    the current user is a **host user**.
-   If the UserId is not null and the TenantId is not null, we know
    that the current user is a **tenant user**.
-   If the UserId is null but the TenantId is not null, that means we know
    the current tenant, but the current request is not authorized (user did
    not login). See the next section to understand how the current tenant is
    determined.

See the [session documentation](/Pages/Documents/Abp-Session) for more
information.

#### Determining Current Tenant

Since all tenant users use the same application, we should have a way of
distinguishing the tenant of the current request. The default session
implementation (ClaimsAbpSession) uses different approaches to find the
tenant related to the current request in this given order:

1.  If the user is logged in, it gets the TenantId from current claims. Claim
    name is *http://www.aspnetboilerplate.com/identity/claims/tenantId*
    and should contain an integer value. If it's not found in claims
    then the user is assumed to be a *host* user.
2.  If the user has not logged in, then it tries to resolve the TenantId from the
    *tenant resolve contributor*s. There are 3 pre-defined tenant
    contributors and are run in a given order (first successful resolver 'wins'):
    1.  **DomainTenantResolveContributor**: Tries to resolve tenancy
        name from an url, generally from a domain or subdomain. You can
        configure the domain format in the PreInitialize method of your module
        (like
        Configuration.Modules.AbpWebCommon().MultiTenancy.DomainFormat =
        "{0}.mydomain.com";). If the domain format is "{0}.mydomain.com" and
        the current host of the request is ***acme*.mydomain.com**, then the
        tenancy name is resolved as "acme". The next step is to query
        ITenantStore to find the TenantId by the given tenancy name. If a
        tenant is found, then it's resolved as the current TenantId.
    2.  **HttpHeaderTenantResolveContributor**: Tries to resolve
        TenantId from an "Abp.TenantId" header value, if present. This is a
        constant defined in
        Abp.MultiTenancy.MultiTenancyConsts.TenantIdResolveKey.
    3.  **HttpCookieTenantResolveContributor**: Tries to resolve
        the TenantId from an "Abp.TenantId" cookie value, if present. This uses the
        same constant explained above.

By default, ASP.NET Boilerplate uses "Abp.TenantId" to find TenantId from Cookie or Request Headers. You can change it using multi-tenancy configuration:

````c#
Configuration.MultiTenancy.TenantIdResolveKey = "Abp-TenantId";
````

You also need to configure it on the client side:

````js
abp.multiTenancy.tenantIdCookieName = 'Abp-TenantId';
````

If none of these attempts can resolve a TenantId, then the current requester
is considered to be the host. Tenant resolvers are extensible. You can add
resolvers to the **Configuration.MultiTenancy.Resolvers** collection, or
remove an existing resolver.

One last thing on resolvers: The resolved tenant id is cached during
the same request for performance reasons. Resolvers are executed
once in a request, and only if the current user has not already logged in.

##### Tenant Store

The **DomainTenantResolveContributor** uses ITenantStore to find the tenant id
by tenancy name. The default implementation of **ITenantStore** is
**NullTenantStore** which does not contain any tenant and returns null
for queries. You can implement and replace it to query tenants from any
data source. [Module Zero](Zero/Overall.md) properly implements it by
getting it from its [tenant manager](Zero/Tenant-Management.md). So if you
are using Module Zero, you don't need to worry about the tenant store.

#### Data Filters

For the **multi-tenant single database** approach, we must add a
**TenantId** filter to only get the current tenant's entities when
retrieving [entities](/Pages/Documents/Entities) from the database. ASP.NET
Boilerplate automatically does it when you implement one of the two
interfaces for your entity: **IMustHaveTenant** and **IMayHaveTenant**.

##### IMustHaveTenant Interface

This interface is used to distinguish the entities of different tenants by
defining a **TenantId** property. An example entity that implements
IMustHaveTenant:

    public class Product : Entity, IMustHaveTenant
    {
        public int TenantId { get; set; }

        public string Name { get; set; }

        //...other properties
    }

This way, ASP.NET Boilerplate knows that this is a tenant-specific entity
and automatically isolates the entities of a tenant from other tenants.

##### IMayHaveTenant interface

We may need to share an **entity type** between host and tenants. As such, an
entity may be owned by a tenant or the host. The IMayHaveTenant interface
also defines **TenantId** (similar to IMustHaveTenant), but it is **nullable**
in this case. An example entity that implements IMayHaveTenant:

    public class Role : Entity, IMayHaveTenant
    {
        public int? TenantId { get; set; }

        public string RoleName { get; set; }

        //...other properties
    }

We may use the same Role class to store Host roles and Tenant roles. In this
case, the TenantId property says if this is  host entity or tenant
entitiy. A **null** value means this is a **host** entity, a
**non-null** value means this entity is owned by a **tenant** where the Id is
the **TenantId**.

##### Additional Notes

IMayHaveTenant is not as common as IMustHaveTenant. For example, a Product
class can not be IMayHaveTenant since a Product is related to the actual
application functionality, and not related to managing tenants. So use
the IMayHaveTenant interface carefully since it's harder to maintain code
shared by host and tenants.

When you define an entity type as IMustHaveTenant or IMayHaveTenant,
**always set the TenantId** when you create a new entity (While ASP.NET
Boilerplate tries to set it from current TenantId, it may not be
possible in some cases, especially for IMayHaveTenant entities). Most of
the time, this will be the only point you deal with the TenantId properties.
You don't need to explicitly write the TenantId filter in Where conditions
while writing LINQ, since it is automatically filtered.

#### Switching Between Host and Tenants

While working on a multi-tenant application database, we can get the
**current tenant**. By default, it's obtained from the
[IAbpSession](Abp-Session.md) (as described before). We can change
this behavior and switch to another tenant's database. Example:

    public class ProductService : ITransientDependency
    {
        private readonly IRepository<Product> _productRepository;
        private readonly IUnitOfWorkManager _unitOfWorkManager;

        public ProductService(IRepository<Product> productRepository, IUnitOfWorkManager unitOfWorkManager)
        {
            _productRepository = productRepository;
            _unitOfWorkManager = unitOfWorkManager;
        }

        [UnitOfWork]
        public virtual List<Product> GetProducts(int tenantId)
        {
            using (_unitOfWorkManager.Current.SetTenantId(tenantId))
            {
                return _productRepository.GetAllList();
            }
        }
    }

SetTenantId ensures that we are working on a given tenant's data,
independent from the database architecture:

-   If the given tenant has a dedicated database, it switches to that
    database and gets products from it.
-   If the given tenant does not have a dedicated database (the single database
    approach, for example), it adds the automatic TenantId filter to query
    only that tenant's products.

If we don't use SetTenantId, it gets the tenantId from the
[session](Abp-Session.md). There are some guidelines and
best practices here:

-   Use **SetTenantId(null)** to switch to the host.
-   Use SetTenantId within a **using** block (as in the example) if there
    is not a special case. This way, it automatically restores the tenantId at
    the end of the using block and the code calling the GetProducts method
    works as before.
-   You can use SetTenantId in **nested blocks** if it's needed.
-   Since **\_unitOfWorkManager.Current** is only available in a [unit of
    work](Unit-Of-Work.md), be sure that your code runs in a UOW.


text:
package com.animedetour.android.schedule;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
import butterknife.Bind;
import com.animedetour.android.R;
import com.animedetour.android.database.event.EventRepository;
import com.animedetour.android.framework.BaseFragment;
import com.animedetour.android.model.Event;
import com.animedetour.android.schedule.serach.EventSearchActivity;
import com.inkapplications.android.widget.listview.ItemAdapter;
import com.inkapplications.groundcontrol.SubscriptionManager;
import icepick.State;
import org.joda.time.DateTime;
import prism.framework.Layout;
import rx.Subscription;

import javax.inject.Inject;

/**
 * Day schedule fragment
 *
 * This fragment displays a list of the panels / events for a single day.
 *
 * @author Maxwell Vandervelde (Max@MaxVandervelde.com)
 */
@Layout(R.layout.schedule_day)
final public class DayFragment extends BaseFragment
{
    @Inject
    EventRepository eventData;

    @Inject
    SubscriptionManager subscriptionManager;

    @Inject
    EventObserverFactory subscriberFactory;

    @Inject
    EventViewBinder viewBinder;

    @Bind(R.id.panel_list)
    ListView panelList;

    @Bind(R.id.panel_empty_view)
    View panelEmptyView;

    @State
    DateTime day;

    @State
    int scrollPosition = 0;

    private EventUpdateObserver eventUpdateObserver;

    public DayFragment() {}

    public DayFragment(DateTime day)
    {
        this.day = day;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState)
    {
        super.onActivityCreated(savedInstanceState);

        ItemAdapter<PanelView, Event> adapter = new ItemAdapter<>(this.viewBinder);
        this.panelList.setAdapter(adapter);
        this.eventUpdateObserver = this.subscriberFactory.create(this.panelList, adapter, this.panelEmptyView);
    }

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
    {
        inflater.inflate(R.menu.event_actions, menu);

        super.onCreateOptionsMenu(menu, inflater);
    }

    @Override
    public void onResume()
    {
        super.onResume();
        this.updateEvents();
    }

    @Override
    public void onPause()
    {
        super.onPause();

        this.subscriptionManager.unsubscribeAll();
        this.scrollPosition = this.eventUpdateObserver.getScrollPosition();
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item)
    {
        switch (item.getItemId()) {
            case R.id.event_actions_search:
                this.startActivity(new Intent(getActivity(), EventSearchActivity.class));
                return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onViewStateRestored(Bundle savedInstanceState)
    {
        super.onViewStateRestored(savedInstanceState);
        this.eventUpdateObserver.setScrollPosition(this.scrollPosition);
    }

    /**
     * Fetch a new set of data to display in the list of events based on the
     * bound date of the fragment.
     */
    protected void updateEvents()
    {
        Subscription eventSubscription = this.eventData.findAllOnDay(this.day, this.eventUpdateObserver);
        this.subscriptionManager.add(eventSubscription);
    }
}

redpajama_set_name: RedPajamaGithub


text:
mkdir -p $PREFIX/bin
chmod 755 bin/staphopia-sccmec.py
cp -f bin/staphopia-sccmec.py $PREFIX/bin/staphopia-sccmec

# Move data
mkdir -p $PREFIX/share
cp -r share/staphopia-sccmec $PREFIX/share/


text:
{% extends "descriptor/descriptor_view_base.html" %}

{% load staticfiles %}

{% block title_header_big %}
{{ block.super }}
Edit
{% ifequal descriptor_type 'nsd' %}
NS
{% else%}
VNF
{% endifequal %} Descriptor
{% endblock %}

{% block left_sidebar %}
{% include 'etsi/etsi_project_left_sidebar.html' %}
{% endblock %}

{% block breadcrumb_body %}
{{ block.super }}

{{project_overview_data.name}}

  {% ifequal descriptor_type 'nsd' %}
NS
{% else%}
VNF
{% endifequal %} Descriptors

{{descriptor_id}}

{% endblock %}

{% block tab_pane_button_list %}
{{ block.super }}

 YAML

 JSON

{% endblock %}

{% block nav_buttons_list %}
    {{ block.super }}

<button id="save" type="button" class="btn btn-block btn-primary btn-sm"  onclick="update(this.id)"> Save</button>

<button id="save_show_graph" type="button" class="btn btn-block btn-primary btn-sm"  onclick="update(this.id)"> Save and Show Graph</button>

<button type="button" class="btn btn-block btn-primary btn-sm"  onclick="goToGraph()"> Show Graph</button>

{% endblock %}

{% block tab_pane_list %}
{{ block.super }}

			<textarea id="code_editor_yaml">
            </textarea>

                    <textarea id="code_editor_json">

                    </textarea>

{% endblock %}

{% block resource_block %}
{{ block.super }}

{% endblock %}


text:
namespace woff2 {

namespace {

void StoreLoca(int index_fmt, uint32_t value, size_t* offset, uint8_t* dst) {
  if (index_fmt == 0) {
    Store16(value >> 1, offset, dst);
  } else {
    StoreU32(value, offset, dst);
  }
}

}  // namespace

namespace {

bool WriteNormalizedLoca(int index_fmt, int num_glyphs, Font* font) {
  Font::Table* glyf_table = font->FindTable(kGlyfTableTag);
  Font::Table* loca_table = font->FindTable(kLocaTableTag);

  int glyph_sz = index_fmt == 0 ? 2 : 4;
  loca_table->buffer.resize(Round4(num_glyphs + 1) * glyph_sz);
  loca_table->length = (num_glyphs + 1) * glyph_sz;

  uint8_t* glyf_dst = &glyf_table->buffer[0];
  uint8_t* loca_dst = &loca_table->buffer[0];
  uint32_t glyf_offset = 0;
  size_t loca_offset = 0;

  for (int i = 0; i < num_glyphs; ++i) {
    StoreLoca(index_fmt, glyf_offset, &loca_offset, loca_dst);
    Glyph glyph;
    const uint8_t* glyph_data;
    size_t glyph_size;
    if (!GetGlyphData(*font, i, &glyph_data, &glyph_size) ||
        (glyph_size > 0 && !ReadGlyph(glyph_data, glyph_size, &glyph))) {
      return FONT_COMPRESSION_FAILURE();
    }
    size_t glyf_dst_size = glyf_table->buffer.size() - glyf_offset;
    if (!StoreGlyph(glyph, glyf_dst + glyf_offset, &glyf_dst_size)) {
      return FONT_COMPRESSION_FAILURE();
    }
    glyf_dst_size = Round4(glyf_dst_size);
    if (glyf_dst_size > std::numeric_limits<uint32_t>::max() ||
        glyf_offset + static_cast<uint32_t>(glyf_dst_size) < glyf_offset ||
        (index_fmt == 0 && glyf_offset + glyf_dst_size >= (1UL << 17))) {
      return FONT_COMPRESSION_FAILURE();
    }
    glyf_offset += glyf_dst_size;
  }
  if (glyf_offset == 0) {
    return false;
  }

  StoreLoca(index_fmt, glyf_offset, &loca_offset, loca_dst);

  glyf_table->buffer.resize(glyf_offset);
  glyf_table->data = &glyf_table->buffer[0];
  glyf_table->length = glyf_offset;
  loca_table->data = &loca_table->buffer[0];

  return true;
}

}  // namespace

namespace {

bool MakeEditableBuffer(Font* font, int tableTag) {
  Font::Table* table = font->FindTable(tableTag);
  if (table == NULL) {
    return FONT_COMPRESSION_FAILURE();
  }
  if (table->IsReused()) {
    return true;
  }
  int sz = Round4(table->length);
  table->buffer.resize(sz);
  uint8_t* buf = &table->buffer[0];
  memcpy(buf, table->data, sz);
  table->data = buf;
  return true;
}

}  // namespace

bool NormalizeGlyphs(Font* font) {
  Font::Table* head_table = font->FindTable(kHeadTableTag);
  Font::Table* glyf_table = font->FindTable(kGlyfTableTag);
  Font::Table* loca_table = font->FindTable(kLocaTableTag);
  if (head_table == NULL) {
    return FONT_COMPRESSION_FAILURE();
  }
  // If you don't have glyf/loca this transform isn't very interesting
  if (loca_table == NULL && glyf_table == NULL) {
    return true;
  }
  // It would be best if you didn't have just one of glyf/loca
  if ((glyf_table == NULL) != (loca_table == NULL)) {
    return FONT_COMPRESSION_FAILURE();
  }
  // Must share neither or both loca & glyf
  if (loca_table->IsReused() != glyf_table->IsReused()) {
    return FONT_COMPRESSION_FAILURE();
  }
  if (loca_table->IsReused()) {
    return true;
  }

  int index_fmt = head_table->data[51];
  int num_glyphs = NumGlyphs(*font);

  // We need to allocate a bit more than its original length for the normalized
  // glyf table, since it can happen that the glyphs in the original table are
  // 2-byte aligned, while in the normalized table they are 4-byte aligned.
  // That gives a maximum of 2 bytes increase per glyph. However, there is no
  // theoretical guarantee that the total size of the flags plus the coordinates
  // is the smallest possible in the normalized version, so we have to allow
  // some general overhead.
  // TODO(user) Figure out some more precise upper bound on the size of
  // the overhead.
  size_t max_normalized_glyf_size = 1.1 * glyf_table->length + 2 * num_glyphs;

  glyf_table->buffer.resize(max_normalized_glyf_size);

  // if we can't write a loca using short's (index_fmt 0)
  // try again using longs (index_fmt 1)
  if (!WriteNormalizedLoca(index_fmt, num_glyphs, font)) {
    if (index_fmt != 0) {
      return FONT_COMPRESSION_FAILURE();
    }

    // Rewrite loca with 4-byte entries & update head to match
    index_fmt = 1;
    if (!WriteNormalizedLoca(index_fmt, num_glyphs, font)) {
      return FONT_COMPRESSION_FAILURE();
    }
    head_table->buffer[51] = 1;
  }

  return true;
}

bool NormalizeOffsets(Font* font) {
  uint32_t offset = 12 + 16 * font->num_tables;
  for (auto tag : font->OutputOrderedTags()) {
    auto& table = font->tables[tag];
    table.offset = offset;
    offset += Round4(table.length);
  }
  return true;
}

namespace {

uint32_t ComputeHeaderChecksum(const Font& font) {
  uint32_t checksum = font.flavor;
  uint16_t max_pow2 = font.num_tables ? Log2Floor(font.num_tables) : 0;
  uint16_t search_range = max_pow2 ? 1 << (max_pow2 + 4) : 0;
  uint16_t range_shift = (font.num_tables << 4) - search_range;
  checksum += (font.num_tables << 16 | search_range);
  checksum += (max_pow2 << 16 | range_shift);
  for (const auto& i : font.tables) {
    const Font::Table* table = &i.second;
    if (table->IsReused()) {
      table = table->reuse_of;
    }
    checksum += table->tag;
    checksum += table->checksum;
    checksum += table->offset;
    checksum += table->length;
  }
  return checksum;
}

}  // namespace

bool FixChecksums(Font* font) {
  Font::Table* head_table = font->FindTable(kHeadTableTag);
  if (head_table == NULL) {
    return FONT_COMPRESSION_FAILURE();
  }
  if (head_table->reuse_of != NULL) {
    head_table = head_table->reuse_of;
  }
  if (head_table->length < 12) {
    return FONT_COMPRESSION_FAILURE();
  }

  uint8_t* head_buf = &head_table->buffer[0];
  size_t offset = 8;
  StoreU32(0, &offset, head_buf);
  uint32_t file_checksum = 0;
  uint32_t head_checksum = 0;
  for (auto& i : font->tables) {
    Font::Table* table = &i.second;
    if (table->IsReused()) {
      table = table->reuse_of;
    }
    table->checksum = ComputeULongSum(table->data, table->length);
    file_checksum += table->checksum;

    if (table->tag == kHeadTableTag) {
      head_checksum = table->checksum;
    }
  }

  file_checksum += ComputeHeaderChecksum(*font);
  offset = 8;
  StoreU32(0xb1b0afba - file_checksum, &offset, head_buf);

  return true;
}

namespace {
bool MarkTransformed(Font* font) {
  Font::Table* head_table = font->FindTable(kHeadTableTag);
  if (head_table == NULL) {
    return FONT_COMPRESSION_FAILURE();
  }
  if (head_table->reuse_of != NULL) {
    head_table = head_table->reuse_of;
  }
  if (head_table->length < 17) {
    return FONT_COMPRESSION_FAILURE();
  }
  // set bit 11 of head table 'flags' to indicate that font has undergone
  // lossless modifying transform
  int head_flags = head_table->data[16];
  head_table->buffer[16] = head_flags | 0x08;
  return true;
}
}  // namespace

bool NormalizeWithoutFixingChecksums(Font* font) {
  return (MakeEditableBuffer(font, kHeadTableTag) &&
          RemoveDigitalSignature(font) &&
          MarkTransformed(font) &&
          NormalizeGlyphs(font) &&
          NormalizeOffsets(font));
}

bool NormalizeFont(Font* font) {
  return (NormalizeWithoutFixingChecksums(font) &&
          FixChecksums(font));
}

bool NormalizeFontCollection(FontCollection* font_collection) {
  if (font_collection->fonts.size() == 1) {
    return NormalizeFont(&font_collection->fonts[0]);
  }

  uint32_t offset = CollectionHeaderSize(font_collection->header_version,
    font_collection->fonts.size());
  for (auto& font : font_collection->fonts) {
    if (!NormalizeWithoutFixingChecksums(&font)) {
#ifdef FONT_COMPRESSION_BIN
      fprintf(stderr, "Font normalization failed.\n");
#endif
      return FONT_COMPRESSION_FAILURE();
    }
    offset += kSfntHeaderSize + kSfntEntrySize * font.num_tables;
  }

  // Start table offsets after TTC Header and Sfnt Headers
  for (auto& font : font_collection->fonts) {
    for (auto tag : font.OutputOrderedTags()) {
      Font::Table& table = font.tables[tag];
      if (table.IsReused()) {
        table.offset = table.reuse_of->offset;
      } else {
        table.offset = offset;
        offset += Round4(table.length);
      }
    }
  }

  // Now we can fix the checksums
  for (auto& font : font_collection->fonts) {
    if (!FixChecksums(&font)) {
#ifdef FONT_COMPRESSION_BIN
      fprintf(stderr, "Failed to fix checksums\n");
#endif
      return FONT_COMPRESSION_FAILURE();
    }
  }

  return true;
}

} // namespace woff2


text:
var requireDir = require('require-dir');

module.exports = requireDir('./models', { camelcase: true });


text:
"""
The module contains internal data representation in SATOSA and general converteras that can be used
for converting from SAML/OAuth/OpenID connect to the internal representation.
"""
import datetime
import hashlib
from enum import Enum

class UserIdHashType(Enum):
    """
    All different user id hash types
    """
    transient = 1
    persistent = 2
    pairwise = 3
    public = 4
    emailaddress = 5
    unspecified = 6

    @classmethod
    def from_string(cls, str):
        try:
            return getattr(cls, str)
        except AttributeError:
            raise ValueError("Unknown hash type '{}'".format(str))

class UserIdHasher(object):
    """
    Class for creating different user id types
    """
    STATE_KEY = "IDHASHER"

    @staticmethod
    def save_state(internal_request, state):
        """
        Saves all necessary information needed by the UserIdHasher

        :type internal_request: satosa.internal_data.InternalRequest

        :param internal_request: The request
        :param state: The current state
        """
        state_data = {
            "hash_type": internal_request.user_id_hash_type.name
        }
        state[UserIdHasher.STATE_KEY] = state_data

    @staticmethod
    def hash_data(salt, value):
        """
        Hashes a value together with a salt.
        :type salt: str
        :type value: str
        :param salt: hash salt
        :param value: value to hash together with the salt
        :return: hash value (SHA512)
        """
        data = '{value}{salt}'.format(value=value, salt=salt).encode()
        hash = hashlib.sha512(data).hexdigest()
        return hash

    @staticmethod
    def hash_type(state):
        state_data = state[UserIdHasher.STATE_KEY]
        hash_type = UserIdHashType.from_string(state_data["hash_type"])
        return hash_type

    @staticmethod
    def hash_id(salt, user_id, requester, state):
        """
        Sets a user id to the internal_response,
        in the format specified by the internal response

        :type salt: str
        :type user_id: str
        :type requester: str
        :type state: satosa.state.State
        :rtype: str

        :param salt: A salt string for the ID hashing
        :param user_id: the user id
        :param user_id_hash_type: Hashing type
        :param state: The current state
        :return: the internal_response containing the hashed user ID
        """
        hash_type_to_format = {
            UserIdHashType.transient:    '{id}{req}{time}',
            UserIdHashType.persistent:   '{id}{req}',
            UserIdHashType.pairwise:     '{id}{req}',
            UserIdHashType.public:       '{id}',
            UserIdHashType.emailaddress: '{id}',
            UserIdHashType.unspecified:  '{id}',
        }

        format_args = {
            'id': user_id,
            'req': requester,
            'time': datetime.datetime.utcnow().timestamp(),
        }

        hash_type = UserIdHasher.hash_type(state)
        try:
            fmt = hash_type_to_format[hash_type]
        except KeyError as e:
            raise ValueError('Unknown hash type: {}'.format(hash_type)) from e
        else:
            user_id = fmt.format(**format_args)

        hasher = (
            (lambda salt, value: value)
            if hash_type in [
                UserIdHashType.emailaddress,
                UserIdHashType.unspecified,
            ]
            else UserIdHasher.hash_data)
        return hasher(salt, user_id)

class AuthenticationInformation(object):
    """
    Class that holds information about the authentication
    """

    def __init__(self, auth_class_ref, timestamp, issuer):
        """
        Initiate the data carrier

        :type auth_class_ref: str
        :type timestamp: str
        :type issuer: str

        :param auth_class_ref: What method that was used for the authentication
        :param timestamp: Time when the authentication was done
        :param issuer: Where the authentication was done
        """
        self.auth_class_ref = auth_class_ref
        self.timestamp = timestamp
        self.issuer = issuer

    @staticmethod
    def from_dict(auth_info_dict):
        """
        :type auth_info_dict: dict[str, str]
        :rtype: satosa.internal_data.AuthenticationInformation
        :param auth_info_dict: A dict representation of an AuthenticationInformation object
        :return: An AuthenticationInformation object
        """
        return AuthenticationInformation(auth_info_dict["auth_class_ref"],
                                         auth_info_dict["timestamp"],
                                         auth_info_dict["issuer"])

    def to_dict(self):
        """
        Converts an AuthenticationInformation object to a dict
        :rtype: dict[str, str]
        :return: A dict representation of the object
        """
        return {"issuer": self.issuer,
                "timestamp": self.timestamp,
                "auth_class_ref": self.auth_class_ref,}

class InternalData(object):
    """
    A base class for the data carriers between frontends/backends
    """
    pass

class InternalRequest(InternalData):
    """
    Internal request for SATOSA.
    """

    def __init__(self, user_id_hash_type, requester, requester_name=None):
        """

        :param user_id_hash_type:
        :param requester: identifier of the requester

        :type user_id_hash_type: UserIdHashType
        :type requester: str
        """
        self.user_id_hash_type = user_id_hash_type
        self.requester = requester
        if requester_name:
            self.requester_name = requester_name
        else:
            self.requester_name = [{"text": requester, "lang": "en"}]
        self.approved_attributes = None

class InternalResponse(InternalData):
    """
    Holds internal representation of service related data.

    :type _user_id: str
    :type attributes: dict[str, str]
    :type user_id_hash_type: UserIdHashType
    :type auth_info: AuthenticationInformation
    """

    def __init__(self, auth_info=None):
        super().__init__()
        self.user_id = None
        # This dict is a data carrier between frontend and backend modules.
        self.attributes = {}
        self.auth_info = auth_info
        self.user_id_hash_type = None
        self.requester = None

    @staticmethod
    def from_dict(int_resp_dict):
        """
        :type int_resp_dict: dict[str, dict[str, str] | str]
        :rtype: satosa.internal_data.InternalResponse
        :param int_resp_dict: A dict representation of an InternalResponse object
        :return: An InternalResponse object
        """
        auth_info = AuthenticationInformation.from_dict(int_resp_dict["auth_info"])
        internal_response = InternalResponse(auth_info=auth_info)
        if "hash_type" in int_resp_dict:
            internal_response.user_id_hash_type = UserIdHashType.from_string(int_resp_dict["hash_type"])
        internal_response.attributes = int_resp_dict["attr"]
        internal_response.user_id = int_resp_dict["usr_id"]
        internal_response.requester = int_resp_dict["to"]
        return internal_response

    def to_dict(self):
        """
        Converts an InternalResponse object to a dict
        :rtype: dict[str, dict[str, str] | str]
        :return: A dict representation of the object
        """
        _dict = {"usr_id": self.user_id,
                 "attr": self.attributes,
                 "to": self.requester,
                 "auth_info": self.auth_info.to_dict()}
        if self.user_id_hash_type:
            _dict["hash_type"] = self.user_id_hash_type.name
        return _dict


text:
CKEDITOR.plugins.setLang( 'colordialog', 'en', {
	clear: 'Clear',
	highlight: 'Highlight',
	options: 'Color Options',
	selected: 'Selected Color',
	title: 'Select color'
});


text:
Contributions to PHPFluent\EventManager are always welcome. You make our lives easier by
sending us your contributions through [GitHub pull requests](http://help.github.com/pull-requests).

Pull requests for bug fixes must be based on the current stable branch whereas
pull requests for new features must be based on `master`.

Due to time constraints, we are not always able to respond as quickly as we
would like. Please do not take delays personal and feel free to remind us here,
on IRC, or on Gitter if you feel that we forgot to respond.

## Using PHPFluent\EventManager from a git checkout

The following commands can be used to perform the initial checkout of PHPFluent\EventManager:

```shell
git clone git://github.com/PHPFluent/EventManager.git
cd EventManager
```

Retrieve PHPFluent\EventManager's dependencies using [Composer](http://getcomposer.org/):

```shell
composer install
```

## Running tests

After run `composer install` on the library's root directory you must run PHPUnit.

### Linux

You can test the project using the commands:
```shell
$ vendor/bin/phpunit
```

### Windows

You can test the project using the commands:
```shell
> vendor\bin\phpunit
```

No test should fail.

You can tweak the PHPUnit's settings by copying `phpunit.xml.dist` to `phpunit.xml`
and changing it according to your needs.

## Standards

We are trying to follow the [PHP-FIG](http://www.php-fig.org)'s standards, so
when you send us a pull request, be sure you are following them.


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycol. Res. 102(9): 1146 (1998)

#### Original name
Rotiferophthora amamiensis Glockling

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Replacing Records Using Cursors</title>
    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Getting Started with Berkeley DB" />
    <link rel="up" href="Cursors.html" title="Chapter 9. Using Cursors" />
    <link rel="prev" href="DeleteEntryWCursor.html" title="Deleting Records Using Cursors" />
    <link rel="next" href="cursorJavaUsage.html" title="Cursor Example" />

Library Version 11.2.5.3

          Replacing Records Using Cursors

          Prev
          Chapter 9. Using Cursors
           Next

Replacing Records Using Cursors

        You replace the data for a database record by using

            Cursor.putCurrent().

import com.sleepycat.db.Cursor;
import com.sleepycat.db.Database;
import com.sleepycat.db.DatabaseEntry;
import com.sleepycat.db.LockMode;
import com.sleepycat.db.OperationStatus;

...
Cursor cursor = null;
Database myDatabase = null;
try {
    ...
    // Database open omitted for brevity
    ...
    // Create DatabaseEntry objects
    // searchKey is some String.
    DatabaseEntry theKey = new DatabaseEntry(searchKey.getBytes("UTF-8"));
    DatabaseEntry theData = new DatabaseEntry();

    // Open a cursor using a database handle
    cursor = myDatabase.openCursor(null, null);

    // Position the cursor. Ignoring the return value for clarity
    OperationStatus retVal = cursor.getSearchKey(theKey, theData,
                                                 LockMode.DEFAULT);

    // Replacement data
    String replaceStr = "My replacement string";
    DatabaseEntry replacementData =
        new DatabaseEntry(replaceStr.getBytes("UTF-8"));
    cursor.putCurrent(replacementData);
} catch (Exception e) {
    // Exception handling goes here
} finally {
   // Make sure to close the cursor
   cursor.close();
}

        Note that you cannot change a record's key using this method; the key
        parameter is always ignored when you replace a record.

        When replacing the data portion of a record, if you are replacing a
        record that is a member of a sorted duplicates set, then the replacement
        will be successful only if the new record sorts identically to the old
        record. This means that if you are replacing a record that is a member
        of a sorted duplicates set, and if you are using the default
        lexicographic sort, then the replacement will fail due to violating the
        sort order. However, if you
        provide a custom sort routine that, for example, sorts based on just a
        few bytes out of the data item, then potentially you can perform
        a direct replacement and still not violate the restrictions described
        here.

            Under these circumstances, if

        you want to replace the data contained by a duplicate record,

                and you are not using a custom sort routine, then

        delete the record and create a new record with the desired key and data.

          Prev

            Up

           Next

          Deleting Records Using Cursors

            Home

           Cursor Example


text:
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <set>
#include <climits>
using namespace std;
#include "judger.h"

typedef long long s64;

#define for_stl(it, v) for (typeof(v.begin()) it = v.begin(); it != v.end(); it++)

double absfloor(double a)
{
	if (a > 0)
		return floor(a);
	else
		return ceil(a);
}

Owner getEnemy(Owner owner)
{
	if (owner == O_RED)
		return O_BLUE;
	else
		return O_RED;
}

string toStr(Owner owner)
{
	switch (owner)
	{
		case O_RED:
			return "Red";
		case O_BLUE:
			return "Blue";
		default:
			return "None";
	}
}
string getMsgHeader(Owner owner)
{
	switch (owner)
	{
		case O_RED:
			return "Red > ";
		case O_BLUE:
			return "Blue> ";
		default:
			return "None> ";
	}
}

const int TOT_GAME_TIME = 1800;
const int MAX_DROPLET_DISP = 30;
const int MAP_WIDTH = 10000;
const int MAP_HEIGHT = 10000;
const int MAKE_DROPLET_TIME = 5;
const int BRAIN_FULL_BLOOD = 5000;
const int DROPLET_FULL_BLOOD = 20;
const int BRAIN_RADIUS = 500;

inline bool lessPri(const Vector &a, const Vector &b)
{
	if (a.len2() != b.len2())
		return a.len2() < b.len2();
	if (a.x != b.x)
		return a.x < b.x;
	return a.y < b.y;
}

class invalid_movement_error : public myException
{
private:
	string what_arg;
public:
	explicit invalid_movement_error(const string& _what_arg) throw()
		: what_arg(_what_arg){}
	virtual ~invalid_movement_error() throw(){}
	virtual string what() const throw()
	{
		return what_arg;
	}
	virtual string code() const throw()
	{
		return "Invalid Output";
	}
};
class invalid_input_error : public myException
{
public:
	virtual string what() const throw()
	{
		return "invalid output.";
	}
	virtual string code() const throw()
	{
		return "Invalid Output";
	}
};
class failed_to_print_error : public myException
{
public:
	virtual string what() const throw()
	{
		//return "Input Exceeded"
		return "failed to print the situation information.";
	}
	virtual string code() const throw()
	{
		return "Input Exceeded";
	}
};

	Droplet* Judger::getDroplet(Owner owner, int id)
	{
		switch (owner)
		{
			case O_RED:
				if (!(0 <= id && id < (int)redDroplets.size()))
					return NULL;
				return &redDroplets[id];
			case O_BLUE:
				if (!(0 <= id && id < (int)blueDroplets.size()))
					return NULL;
				return &blueDroplets[id];
			default:
				return NULL;
		}
	}
	ExternalPlayer *Judger::getPlayer(Owner owner)
	{
		if (owner == O_RED)
			return &redPlayer;
		else
			return &bluePlayer;
	}

	void Judger::printSitu(Owner owner)
	{
		ExternalPlayer *pl = getPlayer(owner);
		Movement *em = owner == O_RED ? &blueMovement : &redMovement;

		if (fprintf(pl->in, "%d\n", (int)em->shootings.size()) < 0)
			throw failed_to_print_error();
		for_stl(it, em->shootings)
			if (fprintf(pl->in, "%d %d\n", it->first, it->second) < 0)
				throw failed_to_print_error();

		if (fprintf(pl->in, "%d\n", (int)em->poss.size()) < 0)
			throw failed_to_print_error();
		for_stl(it, em->poss)
		{
			int x = it->second.x, y = it->second.y;
			if (owner == O_BLUE)
				x = MAP_WIDTH - x;
			if (fprintf(pl->in, "%d %d %d\n", it->first, x, y) < 0)
				throw failed_to_print_error();
		}

		if (fprintf(pl->in, "%d\n", (int)em->newDropletsPosY.size()) < 0)
			throw failed_to_print_error();
		for_stl(it, em->newDropletsPosY)
			if (fprintf(pl->in, "%d\n", *it) < 0)
				throw failed_to_print_error();

		if (fprintf(pl->in, "0\n") < 0)
			throw failed_to_print_error();
		if (fprintf(pl->in, "-1 -1\n") < 0)
			throw failed_to_print_error();
		if (fprintf(pl->in, "0\n") < 0)
			throw failed_to_print_error();

		if (fflush(pl->in) == EOF)
			throw failed_to_print_error();
	}

	char Judger::readChar(FILE *in)
	{
		char c;
		while ((c = fgetc(in)) == EOF)
		{
			//if (ferror(in))
			//	throw invalid_input_error();
			//cerr<<"read:"<<c<<endl;
			if (programChecker)
				programChecker->check();
		}
		return c;
	}
	int Judger::readInt(FILE *in, char ed)
	{
		char c = readChar(in);
		int res;
		if (c == '0')
		{
			res = 0;
			c = readChar(in);
		}
		else if ('1' <= c && c <= '9')
		{
			res = c - '0';
			while (c = readChar(in), '0' <= c && c <= '9')
			{
				int d = c - '0';
				if (res > (INT_MAX - d) / 10)
					throw invalid_input_error();
				res = res * 10 + d;
			}
		}
		else if (c == '-')
		{
			res = 0;
			c = readChar(in);
			if (!('1' <= c && c <= '9'))
				throw invalid_input_error();
			res = c - '0';
			while (c = readChar(in), '0' <= c && c <= '9')
			{
				int d = c - '0';
				if (-((s64)res * 10 + d) < INT_MIN)
					throw invalid_input_error();
				res = res * 10 + d;
			}
			res = -res;
		}
		else
			throw invalid_input_error();
		if (c != ed)
			throw invalid_input_error();
		return res;
	}

	void Judger::readMovement(Owner owner)
	{
		ExternalPlayer *pl = getPlayer(owner);
		Movement *m = owner == O_RED ? &nextRedMovement : &nextBlueMovement;

		*m = Movement();

		int nShootings = readInt(pl->out, '\n');
		if (nShootings < 0)
			throw invalid_movement_error("the number of shootings is negative.");
		for (int i = 0; i < nShootings; i++)
		{
			int shooter = readInt(pl->out, ' '), target = readInt(pl->out, '\n');
			m->shootings.push_back(make_pair(shooter, target));
		}

		int nNewPos = readInt(pl->out, '\n');
		if (nNewPos < 0)
			throw invalid_movement_error("the number of new positions is negative.");
		for (int i = 0; i < nNewPos; i++)
		{
			int id = readInt(pl->out, ' '), x = readInt(pl->out, ' '), y = readInt(pl->out, '\n');
			if (owner == O_BLUE)
				x = MAP_WIDTH - x;
			if (m->poss.count(id))
				throw invalid_movement_error("try moving multiple times.");
			m->poss[id] = Vector(x, y);
		}

		int nNewDropletsPosY = readInt(pl->out, '\n');
		if (nNewDropletsPosY < 0)
			throw invalid_movement_error("the number of new droplets is negative.");
		for (int i = 0; i < nNewDropletsPosY; i++)
		{
			int y = readInt(pl->out, '\n');
			m->newDropletsPosY.push_back(y);
		}
	}

	void Judger::recordChar(const char &a)
	{
		fwrite(&a, 1, sizeof(char), logFile);
	}
	void Judger::recordUChar(const unsigned char &a)
	{
		fwrite(&a, 1, sizeof(unsigned char), logFile);
	}
	void Judger::recordShort(const short &a)
	{
		recordChar(a >> 8 & 255);
		recordChar(a & 255);
	}
	void Judger::recordInt(const int &a)
	{
		recordChar(a >> 24 & 255);
		recordChar(a >> 16 & 255);
		recordChar(a >> 8 & 255);
		recordChar(a & 255);
	}
	void Judger::recordString(const string &s)
	{
		recordInt((int)s.size());
		fwrite(s.c_str(), 1, (int)s.size(), logFile);
	}

	void Judger::recordDisp(Vector d)
	{
		int p = 0;
		while (p < (int)dispList.size() && !(dispList[p].x == d.x && dispList[p].y == d.y))
			p++;
		if (p == (int)dispList.size())
			recordUChar(255);
		else
		{
			if (p < 240)
				recordUChar(15 + p);
			else
				recordUChar((p - 200) >> 8), recordUChar((p - 200) & 255);
			for (int i = p; i > 0; i--)
				dispList[i] = dispList[i - 1];
			dispList[0] = d;
		}
	}

	void Judger::recordMovement(Owner owner)
	{
		Movement *m = owner == O_RED ? &redMovement : &blueMovement;
		recordString(m->errMsg.errMsg);
		if (!m->errMsg.errMsg.empty())
			return;
		recordShort((int)m->shootings.size());
		for_stl(it, m->shootings)
			recordShort(it->first), recordShort(it->second);

		const vector<Droplet> &dr = owner == O_RED ? redDroplets : blueDroplets;
		for_stl(it, dr)
			if (it->blood > 0)
			{
				Vector d;
				if (m->poss.count(it->id))
					d = m->poss[it->id] - it->pos;
				else
					d = Vector(-100, -100);
				recordDisp(d);
			}

		recordShort((int)m->newDropletsPosY.size());
		for_stl(it, m->newDropletsPosY)
			recordShort(*it);
	}

	void Judger::move(Owner owner)
	{
		try
		{
			printSitu(owner);
			readMovement(owner);
		}
		catch (myException &e)
		{
			Movement *m = owner == O_RED ? &nextRedMovement : &nextBlueMovement;
			m->errMsg.errMsg =  getMsgHeader(owner) + e.what();
			m->errMsg.errCode = e.code();
		}
	}

	bool Judger::checkMovementValid(Owner owner)
	{
		Movement *m = owner == O_RED ? &redMovement : &blueMovement;

		if (!m->errMsg.errMsg.empty())
			return false;

		try
		{
			set<int> shooterIdSet;
			for_stl(it, m->shootings)
			{
				Droplet *shooter = getDroplet(owner, it->first);
				Droplet *target = getDroplet(getEnemy(owner), it->second);
				if (shooter == NULL)
					throw invalid_movement_error("invalid shooter.");
				if (target == NULL)
					throw invalid_movement_error("invalid target.");
				if (shooterIdSet.count(it->first))
					throw invalid_movement_error("try shooting multiple targets.");
				if (!shooter->canShoot(*target))
					throw invalid_movement_error("out of firing range.");
				shooterIdSet.insert(it->first);
			}

			for_stl(it, m->poss)
			{
				Droplet *droplet = getDroplet(owner, it->first);
				if (droplet == NULL)
					throw invalid_movement_error("invalid move.");
				if (dist2(droplet->pos, it->second) > sqr(MAX_DROPLET_DISP))
					throw invalid_movement_error("move too fast.");
				if (0 > it->second.x || it->second.x > MAP_WIDTH)
					throw invalid_movement_error("move out of range.");
				if (0 > it->second.y || it->second.y > MAP_HEIGHT)
					throw invalid_movement_error("move out of range.");
			}

			int nWaitingDroplets = owner == O_RED ? nRedWaitingDroplets : nBlueWaitingDroplets;
			if ((int)m->newDropletsPosY.size() > nWaitingDroplets)
				throw invalid_movement_error("too much new droplets.");
			for_stl(it, m->newDropletsPosY)
			{
				if (0 > *it || *it > MAP_HEIGHT)
					throw invalid_movement_error("the new droplet is out of range.");
			}
		}
		catch (myException &e)
		{
			m->errMsg.errMsg = getMsgHeader(owner) + e.what();
			m->errMsg.errCode = e.code();
			return false;
		}

		return true;
	}

	void Judger::calcWinnerAndGameOver(bool isRedLost, bool isBlueLost)
	{
		if(!msgout.redInfo.str().empty() && !msgout.blueInfo.str().empty()){
			winner = O_NONE;
		}
		else if (isRedLost && isBlueLost)
		{
			if (redBrainBlood != blueBrainBlood)
			{
				if (redBrainBlood > blueBrainBlood)
					winner = O_RED;
				else
					winner = O_BLUE;
			}
			else if (redScore != blueScore)
			{
				if (redScore > blueScore)
					winner = O_RED;
				else
					winner = O_BLUE;
			}
			else
				winner = O_NONE;
		}
		else if (isRedLost)
			winner = O_BLUE;
		else if (isBlueLost)
			winner = O_RED;
		gameOver();
	}

	void Judger::gameOver()
	{
		isOver = true;
		if(!msgout.redInfo.str().empty() || !msgout.blueInfo.str().empty()){
			msgout.result=0;
			if(msgout.blueInfo.str().empty()){
				msgout.blueInfo<<"Normal Operation";
				msgout.result=2;
			}else if(msgout.redInfo.str().empty()){
				msgout.redInfo<<"Normal Operation";
				msgout.result=1;
			}
		}else{
			if(winner == O_RED){
				msgout.redInfo<<"";
				msgout.blueInfo<<"";
				msgout.result=1;
			}else if(winner == O_BLUE){
				msgout.blueInfo<<"";
				msgout.redInfo<<"";
				msgout.result=2;
			}else{
				msgout.redInfo<<"";
				msgout.blueInfo<<"";
				msgout.result=0;
			}
			msgout.redInfo << "HP:" << redBrainBlood <<" PT:" << redScore << "";
			msgout.blueInfo << "HP:" << blueBrainBlood <<" PT:" << blueScore << "";
		}
	}
	Judger::Judger(FILE *_logFile,const string &redlog,const string &bluelog)
	:logFile(_logFile),redPlayer(NULL, NULL), bluePlayer(NULL,NULL)
	{
		redMovement = Movement();
		redMovement.errMsg.errMsg = getMsgHeader(O_RED) + redlog;
		blueMovement = Movement();
		blueMovement.errMsg.errMsg = getMsgHeader(O_BLUE) + bluelog;
		recordMovement(O_RED);
		recordMovement(O_BLUE);
		fflush(logFile);
	}
	Judger::Judger(FILE *_redIn, FILE *_redOut, FILE *_blueIn, FILE *_blueOut, FILE *_logFile)
		: logFile(_logFile), redPlayer(_redIn, _redOut), bluePlayer(_blueIn, _blueOut),
		programChecker(NULL),
		redBrainPos(1000, 5000), blueBrainPos(9000, 5000),
		redBrainBlood(BRAIN_FULL_BLOOD), blueBrainBlood(BRAIN_FULL_BLOOD),
		nRedWaitingDroplets(0), nBlueWaitingDroplets(0),
		redMakeDropletRestTime(1), blueMakeDropletRestTime(1),
		redScore(0), blueScore(0),
		restTime(TOT_GAME_TIME)
	{
		isOver = false;

		if (_redIn == NULL || _blueIn == NULL)
		{
			calcWinnerAndGameOver(_redIn == NULL, _blueIn == NULL);
			return;
		}

		for (int x = -MAX_DROPLET_DISP; x <= MAX_DROPLET_DISP; x++)
			for (int y = -MAX_DROPLET_DISP; y <= MAX_DROPLET_DISP; y++)
				if (x * x + y * y <= sqr(MAX_DROPLET_DISP))
				dispList.push_back(Vector(x, y));
		sort(dispList.begin(), dispList.end(), lessPri), reverse(dispList.begin(), dispList.end());

		nextRedMovement = Movement();
		nextBlueMovement = Movement();
		simulate();
	}

	void Judger::setProgramChecker(ProgramChecker *_programChecker)
	{
		programChecker = _programChecker;
	}

	bool Judger::getIsOver()
	{
		if(isOver){
			fflush(logFile);
		}
		return isOver;
	}

	void Judger::run(Owner owner)
	{
		move(owner);
	}

	void Judger::simulate()
	{
		cerr << "restTime: " << restTime << endl;

		redMovement = nextRedMovement;
		blueMovement = nextBlueMovement;

		bool isRedLost = !checkMovementValid(O_RED);
		bool isBlueLost = !checkMovementValid(O_BLUE);

		recordMovement(O_RED);
		recordMovement(O_BLUE);

		if (isRedLost || isBlueLost)
		{
			if (isRedLost)
				msgout.redInfo << redMovement.errMsg.errCode;
			if (isBlueLost)
				msgout.blueInfo << blueMovement.errMsg.errCode;
			calcWinnerAndGameOver(isRedLost, isBlueLost);
			return;
		}

		for_stl(it, redDroplets)
			if (it->blood > 0 && dist2(it->pos, blueBrainPos) <= sqr(BRAIN_RADIUS) && blueBrainBlood > 0)
				blueBrainBlood--;
		for_stl(it, blueDroplets)
			if (it->blood > 0 && dist2(it->pos, redBrainPos) <= sqr(BRAIN_RADIUS) && redBrainBlood > 0)
				redBrainBlood--;
		isRedLost = redBrainBlood == 0;
		isBlueLost = blueBrainBlood == 0;
		if (isRedLost || isBlueLost)
		{
			calcWinnerAndGameOver(isRedLost, isBlueLost);
			return;
		}

		for_stl(it, redMovement.shootings)
			if (blueDroplets[it->second].blood > 0)
				blueDroplets[it->second].blood--, redDroplets[it->first].level++;
		for_stl(it, blueMovement.shootings)
			if (redDroplets[it->second].blood > 0)
				redDroplets[it->second].blood--, blueDroplets[it->first].level++;

		for_stl(it, redMovement.poss)
			if (redDroplets[it->first].blood > 0)
				redDroplets[it->first].pos = it->second;
		for_stl(it, blueMovement.poss)
			if (blueDroplets[it->first].blood > 0)
				blueDroplets[it->first].pos = it->second;

		nRedWaitingDroplets -= (int)redMovement.newDropletsPosY.size();
		for_stl(it, redMovement.newDropletsPosY)
		{
			Droplet dr;
			dr.id = (int)redDroplets.size();
			dr.owner = O_RED;
			dr.blood = DROPLET_FULL_BLOOD;
			dr.level = 0;
			dr.pos = Vector(0, *it);
			redDroplets.push_back(dr);
		}
		nBlueWaitingDroplets -= (int)blueMovement.newDropletsPosY.size();
		for_stl(it, blueMovement.newDropletsPosY)
		{
			Droplet dr;
			dr.id = (int)blueDroplets.size();
			dr.owner = O_BLUE;
			dr.blood = DROPLET_FULL_BLOOD;
			dr.level = 0;
			dr.pos = Vector(MAP_WIDTH, *it);
			blueDroplets.push_back(dr);
		}

		for_stl(it, blueDroplets)
			if (it->blood > 0)
			{
				int d = (int)floor(sqrt(dist2(it->pos, redBrainPos)) / 500);
				blueScore += max(8 - d, 0);
			}
		for_stl(it, redDroplets)
			if (it->blood > 0)
			{
				int d = (int)floor(sqrt(dist2(it->pos, blueBrainPos)) / 500);
				redScore += max(8 - d, 0);
			}

		redMakeDropletRestTime--;
		if (redMakeDropletRestTime == 0) {
			nRedWaitingDroplets++;
			redMakeDropletRestTime += MAKE_DROPLET_TIME;
		}
		blueMakeDropletRestTime--;
		if (blueMakeDropletRestTime == 0) {
			nBlueWaitingDroplets++;
			blueMakeDropletRestTime += MAKE_DROPLET_TIME;
		}

		restTime--;
		if (restTime == 0)
		{
			calcWinnerAndGameOver(true, true);
			return;
		}
	}

/*int main()
{
	FILE *redIn = fopen("RED.in", "w");
	FILE *redOut = fopen("RED.out", "r");
	FILE *blueIn = fopen("BLUE.in", "w");
	FILE *blueOut = fopen("BLUE.out", "r");
	FILE *logFile = fopen("log.bin", "wb");

	// Oops, open red program failed!
	// no problem!
	// Judger ju(NULL, NULL, blueIn, blueOut, logFile);
	//

	Judger ju(redIn, redOut, blueIn, blueOut, logFile);

	SampleProgramChecker checker;
	// you can set program checker at any time.
	ju.setProgramChecker(&checker);

	while (!ju.getIsOver())
	{
		ju.run(O_RED);
		ju.run(O_BLUE);
		ju.simulate();
	}
	cerr << ju.getMsg();

    return 0;
}
*/


text:
extern "Java"
{
  namespace java
  {
    namespace awt
    {
        class Dimension;
        class Font;
    }
  }
  namespace javax
  {
    namespace swing
    {
      namespace border
      {
          class Border;
      }
      namespace tree
      {
          class DefaultTreeCellEditor;
          class DefaultTreeCellEditor$DefaultTextField;
      }
    }
  }
}

class javax::swing::tree::DefaultTreeCellEditor$DefaultTextField : public ::javax::swing::JTextField
{

public:
  DefaultTreeCellEditor$DefaultTextField(::javax::swing::tree::DefaultTreeCellEditor *, ::javax::swing::border::Border *);
  virtual ::java::awt::Font * getFont();
  virtual ::javax::swing::border::Border * getBorder();
  virtual ::java::awt::Dimension * getPreferredSize();
public: // actually package-private
  static const jlong serialVersionUID = -6629304544265300143LL;
public: // actually protected
  ::javax::swing::border::Border * __attribute__((aligned(__alignof__( ::javax::swing::JTextField)))) border;
public: // actually package-private
  ::javax::swing::tree::DefaultTreeCellEditor * this$0;
public:
  static ::java::lang::Class class$;
};

#endif // __javax_swing_tree_DefaultTreeCellEditor$DefaultTextField__


text:
<?php

  use osCommerce\OM\Core\HTML;

  function osc_cfg_set_textarea_field($default, $key = null) {
    $name = (!empty($key) ? 'configuration[' . $key . ']' : 'configuration_value');

    return HTML::textareaField($name, $default, 35, 5);
  }
?>


text:
const addon = require('./build/Release/arguments');
console.log('this should be eight:', addon.add(3,5));


text:
/*
 * Chiamata ajax che ritorna in data il livello dell'utente
 * ed in base ad esso sblocca gli opportuni livelli.
 */

$.ajax({
    url:"PHP/checkLevel.php",
    type:"get",
    dataType: 'text',
    async:false,
    success:function(data){
                for(var i=0;i<data;i++){
                    $("#"+(i+1)).removeAttr("disabled");

                }
            }
    });


text:
body {
   background: #eee;
}
.phaseFormColumns {
   vertical-align: top;
   font-style: italic;
   font-size: 1.1em;
}
.columns {
   vertical-align: top;
}


text:
require 'hashugar'

class Authentication < ActiveRecord::Base
  belongs_to :resource, polymorphic: true
  validates :provider, :uid, presence: true

  def self.from(omniauth_data, resource)
    auth = normalize(omniauth_data)
    authentication = self.find_or_create(auth)
    authentication.access_token = auth.credentials.token
    authentication.access_token_secret = auth.credentials.secret
    authentication.resource = resource
    resource.save(validate: false)
    authentication.save
    authentication
  end

  def self.normalize(omniauth_data)
    return omniauth_data if omniauth_data.is_a? Hashugar
    normalized = omniauth_data.to_hashugar
    normalized.delete(:extra)
    normalized.credentials ||= {}
    normalized.info ||= {}
    normalized.info.delete(:description)
    normalized
  end

  private

  def self.find_or_create(auth)
    self.find_by(
      provider: auth.provider,
      uid: auth.uid) ||
    self.new(
      provider: auth.provider,
      uid: auth.uid,
      access_token: auth.credentials.token)
  end

end


text:
module PhatPgsearch
  module PostgreSQL
    class IndexDefinition < Struct.new(:table, :name, :type, :column) #:nodoc:
    end

    module SchemaDumper
      def self.included(base)

      end

      def indexes

      end
    end

    module SchemaStatements

      # deprecated
      # use: add_index :sample_headers, :tsv, using: :gin
      def add_gin_index(table_name, column_name, options = {})
        index_name = index_name(table_name, :column => column_name)
        index_name = options[:name].to_s if options.key?(:name)
        execute "CREATE INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)} USING gin(#{quote_column_name(column_name)})"
      end

      # deprecated
      # use: add_index :sample_headers, :tsv, using: :gist
      def add_gist_index(table_name, column_name, options = {})
        index_name = index_name(table_name, :column => column_name)
        index_name = options[:name].to_s if options.key?(:name)
        execute "CREATE INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)} USING gist(#{quote_column_name(column_name)})"
      end
    end

    module PostgreSQLColumn
      def pgsearch_index(table)

      end

      def simplified_type(field_type)
        if field_type == 'tsvector'
          :string
        else
          super(field_type)
        end
      end
    end

    module TableDefinition
      def self.included(base)
        # add data type
        ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:tsvector] = {:name => "tsvector"}
      end

      # add tsvector column
      def tsvector(*args)
        options = args.extract_options!
        column_names = args
        column_names.each { |name| column(name, :tsvector, options) }
      end
    end
  end
end


text:
'''
==================
RBF SVM parameters
==================

This example illustrates the effect of the parameters `gamma`
and `C` of the rbf kernel SVM.

Intuitively, the `gamma` parameter defines how far the influence
of a single training example reaches, with low values meaning 'far'
and high values meaning 'close'.
The `C` parameter trades off misclassification of training examples
against simplicity of the decision surface. A low C makes
the decision surface smooth, while a high C aims at classifying
all training examples correctly.

Two plots are generated.  The first is a visualization of the
decision function for a variety of parameter values, and the second
is a heatmap of the classifier's cross-validation accuracy as
a function of `C` and `gamma`.
'''
print __doc__

import numpy as np
import pylab as pl

from sklearn.svm import SVC
from sklearn.preprocessing import Scaler
from sklearn.datasets import load_iris
from sklearn.cross_validation import StratifiedKFold
from sklearn.grid_search import GridSearchCV

##############################################################################
# Load and prepare data set
#
# dataset for grid search
iris = load_iris()
X = iris.data
Y = iris.target

# dataset for decision function visualization
X_2d = X[:, :2]
X_2d = X_2d[Y > 0]
Y_2d = Y[Y > 0]
Y_2d -= 1

# It is usually a good idea to scale the data for SVM training.
# We are cheating a bit in this example in scaling all of the data,
# instead of fitting the transformation on the training set and
# just applying it on the test set.

scaler = Scaler()

X = scaler.fit_transform(X)
X_2d = scaler.fit_transform(X_2d)

##############################################################################
# Train classifier
#
# For an initial search, a logarithmic grid with basis
# 10 is often helpful. Using a basis of 2, a finer
# tuning can be achieved but at a much higher cost.

C_range = 10.0 ** np.arange(-2, 9)
gamma_range = 10.0 ** np.arange(-5, 4)
param_grid = dict(gamma=gamma_range, C=C_range)

grid = GridSearchCV(SVC(), param_grid=param_grid, cv=StratifiedKFold(y=Y, k=3))
grid.fit(X, Y)

print("The best classifier is: ", grid.best_estimator_)

# Now we need to fit a classifier for all parameters in the 2d version
# (we use a smaller set of parameters here because it takes a while to train)
C_2d_range = [1, 1e2, 1e4]
gamma_2d_range = [1e-1, 1, 1e1]
classifiers = []
for C in C_2d_range:
    for gamma in gamma_2d_range:
        clf = SVC(C=C, gamma=gamma)
        clf.fit(X_2d, Y_2d)
        classifiers.append((C, gamma, clf))

##############################################################################
# visualization
#
# draw visualization of parameter effects
pl.figure(figsize=(8, 6))
xx, yy = np.meshgrid(np.linspace(-5, 5, 200), np.linspace(-5, 5, 200))
for (k, (C, gamma, clf)) in enumerate(classifiers):
    # evaluate decision function in a grid
    Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()])
    Z = Z.reshape(xx.shape)

    # visualize decision function for these parameters
    pl.subplot(len(C_2d_range), len(gamma_2d_range), k + 1)
    pl.title("gamma 10^%d, C 10^%d" % (np.log10(gamma), np.log10(C)),
        size='medium')

    # visualize parameter's effect on decision function
    pl.pcolormesh(xx, yy, -Z, cmap=pl.cm.jet)
    pl.scatter(X_2d[:, 0], X_2d[:, 1], c=Y_2d, cmap=pl.cm.jet)
    pl.xticks(())
    pl.yticks(())
    pl.axis('tight')

# plot the scores of the grid
# grid_scores_ contains parameter settings and scores
score_dict = grid.grid_scores_

# We extract just the scores
scores = [x[1] for x in score_dict]
scores = np.array(scores).reshape(len(C_range), len(gamma_range))

# draw heatmap of accuracy as a function of gamma and C
pl.figure(figsize=(8, 6))
pl.subplots_adjust(left=0.05, right=0.95, bottom=0.15, top=0.95)
pl.imshow(scores, interpolation='nearest', cmap=pl.cm.spectral)
pl.xlabel('gamma')
pl.ylabel('C')
pl.colorbar()
pl.xticks(np.arange(len(gamma_range)), gamma_range, rotation=45)
pl.yticks(np.arange(len(C_range)), C_range)

pl.show()


text:
package gov.nih.nci.nbia.servlet;

import gov.nih.nci.nbia.security.AuthorizationManager;
import gov.nih.nci.nbia.util.ThumbnailUtil;

import java.io.File;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * This is the cousin of the ThumbnailServer.... it is application wide
 * and allows access only to thumbnails that are public.
 */
public class PublicOnlyThumbnailServlet extends HttpServlet {

    public void service(HttpServletRequest request,
    		            HttpServletResponse response) throws ServletException,
    		                                                 IOException {

    	//crap, if this takes too long.... can't put it in init()
    	//because authorizations can change.  maybe put on a timer - like every hour
    	//or so rebuild this and store it?
    	AuthorizationManager authorizationManager = null;
    	try {
    		authorizationManager = new AuthorizationManager();
    	}
    	catch(Exception ex) {
    		ex.printStackTrace();
    		throw new RuntimeException();
    	}

    	// Get the file path ID from the request
        String imageId = request.getParameter("imageId");
        if(imageId==null) {
        	response.setStatus(400);
        	return;
        }
        int indx = imageId.indexOf('-');
		String locPart1 = imageId;
		String locPart2 = null;
		if (indx != -1) {
			locPart1 = imageId.substring(0, indx);
			locPart2 = imageId.substring(indx + 1);
		}

        File dicomFile = ThumbnailUtil.retrieveImageFile(authorizationManager,
        		locPart1);
        if(dicomFile==null) {
        	response.setStatus(400);
        	return;
        }
        File thumbnailFile = null;
        if (locPart2 != null) {
			thumbnailFile = ThumbnailUtil.deduceThumbnailFromDicomFile(
					dicomFile, locPart2);
		} else {
			thumbnailFile = ThumbnailUtil.deduceThumbnailFromDicomFile(dicomFile);
		}

        ThumbnailUtil.writeJpegFile(thumbnailFile, response);
    }

}


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

<title>TimeSourceProvider</title>
<meta name="date" content="2016-09-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.deeplearning4j.spark.time

Class TimeSourceProvider

java.lang.Object

org.deeplearning4j.spark.time.TimeSourceProvider

public class TimeSourceProvider
extends java.lang.Object

TimeSourceProvider: used to get a TimeSource via a static method.

 Defaults to the Network Time Protocol implementation NTPTimeSource, but can be switched to other implementations
 via the TIMESOURCE_CLASSNAME_PROPERTY system property.

Field Summary

Fields

Modifier and Type
Field and Description

static java.lang.String
DEFAULT_TIMESOURCE_CLASS_NAME

Default class to use when getting a TimeSource instance

static java.lang.String
TIMESOURCE_CLASSNAME_PROPERTY

Name of the system property to set if the TimeSource type/class is to be customized

Method Summary

All Methods Static Methods Concrete Methods

Modifier and Type
Method and Description

static TimeSource
getInstance()

Get a TimeSource
 the default TimeSource instance (default: NTPTimeSource

static TimeSource
getInstance(java.lang.String className)

Get a specific TimeSource by class name

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_TIMESOURCE_CLASS_NAME

public static final java.lang.String DEFAULT_TIMESOURCE_CLASS_NAME

Default class to use when getting a TimeSource instance

TIMESOURCE_CLASSNAME_PROPERTY

public static final java.lang.String TIMESOURCE_CLASSNAME_PROPERTY

Name of the system property to set if the TimeSource type/class is to be customized

See Also:

Constant Field Values

Method Detail

getInstance

public static TimeSource getInstance()

Get a TimeSource
 the default TimeSource instance (default: NTPTimeSource

Returns:

TimeSource

getInstance

public static TimeSource getInstance(java.lang.String className)

Get a specific TimeSource by class name

Parameters:

className - Class name of the TimeSource to return the instance for

Returns:

TimeSource instance

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package org.jboss.pnc.causewayclient;

import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.apache.http.client.fluent.Request;
import org.apache.http.entity.ContentType;
import org.apache.http.message.BasicHeader;
import org.apache.http.util.EntityUtils;
import org.jboss.pnc.causewayclient.remotespi.BuildImportRequest;
import org.jboss.pnc.causewayclient.remotespi.UntagRequest;
import org.jboss.pnc.common.json.JsonOutputConverterMapper;
import org.jboss.pnc.common.json.moduleconfig.BpmModuleConfig;
import org.jboss.pnc.common.util.HttpUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import java.io.IOException;

/**
 * @author Matej Lazar
 */
@Dependent
public class DefaultCausewayClient implements CausewayClient {

    Logger logger = LoggerFactory.getLogger(DefaultCausewayClient.class);

    private String buildPushEndpoint;
    private String untagEndpoint;

    @Deprecated //CDI workaround
    public DefaultCausewayClient() {
    }

    @Inject
    public DefaultCausewayClient(BpmModuleConfig bpmModuleConfig) {
        String causewayBaseUrl = bpmModuleConfig.getCausewayBaseUrl();
        buildPushEndpoint = causewayBaseUrl + "/import/build";
        untagEndpoint = causewayBaseUrl + "/untag/build";
    }

    boolean post(String url, String jsonMessage, String authToken) {
        Header authHeader = new BasicHeader("Authorization", "Bearer " + authToken);
        HttpResponse response;
        try {
            logger.info("Making POST request to {}.", url);
            logger.debug("Request body {}.", jsonMessage);
            response = Request.Post(url)
                    .addHeader(authHeader)
                    .bodyString(jsonMessage, ContentType.APPLICATION_JSON)
                    .execute()
                    .returnResponse();
        } catch (IOException e) {
            logger.error("Failed to invoke remote Causeway.", e);
            return false;
        }
        try {
            int statusCode = response.getStatusLine().getStatusCode();
            logger.info("Response status: {}", statusCode);
            logger.debug("Response: " + EntityUtils.toString(response.getEntity()));
            if (!HttpUtils.isSuccess(statusCode)) {
                return false;
            }
        } catch (IOException e) {
            logger.error("Failed to read Causeway response.", e);
            return false;
        }
        return true;
    }

    @Override
    public boolean importBuild(BuildImportRequest buildImportRequest, String authToken) {
        String jsonMessage = JsonOutputConverterMapper.apply(buildImportRequest);
        return post(buildPushEndpoint, jsonMessage, authToken);
    }

    @Override
    public boolean untagBuild(UntagRequest untagRequest, String authToken) {
        String jsonMessage = JsonOutputConverterMapper.apply(untagRequest);
        return post(untagEndpoint, jsonMessage, authToken);
    }

}


text:
  La Celle est
      une commune localisée dans le département de Var en Provence-Alpes-Côte d'Azur. Elle comptait 1 239 habitants en 2008.

Le nombre d'habitations, à La Celle, se décomposait en 2011 en 93 appartements et 515 maisons soit
 un marché plutôt équilibré.

La commune dispose en ce qui concerne l'éducation des jeunes de un lycée.
Pour ceux d'entre nous ayant moins de 6 ans, la commune dispose de deux écoles primaires.
La Celle dispose des équipements éducatifs facilitant une éducation de qualité.
Lors d'un projet d'acheter un appartement ou une maison à La Celle, il est important évaluer la qualité des équipements éducatifs

La commune compte quelques  équipements sportifs, elle propose entre autres un terrain de tennis, un terrain de sport et une boucle de randonnée.

À coté de La Celle sont localisées les communes de
La Roquebrussanne à 7 km, 2 061 habitants,
Vins-sur-Caramy à 9 km, 773 habitants,
Garéoult située à 7 km, 5 435 habitants,
Forcalqueiret à 7 km, 2 039 habitants,
Camps-la-Source à 4 km, 1 485 habitants,
Néoules localisée à 9 km, 2 264 habitants,
 entre autres. De plus, La Celle est située à seulement 28 km de La Valette-du-Var.

À La Celle, la valeur moyenne à la vente d'un appartement s'évalue à 2 421 € du m² en vente. la valorisation moyenne d'une maison à l'achat se situe à 2 396 € du m². À la location la valorisation moyenne se situe à 10,47 € du m² par mois.