text:
#ifndef H_LUCY_INDEX_SNAPSHOT
#define H_LUCY_INDEX_SNAPSHOT 1

#ifdef __cplusplus
extern "C" {
#endif

#include "lucy_parcel.h"

/* Include the header for this class's parent.
 */

#include "Clownfish/Obj.h"

/* Define the struct layout for instances of this class.
 */

#ifdef C_LUCY_SNAPSHOT
extern uint32_t lucy_Snapshot_IVARS_OFFSET;
typedef struct lucy_SnapshotIVARS lucy_SnapshotIVARS;
static CFISH_INLINE lucy_SnapshotIVARS*
lucy_Snapshot_IVARS(lucy_Snapshot *self) {
   char *ptr = (char*)self + lucy_Snapshot_IVARS_OFFSET;
   return (lucy_SnapshotIVARS*)ptr;
}
#ifdef LUCY_USE_SHORT_NAMES
  #define SnapshotIVARS lucy_SnapshotIVARS
  #define Snapshot_IVARS lucy_Snapshot_IVARS
#endif

struct lucy_SnapshotIVARS {
    cfish_Hash* entries;
    cfish_String* path;
};

#endif /* C_LUCY_SNAPSHOT */

/* Declare this class's inert variables.
 */

extern LUCY_VISIBLE int32_t lucy_Snapshot_current_file_format;

/* Declare both this class's inert functions and the C functions which
 * implement this class's dynamic methods.
 */

LUCY_VISIBLE lucy_Snapshot*
lucy_Snapshot_new(void);

LUCY_VISIBLE lucy_Snapshot*
lucy_Snapshot_init(lucy_Snapshot* self);

cfish_Vector*
LUCY_Snapshot_List_IMP(lucy_Snapshot* self);

uint32_t
LUCY_Snapshot_Num_Entries_IMP(lucy_Snapshot* self);

void
LUCY_Snapshot_Add_Entry_IMP(lucy_Snapshot* self, cfish_String* entry);

bool
LUCY_Snapshot_Delete_Entry_IMP(lucy_Snapshot* self, cfish_String* entry);

lucy_Snapshot*
LUCY_Snapshot_Read_File_IMP(lucy_Snapshot* self, lucy_Folder* folder, cfish_String* path);

void
LUCY_Snapshot_Write_File_IMP(lucy_Snapshot* self, lucy_Folder* folder, cfish_String* path);

void
LUCY_Snapshot_Set_Path_IMP(lucy_Snapshot* self, cfish_String* path);

cfish_String*
LUCY_Snapshot_Get_Path_IMP(lucy_Snapshot* self);

void
LUCY_Snapshot_Destroy_IMP(lucy_Snapshot* self);

/* Define typedefs for each dynamic method, allowing us to cast generic
 * pointers to the appropriate function pointer type more cleanly.
 */

typedef void*
(*LUCY_Snapshot_To_Host_t)(lucy_Snapshot* self, void* vcache);

typedef cfish_Obj*
(*LUCY_Snapshot_Clone_t)(lucy_Snapshot* self);

typedef bool
(*LUCY_Snapshot_Equals_t)(lucy_Snapshot* self, cfish_Obj* other);

typedef int32_t
(*LUCY_Snapshot_Compare_To_t)(lucy_Snapshot* self, cfish_Obj* other);

typedef void
(*LUCY_Snapshot_Destroy_t)(lucy_Snapshot* self);

typedef cfish_String*
(*LUCY_Snapshot_To_String_t)(lucy_Snapshot* self);

typedef cfish_Vector*
(*LUCY_Snapshot_List_t)(lucy_Snapshot* self);

typedef uint32_t
(*LUCY_Snapshot_Num_Entries_t)(lucy_Snapshot* self);

typedef void
(*LUCY_Snapshot_Add_Entry_t)(lucy_Snapshot* self, cfish_String* entry);

typedef bool
(*LUCY_Snapshot_Delete_Entry_t)(lucy_Snapshot* self, cfish_String* entry);

typedef lucy_Snapshot*
(*LUCY_Snapshot_Read_File_t)(lucy_Snapshot* self, lucy_Folder* folder, cfish_String* path);

typedef void
(*LUCY_Snapshot_Write_File_t)(lucy_Snapshot* self, lucy_Folder* folder, cfish_String* path);

typedef void
(*LUCY_Snapshot_Set_Path_t)(lucy_Snapshot* self, cfish_String* path);

typedef cfish_String*
(*LUCY_Snapshot_Get_Path_t)(lucy_Snapshot* self);

/* Define type-safe wrappers for inert functions of Obj.
 */

static CFISH_INLINE cfish_Class*
lucy_Snapshot_get_class(lucy_Snapshot *self) {
    return cfish_Obj_get_class((cfish_Obj*)self);
}

static CFISH_INLINE cfish_String*
lucy_Snapshot_get_class_name(lucy_Snapshot *self) {
    return cfish_Obj_get_class_name((cfish_Obj*)self);
}

static CFISH_INLINE bool
lucy_Snapshot_is_a(lucy_Snapshot *self, cfish_Class *ancestor) {
    return cfish_Obj_is_a((cfish_Obj*)self, ancestor);
}

/* Define the inline functions which implement this class's virtual methods.
 */

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_To_Host_OFFSET;
static CFISH_INLINE void*
LUCY_Snapshot_To_Host(lucy_Snapshot* self, void* vcache) {
    const LUCY_Snapshot_To_Host_t method = (LUCY_Snapshot_To_Host_t)cfish_obj_method(self, LUCY_Snapshot_To_Host_OFFSET);
    return method(self, vcache);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_Clone_OFFSET;
static CFISH_INLINE cfish_Obj*
LUCY_Snapshot_Clone(lucy_Snapshot* self) {
    const LUCY_Snapshot_Clone_t method = (LUCY_Snapshot_Clone_t)cfish_obj_method(self, LUCY_Snapshot_Clone_OFFSET);
    return method(self);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_Equals_OFFSET;
static CFISH_INLINE bool
LUCY_Snapshot_Equals(lucy_Snapshot* self, cfish_Obj* other) {
    const LUCY_Snapshot_Equals_t method = (LUCY_Snapshot_Equals_t)cfish_obj_method(self, LUCY_Snapshot_Equals_OFFSET);
    return method(self, other);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_Compare_To_OFFSET;
static CFISH_INLINE int32_t
LUCY_Snapshot_Compare_To(lucy_Snapshot* self, cfish_Obj* other) {
    const LUCY_Snapshot_Compare_To_t method = (LUCY_Snapshot_Compare_To_t)cfish_obj_method(self, LUCY_Snapshot_Compare_To_OFFSET);
    return method(self, other);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_Destroy_OFFSET;
static CFISH_INLINE void
LUCY_Snapshot_Destroy(lucy_Snapshot* self) {
    const LUCY_Snapshot_Destroy_t method = (LUCY_Snapshot_Destroy_t)cfish_obj_method(self, LUCY_Snapshot_Destroy_OFFSET);
    method(self);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_To_String_OFFSET;
static CFISH_INLINE cfish_String*
LUCY_Snapshot_To_String(lucy_Snapshot* self) {
    const LUCY_Snapshot_To_String_t method = (LUCY_Snapshot_To_String_t)cfish_obj_method(self, LUCY_Snapshot_To_String_OFFSET);
    return method(self);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_List_OFFSET;
static CFISH_INLINE cfish_Vector*
LUCY_Snapshot_List(lucy_Snapshot* self) {
    const LUCY_Snapshot_List_t method = (LUCY_Snapshot_List_t)cfish_obj_method(self, LUCY_Snapshot_List_OFFSET);
    return method(self);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_Num_Entries_OFFSET;
static CFISH_INLINE uint32_t
LUCY_Snapshot_Num_Entries(lucy_Snapshot* self) {
    const LUCY_Snapshot_Num_Entries_t method = (LUCY_Snapshot_Num_Entries_t)cfish_obj_method(self, LUCY_Snapshot_Num_Entries_OFFSET);
    return method(self);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_Add_Entry_OFFSET;
static CFISH_INLINE void
LUCY_Snapshot_Add_Entry(lucy_Snapshot* self, cfish_String* entry) {
    const LUCY_Snapshot_Add_Entry_t method = (LUCY_Snapshot_Add_Entry_t)cfish_obj_method(self, LUCY_Snapshot_Add_Entry_OFFSET);
    method(self, entry);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_Delete_Entry_OFFSET;
static CFISH_INLINE bool
LUCY_Snapshot_Delete_Entry(lucy_Snapshot* self, cfish_String* entry) {
    const LUCY_Snapshot_Delete_Entry_t method = (LUCY_Snapshot_Delete_Entry_t)cfish_obj_method(self, LUCY_Snapshot_Delete_Entry_OFFSET);
    return method(self, entry);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_Read_File_OFFSET;
static CFISH_INLINE lucy_Snapshot*
LUCY_Snapshot_Read_File(lucy_Snapshot* self, lucy_Folder* folder, cfish_String* path) {
    const LUCY_Snapshot_Read_File_t method = (LUCY_Snapshot_Read_File_t)cfish_obj_method(self, LUCY_Snapshot_Read_File_OFFSET);
    return method(self, folder, path);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_Write_File_OFFSET;
static CFISH_INLINE void
LUCY_Snapshot_Write_File(lucy_Snapshot* self, lucy_Folder* folder, cfish_String* path) {
    const LUCY_Snapshot_Write_File_t method = (LUCY_Snapshot_Write_File_t)cfish_obj_method(self, LUCY_Snapshot_Write_File_OFFSET);
    method(self, folder, path);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_Set_Path_OFFSET;
static CFISH_INLINE void
LUCY_Snapshot_Set_Path(lucy_Snapshot* self, cfish_String* path) {
    const LUCY_Snapshot_Set_Path_t method = (LUCY_Snapshot_Set_Path_t)cfish_obj_method(self, LUCY_Snapshot_Set_Path_OFFSET);
    method(self, path);
}

extern LUCY_VISIBLE uint32_t LUCY_Snapshot_Get_Path_OFFSET;
static CFISH_INLINE cfish_String*
LUCY_Snapshot_Get_Path(lucy_Snapshot* self) {
    const LUCY_Snapshot_Get_Path_t method = (LUCY_Snapshot_Get_Path_t)cfish_obj_method(self, LUCY_Snapshot_Get_Path_OFFSET);
    return method(self);
}

/* Declare callbacks for wrapping host overrides.
 */

#ifdef CFISH_NO_DYNAMIC_OVERRIDES
#define Lucy_Snapshot_List_OVERRIDE NULL
#define Lucy_Snapshot_Num_Entries_OVERRIDE NULL
#define Lucy_Snapshot_Add_Entry_OVERRIDE NULL
#define Lucy_Snapshot_Delete_Entry_OVERRIDE NULL
#define Lucy_Snapshot_Read_File_OVERRIDE NULL
#define Lucy_Snapshot_Write_File_OVERRIDE NULL
#define Lucy_Snapshot_Set_Path_OVERRIDE NULL
#define Lucy_Snapshot_Get_Path_OVERRIDE NULL
#else
cfish_Vector*
Lucy_Snapshot_List_OVERRIDE(lucy_Snapshot* self);
uint32_t
Lucy_Snapshot_Num_Entries_OVERRIDE(lucy_Snapshot* self);
void
Lucy_Snapshot_Add_Entry_OVERRIDE(lucy_Snapshot* self, cfish_String* entry);
bool
Lucy_Snapshot_Delete_Entry_OVERRIDE(lucy_Snapshot* self, cfish_String* entry);
lucy_Snapshot*
Lucy_Snapshot_Read_File_OVERRIDE(lucy_Snapshot* self, lucy_Folder* folder, cfish_String* path);
void
Lucy_Snapshot_Write_File_OVERRIDE(lucy_Snapshot* self, lucy_Folder* folder, cfish_String* path);
void
Lucy_Snapshot_Set_Path_OVERRIDE(lucy_Snapshot* self, cfish_String* path);
cfish_String*
Lucy_Snapshot_Get_Path_OVERRIDE(lucy_Snapshot* self);
#endif

/* Define "short names" for this class's symbols.
 */

#ifdef LUCY_USE_SHORT_NAMES
  #define Snapshot lucy_Snapshot
  #define SNAPSHOT LUCY_SNAPSHOT
  #define Snapshot_new lucy_Snapshot_new
  #define Snapshot_init lucy_Snapshot_init
  #define Snapshot_current_file_format lucy_Snapshot_current_file_format
  #define Snapshot_get_class lucy_Snapshot_get_class
  #define Snapshot_get_class_name lucy_Snapshot_get_class_name
  #define Snapshot_is_a lucy_Snapshot_is_a
  #define Snapshot_List_IMP LUCY_Snapshot_List_IMP
  #define Snapshot_Num_Entries_IMP LUCY_Snapshot_Num_Entries_IMP
  #define Snapshot_Add_Entry_IMP LUCY_Snapshot_Add_Entry_IMP
  #define Snapshot_Delete_Entry_IMP LUCY_Snapshot_Delete_Entry_IMP
  #define Snapshot_Read_File_IMP LUCY_Snapshot_Read_File_IMP
  #define Snapshot_Write_File_IMP LUCY_Snapshot_Write_File_IMP
  #define Snapshot_Set_Path_IMP LUCY_Snapshot_Set_Path_IMP
  #define Snapshot_Get_Path_IMP LUCY_Snapshot_Get_Path_IMP
  #define Snapshot_Destroy_IMP LUCY_Snapshot_Destroy_IMP
  #define Snapshot_To_Host LUCY_Snapshot_To_Host
  #define Snapshot_To_Host_t LUCY_Snapshot_To_Host_t
  #define Snapshot_Clone LUCY_Snapshot_Clone
  #define Snapshot_Clone_t LUCY_Snapshot_Clone_t
  #define Snapshot_Equals LUCY_Snapshot_Equals
  #define Snapshot_Equals_t LUCY_Snapshot_Equals_t
  #define Snapshot_Compare_To LUCY_Snapshot_Compare_To
  #define Snapshot_Compare_To_t LUCY_Snapshot_Compare_To_t
  #define Snapshot_Destroy LUCY_Snapshot_Destroy
  #define Snapshot_Destroy_t LUCY_Snapshot_Destroy_t
  #define Snapshot_To_String LUCY_Snapshot_To_String
  #define Snapshot_To_String_t LUCY_Snapshot_To_String_t
  #define Snapshot_List LUCY_Snapshot_List
  #define Snapshot_List_t LUCY_Snapshot_List_t
  #define Snapshot_Num_Entries LUCY_Snapshot_Num_Entries
  #define Snapshot_Num_Entries_t LUCY_Snapshot_Num_Entries_t
  #define Snapshot_Add_Entry LUCY_Snapshot_Add_Entry
  #define Snapshot_Add_Entry_t LUCY_Snapshot_Add_Entry_t
  #define Snapshot_Delete_Entry LUCY_Snapshot_Delete_Entry
  #define Snapshot_Delete_Entry_t LUCY_Snapshot_Delete_Entry_t
  #define Snapshot_Read_File LUCY_Snapshot_Read_File
  #define Snapshot_Read_File_t LUCY_Snapshot_Read_File_t
  #define Snapshot_Write_File LUCY_Snapshot_Write_File
  #define Snapshot_Write_File_t LUCY_Snapshot_Write_File_t
  #define Snapshot_Set_Path LUCY_Snapshot_Set_Path
  #define Snapshot_Set_Path_t LUCY_Snapshot_Set_Path_t
  #define Snapshot_Get_Path LUCY_Snapshot_Get_Path
  #define Snapshot_Get_Path_t LUCY_Snapshot_Get_Path_t
#endif /* LUCY_USE_SHORT_NAMES */

#ifdef __cplusplus
}
#endif

#endif /* H_LUCY_INDEX_SNAPSHOT */


text:
package fixtures.azurespecials;

import org.junit.BeforeClass;
import org.junit.Test;

import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl;

public class ApiVersionLocalTests {
    private static AutoRestAzureSpecialParametersTestClientImpl client;

    @BeforeClass
    public static void setup() {
        client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost.:3000", null);
    }

    @Test
    public void getMethodLocalValid() throws Exception {
        client.apiVersionLocals().getMethodLocalValid();
    }

    @Test
    public void getMethodGlobalNotProvidedValid() throws Exception {
        client.apiVersionLocals().getMethodLocalNull(null);
    }

    @Test
    public void getPathGlobalValid() throws Exception {
        client.apiVersionLocals().getPathLocalValid();
    }

    @Test
    public void getSwaggerGlobalValid() throws Exception {
        client.apiVersionLocals().getSwaggerLocalValid();
    }
}

redpajama_set_name: RedPajamaGithub


text:
import { milliseconds } from 'date-fns'
export default milliseconds


text:
@import UIKit;

@interface YHViewController : UIViewController

@end


text:
package com.thinkbiganalytics.nifi.security;

import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.processor.util.StandardValidators;

import javax.annotation.Nonnull;

/**
 * Common Controller Service or Processor properties for accessing Kerberos.
 */
public interface KerberosProperties {

    /**
     * Defines the time interval for refreshing a Kerberos ticket
     */
    PropertyDescriptor KERBEROS_RELOGIN_PERIOD = new PropertyDescriptor.Builder()
        .name("Kerberos Relogin Period")
        .required(false)
        .description("Period of time which should pass before attempting a kerberos relogin")
        .defaultValue("4 hours")
        .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR)
        .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
        .build();

    /**
     * Creates a new property for the Kerberos service keytab.
     *
     * @return the Kerberos service keytab property
     */
    @Nonnull
    PropertyDescriptor createKerberosKeytabProperty();

    /**
     * Creates a new property for the Kerberos service principal.
     *
     * @return the Kerberos service principal property
     */
    @Nonnull
    PropertyDescriptor createKerberosPrincipalProperty();
}


text:
/******************************************************/
/*  Funciones para manejo de datos de Relevadores     */
/******************************************************/

var rootURL = "/RelemancoShopsWeb/backend/web";

$( document ).ready(function() {

    initMap();
    asignarLocalizacionClick();

});

$('label[for="relevador-id_localizacion"]').css("display", "none");
$('label[for="localizacion-nota"]').css("display", "none");

function initMap() {

    var myLatlng = {lat: -34.8059635, lng: -56.2145634};

    var map = new google.maps.Map(document.getElementById('map'), {
        zoom: 11,
        center: myLatlng
    });

    var marker = null;

    map.addListener('click', function(e) {

        var latLng = e.latLng;
        var markerLatlng = {};
        $("#localizacion-latitud").val(e.latLng.lat());
        $("#localizacion-longitud").val(e.latLng.lng());

        if(marker != null){
            marker.setMap(null);
        }
        markerLatlng = {lat: e.latLng.lat(), lng: e.latLng.lng()};
        marker = new google.maps.Marker({
            position: markerLatlng,
            animation: google.maps.Animation.DROP,
            map: map,
            title: $("#comercio-nombre").val() != "" ? $("#comercio-nombre").val() : "Nuevo Comercio"
        });
        marker.setMap(map);

    });

}

/* Funcion que envia los id de los productos seleccionados para asignarlos
al comercio elegido */
function asignarLocalizacionClick(){
    $(".btnAsignarLoc").click(function(){
        var id = $("#relevador-id").val();
        var lat = $("#localizacion-latitud").val();
        var lng = $("#localizacion-longitud").val();
        var nota = $("#relevador-id[selected]").html();

        $.ajax({
            method: "POST",
            url: rootURL + "/relevador/guardar-localizacion?id=" + id,
            dataType: "json",
            data: {"Localizacion[latitud]" : lat, "Localizacion[longitud]" : lng, "Localizacion[nota]" : nota }
        }).done(function(data){

            $.magnificPopup.open({
                items: {
                  src: '

Se asigno la localizacion correctamente!

',
                  type: 'inline'
                }
            });

        }).fail(function(){
            alert("Ocurrio un error al asignar la localizacion.");
        });

        return false;
    });
}


text:
{% extends path+"/scenario_04a/_layout-case-simple.html" %}

{% block citizen_content %}

{{ data.nuggets | log }}

Back

Mental health assessment

	<form method="post" action="../scenario_04a/assessment_ftf/wca-index">

Appearance

  			Help prompts

Example content

		<textarea class="form-control form-control-3-4" name="mentalHealthAppearance" id="mentalHealthAppearance" rows="6">{{ mentalHealthAppearance }}</textarea>

Behaviour

  			Help prompts

Example content

		<textarea class="form-control form-control-3-4" name="mentalHealthBehaviour" id="mentalHealthBehaviour" rows="6">{{ mentalHealthBehaviour }}</textarea>

Speech

  			Help prompts

Example content

		<textarea class="form-control form-control-3-4" name="mentalHealthSpeech" id="mentalHealthSpeech" rows="6">{{ mentalHealthSpeech }}</textarea>

Mood

  			Help prompts

Example content

		<textarea class="form-control form-control-3-4" name="mentalHealthMood" id="mentalHealthMood" rows="6">{{ mentalHealthMood }}</textarea>

Cognitition general

  			Help prompts

Example content

		<textarea class="form-control form-control-3-4" name="mentalHealthCognitition" id="mentalHealthCognitition" rows="6">{{ mentalHealthCognitition }}</textarea>

Insight

  			Help prompts

Example content

		<textarea class="form-control form-control-3-4" name="mentalHealthInsight" id="mentalHealthInsight" rows="6">{{ mentalHealthInsight }}</textarea>

Thoughts

  			Help prompts

Example content

		<textarea class="form-control form-control-3-4" name="mentalHealthThoughts" id="mentalHealthThoughts" rows="6">{{ mentalHealthThoughts }}</textarea>

Perceptions

  			Help prompts

Example content

		<textarea class="form-control form-control-3-4" name="mentalHealthPerceptions" id="mentalHealthPerceptions" rows="6">{{ mentalHealthPerceptions }}</textarea>

Addictions

  			Help prompts

Example content

		<textarea class="form-control form-control-3-4" name="mentalHealthAddictions" id="mentalHealthAddictions" rows="6">{{ mentalHealthAddictions }}</textarea>

Cognitive tests

  			Help prompts

Example content

		<textarea class="form-control form-control-3-4" name="mentalHealthCognitiveTests" id="mentalHealthCognitiveTests" rows="6">{{ mentalHealthCognitiveTests }}</textarea>

<input type="submit" class="button" value="Continue" id="submitButton">

	</form>

{% endblock %}


text:
Op-Amps-101
===========

Wanted to make a pH sensor?
Make a noise-canceller?
Make a custom equalizer?
Mini microphones?

Improve your circuitry with this intro to Analog Circuit Design -- with focus on Op Amps, Instrumental Amplifiers, analog comparators, and opto-isolators.

## Op Amps Are Fun

### Topology Checklist:

* [ ] inverting amplifier (simple volume control)
* [ ] non-inverting amplifier (simple buffer, and amplifier)
* [ ] summing-amplifier (single speaker multiple tones)
* [ ] differential amplifier (matched pair analysis)
* [ ] bridge amplifier (force sensor)
* [ ] logarithmic amplifier (compressor)
* [ ] frequency filter

### Project Checklist:
* [ ] Music: compressor
* [ ] Music: fuzz
* [ ] Music: phasor
* [ ] Music: make-an-instrument
* [ ] Science: pH Sensor
* [ ] Science: Soil Moisture Sensor
* [ ] Science: Light Sensor
* [ ] Science: Strain Gauge Sensor
* [ ] Science: Thermopile sensor
* [ ] Science: Oxygen Sensor
* [ ] Cool: Alpha-Wave-Detector
* [ ] Robotics: Force-Feedback-sensor
* [ ] Robotics: Frequency sensor (whistle-bot)
* [ ] Robotics: Opto-coupling
* [ ] Embedded: single-supply RR op Amps

### Cool Ic's

**Myth:** hardware is expensive
**Fact:** IC samples are free (especially if you can solder)

* [ ] RR Op Amp, a few suggestions, a few sample sites
* [ ] ultra-high input impedence, low offset usage
* [ ] instrumental amplification (pricey, lower bandwidth but very powerful for medical applications)
* [ ] High power op amps
* [ ] Analog Comparators -- do the job.

### Next md-docs

* [ ] create md-doc with sample diagrams of the most important (IMO) op amp configurations
* [ ] create md-doc with description of op-amp limitations/"non-idealities" and what applications they are important concerns
* [ ] create md-doc to create a set of projects each common topology


text:
package org.apereo.cas.oidc.web.controllers.token;

import org.apereo.cas.oidc.OidcConfigurationContext;
import org.apereo.cas.oidc.OidcConstants;
import org.apereo.cas.support.oauth.OAuth20Constants;
import org.apereo.cas.support.oauth.util.OAuth20Utils;
import org.apereo.cas.support.oauth.web.endpoints.OAuth20RevocationEndpointController;

import lombok.val;
import org.pac4j.core.context.JEEContext;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * This is {@link OidcRevocationEndpointController}.
 *
 * @author Misagh Moayyed
 * @since 5.2.0
 */
public class OidcRevocationEndpointController extends OAuth20RevocationEndpointController<OidcConfigurationContext> {

    public OidcRevocationEndpointController(final OidcConfigurationContext configurationContext) {
        super(configurationContext);
    }

    @PostMapping(value = {
        '/' + OidcConstants.BASE_OIDC_URL + '/' + OAuth20Constants.REVOCATION_URL,
        "/**/" + OidcConstants.REVOCATION_URL
    },
        produces = MediaType.APPLICATION_JSON_VALUE)
    @Override
    public ModelAndView handleRequest(final HttpServletRequest request,
                                      final HttpServletResponse response) {
        val webContext = new JEEContext(request, response);
        if (!getConfigurationContext().getOidcRequestSupport().isValidIssuerForEndpoint(webContext, OidcConstants.REVOCATION_URL)) {
            return OAuth20Utils.produceUnauthorizedErrorView(HttpStatus.NOT_FOUND);
        }
        return super.handleRequest(request, response);
    }
}


text:
package pull

import (
	"fmt"

	"code.gitea.io/gitea/models"
	"code.gitea.io/gitea/modules/git"
	"code.gitea.io/gitea/modules/log"
	"code.gitea.io/gitea/modules/notification"
	issue_service "code.gitea.io/gitea/services/issue"
)

// NewPullRequest creates new pull request with labels for repository.
func NewPullRequest(repo *models.Repository, pull *models.Issue, labelIDs []int64, uuids []string, pr *models.PullRequest, assigneeIDs []int64) error {
	if err := TestPatch(pr); err != nil {
		return err
	}

	if err := models.NewPullRequest(repo, pull, labelIDs, uuids, pr); err != nil {
		return err
	}

	for _, assigneeID := range assigneeIDs {
		if err := issue_service.AddAssigneeIfNotAssigned(pull, pull.Poster, assigneeID); err != nil {
			return err
		}
	}

	pr.Issue = pull
	pull.PullRequest = pr

	notification.NotifyNewPullRequest(pr)

	return nil
}

func checkForInvalidation(requests models.PullRequestList, repoID int64, doer *models.User, branch string) error {
	repo, err := models.GetRepositoryByID(repoID)
	if err != nil {
		return fmt.Errorf("GetRepositoryByID: %v", err)
	}
	gitRepo, err := git.OpenRepository(repo.RepoPath())
	if err != nil {
		return fmt.Errorf("git.OpenRepository: %v", err)
	}
	go func() {
		err := requests.InvalidateCodeComments(doer, gitRepo, branch)
		if err != nil {
			log.Error("PullRequestList.InvalidateCodeComments: %v", err)
		}
		gitRepo.Close()
	}()
	return nil
}

func addHeadRepoTasks(prs []*models.PullRequest) {
	for _, pr := range prs {
		log.Trace("addHeadRepoTasks[%d]: composing new test task", pr.ID)
		if err := pr.PushToBaseRepo(); err != nil {
			log.Error("PushToBaseRepo: %v", err)
			continue
		}

		AddToTaskQueue(pr)
	}
}

// AddTestPullRequestTask adds new test tasks by given head/base repository and head/base branch,
// and generate new patch for testing as needed.
func AddTestPullRequestTask(doer *models.User, repoID int64, branch string, isSync bool) {
	log.Trace("AddTestPullRequestTask [head_repo_id: %d, head_branch: %s]: finding pull requests", repoID, branch)
	prs, err := models.GetUnmergedPullRequestsByHeadInfo(repoID, branch)
	if err != nil {
		log.Error("Find pull requests [head_repo_id: %d, head_branch: %s]: %v", repoID, branch, err)
		return
	}

	if isSync {
		requests := models.PullRequestList(prs)
		if err = requests.LoadAttributes(); err != nil {
			log.Error("PullRequestList.LoadAttributes: %v", err)
		}
		if invalidationErr := checkForInvalidation(requests, repoID, doer, branch); invalidationErr != nil {
			log.Error("checkForInvalidation: %v", invalidationErr)
		}
		if err == nil {
			for _, pr := range prs {
				pr.Issue.PullRequest = pr
				notification.NotifyPullRequestSynchronized(doer, pr)
			}
		}
	}

	addHeadRepoTasks(prs)

	log.Trace("AddTestPullRequestTask [base_repo_id: %d, base_branch: %s]: finding pull requests", repoID, branch)
	prs, err = models.GetUnmergedPullRequestsByBaseInfo(repoID, branch)
	if err != nil {
		log.Error("Find pull requests [base_repo_id: %d, base_branch: %s]: %v", repoID, branch, err)
		return
	}
	for _, pr := range prs {
		AddToTaskQueue(pr)
	}
}


text:
SESTATUS=$(command -v sestatus)
[ -n "${SESTATUS}" ] && setenforce 0 || true

INSTALL_YUM_PKGS=
YUM_PKGS="curl
git
gnupg2
php-pear
npm
subversion
"

is_yum_pkg_installed() {
  rpm -q ${1} >>/dev/null 2>&1
}

is_yum_pkg_installed "epel-release" || yum -y install epel-release

for PKG in $YUM_PKGS
do
  is_yum_pkg_installed ${PKG}
  if [ $? -ne 0 ]; then
    [ -z "${INSTALL_YUM_PKGS}" ] && INSTALL_YUM_PKGS="${PKG}" || INSTALL_YUM_PKGS="${INSTALL_YUM_PKGS} ${PKG}"
  fi
done

if [ -n "${INSTALL_YUM_PKGS}" ]; then
  yum clean expire-cache
  yum install -y ${INSTALL_YUM_PKGS}
fi

command -v docker >>/dev/null
if [ $? -ne 0 ]; then
  cd /etc/yum.repos.d/
  curl -LO https://download.docker.com/linux/centos/docker-ce.repo
  cd - >>/dev/null

  yum clean expire-cache
  yum -y install docker-ce

fi

[ "$(systemctl is-enabled docker)" == "enabled" ] || systemctl enable docker
[ "$(systemctl is-active docker)" == "active" ] || systemctl start docker


text:
package me.veegn.talon.web.system;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 异常处理控制器
 * Created by Veegn on 2017/8/2.
 */
/*@Controller
public class ExceptionController {

    private static final String PAGE_NAME_ERROR = "error";

    @RequestMapping("error")
    public String error(){
        return PAGE_NAME_ERROR;
    }
}*/


text:
<?php

namespace spec\Sylius\Bundle\SearchBundle\Listener;

use Doctrine\ORM\Event\LifecycleEventArgs;
use PhpSpec\ObjectBehavior;
use Sylius\Bundle\SearchBundle\Indexer\OrmIndexer;

/**
 * @author Argyrios Gounaris <agounaris@gmail.com>
 */
class OrmListenerSpec extends ObjectBehavior
{
    function let(OrmIndexer $ormIndexer)
    {
        $this->beConstructedWith($ormIndexer);
    }

    function it_is_initializable()
    {
        $this->shouldHaveType('Sylius\Bundle\SearchBundle\Listener\OrmListener');
    }

    function it_populates_the_insertion_array(LifecycleEventArgs $args)
    {
        $this->postPersist($args);

        $this->scheduledForInsertion->shouldBeArray();
    }

    function it_populates_the_update_array(LifecycleEventArgs $args)
    {
        $this->postUpdate($args);

        $this->scheduledForInsertion->shouldBeArray();
    }

    function it_populates_the_delete_array(LifecycleEventArgs $args)
    {
        $this->preRemove($args);

        $this->scheduledForDeletion->shouldBeArray();
    }
}


text:
//
// This file is part of nuBASIC
// Copyright (c) Antonino Calderone (antonino.calderone@gmail.com)
// All rights reserved.
// Licensed under the MIT License.
// See COPYING file in the project root for full license information.
//

/* -------------------------------------------------------------------------- */

#include "nu_expr_unary_op.h"
#include "nu_global_function_tbl.h"

/* -------------------------------------------------------------------------- */

namespace nu {

/* -------------------------------------------------------------------------- */

expr_unary_op_t::expr_unary_op_t(
    const std::string& op_name, expr_any_t::handle_t var)
    : _op_name(op_name)
    , _var(var)
{
}

/* -------------------------------------------------------------------------- */

bool expr_unary_op_t::empty() const noexcept {
    return false;
}

/* -------------------------------------------------------------------------- */

variant_t expr_unary_op_t::eval(rt_prog_ctx_t& ctx) const
{
    if (!global_function_tbl_t::get_instance().is_defined(_op_name)) {
        throw exception_t(
            std::string("Error: \"" + _op_name + "\" undefined symbol"));
    }

    func_args_t args;
    args.push_back(_var);

    return global_function_tbl_t::get_instance()[_op_name](ctx, _op_name, args);
}

/* -------------------------------------------------------------------------- */

} // namespace

/* -------------------------------------------------------------------------- */


text:
package com.ameron32.rpgbuilder;

import android.app.Dialog;
import android.content.Context;

public class InputDialog {
private Dialog d;

	public InputDialog(Context c) {
		d = new Dialog(c);

	}

}


text:
<?php

namespace Nocks\SDK\Exception;

class GoneException extends HttpException {

}


text:
NSString *ScrollViewContentSizeKeyPath = @"contentSize";
NSString *ScrollViewContentOffsetKeyPath = @"contentOffset";
NSString *ScrollViewPanStateKeyPath = @"state";

@interface JJRefreshView ()<UIScrollViewDelegate>

@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *juhua;
@property(nonatomic, weak) UIScrollView * scrollView;

@property(nonatomic, strong) void(^downPullBlock)();

@property(nonatomic, strong) void(^upPullBlock)();

@property(nonatomic, strong) UIPanGestureRecognizer * pan;
@property(nonatomic, assign) UIEdgeInsets oriEdgeInsets;
@end

@implementation JJRefreshView
static JJRefreshView * header;
static JJRefreshView * footer;

+ (JJRefreshView *)loadDownPullViewWithBlock:(void (^)())requestBlock
{
    if (header == nil) {

        header = [[NSBundle mainBundle] loadNibNamed:@"JJRefreshView" owner:nil options:nil].firstObject;
        [header someInitSetting];
        header.downPullBlock = requestBlock;
    }
    return header;
}

+ (JJRefreshView *)loadUpPullViewWithBlock:(void (^)())requestBlock
{
    if (footer == nil) {

        footer = [[NSBundle mainBundle] loadNibNamed:@"JJRefreshView" owner:nil options:nil].lastObject;
        [footer someInitSetting];
        footer.upPullBlock = requestBlock;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:footer action:@selector(footerTaped:)];
        [footer addGestureRecognizer:tap];
    }

    return footer;
}

- (void)someInitSetting
{
    header.juhua.hidden = YES;
    header.hidden = YES;
    footer.juhua.hidden = YES;
    footer.statusLabel.text = @"下拉或点击加载更多";
    header.statusLabel.text = @"下拉刷新更多";
}

- (void)footerTaped:(UITapGestureRecognizer *)tap
{
    if (self.upPullRefreshing == YES) {
        return;
    }
    JJRefreshView *footer = (JJRefreshView *)tap.view;
    [footer startFooterRefresh];
}

#pragma mark ------------------------------------------
#pragma mark 设置KVO监听
- (void)willMoveToSuperview:(UIView *)newSuperview
{
    [super willMoveToSuperview:newSuperview];

    // 如果不是UIScrollView,不做任何事情
    if (newSuperview && ![newSuperview isKindOfClass:[UIScrollView class]]) return;

    // 旧的父控件移除监听
    [self removeObservers];

    if (newSuperview) { // 新的父控件
        // 记录UIScrollView
        _scrollView = (UIScrollView *)newSuperview;
        // 设置永远支持垂直弹簧效果
        self.scrollView.alwaysBounceVertical = YES;
        _oriEdgeInsets = _scrollView.contentInset;
        // 添加监听
        [self addObservers];
    }
}

- (void)addObservers
{
    NSKeyValueObservingOptions options = NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld;
    [self.scrollView addObserver:self forKeyPath:ScrollViewContentOffsetKeyPath options:options context:nil];
    [self.scrollView addObserver:self forKeyPath:ScrollViewContentSizeKeyPath options:options context:nil];
    self.pan = self.scrollView.panGestureRecognizer;
    [self.pan addObserver:self forKeyPath:ScrollViewPanStateKeyPath options:options context:nil];
}
- (void)removeObservers
{
    [self.superview removeObserver:self forKeyPath:ScrollViewContentOffsetKeyPath];
    [self.superview removeObserver:self forKeyPath:ScrollViewContentSizeKeyPath];;
    [self.pan removeObserver:self forKeyPath:ScrollViewPanStateKeyPath];
    self.pan = nil;
}

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
    if (keyPath == ScrollViewContentOffsetKeyPath) {
        [self jj_scrollViewDidScroll:self.scrollView];
    }
    if (keyPath == ScrollViewContentSizeKeyPath) {
        [self jj_scrollViewDidChangeContentSize:self.scrollView];
    }
    if (keyPath == ScrollViewPanStateKeyPath) {
        if (self.pan.state == UIGestureRecognizerStateEnded) {
            [self jj_scrollViewDidEndDragging:self.scrollView];
        }
    }
}

#pragma mark ------------------------------------------
#pragma mark 监听方法

- (void)jj_scrollViewDidScroll:(UIScrollView *)scrollView
{
    [scrollView.header dealHeaderRefreshView:scrollView];
    [scrollView.footer dealFooterRefreshView:scrollView];
}

- (void)jj_scrollViewDidEndDragging:(UIScrollView *)scrollView
{
    if (scrollView.header.downPullRefreshing) return;
    if (scrollView.contentOffset.y < -(scrollView.header.jj_height + scrollView.jj_insetT)) {

        [scrollView.header appearHeaderAndRefreshing];
    }
}

- (void)jj_scrollViewDidChangeContentSize:(UIScrollView *)scrollView
{
    footer.frame = CGRectMake(0, scrollView.contentSize.height, self.jj_width, 44);
    scrollView.jj_insetB = _oriEdgeInsets.bottom + footer.jj_height;

}
#pragma mark ------------------------------------------
#pragma mark other methods
- (void)dealFooterRefreshView:(UIScrollView *)scrollView
{
    if (scrollView.footer == nil) return;
    if (scrollView.footer.upPullRefreshing) return;
    scrollView.footer.scrollView = scrollView;
    if (scrollView.jj_offsetY > scrollView.jj_contentH - scrollView.jj_height) {

    }
    if (scrollView.contentOffset.y > scrollView.jj_contentH - scrollView.jj_height + scrollView.jj_insetB) {
        [scrollView.footer startFooterRefresh];
    }
}

- (void)dealHeaderRefreshView:(UIScrollView *)scrollView
{
    if (scrollView.header == nil) return;
    if (scrollView.header.downPullRefreshing) return;
    scrollView.header.scrollView = scrollView;
    if (scrollView.contentOffset.y < -(scrollView.header.jj_height + scrollView.jj_insetT)) {
        scrollView.header.statusLabel.text = @"松开立即刷新";
    }else{
        scrollView.header.statusLabel.text = @"下拉刷新更多";
    }
    if (scrollView.jj_offsetY < -scrollView.jj_insetT) {
        scrollView.header.hidden = NO;
    }
}

- (void)appearHeaderAndRefreshing
{
    if (self.downPullRefreshing) return;
    self.statusLabel.text = @"正在刷新...";
    self.downPullRefreshing = YES;
    self.juhua.hidden = NO;
    [self.juhua startAnimating];
    [UIView animateWithDuration:0.25 animations:^{

        self.scrollView.jj_insetT += self.scrollView.header.jj_height;
    }];
    header.downPullBlock();

}

- (void)hideHeaderAndStopRefresh
{
    self.statusLabel.text = @"下拉刷新更多";
    self.downPullRefreshing = NO;
    self.juhua.hidden = YES;
    [self.juhua stopAnimating];
    [UIView animateWithDuration:0.25 animations:^{

        self.scrollView.jj_insetT -= self.scrollView.header.jj_height;
    } completion:^(BOOL finished) {
        self.hidden = YES;
    }];
}

- (void)startFooterRefresh
{
    if (self.upPullRefreshing) return;
    self.statusLabel.text = @"正在加载...";
    self.upPullRefreshing = YES;
    self.juhua.hidden = NO;
    [self.juhua startAnimating];
    footer.upPullBlock();
}

- (void)stopFooterRefresh
{
    self.statusLabel.text = @"下拉或点击加载更多";
    self.upPullRefreshing = NO;
    self.juhua.hidden = YES;
    [self.juhua stopAnimating];
}

- (void)dealloc
{
    //    NSLog(@"refreshView销毁了");
}
@end


text:
<?php

namespace Phlexible\Bundle\MediaExtractorBundle;

use Phlexible\Bundle\MediaExtractorBundle\DependencyInjection\Compiler\AddExtractorsPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
 * Media extractor bundle
 *
 * @author Stephan Wentz <sw@brainbits.net>
 */
class PhlexibleMediaExtractorBundle extends Bundle
{
    /**
     * {@inheritdoc}
     */
    public function build(ContainerBuilder $container)
    {
        $container->addCompilerPass(new AddExtractorsPass());
    }
}


text:
<?php
/**
 * @author  MyBB Group
 * @version 2.0.0
 * @package mybb/core
 * @license http://www.mybb.com/licenses/bsd3 BSD-3
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateUserActivityTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_activity', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('user_id');
            $table->string('activity_type');
            $table->unsignedInteger('activity_id');
            $table->text('extra_details')->nullable();
            $table->nullableTimestamps();

            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('user_activity');
    }
}


text:
package minesim.events;

import notifications.NotificationManager;
import minesim.entities.*;

public class ZombieEvent extends RandomEvent {

    /**
     * Determines the chance of spawning the event
     */
    public static int chance() {
        return 2;
    }

    /**
     * Spawns one zombie
     */
    public static void execute() {
        //Random number generated for spawn position
        int x = (int) (Math.random() * 1500);

        //Notification printed
        NotificationManager.notify("Oh no it's a zombie!");

        //Spawns zombie at random location
        minesim.World.getInstance().addEntityToWorld(new ZombieMob(x, 100, 80, 42, 42));
    }
}


text:
!function(n){"function"==typeof define&&define.amd?define("primeng",n):n()}((function(){}));
//# sourceMappingURL=primeng.umd.min.js.map


text:
package com.koch.ambeth.orm20.independent.a22b;

import com.koch.ambeth.model.AbstractEntity;

public class EntityA extends AbstractEntity {
	private EntityB b1;

	private EntityB b2;

	public EntityB getB1() {
		return b1;
	}

	public void setB1(EntityB b1) {
		this.b1 = b1;
	}

	public EntityB getB2() {
		return b2;
	}

	public void setB2(EntityB b2) {
		this.b2 = b2;
	}
}


text:
package com.yokmama.learn10.chapter04.lesson16;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.yokmama.learn10.chapter04.lesson16.demo.DemoContent;

/**
 * A list fragment representing a list of Items. This fragment
 * also supports tablet devices by allowing list items to be given an
 * 'activated' state upon selection. This helps indicate which item is
 * currently being viewed in a {@link com.yokmama.learn10.chapter04.lesson16.demo.DemoCreator}.
 * <p/>
 * Activities containing this fragment MUST implement the {@link Callbacks}
 * interface.
 */
public class ItemListFragment extends ListFragment {

    /**
     * The serialization (saved instance state) Bundle key representing the
     * activated item position. Only used on tablets.
     */
    private static final String STATE_ACTIVATED_POSITION = "activated_position";

    /**
     * The fragment's current callback object, which is notified of list item
     * clicks.
     */
    private Callbacks mCallbacks = sDemoCallbacks;

    /**
     * The current activated item position. Only used on tablets.
     */
    private int mActivatedPosition = ListView.INVALID_POSITION;

    /**
     * A callback interface that all activities containing this fragment must
     * implement. This mechanism allows activities to be notified of item
     * selections.
     */
    public interface Callbacks {
        /**
         * Callback for when an item has been selected.
         */
        public void onItemSelected(DemoContent.DemoItem demoItem);
    }

    /**
     * A Demo implementation of the {@link Callbacks} interface that does
     * nothing. Used only when this fragment is not attached to an activity.
     */
    private static Callbacks sDemoCallbacks = new Callbacks() {
        @Override
        public void onItemSelected(DemoContent.DemoItem demoItem) {
        }
    };

    /**
     * Mandatory empty constructor for the fragment manager to instantiate the
     * fragment (e.g. upon screen orientation changes).
     */
    public ItemListFragment() {
    }

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

        // TODO: replace with a real list adapter.
        setListAdapter(new MyArrayAdapter(getActivity()));
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        // Restore the previously serialized activated item position.
        if (savedInstanceState != null
                && savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) {
            setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION));
        }
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);

        // Activities containing this fragment must implement its callbacks.
        if (!(activity instanceof Callbacks)) {
            throw new IllegalStateException("Activity must implement fragment's callbacks.");
        }

        mCallbacks = (Callbacks) activity;
    }

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

        // Reset the active callbacks interface to the demo implementation.
        mCallbacks = sDemoCallbacks;
    }

    @Override
    public void onListItemClick(ListView listView, View view, int position, long id) {
        super.onListItemClick(listView, view, position, id);

        // Notify the active callbacks interface (the activity, if the
        // fragment is attached to one) that an item has been selected.
        mCallbacks.onItemSelected(DemoContent.ITEMS.get(position));
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        if (mActivatedPosition != ListView.INVALID_POSITION) {
            // Serialize and persist the activated item position.
            outState.putInt(STATE_ACTIVATED_POSITION, mActivatedPosition);
        }
    }

    /**
     * Turns on activate-on-click mode. When this mode is on, list items will be
     * given the 'activated' state when touched.
     */
    public void setActivateOnItemClick(boolean activateOnItemClick) {
        // When setting CHOICE_MODE_SINGLE, ListView will automatically
        // give items the 'activated' state when touched.
        getListView().setChoiceMode(activateOnItemClick
                ? ListView.CHOICE_MODE_SINGLE
                : ListView.CHOICE_MODE_NONE);
    }

    private void setActivatedPosition(int position) {
        if (position == ListView.INVALID_POSITION) {
            getListView().setItemChecked(mActivatedPosition, false);
        } else {
            getListView().setItemChecked(position, true);
        }

        mActivatedPosition = position;
    }

    private class MyArrayAdapter extends ArrayAdapter<DemoContent.DemoItem>{
        LayoutInflater mLayoutInflater;

        public MyArrayAdapter(Context context) {
            super(context, R.layout.menu_list_item,
                    R.id.text1,
                    DemoContent.ITEMS);
            mLayoutInflater = LayoutInflater.from(context);
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            if(convertView == null){
                convertView = mLayoutInflater.inflate(R.layout.menu_list_item, parent, false);
            }
            TextView text1 = (TextView)convertView.findViewById(R.id.text1);
            TextView text2 = (TextView)convertView.findViewById(R.id.text2);
            DemoContent.DemoItem item = getItem(position);
            text1.setText(item.getContent());
            text2.setText(item.getDescription());

            return convertView;
        }
    }
}


text:
<!DOCTYPE html>

      <title></title>

Problem 1: Write a function called sum() that takes in two numbers as arguments and then returns the sum of those numbers.

Problem 2: Write a function called multiply() that takes in two numbers as arguments and then returns the product of those numbers.

Problem 3: Write a function called sumAndMultiply() that takes in THREE numbers as arguments and then returns two values in an array: the sum of those numbers and the product of those numbers.

Problem 4: Write a function called sumArray() that takes in an array of numbers as a single argument and then returns the sum of those numbers.

Problem 5: Write a function called multiplyArray() that takes in an array of numbers as a single argument and then returns the product of those numbers.


text:
<?php

namespace Knp\Menu\Renderer;

interface RendererProviderInterface
{
    /**
     * Retrieves a renderer by its name
     *
     * If null is given, a renderer marked as default is returned.
     *
     * @param string $name
     *
     * @return RendererInterface
     * @throws \InvalidArgumentException if the renderer does not exists
     */
    public function get($name = null);

    /**
     * Checks whether a renderer exists
     *
     * @param string $name
     *
     * @return boolean
     */
    public function has($name);
}


text:
namespace aprilui
{
	ImageBox::ImageBox(chstr name, grect rect) : Object(name, rect)
	{
		this->image = NULL;
	}

	ImageBox::~ImageBox()
	{
	}

	Object* ImageBox::createInstance(chstr name, grect rect)
	{
		return new ImageBox(name, rect);
	}

	void ImageBox::setImage(Image* image)
	{
		this->image = image;
		if (image != NULL)
		{
			grect rect = image->getSrcRect();
			if (this->rect.w == -1)
			{
				this->rect.w = rect.w * aprilui::getDefaultScale();
				this->center.x = rect.w * 0.5f;
			}
			if (this->rect.h == -1)
			{
				this->rect.h = rect.h * aprilui::getDefaultScale();
				this->center.y = this->rect.h * 0.5f;
			}
			this->imageName = image->getFullName();
		}
		else
		{
			this->imageName = APRILUI_IMAGE_NAME_NULL;
		}
	}

	void ImageBox::setImageByName(chstr name)
	{
		this->setImage(this->dataset->getImage(name));
	}

	bool ImageBox::trySetImageByName(chstr name)
	{
		if (this->imageName != name)
		{
			// using c/p code because of performance reasons
			this->setImage(this->dataset->getImage(name));
			return true;
		}
		return false;
	}

	void ImageBox::OnDraw()
	{
		if (this->image == NULL)
		{
			this->image = this->dataset->getImage(APRILUI_IMAGE_NAME_NULL);
		}
		april::Color color = this->_getDrawColor();
		color.a = (unsigned char)(color.a * this->_getDisabledAlphaFactor());
		if (!aprilui::isDebugEnabled())
		{
			this->image->draw(this->_getDrawRect(), color);
		}
		else
		{
			grect rect = this->_getDrawRect();
			april::rendersys->drawFilledRect(rect, april::Color(april::Color::Black, 32));
			april::rendersys->drawRect(rect, april::Color(april::Color::White, 64));
			this->image->draw(rect, color);
		}
		Object::OnDraw();
	}

	void ImageBox::resizeToFitImage()
	{
		if (this->image != NULL)
		{
			this->rect.setSize(this->image->getSrcRect().getSize() * aprilui::getDefaultScale());
			this->resetCenter();
		}
	}

	void ImageBox::notifyEvent(chstr name, void* params)
	{
		if (name == "UpdateImage")
		{
			this->setImageByName(this->imageName);
		}
		Object::notifyEvent(name, params);
	}

	hstr ImageBox::getProperty(chstr name, bool* propertyExists)
	{
		if (propertyExists != NULL)
		{
			*propertyExists = true;
		}
		if (name == "image")	return this->getImageName();
		return Object::getProperty(name, propertyExists);
	}

	bool ImageBox::setProperty(chstr name, chstr value)
	{
		if (name == "image")	this->setImageByName(value);
		else return Object::setProperty(name, value);
		return true;
	}

	bool ImageBox::onMouseDown(april::Key keyCode)
	{
		if (Object::onMouseDown(keyCode))
		{
			return true;
		}
		if (this->isCursorInside())
		{
			this->triggerEvent("MouseDown", keyCode);
			return true;
		}
		return false;
	}

	bool ImageBox::onMouseUp(april::Key keyCode)
	{
		if (Object::onMouseUp(keyCode))
		{
			return true;
		}
		if (this->isCursorInside())
		{
			this->triggerEvent("Click", keyCode);
			return true;
		}
		return false;
	}
}


text:
using UnityEngine;
using UnityEditor;
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;

namespace Fungus
{
	/**
	 * Prevents saving of selected blocks and commands to avoid version control conflicts
	 */
	public class AssetModProcessor : UnityEditor.AssetModificationProcessor
	{
		public static string[] OnWillSaveAssets(string[] paths)
		{
			string sceneName = "";

			foreach (string path in paths)
			{
				if (path.Contains(".unity"))
				{
					sceneName = Path.GetFileNameWithoutExtension(path);
				}
			}

			if (sceneName.Length == 0)
			{
				return paths;
			}

			// Reset these variables before save so that they won't cause a git conflict
			Flowchart[] flowcharts = UnityEngine.Object.FindObjectsOfType<Flowchart>();
			foreach (Flowchart f in flowcharts)
			{
				if (!f.saveSelection)
				{
					f.selectedBlock = null;
					f.ClearSelectedCommands();
				}
			}

			return paths;
		}

	}
}


text:
<?php

namespace Cac\UserBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class BigbossFormType extends AbstractType
{
    private $class;

    /**
     * @param string $class The User class name
     */
    public function __construct($class)
    {
        $this->class = $class;
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('plainPassword', 'repeated', array(
                'label' => 'Mot de passe',
                'type' => 'password',
                'options' => array('translation_domain' => 'FOSUserBundle'),
                'first_options' => array('label' => 'Mot de passe'),
                'second_options' => array('label' => 'Confirmez votre mot de passe'),
                'invalid_message' => 'Les mots de passe ne conrrespondent pas',
            ))
            ->add('email', 'repeated', array(
                    'type' => 'email',
                    'options' => array('translation_domain' => 'FOSUserBundle'),
                    'first_options' => array('label' => 'E-mail'),
                    'second_options' => array('label' => 'Confirmez votre e-mail'),
                    'invalid_message' => 'Les e-mails ne correspondent pas',
            ))
            ->add('name', null, array('label' => 'Nom'))
            ->add('firstname', null, array('label' => 'Prénom'))
            ->add('gender', 'choice', array(
                'label' => 'Genre',
                'choices'   => array('1' => 'Mr', '2' => 'Mme'),
                'multiple' => false
                )
            )
            ->add('company', null, array('label' => 'Société'))
            ->add('siret', null, array('label' => 'Numéro SIRET','required' => false))
            ->add('fix_phone', 'text', array('label' => 'Téléphone fixe','required' => false))
            ->add('mobile_phone', 'text', array('label' => 'Téléphone mobile'))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => $this->class,
            'intention'  => 'registration',
        ));
    }

    public function getName()
    {
        return 'cac_bigboss_registration';
    }
}


text: My provisioning scripts for macOS development environment with Ansible.


text:
<?php

namespace Kanboard\ServiceProvider;

use Psr\Log\LogLevel;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
use SimpleLogger\Logger;
use SimpleLogger\Syslog;
use SimpleLogger\File;

class LoggingProvider implements ServiceProviderInterface
{
    public function register(Container $container)
    {
        $logger = new Logger;

        if (ENABLE_SYSLOG) {
            $syslog = new Syslog('kanboard');
            $syslog->setLevel(LogLevel::ERROR);
            $logger->setLogger($syslog);
        }

        if (DEBUG) {
            $logger->setLogger(new File(DEBUG_FILE));
        }

        $container['logger'] = $logger;

        return $container;
    }
}


text:
namespace content {

OnscreenDisplayClient::OnscreenDisplayClient(
    const scoped_refptr<cc::ContextProvider>& onscreen_context_provider,
    scoped_ptr<cc::OutputSurface> software_surface,
    cc::SurfaceManager* manager,
    scoped_refptr<base::SingleThreadTaskRunner> task_runner)
    : onscreen_context_provider_(onscreen_context_provider),
      software_surface_(software_surface.Pass()),
      display_(
          new cc::Display(this, manager, HostSharedBitmapManager::current())),
      task_runner_(task_runner),
      scheduled_draw_(false),
      weak_ptr_factory_(this) {
}

OnscreenDisplayClient::~OnscreenDisplayClient() {
}

scoped_ptr<cc::OutputSurface> OnscreenDisplayClient::CreateOutputSurface() {
  if (!onscreen_context_provider_)
    return software_surface_.Pass();
  return make_scoped_ptr(new cc::OutputSurface(onscreen_context_provider_))
      .Pass();
}

void OnscreenDisplayClient::DisplayDamaged() {
  if (scheduled_draw_)
    return;
  TRACE_EVENT0("content", "OnscreenDisplayClient::DisplayDamaged");
  scheduled_draw_ = true;
  task_runner_->PostTask(
      FROM_HERE,
      base::Bind(&OnscreenDisplayClient::Draw, weak_ptr_factory_.GetWeakPtr()));
}

void OnscreenDisplayClient::Draw() {
  TRACE_EVENT0("content", "OnscreenDisplayClient::Draw");
  scheduled_draw_ = false;
  display_->Draw();
}

}  // namespace content


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MarcaArticulos extends CI_Controller
{

    private $datos;

    public function __construct() {
        parent::__construct();
        $this->load->helper('url');
        $this->load->model("Articulo_model");
        $this->load->model("MarcaArticulo_model");
        $this->cabeceras_css = array(
            base_url('assets/bootstrap/css/bootstrap.min.css'),
            base_url("assets/fa/css/font-awesome.min.css"),
            base_url("assets/dist/css/AdminLTE.min.css"),
            base_url("assets/dist/css/skins/skin-blue.min.css"),
            base_url("assets/hergo/estilos.css"),
        );
        $this->cabecera_script = array(
            base_url('assets/plugins/jQuery/jquery-2.2.3.min.js'),
            base_url('assets/bootstrap/js/bootstrap.min.js'),
            base_url('assets/dist/js/app.min.js'),
            base_url('assets/plugins/validator/bootstrapvalidator.min.js'),
            base_url('assets/plugins/slimscroll/slimscroll.min.js'),
        );
        $this->datos['nombre_usuario'] = $this->session->userdata('nombre');
        $this->datos['almacen_usuario']= $this->session->userdata['datosAlmacen']->almacen;
        if ($this->session->userdata('foto') == NULL)
            $this->datos['foto'] = base_url('assets/imagenes/ninguno.png');
        else
            $this->datos['foto'] = base_url('assets/imagenes/') . $this->session->userdata('foto');
    }

    public function index() {
        if (!$this->session->userdata('logeado'))
            redirect('auth', 'refresh');
        /*         * ************TITULOS Y LEVEL************** */
        $this->datos['menu'] = "Administracion";
        $this->datos['opcion'] = "Marca Articulos";
        $this->datos['titulo'] = "Marca Articulos";

        $this->datos['cabeceras_css'] = $this->cabeceras_css;
        $this->datos['cabeceras_script'] = $this->cabecera_script;
        /*         * ************FUNCION************** */
        $this->datos['cabeceras_script'][] = base_url('assets/hergo/funciones.js');
        $this->datos['cabeceras_script'][] = base_url('assets/hergo/marcaArticulo.js');

        /*         * ***********TABLE************** */
        $this->datos['cabeceras_css'][] = base_url('assets/plugins/table-boot/css/bootstrap-table.css');
        $this->datos['cabeceras_script'][] = base_url('assets/plugins/table-boot/js/bootstrap-table.js');
        $this->datos['cabeceras_script'][] = base_url('assets/plugins/table-boot/js/bootstrap-table-es-MX.js');
        $this->datos['cabeceras_script'][] = base_url('assets/plugins/table-boot/js/bootstrap-table-export.js');
        $this->datos['cabeceras_script'][] = base_url('assets/plugins/table-boot/js/tableExport.js');
        /*         * *******UPLOAD***************** */
        $this->datos['cabeceras_css'][] = base_url('assets/plugins/FileInput/css/fileinput.min.css');
        $this->datos['cabeceras_script'][] = base_url('assets/plugins/FileInput/js/fileinput.min.js');
        $this->datos['cabeceras_script'][] = base_url('assets/plugins/FileInput/js/locales/es.js');
        /*         * ******************************** */
        //$this->datos['unidad'] = $this->Articulo_model->retornar_tabla("unidad");
        $this->datos['marca'] = $this->Articulo_model->retornar_tabla("marca");
        //$this->datos['linea'] = $this->Articulo_model->retornar_tabla("linea");
        //$this->datos['requisito'] = $this->Articulo_model->retornar_tabla("requisito");
        //$this->datos['articulos'] = $this->Articulo_model->retornar_tabla("marca");

        $this->load->view('plantilla/head.php', $this->datos);
        $this->load->view('plantilla/header.php', $this->datos);
        $this->load->view('plantilla/menu.php', $this->datos);
        $this->load->view('plantilla/headercontainer.php', $this->datos);
        $this->load->view('administracion/marca/marca.php', $this->datos);
        $this->load->view('plantilla/footcontainer.php', $this->datos);
        $this->load->view('plantilla/footer.php', $this->datos);
    }

    public function agregarMarca() {
        if ($this->input->is_ajax_request()) {
            $lin = $this->security->xss_clean($this->input->post('linea'));
            $sig = $this->security->xss_clean($this->input->post('sigla'));
            $cod = $this->security->xss_clean($this->input->post('cod'));
            $enu = $this->security->xss_clean($this->input->post('enuso'));
            if ($cod == "")
                $this->MarcaArticulo_model->agregarMarca_model($lin, $sig);
            else
                $this->MarcaArticulo_model->editarMarca_model($lin, $sig, $cod);
        }
        echo "{}";
    }

}


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML5 Canvas</title>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
    <canvas id="the-canvas" width="1910" height="945"></canvas>
    <script type="text/javascript" src="script-task1.js"></script>
</body>
</html>


text:
<Record>
<Term>Non-neoplastic Lymphoid Disorders of the Mouse Hematologic System</Term>
<SemanticType>Disease or Syndrome</SemanticType>
<ParentTerm>Non-Neoplastic Hematopoietic Disorders of Mouse</ParentTerm>
<ClassificationPath>EO_Findings_and_Disorders_Kind/Experimental Organism Diagnosis/Mouse Pathologic Diagnoses/Mouse Cancer-Related Conditions/Mouse Noncancerous Conditions/Non-Neoplastic Hematopoietic Disorders of Mouse/Non-neoplastic Lymphoid Disorders of the Mouse Hematologic System</ClassificationPath>
<BroaderTerm>Mouse Cancer-Related Conditions</BroaderTerm>
<BroaderTerm>Mouse Pathologic Diagnoses</BroaderTerm>
<BroaderTerm>EO_Findings_and_Disorders_Kind</BroaderTerm>
<BroaderTerm>Experimental Organism Diagnosis</BroaderTerm>
<BroaderTerm>Mouse Noncancerous Conditions</BroaderTerm>
<BroaderTerm>Non-Neoplastic Hematopoietic Disorders of Mouse</BroaderTerm>
<BroaderTerm>Non-neoplastic Lymphoid Disorders of the Mouse Hematologic System</BroaderTerm>
<ChildTerm>Pre-lymphoma Lymphoproliferative Disorders of the Mouse Hematologic System</ChildTerm>
<Synonym>Non-neoplastic Lymphoid Disorders of the Hematologic System</Synonym>
<Synonym>Non-neoplastic Lymphoid Disorders of the Mouse Hematologic System</Synonym>
<Synonym>Non-neoplastic lymphoid disorders</Synonym>
<Source>NCI Thesaurus</Source>
</Record>


text:
<?php
if($this->session->flashdata('updatemessage')=="Store details updated"){
?>

<?php  } ?>
<?php
if($this->session->flashdata('perupdatemessage')=="Personal Details are Updated Successfully"){

?>

<?php  } ?>
<?php
if($this->session->flashdata('tab')==2){
?>

<?php  } ?>
<?php
if($this->session->flashdata('tab')==3){
?>

<?php  } ?>
<?php
if($this->session->flashdata('tab')==4){
?>

<?php  } ?>
<?php
if($this->session->flashdata('tab')==5){
?>

<?php  } ?>

            <form action="#" method="get" class="sidebar-form search-box pull-right hidden-md hidden-lg hidden-sm">

                    <input type="text" name="q" class="form-control" placeholder="Search...">

            <button type="submit" name="search" id="search-btn" class="btn"></button>

            </form>

Update

            Update Your Details

<a href="<?php echo base_url('seller/dashboard');?>"> Home

Update Your Details

Basic details

your Category

Store details

Bank details

Change password

            <?php if($this->session->flashdata('updatemessage')): ?>

<button type="button" class="close" data-dismiss="alert" aria-label="Close">
            ×
            </button><?php echo $this->session->flashdata('updatemessage');?>

            <?php endif; ?>
            <?php if($this->session->flashdata('errormessage')): ?>

<button type="button" class="close" data-dismiss="alert" aria-label="Close">
            ×
            </button><?php echo $this->session->flashdata('errormessage');?>

            <?php endif; ?>

      <?php //echo '
';print_r($seller_storedetails);exit; ?>
    <form  id="basicdetails" name="basicdetails" action="<?php echo base_url('seller/personnel_details/updatebd'); ?>" method="post" enctype="multipart/form-data">

      Seller Name
      <input class="form-control" placeholder="Name" type="text" id="seller_name" name="seller_name" value="<?php echo $seller_storedetails['seller_name'];   ?>">

      Seller Email
      <input class="form-control" placeholder="Email" type="text" id="seller_email" name="seller_email" value="<?php echo $seller_storedetails['seller_email']   ?>">

      Mobile Number
      <input class="form-control" placeholder="Name" type="text" id="seller_mobile" name="seller_mobile" value="<?php echo $seller_storedetails['seller_mobile'];   ?>">

      <button type="submit" class="btn btn-primary">Submit</button>

      </form>
      <a type="submit" class="btn btn-danger" href="<?php echo base_url('seller/dashboard'); ?>">Cancel

            <?php if($this->session->flashdata('catupdatemessage')): ?>

<button type="button" class="close" data-dismiss="alert" aria-label="Close">
            ×
            </button><?php echo $this->session->flashdata('catupdatemessage');?>

            <?php endif; ?>

              <form id="categories" onsubmit="return validations();" name="categories" action="<?php echo base_url('seller/personnel_details/seller_categories'); ?>" method="post" enctype="multipart/form-data">
                Select Categories
                  <select id="seller_cat"  name="seller_cat[]"   multiple class="chosen-select" tabindex="8">

                    <?php foreach($seller_categorudetails as $cat_data){ ?>
                    <option value="<?php echo $cat_data['seller_category_id']; ?>" selected="selected"><?php echo $cat_data['category_name']; ?></option>
                    <?php } ?>

                     <?php foreach($getcat as $cat_details){ ?>
                        <option value="<?php echo $cat_details['category_id']; ?>"><?php echo $cat_details['category_name']; ?></option>
                      <?php } ?>

                  </select>

                <button type="submit" class="btn btn-primary">Submit</button>
              </form>
              <a type="submit" class="btn btn-danger" href="<?php echo base_url('seller/dashboard'); ?>">Cancel

                <?php if($this->session->flashdata('storeupdatemessage')): ?>

<button type="button" class="close" data-dismiss="alert" aria-label="Close">
                ×
                </button><?php echo $this->session->flashdata('storeupdatemessage');?>

                <?php endif; ?>

                             <form id="storedetails"  name="storedetails" action="<?php echo base_url('seller/personnel_details/seller_storedetails'); ?>" method="post" onsubmit="return checkvalidations();" enctype="multipart/form-data">

                            Your Store Name (Which displays on our website)
                            <input  type="text" class="form-control" name="storename" id="storename" value="<?php echo $seller_storedetails['store_name'];   ?>" class="storename">

                            Address Line 1
                            <input  type="text"  name="address1" id="address1" value="<?php echo $seller_storedetails['addrees1'];   ?>" class="form-control" />

                            Address Line 2
                            <input  type="text"  name="address2" id="address2" value="<?php echo $seller_storedetails['addrees2'];   ?>" class="form-control" />

                            Pincode
                            <input  type="text"  name="pincode" id="pincode"  value="<?php echo $seller_storedetails['pin_code'];   ?>" class="form-control" />

                            Other Shops (if any):
                            <select class="form-control" required="required" name ="other_shops" id ="other_shops" onchange="orthershops(this.value);">
                            <?php if($seller_storedetails['other_shops']=="yes") {?>
                            <option value="yes" selected>YES</option>
                            <?php }else{ ?>
                            <option value="yes">YES</option>
                            <?php } ?>
                            <?php if($seller_storedetails['other_shops']=="no") {?>
                            <option value="no" selected>No</option>
                            <?php }else{ ?>
                            <option value="no">No</option>
                            <?php } ?>
                            </select>

       <?php if($seller_storedetails['other_shops']=="yes") {?>

           Other Locations
            <select id="other_shops_location"  name="other_shops_location[]"   multiple class="chosen-select" tabindex="8">

                 <?php foreach($locations_list as $areas){ ?>
                    <option value="<?php echo $areas; ?>" selected="selected"><?php echo $areas ?></option>
                    <?php } ?>

                     <?php foreach($select_areas as $areas){ ?>
                        <option value="<?php echo $areas->location_name; ?>"><?php echo $areas->location_name; ?></option>
                      <?php } ?>
            </select>

      <?php } ?>

		Area

		<select class="form-control" required="required" name ="areacode" id ="areacode" onchange="orthershops(this.value);">
			<option value="">Select</option>
			<?php foreach($select_areas as $list){ ?>
			<?php if($list->location_id==$seller_storedetails['area']){ ?>
			      <option value="<?php echo $list->location_id; ?>" selected="selected"><?php echo $list->location_name; ?></option>

			<?php }else{ ?>
              <option value="<?php echo $list->location_id; ?>"><?php echo $list->location_name; ?></option>
			<?php } ?>
			  <?php } ?>
		</select>

           Other Locations
            <select id="other_shops_location"  name="other_shops_location[]"   multiple class="chosen-select" tabindex="8">

              <?php foreach($select_areas as $area){ ?>
                <option value="<?php echo $area->location_name; ?>"><?php echo $area->location_name; ?></option>
              <?php }?>
            </select>

                            Any web link
                            <input type="text" id="weblink"  name="weblink" value="<?php echo $seller_storedetails['weblink'];   ?>"  class="form-control"/>

                              GSTIN
                              <input type="text"  name="tin" id="tin"  value="<?php echo $seller_storedetails['tin_vat'];   ?>"  class="form-control" />
                              <input type="file" title="Upload" name="timimages" onchange="tinpopupimage();" id="timimages" class="form-control" />
                              replace

                              <a id="oldtanimage" target="_blank" href="<?php echo site_url('assets/sellerfile/'); ?><?php echo $seller_storedetails['tinvatimage'];?>" ><?php echo $seller_storedetails['tinvatimage'];?>

                              Tan
                              <input  type="text"  name="tan" id="tan" value="<?php echo $seller_storedetails['tan'];   ?>" class="form-control"/>
                              <input type="file" name="tanimages" id="tanimages" onchange="tanimageuload(this.value)">
                              Replace

                              <a target="_blank" href="<?php echo site_url('assets/sellerfile/'); ?><?php echo $seller_storedetails['tanimage'];?>" ><?php echo $seller_storedetails['tanimage'];?>

      CIN
    <input  type="text" id="cst"  name="cst" value="<?php echo $seller_storedetails['cst'];   ?>" class="form-control"/>
    <input type="file" id="cstimag" name="cstimag" onchange="cstimageuload(this.value)">
    Replace

    <a target="_blank" href="<?php echo site_url('assets/sellerfile/'); ?><?php echo $seller_storedetails['cstimage'];?>" ><?php echo $seller_storedetails['cstimage'];?>

        Signature file
  <input style="height: auto;" type="file" name='gstimag' id="gstimag" class="form-control"/>
  <a target="_blank" href="<?php echo site_url('assets/sellerfile/'); ?><?php echo $seller_storedetails['gstinimage'];?>" ><?php echo isset($seller_storedetails['gstinimage'])?$seller_storedetails['gstinimage']:''; ?>

                                                            <button type="submit" id="resubmit" class="btn btn-primary">Submit</button>

                                                    </form>
                          <a type="submit" class="btn btn-danger" href="<?php echo base_url('seller/dashboard'); ?>">Cancel

                <?php if($this->session->flashdata('perupdatemessage')): ?>

<button type="button" class="close" data-dismiss="alert" aria-label="Close">
                ×
                </button><?php echo $this->session->flashdata('perupdatemessage');?>

                <?php endif; ?>

                                                    <form id="personalidetails"  name="personalidetails" action="<?php echo base_url('seller/personnel_details/personal_details_updatebd'); ?>" method="post" enctype="multipart/form-data">

                                                            Bank account
                                                            <input class="form-control" placeholder="Name" type="text" id="bank_account" name="bank_account" value="<?php echo $seller_storedetails['seller_bank_account']?>">

                                                            Bank Account Name
                              <input maxlength="100" type="text" maxlength="12" id="account_name" name="account_name" class="form-control"  value="<?php echo isset($seller_storedetails['seller_account_name'])?$seller_storedetails['seller_account_name']:''; ?>" />

                            Bank Account IFSC Code
                            <input maxlength="100" type="text"  name="ifsccode" class="form-control" id="ifsccode"  value="<?php echo isset($seller_storedetails['seller_aaccount_ifsc_code'])?$seller_storedetails['seller_aaccount_ifsc_code']:''; ?>" />

                                                            <button type="submit" class="btn btn-primary">Submit</button>

                                                    </form>
                          <a type="submit" class="btn btn-danger" href="<?php echo base_url('seller/dashboard'); ?>">Cancel

                    <?php if($this->session->flashdata('updatpassword')): ?>

<button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    ×
                    </button><?php echo $this->session->flashdata('updatpassword');?>

                    <?php endif; ?>
                    <?php if($this->session->flashdata('passworderror')): ?>

<button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    ×
                    </button><?php echo $this->session->flashdata('passworderror');?>

                    <?php endif; ?>

                    <form id="changepassword"  name="changepassword" action="<?php echo base_url('seller/personnel_details/changepassword'); ?>" method="post" enctype="multipart/form-data">

                      old passwod
                      <input class="form-control"  type="password" id="oldpassword" name="oldpassword" value="">

                      New Password
                      <input maxlength="100" type="password" maxlength="12" id="newpassword" name="newpassword" class="form-control"  value="" />

                      Confirm Password
                      <input maxlength="100" type="password" maxlength="12" id="confirmpassword" name="confirmpassword" class="form-control"  value="" />

                    <button type="submit" class="btn btn-primary">Submit</button>

                    </form>
                    <a type="submit" class="btn btn-danger" href="<?php echo base_url('seller/dashboard'); ?>">Cancel

<link rel="stylesheet" href="<?php echo base_url(); ?>assets/dist/css/bootstrapValidator.css"/>


text:
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>English Quiz | have fun!!!</title>
    <link rel="stylesheet" href="node_modules/bulma/css/bulma.css">
    <link rel="stylesheet" href="node_modules/font-awesome/css/font-awesome.css">
  </head>
  <body>

    <div id="quiz">

    </div>

    <script src="dist/js/app.js" charset="utf-8"></script>
  </body>
</html>


text:
package java.text;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Locale;
import java.util.TimeZone;

import libcore.icu.ICU;
import libcore.icu.LocaleData;
import libcore.icu.TimeZoneNames;

/**
 * Encapsulates localized date-time formatting data, such as the names of the
 * months, the names of the days of the week, and the time zone data.
 * {@code DateFormat} and {@code SimpleDateFormat} both use
 * {@code DateFormatSymbols} to encapsulate this information.
 *
 *
Typically you shouldn't use {@code DateFormatSymbols} directly. Rather, you
 * are encouraged to create a date/time formatter with the {@code DateFormat}
 * class's factory methods: {@code getTimeInstance}, {@code getDateInstance},
 * or {@code getDateTimeInstance}. These methods automatically create a
 * {@code DateFormatSymbols} for the formatter so that you don't have to. After
 * the formatter is created, you may modify its format pattern using the
 * {@code setPattern} method. For more information about creating formatters
 * using {@code DateFormat}'s factory methods, see {@link DateFormat}.
 *
 *
Direct use of {@code DateFormatSymbols} is likely to be less efficient
 * because the implementation cannot make assumptions about user-supplied/user-modifiable data
 * to the same extent that it can with its own built-in data.
 *
 * @see DateFormat
 * @see SimpleDateFormat
 */
public class DateFormatSymbols implements Serializable, Cloneable {

    private static final long serialVersionUID = -5987973545549424702L;

    private String localPatternChars;

    String[] ampms, eras, months, shortMonths, shortWeekdays, weekdays;

    // This is used to implement parts of Unicode UTS #35 not historically supported.
    transient LocaleData localeData;

    // Localized display names.
    String[][] zoneStrings;
    // Has the user called setZoneStrings?
    transient boolean customZoneStrings;

    /**
     * Locale, necessary to lazily load time zone strings. We force the time
     * zone names to load upon serialization, so this will never be needed
     * post deserialization.
     */
    transient final Locale locale;

    /**
     * Gets zone strings, initializing them if necessary. Does not create
     * a defensive copy, so make sure you do so before exposing the returned
     * arrays to clients.
     */
    synchronized String[][] internalZoneStrings() {
        if (zoneStrings == null) {
            zoneStrings = TimeZoneNames.getZoneStrings(locale);
        }
        return zoneStrings;
    }

    /**
     * Constructs a new {@code DateFormatSymbols} instance containing the
     * symbols for the user's default locale.
     * See "Be wary of the default locale".
     */
    public DateFormatSymbols() {
        this(Locale.getDefault());
    }

    /**
     * Constructs a new {@code DateFormatSymbols} instance containing the
     * symbols for the specified locale.
     *
     * @param locale
     *            the locale.
     */
    public DateFormatSymbols(Locale locale) {
        this.locale = locale;
        this.localPatternChars = SimpleDateFormat.PATTERN_CHARS;

        this.localeData = LocaleData.get(locale);
        this.ampms = localeData.amPm;
        this.eras = localeData.eras;
        this.months = localeData.longMonthNames;
        this.shortMonths = localeData.shortMonthNames;
        this.weekdays = localeData.longWeekdayNames;
        this.shortWeekdays = localeData.shortWeekdayNames;
    }

    /**
     * Returns a new {@code DateFormatSymbols} instance for the user's default locale.
     * See "Be wary of the default locale".
     *
     * @return an instance of {@code DateFormatSymbols}
     * @since 1.6
     */
    public static final DateFormatSymbols getInstance() {
        return getInstance(Locale.getDefault());
    }

    /**
     * Returns a new {@code DateFormatSymbols} for the given locale.
     *
     * @param locale the locale
     * @return an instance of {@code DateFormatSymbols}
     * @throws NullPointerException if {@code locale == null}
     * @since 1.6
     */
    public static final DateFormatSymbols getInstance(Locale locale) {
        if (locale == null) {
            throw new NullPointerException("locale == null");
        }
        return new DateFormatSymbols(locale);
    }

    /**
     * Returns an array of locales for which custom {@code DateFormatSymbols} instances
     * are available.
     *
Note that Android does not support user-supplied locale service providers.
     * @since 1.6
     */
    public static Locale[] getAvailableLocales() {
        return ICU.getAvailableDateFormatSymbolsLocales();
    }

    private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
        ois.defaultReadObject();
        this.localeData = LocaleData.get(locale);
    }

    private void writeObject(ObjectOutputStream oos) throws IOException {
        internalZoneStrings();
        oos.defaultWriteObject();
    }

    @Override
    public Object clone() {
        try {
            return super.clone();
        } catch (CloneNotSupportedException e) {
            throw new AssertionError();
        }
    }

    /**
     * Compares this object with the specified object and indicates if they are
     * equal.
     *
     * @param object
     *            the object to compare with this object.
     * @return {@code true} if {@code object} is an instance of
     *         {@code DateFormatSymbols} and has the same symbols as this
     *         object, {@code false} otherwise.
     * @see #hashCode
     */
    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (!(object instanceof DateFormatSymbols)) {
            return false;
        }
        DateFormatSymbols rhs = (DateFormatSymbols) object;
        return localPatternChars.equals(rhs.localPatternChars) &&
                Arrays.equals(ampms, rhs.ampms) &&
                Arrays.equals(eras, rhs.eras) &&
                Arrays.equals(months, rhs.months) &&
                Arrays.equals(shortMonths, rhs.shortMonths) &&
                Arrays.equals(shortWeekdays, rhs.shortWeekdays) &&
                Arrays.equals(weekdays, rhs.weekdays) &&
                timeZoneStringsEqual(this, rhs);
    }

    private static boolean timeZoneStringsEqual(DateFormatSymbols lhs, DateFormatSymbols rhs) {
        // Quick check that may keep us from having to load the zone strings.
        // Note that different locales may have the same strings, so the opposite check isn't valid.
        if (lhs.zoneStrings == null && rhs.zoneStrings == null && lhs.locale.equals(rhs.locale)) {
            return true;
        }
        // Make sure zone strings are loaded, then check.
        return Arrays.deepEquals(lhs.internalZoneStrings(), rhs.internalZoneStrings());
    }

    @Override
    public String toString() {
        // 'locale' isn't part of the externally-visible state.
        // 'zoneStrings' is so large, we just print a representative value.
        return getClass().getName() +
                "[amPmStrings=" + Arrays.toString(ampms) +
                ",customZoneStrings=" + customZoneStrings +
                ",eras=" + Arrays.toString(eras) +
                ",localPatternChars=" + localPatternChars +
                ",months=" + Arrays.toString(months) +
                ",shortMonths=" + Arrays.toString(shortMonths) +
                ",shortWeekdays=" + Arrays.toString(shortWeekdays) +
                ",weekdays=" + Arrays.toString(weekdays) +
                ",zoneStrings=[" + Arrays.toString(internalZoneStrings()[0]) + "...]" +
                "]";
    }

    /**
     * Returns the array of strings which represent AM and PM. Use the
     * {@link java.util.Calendar} constants {@code Calendar.AM} and
     * {@code Calendar.PM} as indices for the array.
     *
     * @return an array of strings.
     */
    public String[] getAmPmStrings() {
        return ampms.clone();
    }

    /**
     * Returns the array of strings which represent BC and AD. Use the
     * {@link java.util.Calendar} constants {@code GregorianCalendar.BC} and
     * {@code GregorianCalendar.AD} as indices for the array.
     *
     * @return an array of strings.
     */
    public String[] getEras() {
        return eras.clone();
    }

    /**
     * Returns the pattern characters used by {@link SimpleDateFormat} to
     * specify date and time fields.
     *
     * @return a string containing the pattern characters.
     */
    public String getLocalPatternChars() {
        return localPatternChars;
    }

    /**
     * Returns the array of strings containing the full names of the months. Use
     * the {@link java.util.Calendar} constants {@code Calendar.JANUARY} etc. as
     * indices for the array.
     *
     * @return an array of strings.
     */
    public String[] getMonths() {
        return months.clone();
    }

    /**
     * Returns the array of strings containing the abbreviated names of the
     * months. Use the {@link java.util.Calendar} constants
     * {@code Calendar.JANUARY} etc. as indices for the array.
     *
     * @return an array of strings.
     */
    public String[] getShortMonths() {
        return shortMonths.clone();
    }

    /**
     * Returns the array of strings containing the abbreviated names of the days
     * of the week. Use the {@link java.util.Calendar} constants
     * {@code Calendar.SUNDAY} etc. as indices for the array.
     *
     * @return an array of strings.
     */
    public String[] getShortWeekdays() {
        return shortWeekdays.clone();
    }

    /**
     * Returns the array of strings containing the full names of the days of the
     * week. Use the {@link java.util.Calendar} constants
     * {@code Calendar.SUNDAY} etc. as indices for the array.
     *
     * @return an array of strings.
     */
    public String[] getWeekdays() {
        return weekdays.clone();
    }

    /**
     * Returns the two-dimensional array of strings containing localized names for time zones.
     * Each row is an array of five strings:
     *

     *
The time zone ID, for example "America/Los_Angeles".
     *     This is not localized, and is used as a key into the table.
     *
The long display name, for example "Pacific Standard Time".
     *
The short display name, for example "PST".
     *
The long display name for DST, for example "Pacific Daylight Time".
     *     This is the non-DST long name for zones that have never had DST, for
     *     example "Central Standard Time" for "Canada/Saskatchewan".
     *
The short display name for DST, for example "PDT". This is the
     *     non-DST short name for zones that have never had DST, for example
     *     "CST" for "Canada/Saskatchewan".
     *

     */
    public String[][] getZoneStrings() {
        String[][] result = clone2dStringArray(internalZoneStrings());
        // If icu4c doesn't have a name, our array contains a null. TimeZone.getDisplayName
        for (String[] zone : result) {
            String id = zone[0];
            if (zone[1] == null) {
                zone[1] = TimeZone.getTimeZone(id).getDisplayName(false, TimeZone.LONG, locale);
            }
            if (zone[2] == null) {
                zone[2] = TimeZone.getTimeZone(id).getDisplayName(false, TimeZone.SHORT, locale);
            }
            if (zone[3] == null) {
                zone[3] = TimeZone.getTimeZone(id).getDisplayName(true, TimeZone.LONG, locale);
            }
            if (zone[4] == null) {
                zone[4] = TimeZone.getTimeZone(id).getDisplayName(true, TimeZone.SHORT, locale);
            }
        }
        return result;
    }

    private static String[][] clone2dStringArray(String[][] array) {
        String[][] result = new String[array.length][];
        for (int i = 0; i < array.length; ++i) {
            result[i] = array[i].clone();
        }
        return result;
    }

    @Override
    public int hashCode() {
        String[][] zoneStrings = internalZoneStrings();
        int hashCode;
        hashCode = localPatternChars.hashCode();
        for (String element : ampms) {
            hashCode += element.hashCode();
        }
        for (String element : eras) {
            hashCode += element.hashCode();
        }
        for (String element : months) {
            hashCode += element.hashCode();
        }
        for (String element : shortMonths) {
            hashCode += element.hashCode();
        }
        for (String element : shortWeekdays) {
            hashCode += element.hashCode();
        }
        for (String element : weekdays) {
            hashCode += element.hashCode();
        }
        for (String[] element : zoneStrings) {
            for (int j = 0; j < element.length; j++) {
                if (element[j] != null) {
                    hashCode += element[j].hashCode();
                }
            }
        }
        return hashCode;
    }

    /**
     * Sets the array of strings which represent AM and PM. Use the
     * {@link java.util.Calendar} constants {@code Calendar.AM} and
     * {@code Calendar.PM} as indices for the array.
     *
     * @param data
     *            the array of strings for AM and PM.
     */
    public void setAmPmStrings(String[] data) {
        ampms = data.clone();
    }

    /**
     * Sets the array of Strings which represent BC and AD. Use the
     * {@link java.util.Calendar} constants {@code GregorianCalendar.BC} and
     * {@code GregorianCalendar.AD} as indices for the array.
     *
     * @param data
     *            the array of strings for BC and AD.
     */
    public void setEras(String[] data) {
        eras = data.clone();
    }

    /**
     * Sets the pattern characters used by {@link SimpleDateFormat} to specify
     * date and time fields.
     *
     * @param data
     *            the string containing the pattern characters.
     * @throws NullPointerException
     *            if {@code data} is null
     */
    public void setLocalPatternChars(String data) {
        if (data == null) {
            throw new NullPointerException("data == null");
        }
        localPatternChars = data;
    }

    /**
     * Sets the array of strings containing the full names of the months. Use
     * the {@link java.util.Calendar} constants {@code Calendar.JANUARY} etc. as
     * indices for the array.
     *
     * @param data
     *            the array of strings.
     */
    public void setMonths(String[] data) {
        months = data.clone();
    }

    /**
     * Sets the array of strings containing the abbreviated names of the months.
     * Use the {@link java.util.Calendar} constants {@code Calendar.JANUARY}
     * etc. as indices for the array.
     *
     * @param data
     *            the array of strings.
     */
    public void setShortMonths(String[] data) {
        shortMonths = data.clone();
    }

    /**
     * Sets the array of strings containing the abbreviated names of the days of
     * the week. Use the {@link java.util.Calendar} constants
     * {@code Calendar.SUNDAY} etc. as indices for the array.
     *
     * @param data
     *            the array of strings.
     */
    public void setShortWeekdays(String[] data) {
        shortWeekdays = data.clone();
    }

    /**
     * Sets the array of strings containing the full names of the days of the
     * week. Use the {@link java.util.Calendar} constants
     * {@code Calendar.SUNDAY} etc. as indices for the array.
     *
     * @param data
     *            the array of strings.
     */
    public void setWeekdays(String[] data) {
        weekdays = data.clone();
    }

    /**
     * Sets the two-dimensional array of strings containing localized names for time zones.
     * See {@link #getZoneStrings} for details.
     * @throws IllegalArgumentException if any row has fewer than 5 elements.
     * @throws NullPointerException if {@code zoneStrings == null}.
     */
    public void setZoneStrings(String[][] zoneStrings) {
        if (zoneStrings == null) {
            throw new NullPointerException("zoneStrings == null");
        }
        for (String[] row : zoneStrings) {
            if (row.length < 5) {
                throw new IllegalArgumentException(Arrays.toString(row) + ".length < 5");
            }
        }
        this.zoneStrings = clone2dStringArray(zoneStrings);
        this.customZoneStrings = true;
    }

    /**
     * Returns the display name of the timezone specified. Returns null if no name was found in the
     * zone strings.
     *
     * @param daylight whether to return the daylight savings or the standard name
     * @param style one of the {@link TimeZone} styles such as {@link TimeZone#SHORT}
     *
     * @hide used internally
     */
    String getTimeZoneDisplayName(TimeZone tz, boolean daylight, int style) {
        if (style != TimeZone.SHORT && style != TimeZone.LONG) {
            throw new IllegalArgumentException("Bad style: " + style);
        }

        // If custom zone strings have been set with setZoneStrings() we use those. Otherwise we
        // use the ones from LocaleData.
        String[][] zoneStrings = internalZoneStrings();
        return TimeZoneNames.getDisplayName(zoneStrings, tz.getID(), daylight, style);
    }
}


