text:
author: temjeito@yahoo.com
comments: true
date: 2014-09-05 17:39:07+00:00
excerpt:
Yesterday, Getty sued Microsoft for copyright infringement in the Southern
  District of New York, alleging that images published through Microsoft's Widget
  "typically consist of copyrighted images, including images whose copyrights are
  owned or controlled by" Getty. Getty alleges that the Widget has "been implemented
  by websites around the world – including in commercial settings…." Microsoft will
  no doubt rely on the Ninth Circuit's decision in Perfect 10. Below, I lay out my
  first impressions of how I think Getty might fare based on that decision.

layout: post
slug: 201495getty-says-bing-widget-infringes-copyrights
title: Getty Says Bing "Widget" Infringes Copyrights
wordpress_id: 68
categories:
- Copyright
- Intellectual Property
- Litigation
tags:
- copyright
- Perfect 10
- photographs
- search engines
---
A few weeks ago, Microsoft launched a new service called "[Bing Image Widget]".[^1] The "Widget" is a string of code that you embed in your website, and which will stream images corresponding to any search terms you select to a configurable panel on the site. Here is the Widget for "nerd":

You can choose to display images in the Widget in "collage" form, as above, or in "slideshow" form. Here's "lawyer" in slideshow form:

[Microsoft's terms of service] restrict the user from doing any of the following:

> (h) use the Services to violate the law or for any unauthorized purpose;
> (i) use the Services to infringe upon the copyright, trademark or other intellectual property rights of anyone;
> (h) copy, store, or cache any Bing Image Widget or Bing results or image information from the Services;
> (j) commercialize (i.e., sell, rent, or lease) Bing Image Widget or Bing results; > >

Getty Images, Inc. has a similar service called "[Embed]". Embed draws search results from Getty's own collection of images, and generates code that will publish a single image on your website. Here's an Embedded Getty image showing one of the three results for "nerd lawyer".

[\#163640873] / [gettyimages.com]

[Getty's terms of service] restrict use of their embedded viewer as follows:

> You may only use embedded Getty Images Content for editorial purposes (meaning relating to events that are newsworthy or of public interest). Embedded Getty Images Content may not be used: (a) for any commercial purpose (for example, in advertising, promotions or merchandising) or to suggest endorsement or sponsorship; (b) in violation of any stated restriction; (c) in a defamatory, pornographic or otherwise unlawful manner; or (d) outside of the context of the Embedded Viewer.

Getty's [FAQ] tells a slightly different story:[^2]

> **Are there any restrictions for using a Getty Images photo I've embedded on a website, social media site or blog?**

Yes. You may not use Getty Images embedded photos for the following purposes or in the following manner:

• Commercial use intended to sell a product, raise money, or promote or endorse something.

• Any use that is defamatory, pornographic or otherwise illegal.

• Any use that violates a stated restriction on the gettyimages.com image details page.

• Any use outside of the context of the embed functionality. > >
Yesterday, Getty sued Bing for copyright infringement in the Southern District of New York, alleging that images published through Microsoft's Widget "typically consist of copyrighted images, including images whose copyrights are owned or controlled by" Getty. Getty alleges that the Widget has "been implemented by websites around the world – including in commercial settings…."

Getty alleges that the larger-sized images displayed in the "slideshow" view are "hosted and served from the third-party website that hosts the image and from which \[Microsoft\], through Bing Image Search, made its copy of the thumbnail version of the image." Getty further alleges that:

> Defendant intentionally masks the third-party source website and any context that surrounds the image as it appears on that third-party site, creating the appearance that the image is instead coming from the Bing-branded display panel. Further masking the image's origin (and serving Defendant's own commercial interests), clicking the image takes the user not to the third-party source website, but instead to Defendant's own Bing Image Search site.

Microsoft will no doubt rely on the Ninth Circuit's decision in *Perfect 10*.[^3] Below, I lay out my first impressions of how I think Getty might fare based on that decision.[^4]

Direct Infringement
===================

Based on the allegations in the complaint I would expect Getty to attempt to distinguish *Perfect 10* on the basis that the Widget displays larger images, not just thumbnails. However, Perfect 10 itself raised a similar defense in what appear to have been similar circumstances, and was unsuccessful.[^5] In *Yandex*, Perfect 10 argued that, unlike Google, Yandex's image search linked directly to a full-size version of the image stored on Perfect 10's website, but displayed that image on a webpage with the Yandex logo on it. The court declined to distinguish this from the "in-line" linking that the Ninth Circuit held was not infringing in *Pefect 10*.[^6]

Fair Use
--------

Microsoft also can be expected to raise a fair use defense.

**Purpose and character.** Although it relies on the Bing search engine to select the images it displays, the Widget would not seem to provide the same "informative function," or provide an "entirely new" use or context as a page of search results. The intended end use of the images would seem to be for aesthetic purposes,[^7] and Microsoft's use of the images appears to be primarily for a commercial purpose. In its terms of service, Microsoft reserves the right to include its own trademarks or logos, as well as advertising, in the images provided through the Widget, and restricts the user's right to monetize pages in which the Widget is embedded.

**Nature of work.** The images are likely to be found to be (at least mostly) creative in nature, but obviously also previously published on the Internet.

**Amount and substantiality.** It appears that the Widget displays the entire image. Like Google before it, Microsoft can argue that use of the entire image is necessary for the purposes of displaying search results. The purpose of the Widget is somewhat different, however, and I suppose an argument could be made that the usefulness of the Widget would not be impaired by using only parts of images.

**Effect of use.** The Widget is more closely aligned with the potential market for images on the Internet than are search results. Getty itself uses (and has been using) the images it alleges Microsoft is infringing in a very similar way.

Contributory Infringement
=========================

There is a strong argument that the end users are directly infringing Getty's copyrighted images[^8] when they publish those images on their websites, and the Widget almost certainly provides end users with "substantial assistance" in that regard. Getty makes a conclusory allegation that Microsoft can "stop or limit infringement occuring through the use of the Bing Image Widget." However, Microsoft's terms of service do not assert the right to limit or remove the images that appear in the Widget. Notably, the complaint does not allege that Getty notified Microsoft that it was infringing specific works. If Microsoft can and has taken steps to exclude Getty's images from the Widget, actual knowledge may present an insurmountable hurdle.

Vicarious Infringement
======================

As noted above, Microsoft's terms of service suggest Microsoft may not have the technical and/or practical ability to control end users' use of the Widget and the images therein. However, the fact that every website using the Widget has Microsoft's code embedded in it suggests at least a greater level of control/ability to monitor than in the case of images on Google's search results page.

On a first look, my sense is that Getty will have a very hard time proving direct infringement because Microsoft doesn't store the full-size images on its servers. If Getty can get over that hurdle, I think it has the better of the fair use argument. I think it is likely that the court will find that the purpose of the Widget is less transformative than that of a search engine. Whether Microsoft is secondarily liable will probably turn on the underlying technology; specifically, the extent to which Microsoft has the ability to monitor, control, and limit the use of the Widget and the images it displays. If Microsoft lacks the technical or practical ability to do that, it should be able to avoid secondary liability. On the other hand, if it *does* have that ability, the question will be whether, when, and to what extent Microsoft acted to ensure that Getty's copyrighted images were not being displayed on the Widget once Microsoft became aware of the alleged infringement.

Please share your views in the comments section below, especially if you disagree with my analysis.

------------------------------------------------------------------------

[^1]: I had no idea either.

[^2]: I see a blog post on [conflicting terms and policies] in my future.

[^3]: *Perfect 10, Inc. v. Amazon.com, Inc.*, 508 F.3d 1146 (2007).

[^4]: District courts in the Second Circuit have repeatedly followed *Perfect 10*.

[^5]: *Perfect 10, Inc. v. Yandex N.V.*, 962 F.Supp.2d 1146 (N.D. Cal. 2013) ("Yandex").

[^6]: The Ninth Circuit also rejected Perfect 10's arguments based on potential confusion about the source of the images in *Perfect 10*: "While in-line linking and framing may cause some computer users to believe they are viewing a single Google webpage, the Copyright Act, unlike the Trademark Act, does not protect a copyright holder against acts that cause consumer confusion." *Pefect 10*, 508 F.3d 1146 at 1161.

[^7]: Although the actual purpose of use may vary from website to website.

[^8]: Getty's images are licensed in a variety of different ways, so the case for direct infringement may be stronger for some images than for others.

  [Bing Image Widget]: http://www.bing.com/widget/image
  [Microsoft's terms of service]: http://www.bing.com/webmaster/help/bing-image-widget-terms-of-service-6e6e374c
  [Embed]: http://www.gettyimages.com/embed
  [\#163640873]: http://www.gettyimages.com/detail/163640873
  [gettyimages.com]: http://www.gettyimages.com
  [Getty's terms of service]: http://www.gettyimages.com/Corporate/Terms.aspx
  [FAQ]: http://www.gettyimages.com/HelpCenter#embed
  [conflicting terms and policies]: http://mbsmithlaw.com/nerdlawyer/2014/9/2/do-your-refund-policies-and-practices-comply-with-local-laws#here


text:
#pragma once

#include <limits>
#include <algorithm>
#include <cmath>

#include "hostdevice.h"

typedef enum {
    CTC_STATUS_SUCCESS = 0,
    CTC_STATUS_MEMOPS_FAILED = 1,
    CTC_STATUS_INVALID_VALUE = 2,
    CTC_STATUS_EXECUTION_FAILED = 3,
    CTC_STATUS_UNKNOWN_ERROR = 4
} ctcStatus_t;

typedef enum {
    CTC_CPU = 0,
    CTC_GPU = 1
} ctcComputeLocation;

namespace ctc_helper {

static const float threshold = 1e-1;

template<typename T>
HOSTDEVICE
T neg_inf() { return -T(INFINITY); }

inline int div_up(int x, int y) {
    return (x + y - 1) / y;
}

template <typename Arg, typename Res = Arg> struct maximum {
    HOSTDEVICE
    Res operator()(const Arg& x, const Arg& y) const {
        return x < y ? y : x;
    }
};

template <typename Arg, typename Res = Arg> struct add {
    HOSTDEVICE
    Res operator()(const Arg& x, const Arg& y) const {
        return x + y;
    }
};

template <typename Arg, typename Res = Arg> struct identity {
    HOSTDEVICE Res operator()(const Arg& x) const {return Res(x);}
};

template <typename Arg, typename Res = Arg> struct negate {
    HOSTDEVICE Res operator()(const Arg& x) const {return Res(-x);}
};

template <typename Arg, typename Res = Arg> struct exponential {
    HOSTDEVICE Res operator()(const Arg& x) const {return std::exp(x);}
};

template<typename Arg1, typename Arg2 = Arg1, typename Res=Arg1>
struct log_plus {
    typedef Res result_type;
    HOSTDEVICE
    Res operator()(const Arg1& p1, const Arg2& p2) {
        if (p1 == neg_inf<Arg1>())
            return p2;
        if (p2 == neg_inf<Arg2>())
            return p1;
        Res result = log1p(exp(-fabs(p1 - p2))) + maximum<Res>()(p1, p2);
        return result;
    }
};

}

redpajama_set_name: RedPajamaGithub


text:
/*eslint no-console:0 */
'use strict';
const webpack = require('webpack');
const config = require('../cfg/dist.js');

webpack(config, function (err, stats) {
  if (err) throw err
  process.stdout.write(stats.toString({
    colors: true,
    modules: false,
    children: false,
    chunks: false,
    chunkModules: false
  }) + '\n\n')
})


text:
package org.hawkular.client.android.backend;

import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.hawkular.client.android.auth.ModifiedAuthzModule;
import org.hawkular.client.android.auth.ModuleKeeper;
import org.hawkular.client.android.auth.Session;
import org.hawkular.client.android.backend.model.Alert;
import org.hawkular.client.android.backend.model.AlertStatus;
import org.hawkular.client.android.backend.model.Environment;
import org.hawkular.client.android.backend.model.Metric;
import org.hawkular.client.android.backend.model.MetricData;
import org.hawkular.client.android.backend.model.Persona;
import org.hawkular.client.android.backend.model.Resource;
import org.hawkular.client.android.backend.model.Trigger;
import org.hawkular.client.android.util.Ports;
import org.hawkular.client.android.util.Uris;
import org.hawkular.client.android.util.Urls;
import org.jboss.aerogear.android.authorization.AuthorizationManager;
import org.jboss.aerogear.android.authorization.AuthzModule;
import org.jboss.aerogear.android.core.Callback;
import org.jboss.aerogear.android.core.ReadFilter;
import org.jboss.aerogear.android.pipe.LoaderPipe;
import org.jboss.aerogear.android.pipe.PipeConfiguration;
import org.jboss.aerogear.android.pipe.PipeManager;
import org.jboss.aerogear.android.pipe.module.PipeModule;
import org.jboss.aerogear.android.pipe.rest.RestfulPipeConfiguration;

import android.Manifest;
import android.app.Activity;
import android.app.Fragment;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresPermission;

/**
 * Backend client.
 *
 * A master controller for all backend-related operations.
 *
 * Configures proper {@link org.jboss.aerogear.android.pipe.module.PipeModule} instances for authorization
 * using {@link org.jboss.aerogear.android.authorization.AuthorizationManager}. Configures used in the application
 * {@link org.jboss.aerogear.android.pipe.Pipe} instances.
 *
 * Most of the configuration is stored using internal AeroGear long-lived objects. It is not necessary to handle
 * this class objects as singletons, it is intended to be used as a short-lived object.
 *
 * As a rule of thumb, it is necessary to configure authorization using {@link #configureAuthorization()}
 * in the beginning of the application lifecycle, most likely
 * on the first screen. The next step is to configure {@link org.jboss.aerogear.android.pipe.Pipe} instances.
 * The best time to to do so of course is after the authorization process.
 *
 * {@link org.jboss.aerogear.android.pipe.Pipe} instances are not exposed to class users, external API prefers
 * {@link org.jboss.aerogear.android.core.Callback} over them.
 */
public final class BackendClient {
    private final Activity activity;
    private final Fragment fragment;

    @NonNull
    @RequiresPermission(Manifest.permission.INTERNET)
    public static BackendClient of(@NonNull Activity activity) {
        return new BackendClient(activity, null);
    }

    @NonNull
    @RequiresPermission(Manifest.permission.INTERNET)
    public static BackendClient of(@NonNull Fragment fragment) {
        return new BackendClient(null, fragment);
    }

    private BackendClient(Activity activity, Fragment fragment) {
        this.activity = activity;
        this.fragment = fragment;
    }

    public void saveCred(String key, String secret)
    {
        Session session = new Session(key, secret);
        ((ModifiedAuthzModule)getAuthorizationModule()).addAccount(session);
    }

    public void configureAuthorization() {
        ModuleKeeper.modules.put("hawkular", new ModifiedAuthzModule(activity.getApplicationContext()));
    }

    public void configureCommunication(@NonNull String host, @NonNull Persona persona) {
        URL backendUrl = Urls.getUrl(host);

        configurePipes(backendUrl, persona);
    }

    public void configureCommunication(@NonNull String host,
                                       @IntRange(from = Ports.MINIMUM, to = Ports.MAXIMUM) int port,
                                       @NonNull Persona persona) {
        URL backendUrl = Urls.getUrl(host, port);

        configurePipes(backendUrl, persona);
    }

    private void configurePipes(URL backendUrl, Persona persona) {
        URL pipeUrl = Urls.getUrl(backendUrl, BackendPipes.Paths.ROOT);

        List<PipeModule> pipeModules = Arrays.asList(
            getAuthorizationModule(),
            getPersonnelModule(persona));

        configurePipe(BackendPipes.Names.ALERTS, pipeUrl, pipeModules, Alert.class);
        configurePipe(BackendPipes.Names.ALERT_ACKNOWLEDGE, pipeUrl, pipeModules, String.class);
        configurePipe(BackendPipes.Names.ALERT_RESOLVE, pipeUrl, pipeModules, String.class);
        configurePipe(BackendPipes.Names.ENVIRONMENTS, pipeUrl, pipeModules, Environment.class);
        configurePipe(BackendPipes.Names.METRICS, pipeUrl, pipeModules, Metric.class);
        configurePipe(BackendPipes.Names.METRIC_DATA_AVAILABILITY, pipeUrl, pipeModules, MetricData.class);
        configurePipe(BackendPipes.Names.METRIC_DATA_GAUGE, pipeUrl, pipeModules, MetricData.class);
        configurePipe(BackendPipes.Names.PERSONA, backendUrl, pipeModules, Persona.class);
        configurePipe(BackendPipes.Names.PERSONAS, backendUrl, pipeModules, Persona.class);
        configurePipe(BackendPipes.Names.RESOURCES, pipeUrl, pipeModules, Resource.class);
        configurePipe(BackendPipes.Names.TRIGGERS, pipeUrl, pipeModules, Trigger.class);
    }

    private AuthzModule getAuthorizationModule() {
        return ModuleKeeper.modules.get("hawkular");
    }

    private PipeModule getPersonnelModule(Persona persona) {
        return new BackendPersonnel(persona);
    }

    @SuppressWarnings("unchecked")
    private <T> void configurePipe(String pipeName, URL pipeUrl, List<PipeModule> pipeModules, Class<T> pipeClass) {
        PipeConfiguration pipeConfiguration = PipeManager.config(pipeName, RestfulPipeConfiguration.class)
            .withUrl(pipeUrl);

        for (PipeModule pipeModule : pipeModules) {
            pipeConfiguration.module(pipeModule);
        }

        pipeConfiguration.forClass(pipeClass);
    }

    public void authorize(@NonNull Activity activity, @NonNull Callback<String> callback) {
        getAuthorizationModule().requestAccess(activity, callback);
    }

    public void deauthorize() {
        AuthzModule authorizationModule = getAuthorizationModule();

        if (authorizationModule.hasCredentials()) {
            authorizationModule.deleteAccount();
        }
    }

    public void getAlerts(@NonNull Date startTime, @NonNull Date finishTime, @NonNull List<Trigger> triggers,
                          @NonNull Callback<List<Alert>> callback) {
        Map<String, String> parameters = new HashMap<>();
        parameters.put(BackendPipes.Parameters.START_TIME, String.valueOf(startTime.getTime()));
        parameters.put(BackendPipes.Parameters.FINISH_TIME, String.valueOf(finishTime.getTime()));
        parameters.put(BackendPipes.Parameters.TRIGGERS, Uris.getParameter(getTriggerIds(triggers)));
        parameters.put(BackendPipes.Parameters.STATUSES, String.valueOf(AlertStatus.OPEN));

        URI uri = Uris.getUri(BackendPipes.Paths.ALERTS, parameters);

        readPipe(BackendPipes.Names.ALERTS, uri, callback);
    }

    private List<String> getTriggerIds(List<Trigger> triggers) {
        List<String> triggerIds = new ArrayList<>(triggers.size());

        for (Trigger trigger : triggers) {
            triggerIds.add(trigger.getId());
        }

        return triggerIds;
    }

    public void acknowledgeAlert(@NonNull Alert alert,
                                 @NonNull Callback<List<String>> callback) {
        URI uri = Uris.getUri(String.format(BackendPipes.Paths.ALERT_ACKNOWLEDGE, alert.getId()));

        readPipe(BackendPipes.Names.ALERT_ACKNOWLEDGE, uri, callback);
    }

    public void resolveAlert(@NonNull Alert alert,
                             @NonNull Callback<List<String>> callback) {
        URI uri = Uris.getUri(String.format(BackendPipes.Paths.ALERT_RESOLVE, alert.getId()));

        readPipe(BackendPipes.Names.ALERT_RESOLVE, uri, callback);
    }

    public void getEnvironments(@NonNull Callback<List<Environment>> callback) {
        URI uri = Uris.getUri(BackendPipes.Paths.ENVIRONMENTS);

        readPipe(BackendPipes.Names.ENVIRONMENTS, uri, callback);
    }

    public void getMetrics(@NonNull Environment environment, @NonNull Resource resource,
                           @NonNull Callback<List<Metric>> callback) {
        URI uri = Uris.getUri(String.format(BackendPipes.Paths.METRICS, environment.getId(), resource.getId()));

        readPipe(BackendPipes.Names.METRICS, uri, callback);
    }

    public void getMetricDataAvailability(@NonNull Resource resource,
                                          @NonNull Date startTime, @NonNull Date finishTime,
                                          @NonNull Callback<List<MetricData>> callback) {
        Map<String, String> parameters = new HashMap<>();
        parameters.put(BackendPipes.Parameters.START, String.valueOf(startTime.getTime()));
        parameters.put(BackendPipes.Parameters.FINISH, String.valueOf(finishTime.getTime()));

        URI uri = Uris.getUri(String.format(BackendPipes.Paths.METRIC_DATA_AVAILABILITY, resource.getId()), parameters);

        readPipe(BackendPipes.Names.METRIC_DATA_AVAILABILITY, uri, callback);
    }

    public void getMetricDataGauge(@NonNull Metric metric,
                                   @NonNull Date startTime, @NonNull Date finishTime,
                                   @NonNull Callback<List<MetricData>> callback) {
        Map<String, String> parameters = new HashMap<>();
        parameters.put(BackendPipes.Parameters.START, String.valueOf(startTime.getTime()));
        parameters.put(BackendPipes.Parameters.FINISH, String.valueOf(finishTime.getTime()));

        URI uri = Uris.getUri(String.format(BackendPipes.Paths.METRIC_DATA_GAUGE, metric.getId()), parameters);

        readPipe(BackendPipes.Names.METRIC_DATA_GAUGE, uri, callback);
    }

    public void getPersona(@NonNull Callback<List<Persona>> callback) {
        URI uri = Uris.getUri(BackendPipes.Paths.PERSONA);

        readPipe(BackendPipes.Names.PERSONA, uri, callback);
    }

    public void getPersonas(@NonNull Callback<List<Persona>> callback) {
        URI uri = Uris.getUri(BackendPipes.Paths.PERSONAS);

        readPipe(BackendPipes.Names.PERSONAS, uri, callback);
    }

    public void getResources(@NonNull Environment environment,
                             @NonNull Callback<List<Resource>> callback) {
        URI uri = Uris.getUri(String.format(BackendPipes.Paths.RESOURCES, environment.getId()));

        readPipe(BackendPipes.Names.RESOURCES, uri, callback);
    }

    public void getTriggers(@NonNull Callback<List<Trigger>> callback) {
        URI uri = Uris.getUri(BackendPipes.Paths.TRIGGERS);

        readPipe(BackendPipes.Names.TRIGGERS, uri, callback);
    }

    @SuppressWarnings("unchecked")
    private <T> void readPipe(String pipeName, URI uri, Callback<List<T>> callback) {
        getPipe(pipeName).read(getFilter(uri), callback);
    }

    private LoaderPipe getPipe(String pipeName) {
        if (activity != null) {
            return PipeManager.getPipe(pipeName, activity);
        } else {
            return PipeManager.getPipe(pipeName, fragment, fragment.getActivity().getApplicationContext());
        }
    }

    private ReadFilter getFilter(URI uri) {
        ReadFilter filter = new ReadFilter();

        filter.setLinkUri(uri);

        return filter;
    }
}


text:
package unicredit

import scala.tools.nsc.{ Global, Phase }
import scala.tools.nsc.plugins.{ Plugin, PluginComponent }
import scala.tools.nsc.transform.{ Transform, TypingTransformers }
import scala.tools.nsc.symtab.Flags
import scala.tools.nsc.plugins.Plugin
import scala.tools.nsc.ast.TreeDSL

import java.nio.file.Files.readAllBytes
import java.nio.file.Paths.get

import scala.collection.mutable
import scala.util.{ Try => STry, Success, Failure }
import scala.reflect.internal.MissingRequirementError

class AnnotationAdderPlugin(val global: Global) extends Plugin {
  import global._

  val name = "annotation-adder-plugin"
  val description = "Want to add annotation to classes, fields, and methods"
  val components = List[PluginComponent](AnnotationAdderComponent)

  lazy val config: mutable.Set[(String, String, List[String])] =
    (try new String(readAllBytes(get("./annotation_adder.config"))).split("\n").toSeq.map(e => {
      val splitted = e.split(" ")
      (splitted(0), splitted(1), splitted.drop(2).toList)
    })
    catch {
      case err: Throwable =>
        println("Annotation adder configuration file is missing")
        Seq()
    }).to[mutable.Set]

  private object AnnotationAdderComponent extends PluginComponent with Transform {
    val global = AnnotationAdderPlugin.this.global
    import global._
    import global.definitions._

    override val runsAfter = List("typer")

    val phaseName = "annotation-adder"

    def newTransformer(unit: CompilationUnit) =
      new Transformer {

        val annotators =
          config.flatMap { c =>
            val originalSym = STry {
              try
                rootMirror.getClassByName((c._1: TypeName))
              catch {
                case _: MissingRequirementError => //is not a class get member
                  val i = c._1.lastIndexOf('.')
                  val className = c._1.substring(0, i)
                  val memberName = c._1.substring(i + 1)

                  val cl = rootMirror.getClassByName((className: TypeName))
                  try {
                     getMember(cl, (memberName: TermName))
                  } catch {
                    case err: Throwable =>
                      err.printStackTrace
                      throw err
                  }
                case err: Throwable =>
                  err.printStackTrace
                  throw err
              }
            }
            val annotation = STry {

                rootMirror.getClassByName((c._2: TypeName))
            }

            val params =
                c._3.map(x => { //maybe a little better could be done
                  x match {
                    case "true" => reify(true).tree
                    case "false" => reify(false).tree
                    case str => reify(str.toString()).tree
                  }
                })

            (originalSym, annotation) match {
              case (Success(orSym), Success(annotationSym)) =>
                //orSym.addAnnotation(annotationSym)
                Some(orSym, annotationSym, params)
              //unit.warning(null, s"adding annotation ${c._2} to ${c._1}")
              case _ =>
                None
              //unit.warning(null, s"ANNOTATION ADDER ERROR: ${c._1} or ${c._2} not found")
            }
          }

        //probably we could avoid to use a transformer and use a traver only
        override def transform(tree: Tree): Tree = {

  /*       // try {
           val toAnnotate = annotators.find { case (symb,_,_) => symb == tree.symbol && symb.owner == tree.symbol.owner}

            val toValAnnotate =
              if (toAnnotate.isDefined) None
              else annotators.find { case (symb,_,_) =>
                symb.owner == tree.symbol.owner && (symb.nameString+" " : TermName) == tree.symbol.name}
*/
            tree match {
              case cd : ClassDef =>
                val toAnnotate = annotators.find { case (symb,_,_) =>
                  symb == cd.symbol && symb.owner == cd.symbol.owner}
                if (toAnnotate.isDefined) {
                  cd.symbol.addAnnotation(toAnnotate.get._2, toAnnotate.get._3: _*)
                  unit.warning(tree.pos, s"Class Annotation ${toAnnotate.get._2.nameString} added.")
                }
              case dd: DefDef =>
                val toAnnotate = annotators.find { case (symb,_,_) =>
                  symb == dd.symbol && symb.owner == dd.symbol.owner}
                if (toAnnotate.isDefined) {
                  dd.symbol.addAnnotation(toAnnotate.get._2, toAnnotate.get._3: _*)
                  unit.warning(tree.pos, s"Def Annotation ${toAnnotate.get._2.nameString} added.")
                }
              case vd: ValDef =>
                val toAnnotate = annotators.find { case (symb,_,_) =>
                  symb.owner == vd.symbol.owner && (symb.nameString+" " : TermName) == vd.symbol.name}
                if (toAnnotate.isDefined) {
                  vd.symbol.addAnnotation(toAnnotate.get._2, toAnnotate.get._3: _*)
                  unit.warning(tree.pos, s"Val Annotation ${toAnnotate.get._2.nameString} added.")
                }
              case _ =>
            }
/*
            if (toAnnotate.isDefined) {
              tree.symbol.addAnnotation(toAnnotate.get._2, toAnnotate.get._3: _*)
              unit.warning(tree.pos, s"Annotation ${toAnnotate.get._2.nameString} added.")
            } else if (toValAnnotate.isDefined) {
              tree.symbol.addAnnotation(toValAnnotate.get._2, toAnnotate.get._3: _*)
              unit.warning(tree.pos, s"Annotation ${toValAnnotate.get._2.nameString} added")
            }

          } catch {
            case _ : Throwable =>
          }*/

          super.transform(tree)
        }
      }
  }
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _propTypes = require('prop-types');

var responsivePropType = (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string, _propTypes.array]);

var propTypes = {
  width: responsivePropType,
  fontSize: responsivePropType,
  color: responsivePropType,
  bg: responsivePropType,
  m: responsivePropType,
  mt: responsivePropType,
  mr: responsivePropType,
  mb: responsivePropType,
  ml: responsivePropType,
  mx: responsivePropType,
  my: responsivePropType,
  p: responsivePropType,
  pt: responsivePropType,
  pr: responsivePropType,
  pb: responsivePropType,
  pl: responsivePropType,
  px: responsivePropType,
  py: responsivePropType
};

exports.default = propTypes;


text:
package modelo;

public class Circulo implements Figuras {

	/**
	 * Área de un cúrculo
	 *
	 * @param parameters parameters[0] = radio
	 * @return double retorna el área de un círculo
	 */
	@Override
	public double area(double[] parameters) {
		return Math.PI*Math.pow(parameters[0], 2);
	}

	/**
	 * Perímetro de un círculo
	 *
	 * @param parameters parameters[0] = radio
	 * @return double retorna el área de un círculo
	 */
	@Override
	public double perimetro(double[] parameters) {
		return Math.PI * parameters[0];
	}

}


text:
package org.apache.sling.servlets.resolver.internal.helper;

import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;

import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.SyntheticResource;
import org.apache.sling.servlets.resolver.internal.SlingServletResolver;

/**
 * The ResourceCollector class provides a single public method -
 * {@link #getServlets(ResourceResolver)} - which is used to find an ordered collection
 * of Resource instances which may be used to find a servlet or
 * script to handle a request to the given resource.
 */
public abstract class AbstractResourceCollector {

    // the most generic resource type to use. This may be null in which
    // case the default servlet name will be used as the base name
    protected final String baseResourceType;

    // the request extension or null if the request has no extension
    protected final String extension;

    protected int hashCode;

    protected final String resourceType;

    protected final String resourceSuperType;

    protected final String[] executionPaths;

    public AbstractResourceCollector(final String baseResourceType,
            final String resourceType,
            final String resourceSuperType,
            final String extension,
            final String[] executionPaths) {
        this.baseResourceType = baseResourceType;
        this.resourceType = resourceType;
        this.resourceSuperType = resourceSuperType;
        this.extension = extension;
        this.executionPaths = executionPaths;
    }

    public final Collection<Resource> getServlets(final ResourceResolver resolver) {

        final SortedSet<Resource> resources = new TreeSet<Resource>();
        final Iterator<String> locations = new LocationIterator(resourceType, resourceSuperType,
                                                                baseResourceType, resolver);
        while (locations.hasNext()) {
            final String location = locations.next();

            // get the location resource, use a synthetic resource if there
            // is no real location. There may still be children at this
            // location
            final String path;
            if ( location.endsWith("/") ) {
                path = location.substring(0, location.length() - 1);
            } else {
                path = location;
            }
            final Resource locationRes = getResource(resolver, path);
            getWeightedResources(resources, locationRes);
        }

        return resources;
    }

    abstract protected void getWeightedResources(final Set<Resource> resources,
                                                 final Resource location);

    /**
     * Creates a {@link WeightedResource} and adds it to the set of resources.
     * The number of resources already present in the set is used as the ordinal
     * number for the newly created resource.
     *
     * @param resources The set of resource to which the
     *            {@link WeightedResource} is added.
     * @param resource The Resource on which the
     *            {@link WeightedResource} is based.
     * @param numSelectors The number of request selectors which are matched by
     *            the name of the resource.
     * @param methodPrefixWeight The method/prefix weight assigned to the
     *            resource according to the resource name.
     */
    protected final void addWeightedResource(final Set<Resource> resources,
            final Resource resource,
            final int numSelectors,
            final int methodPrefixWeight) {
        final WeightedResource lr = new WeightedResource(resources.size(), resource,
            numSelectors, methodPrefixWeight);
        resources.add(lr);
    }

    /**
     * Returns a resource for the given path.
     * If no resource exists at the given path a
     * SyntheticResource is returned.
     *
     * @param resolver The ResourceResolver used to access the
     *            resource.
     * @param path The absolute path of the resource to return.
     * @return The actual resource at the given path or a
     *         synthetic resource representing the path location.
     */
    protected final Resource getResource(final ResourceResolver resolver,
                                         String path) {
        Resource res = resolver.getResource(path);

        if (res == null) {
            if (!path.startsWith("/")) {
                path = "/".concat(path);
            }

            res = new SyntheticResource(resolver, path, "$synthetic$");
        }

        return res;
    }

    @Override
    public boolean equals(Object obj) {
        if ( !(obj instanceof AbstractResourceCollector) ) {
            return false;
        }
        if ( obj == this ) {
            return true;
        }
        final AbstractResourceCollector o = (AbstractResourceCollector)obj;
        if ( stringEquals(resourceType, o.resourceType)
             && stringEquals(resourceSuperType, o.resourceSuperType)
             && stringEquals(extension, o.extension)
             && stringEquals(baseResourceType, o.baseResourceType)) {
            return true;
        }
        return false;
    }

    @Override
    public int hashCode() {
        return this.hashCode;
    }

    /**
     * Helper method to compare two strings which can possibly be null
     */
    protected boolean stringEquals(final String s1, final String s2) {
        if ( s1 == null && s2 == null ) {
            return true;
        }
        if ( s1 == null || s2 == null ) {
            return false;
        }
        return s1.equals(s2);
    }

    protected boolean isPathAllowed(final String path) {
        return isPathAllowed(path, this.executionPaths);
    }

    /**
     * This method checks whether a path is allowed to be executed.
     *
     * @param path The path to check (must not be {@code null} or empty)
     * @param executionPaths The path to check against
     * @return {@code true} if the executionPaths is {@code null} or empty or if
     *         the path equals one entry or one of the executionPaths entries is
     *         a prefix to the path. Otherwise or if path is {@code null}
     *         {@code false} is returned.
     */
    public static boolean isPathAllowed(final String path, final String[] executionPaths) {
        if (executionPaths == null || executionPaths.length == 0) {
            SlingServletResolver.LOGGER.debug("Accepting servlet at '{}' as there are no configured execution paths.",
                path);
            return true;
        }

        if (path == null || path.length() == 0) {
            SlingServletResolver.LOGGER.debug("Ignoring servlet with empty path.");
            return false;
        }

        for (final String config : executionPaths) {
            if (config.endsWith("/")) {
                if (path.startsWith(config)) {
                    SlingServletResolver.LOGGER.debug(
                        "Accepting servlet at '{}' as the path is prefixed with configured execution path '{}'.", path,
                        config);
                    return true;
                }
            } else if (path.equals(config)) {
                SlingServletResolver.LOGGER.debug(
                    "Accepting servlet at '{}' as the path equals configured execution path '{}'.", path, config);
                return true;
            }
        }

        if (SlingServletResolver.LOGGER.isDebugEnabled()) {
            SlingServletResolver.LOGGER.debug(
                "Ignoring servlet at '{}' as the path is not in the configured execution paths.", path);
        }

        return false;
    }

}


text:
<?php

class Google_Service_DLP_GooglePrivacyDlpV2beta1DeidentifyContentRequest extends Google_Collection
{
  protected $collection_key = 'items';
  protected $deidentifyConfigType = 'Google_Service_DLP_GooglePrivacyDlpV2beta1DeidentifyConfig';
  protected $deidentifyConfigDataType = '';
  protected $inspectConfigType = 'Google_Service_DLP_GooglePrivacyDlpV2beta1InspectConfig';
  protected $inspectConfigDataType = '';
  protected $itemsType = 'Google_Service_DLP_GooglePrivacyDlpV2beta1ContentItem';
  protected $itemsDataType = 'array';

  /**
   * @param Google_Service_DLP_GooglePrivacyDlpV2beta1DeidentifyConfig
   */
  public function setDeidentifyConfig(Google_Service_DLP_GooglePrivacyDlpV2beta1DeidentifyConfig $deidentifyConfig)
  {
    $this->deidentifyConfig = $deidentifyConfig;
  }
  /**
   * @return Google_Service_DLP_GooglePrivacyDlpV2beta1DeidentifyConfig
   */
  public function getDeidentifyConfig()
  {
    return $this->deidentifyConfig;
  }
  /**
   * @param Google_Service_DLP_GooglePrivacyDlpV2beta1InspectConfig
   */
  public function setInspectConfig(Google_Service_DLP_GooglePrivacyDlpV2beta1InspectConfig $inspectConfig)
  {
    $this->inspectConfig = $inspectConfig;
  }
  /**
   * @return Google_Service_DLP_GooglePrivacyDlpV2beta1InspectConfig
   */
  public function getInspectConfig()
  {
    return $this->inspectConfig;
  }
  /**
   * @param Google_Service_DLP_GooglePrivacyDlpV2beta1ContentItem
   */
  public function setItems($items)
  {
    $this->items = $items;
  }
  /**
   * @return Google_Service_DLP_GooglePrivacyDlpV2beta1ContentItem
   */
  public function getItems()
  {
    return $this->items;
  }
}


text:
<resources xmlns:tools="http://schemas.android.com/tools">
    <!-- Base application theme. -->
    <style name="Theme.Mdlrefapps" parent="Theme.Material3.DayNight">
        <!-- Primary brand color. -->
        <item name="colorPrimary">@color/purple_500</item>
        <item name="colorPrimaryVariant">@color/purple_700</item>
        <item name="colorOnPrimary">@color/white</item>
        <!-- Secondary brand color. -->
        <item name="colorSecondary">@color/teal_200</item>
        <item name="colorSecondaryVariant">@color/teal_700</item>
        <item name="colorOnSecondary">@color/black</item>
        <!-- Status bar color. -->
        <item name="android:statusBarColor">@android:color/transparent</item>
        <item name="android:windowLightStatusBar">true</item>
        <!-- Customize your theme here. -->
        <item name="bottomSheetDialogTheme">@style/CustomBottomSheetDialog</item>
    </style>
</resources>


text:
#ifndef GOF_STATE_OPERATION_H
#define GOF_STATE_OPERATION_H

namespace GoF {

    namespace State {

        enum Operation
        {
            SUM
            , SUBTRACT
            , MULTIPLY
            , DIVIDE

        };

    }

}

#endif


text:
/**
 * AngularStrap - Twitter Bootstrap directives for AngularJS
 * @version v0.7.5 - 2013-07-21
 * @link http://mgcrea.github.com/angular-strap
 * @author Olivier Louvignes <olivier@mg-crea.com>
 * @license MIT License, http://www.opensource.org/licenses/MIT
 */
angular.module('$strap.config', []).value('$strapConfig', {});
angular.module('$strap.filters', ['$strap.config']);
angular.module('$strap.directives', ['$strap.config']);
angular.module('$strap', [
  '$strap.filters',
  '$strap.directives',
  '$strap.config'
]);
'use strict';
angular.module('$strap.directives').directive('bsAlert', [
  '$parse',
  '$timeout',
  '$compile',
  function ($parse, $timeout, $compile) {
    return {
      restrict: 'A',
      link: function postLink(scope, element, attrs) {
        var getter = $parse(attrs.bsAlert), setter = getter.assign, value = getter(scope);
        var closeAlert = function closeAlertFn(delay) {
          $timeout(function () {
            element.alert('close');
          }, delay * 1);
        };
        if (!attrs.bsAlert) {
          if (angular.isUndefined(attrs.closeButton) || attrs.closeButton !== '0' && attrs.closeButton !== 'false') {
            element.prepend('<button type="button" class="close" data-dismiss="alert">×</button>');
          }
          if (attrs.closeAfter)
            closeAlert(attrs.closeAfter);
        } else {
          scope.$watch(attrs.bsAlert, function (newValue, oldValue) {
            value = newValue;
            element.html((newValue.title ? '' + newValue.title + ' ' : '') + newValue.content || '');
            if (!!newValue.closed) {
              element.hide();
            }
            $compile(element.contents())(scope);
            if (newValue.type || oldValue.type) {
              oldValue.type && element.removeClass('alert-' + oldValue.type);
              newValue.type && element.addClass('alert-' + newValue.type);
            }
            if (angular.isDefined(newValue.closeAfter))
              closeAlert(newValue.closeAfter);
            else if (attrs.closeAfter)
              closeAlert(attrs.closeAfter);
            if (angular.isUndefined(attrs.closeButton) || attrs.closeButton !== '0' && attrs.closeButton !== 'false') {
              element.prepend('<button type="button" class="close" data-dismiss="alert">×</button>');
            }
          }, true);
        }
        element.addClass('alert').alert();
        if (element.hasClass('fade')) {
          element.removeClass('in');
          setTimeout(function () {
            element.addClass('in');
          });
        }
        var parentArray = attrs.ngRepeat && attrs.ngRepeat.split(' in ').pop();
        element.on('close', function (ev) {
          var removeElement;
          if (parentArray) {
            ev.preventDefault();
            element.removeClass('in');
            removeElement = function () {
              element.trigger('closed');
              if (scope.$parent) {
                scope.$parent.$apply(function () {
                  var path = parentArray.split('.');
                  var curr = scope.$parent;
                  for (var i = 0; i < path.length; ++i) {
                    if (curr) {
                      curr = curr[path[i]];
                    }
                  }
                  if (curr) {
                    curr.splice(scope.$index, 1);
                  }
                });
              }
            };
            $.support.transition && element.hasClass('fade') ? element.on($.support.transition.end, removeElement) : removeElement();
          } else if (value) {
            ev.preventDefault();
            element.removeClass('in');
            removeElement = function () {
              element.trigger('closed');
              scope.$apply(function () {
                value.closed = true;
              });
            };
            $.support.transition && element.hasClass('fade') ? element.on($.support.transition.end, removeElement) : removeElement();
          } else {
          }
        });
      }
    };
  }
]);
'use strict';
angular.module('$strap.directives').directive('bsButton', [
  '$parse',
  '$timeout',
  function ($parse, $timeout) {
    return {
      restrict: 'A',
      require: '?ngModel',
      link: function postLink(scope, element, attrs, controller) {
        if (controller) {
          if (!element.parent('[data-toggle="buttons-checkbox"], [data-toggle="buttons-radio"]').length) {
            element.attr('data-toggle', 'button');
          }
          var startValue = !!scope.$eval(attrs.ngModel);
          if (startValue) {
            element.addClass('active');
          }
          scope.$watch(attrs.ngModel, function (newValue, oldValue) {
            var bNew = !!newValue, bOld = !!oldValue;
            if (bNew !== bOld) {
              $.fn.button.Constructor.prototype.toggle.call(button);
            } else if (bNew && !startValue) {
              element.addClass('active');
            }
          });
        }
        if (!element.hasClass('btn')) {
          element.on('click.button.data-api', function (ev) {
            element.button('toggle');
          });
        }
        element.button();
        var button = element.data('button');
        button.toggle = function () {
          if (!controller) {
            return $.fn.button.Constructor.prototype.toggle.call(this);
          }
          var $parent = element.parent('[data-toggle="buttons-radio"]');
          if ($parent.length) {
            element.siblings('[ng-model]').each(function (k, v) {
              $parse($(v).attr('ng-model')).assign(scope, false);
            });
            scope.$digest();
            if (!controller.$modelValue) {
              controller.$setViewValue(!controller.$modelValue);
              scope.$digest();
            }
          } else {
            scope.$apply(function () {
              controller.$setViewValue(!controller.$modelValue);
            });
          }
        };
      }
    };
  }
]).directive('bsButtonsCheckbox', [
  '$parse',
  function ($parse) {
    return {
      restrict: 'A',
      require: '?ngModel',
      compile: function compile(tElement, tAttrs, transclude) {
        tElement.attr('data-toggle', 'buttons-checkbox').find('a, button').each(function (k, v) {
          $(v).attr('bs-button', '');
        });
      }
    };
  }
]).directive('bsButtonsRadio', [
  '$timeout',
  function ($timeout) {
    return {
      restrict: 'A',
      require: '?ngModel',
      compile: function compile(tElement, tAttrs, transclude) {
        tElement.attr('data-toggle', 'buttons-radio');
        if (!tAttrs.ngModel) {
          tElement.find('a, button').each(function (k, v) {
            $(v).attr('bs-button', '');
          });
        }
        return function postLink(scope, iElement, iAttrs, controller) {
          if (controller) {
            $timeout(function () {
              iElement.find('[value]').button().filter('[value="' + controller.$viewValue + '"]').addClass('active');
            });
            iElement.on('click.button.data-api', function (ev) {
              scope.$apply(function () {
                controller.$setViewValue($(ev.target).closest('button').attr('value'));
              });
            });
            scope.$watch(iAttrs.ngModel, function (newValue, oldValue) {
              if (newValue !== oldValue) {
                var $btn = iElement.find('[value="' + scope.$eval(iAttrs.ngModel) + '"]');
                if ($btn.length) {
                  $btn.button('toggle');
                }
              }
            });
          }
        };
      }
    };
  }
]);
'use strict';
angular.module('$strap.directives').directive('bsButtonSelect', [
  '$parse',
  '$timeout',
  function ($parse, $timeout) {
    return {
      restrict: 'A',
      require: '?ngModel',
      link: function postLink(scope, element, attrs, ctrl) {
        var getter = $parse(attrs.bsButtonSelect), setter = getter.assign;
        if (ctrl) {
          element.text(scope.$eval(attrs.ngModel));
          scope.$watch(attrs.ngModel, function (newValue, oldValue) {
            element.text(newValue);
          });
        }
        var values, value, index, newValue;
        element.bind('click', function (ev) {
          values = getter(scope);
          value = ctrl ? scope.$eval(attrs.ngModel) : element.text();
          index = values.indexOf(value);
          newValue = index > values.length - 2 ? values[0] : values[index + 1];
          scope.$apply(function () {
            element.text(newValue);
            if (ctrl) {
              ctrl.$setViewValue(newValue);
            }
          });
        });
      }
    };
  }
]);
'use strict';
angular.module('$strap.directives').directive('bsDatepicker', [
  '$timeout',
  '$strapConfig',
  function ($timeout, $strapConfig) {
    var isAppleTouch = /(iP(a|o)d|iPhone)/g.test(navigator.userAgent);
    var regexpMap = function regexpMap(language) {
      language = language || 'en';
      return {
        '/': '[\\/]',
        '-': '[-]',
        '.': '[.]',
        ' ': '[\\s]',
        'dd': '(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))',
        'd': '(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))',
        'mm': '(?:[0]?[1-9]|[1][012])',
        'm': '(?:[0]?[1-9]|[1][012])',
        'DD': '(?:' + $.fn.datepicker.dates[language].days.join('|') + ')',
        'D': '(?:' + $.fn.datepicker.dates[language].daysShort.join('|') + ')',
        'MM': '(?:' + $.fn.datepicker.dates[language].months.join('|') + ')',
        'M': '(?:' + $.fn.datepicker.dates[language].monthsShort.join('|') + ')',
        'yyyy': '(?:(?:[1]{1}[0-9]{1}[0-9]{1}[0-9]{1})|(?:[2]{1}[0-9]{3}))(?![[0-9]])',
        'yy': '(?:(?:[0-9]{1}[0-9]{1}))(?![[0-9]])'
      };
    };
    var regexpForDateFormat = function regexpForDateFormat(format, language) {
      var re = format, map = regexpMap(language), i;
      i = 0;
      angular.forEach(map, function (v, k) {
        re = re.split(k).join('${' + i + '}');
        i++;
      });
      i = 0;
      angular.forEach(map, function (v, k) {
        re = re.split('${' + i + '}').join(v);
        i++;
      });
      return new RegExp('^' + re + '$', ['i']);
    };
    return {
      restrict: 'A',
      require: '?ngModel',
      link: function postLink(scope, element, attrs, controller) {
        var options = angular.extend({ autoclose: true }, $strapConfig.datepicker || {}), type = attrs.dateType || options.type || 'date';
        angular.forEach([
          'format',
          'weekStart',
          'calendarWeeks',
          'startDate',
          'endDate',
          'daysOfWeekDisabled',
          'autoclose',
          'startView',
          'minViewMode',
          'todayBtn',
          'todayHighlight',
          'keyboardNavigation',
          'language',
          'forceParse'
        ], function (key) {
          if (angular.isDefined(attrs[key]))
            options[key] = attrs[key];
        });
        var language = options.language || 'en', readFormat = attrs.dateFormat || options.format || $.fn.datepicker.dates[language] && $.fn.datepicker.dates[language].format || 'mm/dd/yyyy', format = isAppleTouch ? 'yyyy-mm-dd' : readFormat, dateFormatRegexp = regexpForDateFormat(format, language);
        if (controller) {
          controller.$formatters.unshift(function (modelValue) {
            return type === 'date' && angular.isString(modelValue) && modelValue ? $.fn.datepicker.DPGlobal.parseDate(modelValue, $.fn.datepicker.DPGlobal.parseFormat(readFormat), language) : modelValue;
          });
          controller.$parsers.unshift(function (viewValue) {
            if (!viewValue) {
              controller.$setValidity('date', true);
              return null;
            } else if (type === 'date' && angular.isDate(viewValue)) {
              controller.$setValidity('date', true);
              return viewValue;
            } else if (angular.isString(viewValue) && dateFormatRegexp.test(viewValue)) {
              controller.$setValidity('date', true);
              if (isAppleTouch)
                return new Date(viewValue);
            if (type === 'string') {
            	if (viewValue == "") {
            		return null;
            	} else {
            		return new Date(viewValue).getTime();
            	}
            }
              //return type === 'string' ? new Date(viewValue).getTime() : $.fn.datepicker.DPGlobal.parseDate(viewValue, $.fn.datepicker.DPGlobal.parseFormat(format), language);
            } else {
              controller.$setValidity('date', false);
              return undefined;
            }
          });
          controller.$render = function ngModelRender() {
            if (isAppleTouch) {
              var date = controller.$viewValue ? $.fn.datepicker.DPGlobal.formatDate(controller.$viewValue, $.fn.datepicker.DPGlobal.parseFormat(format), language) : '';
              element.val(date);
              return date;
            }
            if (!controller.$viewValue || controller.$viewValue == null)
              element.val('');
            return element.datepicker('update', controller.$viewValue);
          };
        }
        if (isAppleTouch) {
          element.prop('type', 'date').css('-webkit-appearance', 'textfield');
        } else {
          if (controller) {
            element.on('changeDate', function (ev) {
              scope.$apply(function () {
                controller.$setViewValue(type === 'string' ? element.val() : ev.date);
              });
            });
          }
          element.datepicker(angular.extend(options, {
            format: format,
            language: language
          }));
          scope.$on('$destroy', function () {
            var datepicker = element.data('datepicker');
            if (datepicker) {
              datepicker.picker.remove();
              element.data('datepicker', null);
            }
          });
          attrs.$observe('startDate', function (value) {
            element.datepicker('setStartDate', value);
          });
          attrs.$observe('endDate', function (value) {
            element.datepicker('setEndDate', value);
          });
        }
        var component = element.siblings('[data-toggle="datepicker"]');
        if (component.length) {
          component.on('click', function () {
            if (!element.prop('disabled')) {
              element.trigger('focus');
            }
          });
        }
      }
    };
  }
]);
'use strict';
angular.module('$strap.directives').directive('bsDropdown', [
  '$parse',
  '$compile',
  '$timeout',
  function ($parse, $compile, $timeout) {
    var buildTemplate = function (items, ul) {
      if (!ul)
        ul = [
          '
',
          '
'
        ];
      angular.forEach(items, function (item, index) {
        if (item.divider)
          return ul.splice(index + 1, 0, '

');
        var li = '
' + '' + (item.text || '') + '';
        if (item.submenu && item.submenu.length)
          li += buildTemplate(item.submenu).join('\n');
        li += '
';
        ul.splice(index + 1, 0, li);
      });
      return ul;
    };
    return {
      restrict: 'EA',
      scope: true,
      link: function postLink(scope, iElement, iAttrs) {
        var getter = $parse(iAttrs.bsDropdown), items = getter(scope);
        $timeout(function () {
          if (!angular.isArray(items)) {
          }
          var dropdown = angular.element(buildTemplate(items).join(''));
          dropdown.insertAfter(iElement);
          $compile(iElement.next('ul.dropdown-menu'))(scope);
        });
        iElement.addClass('dropdown-toggle').attr('data-toggle', 'dropdown');
      }
    };
  }
]);

"use strict";

angular.module("$strap.directives").factory("$modal", [
  "$rootScope", "$compile", "$http", "$timeout", "$q", "$templateCache", "$strapConfig", function($rootScope, $compile, $http, $timeout, $q, $templateCache, $strapConfig) {
    var ModalFactory;
    ModalFactory = ModalFactory = function(config) {
      var Modal;
      Modal = function(config) {
        var onSuccess, options, scope, templateUrl;
        options = angular.extend({
          show: true
        }, $strapConfig.modal, config);
        scope = (options.scope ? options.scope : $rootScope.$new());
        templateUrl = options.template;
        return $q.when($templateCache.get(templateUrl) || $http.get(templateUrl, {
          cache: true
        }).then(function(res) {
          return res.data;
        })).then(onSuccess = function(template) {
          var $modal, id;
          id = templateUrl.replace(".html", "").replace(/[\/|\.|:]/g, "-") + "-" + scope.$id;
          $modal = $("

").attr("id", id).addClass("fade").html(template);
          if (options.modalClass) {
            $modal.addClass(options.modalClass);
          }
          $("body").append($modal);
          $timeout(function() {
            return $compile($modal)(scope);
          });
          scope.$modal = function(name) {
            return $modal.modal(name);
          };
          angular.forEach(["show", "hide"], function(name) {
            return scope[name] = function() {
              return $modal.modal(name);
            };
          });
          scope.dismiss = scope.hide;
          angular.forEach(["show", "shown", "hide", "hidden"], function(name) {
            return $modal.on(name, function(ev) {
              return scope.$emit("modal-" + name, ev);
            });
          });
          $modal.on("shown", function(ev) {
            return $("input[autofocus]", $modal).first().trigger("focus");
          });
          $modal.on("hidden", function(ev) {
            if (!options.persist) {
              return scope.$destroy();
            }
          });
          scope.$on("$destroy", function() {
            return $modal.remove();
          });
          $modal.modal(options);
          return $modal;
        });
      };
      return new Modal(config);
    };
    return ModalFactory;
  }
]).directive("bsModal", [
  "$q", "$modal", function($q, $modal) {
    var postLink;
    return {
      restrict: "A",
      scope: true,
      link: postLink = function(scope, iElement, iAttrs, controller) {
        var onSuccess, options;
        options = {
          template: scope.$eval(iAttrs.bsModal),
          persist: true,
          show: false,
          scope: scope
        };
        angular.forEach(["modalClass", "backdrop", "keyboard"], function(key) {
          if (angular.isDefined(iAttrs[key])) {
            return options[key] = iAttrs[key];
          }
        });
        return $q.when($modal(options)).then(onSuccess = function(modal) {
          return iElement.attr("data-target", "#" + modal.attr("id")).attr("data-toggle", "modal");
        });
      }
    };
  }
]);

'use strict';
angular.module('$strap.directives').directive('bsNavbar', [
  '$location',
  function ($location) {
    return {
      restrict: 'A',
      link: function postLink(scope, element, attrs, controller) {
        scope.$watch(function () {
          return $location.path();
        }, function (newValue, oldValue) {
          $('li[data-match-route]', element).each(function (k, li) {
            var $li = angular.element(li), pattern = $li.attr('data-match-route'), regexp = new RegExp('^' + pattern + '$', ['i']);
            if (regexp.test(newValue)) {
              $li.addClass('active').find('.collapse.in').collapse('hide');
            } else {
              $li.removeClass('active');
            }
          });
        });
      }
    };
  }
]);
'use strict';
angular.module('$strap.directives').directive('bsPopover', [
  '$parse',
  '$compile',
  '$http',
  '$timeout',
  '$q',
  '$templateCache',
  function ($parse, $compile, $http, $timeout, $q, $templateCache) {
    $('body').on('keyup', function (ev) {
      if (ev.keyCode === 27) {
        $('.popover.in').each(function () {
          $(this).popover('hide');
        });
      }
    });
    return {
      restrict: 'A',
      scope: true,
      link: function postLink(scope, element, attr, ctrl) {
        var getter = $parse(attr.bsPopover), setter = getter.assign, value = getter(scope), options = {};
        if (angular.isObject(value)) {
          options = value;
        }
        $q.when(options.content || $templateCache.get(value) || $http.get(value, { cache: true })).then(function onSuccess(template) {
          if (angular.isObject(template)) {
            template = template.data;
          }
          if (!!attr.unique) {
            element.on('show', function (ev) {
              $('.popover.in').each(function () {
                var $this = $(this), popover = $this.data('popover');
                if (popover && !popover.$element.is(element)) {
                  $this.popover('hide');
                }
              });
            });
          }
          if (!!attr.hide) {
            scope.$watch(attr.hide, function (newValue, oldValue) {
              if (!!newValue) {
                popover.hide();
              } else if (newValue !== oldValue) {
                popover.show();
              }
            });
          }
          if (!!attr.show) {
            scope.$watch(attr.show, function (newValue, oldValue) {
              if (!!newValue) {
                $timeout(function () {
                  popover.show();
                });
              } else if (newValue !== oldValue) {
                popover.hide();
              }
            });
          }
          element.popover(angular.extend({}, options, {
            content: template,
            html: true
          }));
          var popover = element.data('popover');
          popover.hasContent = function () {
            return this.getTitle() || template;
          };
          popover.getPosition = function () {
            var r = $.fn.popover.Constructor.prototype.getPosition.apply(this, arguments);
            $compile(this.$tip)(scope);
            scope.$digest();
            this.$tip.data('popover', this);
            return r;
          };
          scope.$popover = function (name) {
            popover(name);
          };
          angular.forEach([
            'show',
            'hide'
          ], function (name) {
            scope[name] = function () {
              popover[name]();
            };
          });
          scope.dismiss = scope.hide;
          angular.forEach([
            'show',
            'shown',
            'hide',
            'hidden'
          ], function (name) {
            element.on(name, function (ev) {
              scope.$emit('popover-' + name, ev);
            });
          });
        });
      }
    };
  }
]);
'use strict';
angular.module('$strap.directives').directive('bsSelect', [
  '$timeout',
  function ($timeout) {
    var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/;
    return {
      restrict: 'A',
      require: '?ngModel',
      link: function postLink(scope, element, attrs, controller) {
        var options = scope.$eval(attrs.bsSelect) || {};
        $timeout(function () {
          element.selectpicker(options);
          element.next().removeClass('ng-scope');
        });
        if (controller) {
          scope.$watch(attrs.ngModel, function (newValue, oldValue) {
            if (!angular.equals(newValue, oldValue)) {
              element.selectpicker('refresh');
            }
          });
        }
      }
    };
  }
]);
'use strict';
angular.module('$strap.directives').directive('bsTabs', [
  '$parse',
  '$compile',
  '$timeout',
  function ($parse, $compile, $timeout) {
    var template = '
' + '
' + '
' + '{{pane.title}}' + '
' + '
' + '
' + '
';
    return {
      restrict: 'A',
      require: '?ngModel',
      priority: 0,
      scope: true,
      template: template,
      replace: true,
      transclude: true,
      compile: function compile(tElement, tAttrs, transclude) {
        return function postLink(scope, iElement, iAttrs, controller) {
          var getter = $parse(iAttrs.bsTabs), setter = getter.assign, value = getter(scope);
          scope.panes = [];
          var $tabs = iElement.find('ul.nav-tabs');
          var $panes = iElement.find('div.tab-content');
          var activeTab = 0, id, title, active;
          $timeout(function () {
            $panes.find('[data-title], [data-tab]').each(function (index) {
              var $this = angular.element(this);
              id = 'tab-' + scope.$id + '-' + index;
              title = $this.data('title') || $this.data('tab');
              active = !active && $this.hasClass('active');
              $this.attr('id', id).addClass('tab-pane');
              if (iAttrs.fade)
                $this.addClass('fade');
              scope.panes.push({
                id: id,
                title: title,
                content: this.innerHTML,
                active: active
              });
            });
            if (scope.panes.length && !active) {
              $panes.find('.tab-pane:first-child').addClass('active' + (iAttrs.fade ? ' in' : ''));
              scope.panes[0].active = true;
            }
          });
          if (controller) {
            iElement.on('show', function (ev) {
              var $target = $(ev.target);
              scope.$apply(function () {
                controller.$setViewValue($target.data('index'));
              });
            });
            scope.$watch(iAttrs.ngModel, function (newValue, oldValue) {
              if (angular.isUndefined(newValue))
                return;
              activeTab = newValue;
              setTimeout(function () {
                var $next = $($tabs[0].querySelectorAll('li')[newValue * 1]);
                if (!$next.hasClass('active')) {
                  $next.children('a').tab('show');
                }
              });
            });
          }
        };
      }
    };
  }
]);
'use strict';
angular.module('$strap.directives').directive('bsTimepicker', [
  '$timeout',
  '$strapConfig',
  function ($timeout, $strapConfig) {
    var TIME_REGEXP = '((?:(?:[0-1][0-9])|(?:[2][0-3])|(?:[0-9])):(?:[0-5][0-9])(?::[0-5][0-9])?(?:\\s?(?:am|AM|pm|PM))?)';
    return {
      restrict: 'A',
      require: '?ngModel',
      link: function postLink(scope, element, attrs, controller) {
        if (controller) {
          element.on('changeTime.timepicker', function (ev) {
            $timeout(function () {
              controller.$setViewValue(element.val());
            });
          });
          var timeRegExp = new RegExp('^' + TIME_REGEXP + '$', ['i']);
          controller.$parsers.unshift(function (viewValue) {
            if (!viewValue || timeRegExp.test(viewValue)) {
              controller.$setValidity('time', true);
              return viewValue;
            } else {
              controller.$setValidity('time', false);
              return;
            }
          });
        }
        element.attr('data-toggle', 'timepicker');
        element.parent().addClass('bootstrap-timepicker');
        element.timepicker($strapConfig.timepicker || {});
        var timepicker = element.data('timepicker');
        var component = element.siblings('[data-toggle="timepicker"]');
        if (component.length) {
          component.on('click', $.proxy(timepicker.showWidget, timepicker));
        }
      }
    };
  }
]);
'use strict';
angular.module('$strap.directives').directive('bsTooltip', [
  '$parse',
  '$compile',
  function ($parse, $compile) {
    return {
      restrict: 'A',
      scope: true,
      link: function postLink(scope, element, attrs, ctrl) {
        var getter = $parse(attrs.bsTooltip), setter = getter.assign, value = getter(scope);
        scope.$watch(attrs.bsTooltip, function (newValue, oldValue) {
          if (newValue !== oldValue) {
            value = newValue;
          }
        });
        if (!!attrs.unique) {
          element.on('show', function (ev) {
            $('.tooltip.in').each(function () {
              var $this = $(this), tooltip = $this.data('tooltip');
              if (tooltip && !tooltip.$element.is(element)) {
                $this.tooltip('hide');
              }
            });
          });
        }
        element.tooltip({
          title: function () {
            return angular.isFunction(value) ? value.apply(null, arguments) : value;
          },
          html: true
        });
        var tooltip = element.data('tooltip');
        tooltip.show = function () {
          var r = $.fn.tooltip.Constructor.prototype.show.apply(this, arguments);
          this.tip().data('tooltip', this);
          return r;
        };
        scope._tooltip = function (event) {
          element.tooltip(event);
        };
        scope.hide = function () {
          element.tooltip('hide');
        };
        scope.show = function () {
          element.tooltip('show');
        };
        scope.dismiss = scope.hide;
      }
    };
  }
]);
'use strict';
angular.module('$strap.directives').directive('bsTypeahead', [
  '$parse',
  function ($parse) {
    return {
      restrict: 'A',
      require: '?ngModel',
      link: function postLink(scope, element, attrs, controller) {
        var getter = $parse(attrs.bsTypeahead), setter = getter.assign, value = getter(scope);
        scope.$watch(attrs.bsTypeahead, function (newValue, oldValue) {
          if (newValue !== oldValue) {
            value = newValue;
          }
        });
        element.attr('data-provide', 'typeahead');
        element.typeahead({
          source: function (query) {
            return angular.isFunction(value) ? value.apply(null, arguments) : value;
          },
          minLength: attrs.minLength || 1,
          items: attrs.items,
          updater: function (value) {
            if (controller) {
              scope.$apply(function () {
                controller.$setViewValue(value);
              });
            }
            scope.$emit('typeahead-updated', value);
            return value;
          }
        });
        var typeahead = element.data('typeahead');
        typeahead.lookup = function (ev) {
          var items;
          this.query = this.$element.val() || '';
          if (this.query.length < this.options.minLength) {
            return this.shown ? this.hide() : this;
          }
          items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source;
          return items ? this.process(items) : this;
        };
        if (!!attrs.matchAll) {
          typeahead.matcher = function (item) {
            return true;
          };
        }
        if (attrs.minLength === '0') {
          setTimeout(function () {
            element.on('focus', function () {
              element.val().length === 0 && setTimeout(element.typeahead.bind(element, 'lookup'), 200);
            });
          });
        }
      }
    };
  }
]);


text:
package erepnikov.models;

/**
 * Class Car
 *
 * @author Egor Repnikov
 * @version 0.0.1
 * @since 14.10.2017
 */
public class Car {

    /**
     * Car's ID
     */
    private int id;

    /**
     * Car's name
     */
    private String name;

    /**
     * Car's Transmission
     */
    private Transmission transmission;

    /**
     * Car's Engine
     */
    private Engine engine;

    /**
     * Car's Gearbox
     */
    private Gearbox gearbox;

    /**
     * Car's Body
     */
    private Body body;

    /**
     * Car's Brand
     */
    private Brand brand;

    public Car() {
    }

    public Car(int id, String name, Transmission transmission, Engine engine, Gearbox gearbox) {
        this.id = id;
        this.name = name;
        this.transmission = transmission;
        this.engine = engine;
        this.gearbox = gearbox;
    }

    /**
     * @return Car's ID
     */
    public int getId() {
        return id;
    }

    /**
     * Set Car's ID
     *
     * @param id
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return Car's name
     */
    public String getName() {
        return name;
    }

    /**
     * Set Car's name
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return Car's Transmission
     */
    public Transmission getTransmission() {
        return transmission;
    }

    /**
     * Set Car's Transmission
     *
     * @param transmission
     */
    public void setTransmission(Transmission transmission) {
        this.transmission = transmission;
    }

    /**
     * @return Car's Engine
     */
    public Engine getEngine() {
        return engine;
    }

    /**
     * Set Car's Engine
     *
     * @param engine
     */
    public void setEngine(Engine engine) {
        this.engine = engine;
    }

    /**
     * @return Car's Gearbox
     */
    public Gearbox getGearbox() {
        return gearbox;
    }

    /**
     * Set Car's Gearbox
     *
     * @param gearbox
     */
    public void setGearbox(Gearbox gearbox) {
        this.gearbox = gearbox;
    }

    /**
     * @return Car's Body
     */
    public Body getBody() {
        return body;
    }

    /**
     * Set Car's Body
     * @param body
     */
    public void setBody(Body body) {
        this.body = body;
    }

    /**
     * @return Car's Brand
     */
    public Brand getBrand() {
        return brand;
    }

    /**
     * Set Car's Brand
     * @param brand
     */
    public void setBrand(Brand brand) {
        this.brand = brand;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Car car = (Car) o;

        if (id != car.id) return false;
        if (name != null ? !name.equals(car.name) : car.name != null) return false;
        if (transmission != null ? !transmission.equals(car.transmission) : car.transmission != null) return false;
        if (engine != null ? !engine.equals(car.engine) : car.engine != null) return false;
        if (gearbox != null ? !gearbox.equals(car.gearbox) : car.gearbox != null) return false;
        if (body != null ? !body.equals(car.body) : car.body != null) return false;
        return brand != null ? brand.equals(car.brand) : car.brand == null;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (transmission != null ? transmission.hashCode() : 0);
        result = 31 * result + (engine != null ? engine.hashCode() : 0);
        result = 31 * result + (gearbox != null ? gearbox.hashCode() : 0);
        result = 31 * result + (body != null ? body.hashCode() : 0);
        result = 31 * result + (brand != null ? brand.hashCode() : 0);
        return result;
    }
}


text:
static_assert(OPENTRACING_ABI_VERSION[0] == '2',
    "Invalid version of OpenTracing. Please install a version using the v2 ABI.");


text:
<?php

use opensrs\domains\lookup\GetBalance;

/**
 * @group lookup
 * @group GetBalance
 */
class GetBalanceTest extends PHPUnit_Framework_TestCase
{
    protected $func = 'lookupGetBalance';

    protected $validSubmission = array();

    /**
     * Valid submission should complete with no
     * exception thrown.
     *
     *
     * @group validsubmission
     */
    public function testValidSubmission()
    {
        $data = json_decode(json_encode($this->validSubmission));

        $ns = new GetBalance('array', $data);

        $this->assertTrue($ns instanceof GetBalance);
    }
}


text:
<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),

            new Oneup\UploaderBundle\OneupUploaderBundle(),
            new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(),
            new Liip\ImagineBundle\LiipImagineBundle(),
            new Jb\Bundle\FileUploaderBundle\JbFileUploaderBundle(),
            new JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle(),

            new AppBundle\AppBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
    }
}