text:
Class Mif.Tree.Drag.Element {#Mif.Tree.Drag.Element}
====================================================
Creates drop object from Element.

Mif.Tree.Drag Method: constructor {#Mif.Tree.Drag.Element:constructor}
----------------------------------------------------------------------

### Syntax:

new Mif.Tree.Drag.Element(element, options)

### Arguments:

1. element - (*element*) dom element.
2. options - (*object*) Mif.Tree.Drag.Element options.

### Events

* drop      - Executed when the user drop node. Receives the dragged node as first argument.


text:
#ifndef TENSORFLOW_COMPILER_XLA_SERVICE_COMPILATION_ENVIRONMENTS_H_
#define TENSORFLOW_COMPILER_XLA_SERVICE_COMPILATION_ENVIRONMENTS_H_

#include <cstdint>
#include <memory>
#include <string_view>
#include <typeindex>
#include <utility>

#include "absl/container/flat_hash_map.h"
#include "tensorflow/tsl/platform/casts.h"
#include "tensorflow/tsl/platform/protobuf.h"

namespace xla {

// A class for holding CompilationEnvironments, i.e., protos holding the values
// of command line flags and environment variables that affect compilation.
//
// CompilationEnvironments uses lazy initialization, (see GetEnv() for more
// details). Lazy initialization is used so we can avoid:
// A) Requiring every code path to explitily construct all needed compilation
//    environments, particularly when the default constructed environment is
//    all we need AND
// B) Requiring CompilationEnvironments to implicitly construct all needed
//    environments, thereby requiring it to statically know the types of all
//    such environments
//
// CompilationEnvironments is not thread-safe.
class CompilationEnvironments {
 public:
  CompilationEnvironments() = default;
  CompilationEnvironments(const CompilationEnvironments& rhs) { *this = rhs; }
  CompilationEnvironments& operator=(const CompilationEnvironments& rhs);
  ~CompilationEnvironments() = default;

  // Whenever an environment is added to CompilationEnvironments, even when
  // GetEnv() adds a lazily initialized one, it is passed to this method. The
  // result of this method is the environment that is used by
  // CompilationEnvironments. This allows environment authors to do things like
  // populate missing fields in an added environment.
  //
  // Users of CompilationEnvironments must specialize this method for each type
  // of CompilationEnvironment they wish to use in code.
  //
  // The input env may be null.
  //
  // REQUIRES:
  // - T must be a type of proto message.
  // - The output is *not* allowed to be null, even for null input.
  template <typename T>
  static std::unique_ptr<T> ProcessNewEnv(std::unique_ptr<T> env) = delete;

  // Adds env to the list of CompilationEnvironments. If an environment with
  // std::type_index equal to env.GetTypeid() has already been added, env
  // will replace it.
  //
  // All added environments are processed via ProcessNewEnv().
  //
  // AddEnv<T> will not compile for type T, unless ProcessNewEnv<T> is defined.
  template <typename T>
  void AddEnv(std::unique_ptr<T> env);

  // Returns the CompilationEnvironment corresponding to T. If such an
  // environment has not been added, ProcessNewEnv<T>(nullptr) will be added
  // and returned.
  //
  // GetEnv() is not const because it can perform lazy initialization, thereby
  // modifying the CompilationEnvironments's data members.
  //
  // GetEnv<T> will not compile for type T, unless ProcessNewEnv<T> is defined.
  template <typename T>
  const T& GetEnv();

  // Removes all added environments.
  void Clear() { environments_.clear(); }

 private:
  // Called by GetEnv() when it calls lazily creates a new environment, to
  // globally track stats about how many such environments are created by
  // CompilationEnvironments.
  static void DefaultEnvCreatedByCompilationEnvironments(
      std::string_view env_type);

  // Called by AddEnv(), to globally track stats about how many environments
  // are added to CompilationEnvironments.
  static void EnvAdded(std::string_view env_type);

  // Implements the part of AddEnv() after the ProcessNewEnv() call.
  void AddProcessedEnv(std::unique_ptr<tsl::protobuf::Message> env);

  absl::flat_hash_map<const tsl::protobuf::Descriptor*,
                      std::unique_ptr<tsl::protobuf::Message>>
      environments_;
};

// ----- Template implementation below -----

// Make sure no one tries to specialize ProcessNewEnv() for raw
// tsl::protobuf::Message. Specialization should always be for a specific
// type of proto message.
template <>
std::unique_ptr<tsl::protobuf::Message> CompilationEnvironments::ProcessNewEnv(
    std::unique_ptr<tsl::protobuf::Message> env) = delete;

template <typename T>
void CompilationEnvironments::AddEnv(std::unique_ptr<T> env) {
  AddProcessedEnv(ProcessNewEnv<T>(std::move(env)));
}

template <typename T>
const T& CompilationEnvironments::GetEnv() {
  auto descriptor = T::descriptor();
  auto it = environments_.find(descriptor);
  if (it == environments_.end()) {
    AddEnv<T>(nullptr);
    DefaultEnvCreatedByCompilationEnvironments(descriptor->full_name());
    it = environments_.find(descriptor);
  }
  return tensorflow::down_cast<const T&>(*it->second);
}

}  // namespace xla

#endif  // TENSORFLOW_COMPILER_XLA_SERVICE_COMPILATION_ENVIRONMENTS_H_