text:
from __future__ import division
from numpy import mean, shape, argsort, sort, sum as nsum, delete
from scipy.stats import ttest_1samp
from time import strftime, strptime, struct_time

__author__ = "Justine Debelius"
__copyright__ = "Copyright 2013, The American Gut Project"
__credits__ = ["Justine Debelius"]
__license__ = "BSD"
__version__ = "unversioned"
__maintainer__ = "Justine Debelius"
__email__ = "j.debelius@gmail.com"

def calculate_abundance(sample, taxa, sum_min=0.95):
    """Ranks taxa in a sample in order of abundance

    INPUTS:
        sample -- a one dimensional numpy array or list containing taxonomic
                    frequencies in a single sample

        population -- a numpy array containing containing taxonomic frequency
                    values. Samples are columns, taxa are rows.

        taxa -- a one dimensional numpy array or list of greengenes ids
                    associated the sample

        sum_min -- a value between 0 and 1 indicating the minimum
                    fraction of a sample to be represented by the most abundant
                    OTUs.

    OUTPUTS:
        abundant -- a list of lists of greenegenes taxonomy strings and the
                    frequencies representing the most abundant taxa in the
                    sample."""

    if len(sample) != len(taxa):
        raise ValueError('The number of enteries in samples (%i) and taxa (%i)'
                         ' must be equal.' % (len(sample), len(taxa)))

    # Sorts the sample by abundance
    abundance_data = reversed(sort(sample))
    abundance_rank = reversed(argsort(sample))

    # List comprehension; faster. Also possible in dictionaries?
    abundance_taxa = [taxa[rank] for rank in abundance_rank]

    # Identifies the taxonomy up to the abundance threshold
    abundance_watch = 0
    abundant = []
    for idx, frequency in enumerate(abundance_data):
        abundance_watch = abundance_watch + frequency
        abundant.append([abundance_taxa[idx], round(frequency, 6)])
        if abundance_watch > sum_min:
            break

    return abundant

def calculate_tax_rank_1(sample, population, taxa, critical_value=0.05):
    """Preforms a case 1 t-test on common samples

    INPUTS:
        sample -- a one dimensional numpy array containing the taxonomic
                    frequency values for a single sample

        population -- a numpy array containing containing taxonomic frequency
                    values. Samples are columns, taxa are rows.

        taxa -- an array of greengenes ids associated the sample and
                    population frequencies

        critical_value -- the alpha for use in the t-test

    OUTPUTS:
        high -- a list of lists with greengenes strings, sample frequency,
                    average population frequency, the ratio of values, and the
                    p-value

        low -- a list of lists with greengenes strings, sample frequency,
                    average population frequency, the ratio of values, and the
                    p-value"""

    # Rare taxa are defined as appearing in less than 10% of the samples
    (num_taxa, num_samples) = shape(population)

    if num_taxa != len(taxa):
        raise ValueError('The number of entries in samples and taxa must'
                         ' be equal.')

    # Identifies taxa that are significantly enriched or depleted in the
    # population
    high = []
    low = []

    # Identifies taxa which are not populated
    population_count = nsum(population > 0, axis=1)

    pop_watch = [(idx, count) for (idx, count) in enumerate(population_count)]
    pop_watch = reversed(pop_watch)

    for (idx, count) in pop_watch:
        # Removes any line which is equal to zero
        if count == 0:
            population = delete(population, idx, 0)
            sample = delete(sample, idx)
            taxa = delete(taxa, idx)

    # Determines the ratio
    population_mean = mean(population, 1)
    ratio = sample/population_mean

    # preforms a case 1 t-test comparing the sample and population
    t_stat = []
    p_stat = []
    # Could potentially use qiime functions
    (t_stat, p_stat) = ttest_1samp(population, sample, 1)

    # Preforms a bonferroni correction on the p values
    p_stat = p_stat*num_taxa

    # Determines list position based on the smallest p values.
    p_order = argsort(p_stat)

    # Goes through the p values and determines if they are enriched or depleted
    for index in p_order:
        if p_stat[index] >= critical_value:
            continue

        list_value = [taxa[index],
                      round(sample[index], 6),
                      round(population_mean[index], 6),
                      round(ratio[index], 0),
                      p_stat[index]]
        if ratio[index] > 1:
            high.append(list_value)
        else:
            low.append(list_value)
    return high, low

def convert_taxa(rough_taxa, formatting_keys='%1.2f', hundredx=False):
    """Formats lists of numbers for table generation
    INPUTS:

        rough_taxa -- a list of lists with a descriptor string followed by
                   a list of corresponding values

        formatting_keys --  a string describing the way the value should be
                    formatting using string formats. For example, %1.2f, %2d,
                    %i. A value of 'SKIP' will ignore that value and remove it
                    from the output list.
    OUTPUTS:
        formatted_taxa -- a list of string with formatting for the final table.
    """

    # Checks the rough_taxa argument is sane
    if not isinstance(rough_taxa, list):
        raise TypeError('rough_taxa must have be a list of at least one '
                        'lists.\nrough_taxa is a %s.' % rough_taxa.__class__)
    elif len(rough_taxa) == 0:
        raise ValueError('rough taxa must have be a list of at least one '
                         'lists.\nrough_taxa does not have any elements.')
    elif not isinstance(rough_taxa[0], list):
        raise TypeError('rough taxa must have be a list of at least one '
                        'lists.\nThe first element in rough taxa is a %s.'
                        % rough_taxa[0].__class__)
    num_ent = len(rough_taxa[0])
    for entry in rough_taxa:
        if not isinstance(entry, list):
            raise TypeError('rough_taxa must be a list of lists')
        if not len(entry) == num_ent:
            raise ValueError('list size is inconsistant')
    num_rough = num_ent-1

    if isinstance(formatting_keys, list):
        num_keys = len(formatting_keys)
    else:
        num_keys = 1

    if isinstance(hundredx, list):
        num_hund = len(hundredx)
    else:
        num_hund = 1

    if not isinstance(formatting_keys, (list, str)):
        raise TypeError('formatting_keys must be a list or string.')
    if not num_rough == num_keys and isinstance(formatting_keys, list):
        raise ValueError('The number of elements in rough_taxa (%i) and the '
                         'number of elements in formatting_keys (%i) must be '
                         'equal.' % (num_rough, num_keys))

    elif not isinstance(hundredx, (list, bool)):
        raise TypeError('hundredx must be a list or bool.')
    elif not num_rough == num_hund and isinstance(hundredx, list):
        raise ValueError('The number of elements in rough_taxa(%i) and the '
                         'number of elements in hundredx(%i) must be equal.'
                         % (num_rough, num_hund))

    # Converts formatting keys and hundredx to lists
    if isinstance(formatting_keys, str):
        formatting_keys = [formatting_keys]*num_rough

    if isinstance(hundredx, bool):
        hundredx = [hundredx]*num_rough

    # Creates formatted list
    formatted_taxa = []

    for element in rough_taxa:
        taxon = element[0]
        element.pop(0)
        new_element = [taxon]
        for idx, item in enumerate(element):

            if formatting_keys[idx] == 'SKIP':
                continue

            if hundredx[idx]:
                item = item * 100

            new_element.append(formatting_keys[idx] % item)

        formatted_taxa.append(new_element)

    return formatted_taxa

def convert_taxa_to_list(raw_taxa, tax_format, render_mode, comma=False,
                         color='red'):
    """Converts a list of greengenes strings to a latex list

    INPUTS:
        raw_taxa -- a python list object containing taxonomy strings from
                    greengenes to be included in the final, formated output.

        tax_format -- a list specifiying if an argument should be bolded
                        (denoted by "BOLD"), rendered in color ('COLOR'),
                        or left alone ('REG').

        render_mode -- a python string describing the way the out should be
                    formatted. Options are LATEX, corresponding to LaTex code,
                    or RAW. LATEX will give a string which encodes a table.
                    RAW will give a text file suitable for viewing, although
                    RAW formats do not include italics.

        comma -- a binary value indicating whether the list should be single
                    line comma separated list (TRUE), or a list format with
                    each item on its own line (FALSE).

        color -- a string identifying the shade latex should use for the text.
                    DEFAULT: 'red'

        color -- a string identifying the shade latex should use for the text.
                    DEFAULT: 'red'

    OUTPUT:
        format_list -- a python string formatted to give a list of taxa
                    according to the supplied formatting mode."""

    # Sets up precurser text
    if render_mode == "LATEX":
        prelist = '\\begin{itemize}'
        antelist = '\n\\end{itemize}'
        preitem = '\n\\item '
        anteitem = ''
    else:
        prelist = ''
        antelist = ''
        preitem = '\n o   '
        anteitem = ''

    # Creates the list
    format_list = []
    if comma:
        for idx, taxon in enumerate(raw_taxa):
            format_list.append(
                clean_greengenes_string(taxon,
                                        render_mode=render_mode,
                                        format=tax_format[idx].upper(),
                                        unclassified=True,
                                        color=color))
        format_list = ', '.join(format_list)
    else:
        format_list.append(prelist)
        for idx, taxon in enumerate(raw_taxa):
            cleaned = clean_greengenes_string(taxon, render_mode,
                                              format=tax_format[idx].upper(),
                                              unclassified=True,
                                              color=color)
            format_list.append('%s%s%s' % (preitem, cleaned, anteitem))

        format_list.append(antelist)
        format_list = ''.join(format_list)

    return format_list

def clean_greengenes_string(greengenes_string, render_mode, format=None,
                            unclassified=False, color='red'):
    """Distills a greengenes string to its highest taxonomic resolution

    INPUTS:
        greengenes_string -- a greengenes string describing taxonomy

        render_mode -- a string ("LATEX", "HTML" or "RAW") which describes
                    the way the table will be formatted. LATEX or HTML gives a
                    string containing formatting code.

        format -- a string with a formatting keys to be used with the data.
                    'BOLD' indicates that bold text should be used. 'COLOR'
                    indicates the entry should be colored using the value given
                    by color. A value of None indicates no special formatting.
                    DEFUALT:None
        unclassified -- a binary value indicating whether or not the designator
                    'Unclassified' should be added to entries above the family
                    level
                    DEFUALT: False

        color -- a string describing the latex color to use to render colored
                    text. Valid colors can be found at
                    http://en.wikibooks.org/wiki/LaTeX/Colors#Predefined_colors

    OUTPUTS:
        cleaned_taxon -- a formatted string describing taxonomic information"""

    # Preallocates level descriptors
    TAX_DES = ['Kingdom', 'Phylum', 'Class', 'Order', 'Family', 'Genus',
               'Species']

    # Sets up text formatting strings
    if render_mode == "LATEX":
        italic_before = '\\textit{'
        italic_after = '}'
        bold_before = '\\textbf{'
        bold_after = '}'
        color_before = '\\textcolor{%s}{' % color
        color_after = '}'

    else:
        italic_before = ''
        italic_after = ''
        bold_before = '*'
        bold_after = '*'
        color_before = '*'
        color_after = '*'

    if unclassified:
        classified = 'Unclassified '
    else:
        classified = ''

    greengenes_string = greengenes_string.replace(' ', '')
    # Splits the taxonomy at the ; and removes the designation header.
    split_tax = [field.strip().split('__', 1)[1] for field in
                 greengenes_string.split(';')]

    # Identifies the highest level of resolution at which taxonomy is defined
    for id_, level in enumerate(split_tax):
        if level != '':
            no_levels = id_

    # Sets up taxonomy string
    if no_levels < 5:
        cleaned_taxon = '%s%s %s' % (classified, TAX_DES[no_levels],
                                     split_tax[no_levels])
    elif no_levels == 5:
        cleaned_taxon = '%s %s%s%s' % (TAX_DES[no_levels], italic_before,
                                       split_tax[no_levels], italic_after)
    elif no_levels == 6:
        cleaned_taxon = '%s%s %s%s' % (italic_before, split_tax[no_levels-1],
                                       split_tax[no_levels], italic_after)
    else:
        cleaned_taxon = '%sKingdom %s' % (classified, split_tax)

    if '[' in cleaned_taxon:
        cleaned_taxon = 'cont. %s' % cleaned_taxon.replace('[', ''
                                                           ).replace(']', '')
    cleaned_taxon = cleaned_taxon.replace('_', '-')

    # Bolds taxon if necessary
    if format == 'BOLD':
        cleaned_taxon = ''.join([bold_before, cleaned_taxon, bold_after])
    elif format == 'COLOR':
        cleaned_taxon = ''.join([color_before, cleaned_taxon, color_after])

    return cleaned_taxon

def build_latex_macro(data, categories, format=None):
    """Generates a LaTeX macro for use in a template

    INPUTS:
        data -- a list or list of lists where the inner list contains the same
                    set of information, corresponding to categories and format.

        categories -- a list of strings describing the data to be used in the
                macro (i.e. Name, Sample, etc.)

        format -- a list of anonymous or function names to be used to format
                the data. The final data must be converted to a string. If a
                format of None is provided, all entries will be converted to
                strings.
                DEFAULT: None

    OUTPUTS:
        A LaTeX macro with the definitions provided in categories
    """

    # Preallocates an indexing variable
    ALPHABET = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
                'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
                'Y', 'Z']

    # Preforms a sanity check on the data
    if isinstance(data[0], list):
        num_entries = len(data[0])
        mode = 'multi'
    else:
        num_entries = len(data)
        mode = 'single'

    num_cats = len(categories)
    num_forms = len(format)

    if not num_entries == num_cats:
        raise ValueError('There must be a category for every entry.')
    elif not num_entries == num_forms and format is not None:
        raise ValueError('There must be a format for every entry.')

    # Sets up formatting if necessary
    if format is None:
        format = [lambda x: '%r' % x]*num_entries

    macro = []
    # Combines the data into a mapping index
    for idx, entry in enumerate(data):
        if mode == 'single':
            fun = format[idx]
            macro.append('\\def\\%s{%s}' % (categories[idx], fun(entry)))
        if mode == 'multi' and len(entry[0]) == 0:
            for cat in categories:
                macro.append('\\def\\%s%s{}' % (cat, ALPHABET[idx]))
            macro.append('')
        elif mode == 'multi':
            for id_, cat in enumerate(categories):
                fun = format[id_]
                element = entry[id_]
                macro.append('\\def\\%s%s{%s}' % (cat, ALPHABET[idx],
                             fun(element)))

            macro.append('')

    # Inserts line breaks
    macro = '\n'.join(macro)

    return macro

def format_date(mapping, date_field=None, d_form_in=None, time_field=None,
                t_form_in=None, format_out='%b %d, %Y'):
    """Formats the date information from a mapping dictionary
    INPUTS:
        mapping -- a 2D dictionary where a sample ID is keyed to an mappingdata
                dictionary giving values associated with each sample

        date_filed -- the name of the category holding date information

        format_in -- a string describing how the temporal information is
                encoded. See the time module for string formatting
                (http://docs.python.org/2/library/time.html#time.struct_time)

        format_out -- the way the output string should be formatted. Use the
                format keys from the time module.
    OUTPUT:
        date -- a string giving the date information
    """

    # Performs a sanity check on the data
    if date_field is None and time_field is None:
        raise ValueError('A date or time field must be supplied. '
                         'Neither is available.')

    if date_field is not None and date_field not in mapping:
        raise ValueError('The date_field must be in the mapping data.')

    if d_form_in is None and date_field is not None:
        raise ValueError('A date format must be supplied with a date field.')

    if time_field is not None and time_field not in mapping:
        raise ValueError('The time_field must be in the mapping data.')

    if t_form_in is None and time_field is not None:
        raise ValueError('A time format must be supplied with a time field.')

    # Gets the date information
    if date_field is not None:
        date = strptime(mapping[date_field], d_form_in)
    if time_field is not None:
        time = strptime(mapping[time_field], t_form_in)

    # Gets the date and time into a single structure
    if date_field is not None and time_field is not None:
        tmp = struct_time((date.tm_year, date.tm_mon, date.tm_mday,
                           time.tm_hour, time.tm_min, time.tm_sec,
                           date.tm_wday, date.tm_yday, date.tm_isdst))
    elif date_field is None:
        tmp = time
    elif time_field is None:
        tmp = date

    # Formats the output
    date = strftime(format_out, tmp)

    return date


text:
package org.qifu.vo;

import org.qifu.base.model.BaseValueObj;

public class SysQfieldLogVO extends BaseValueObj implements java.io.Serializable {
	private static final long serialVersionUID = 6858136685113070627L;
	private String oid;
	private String system;
	private String progId;
	private String methodName;
	private String fieldName;
	private String fieldValue;
	private String queryUserId;

	@Override
	public String getOid() {
		return this.oid;
	}

	public void setOid(String oid) {
		this.oid = oid;
	}

	public String getSystem() {
		return system;
	}

	public void setSystem(String system) {
		this.system = system;
	}

	public String getProgId() {
		return progId;
	}

	public void setProgId(String progId) {
		this.progId = progId;
	}

	public String getMethodName() {
		return methodName;
	}

	public void setMethodName(String methodName) {
		this.methodName = methodName;
	}

	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	public String getFieldValue() {
		return fieldValue;
	}

	public void setFieldValue(String fieldValue) {
		this.fieldValue = fieldValue;
	}

	public String getQueryUserId() {
		return queryUserId;
	}

	public void setQueryUserId(String queryUserId) {
		this.queryUserId = queryUserId;
	}

}

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Syll. fung. (Abellini) 22: 220 (1913)

#### Original name
Leptosphaeria conii Rostr.

### Remarks
null


text:
{{! amtc-web ... live view / monitor + control mode }}

    {{#if controllers.laststates.laststates}}
      {{!-- triggers loading laststates - but host display should not depend on it --}}
    {{/if}}
    {{#if controllers.hosts.hosts}}
      {{#each model.hosts as |host|}}

              {{#if host.laststate}}
                {{host.laststate.openPortIcon}}
              {{else}}

              {{/if}}

            {{host.hostname}}

            {{#if host.laststate}}
              {{host.laststate.lastScan}}
            {{else}}
              No logged data yet
            {{/if}}

      {{/each}}
    {{/if}}

    {{#if model.hosts.length}}

Select hosts above like files in Finder/Explorer or by state below

 SSH

 RDP

 No OS

 sleep

 hibernate

 soft-off

 no reply

powered up

any

      {{#if selectedHostsCount}}

Action for selected {{selectedHostsCount}} hosts

          <form>
            {{#each commandActions as |cmd|}}
              {{radio-button name='cmd' value=cmd groupValue=selectedCmd}} {{cmd}}
            {{/each}}
            ... using a inter-command-delay of {{input type="text" size=3 value=selectedDelay}} seconds
            {{#if selectedCmd}}
              <button class="btn btn-default" {{action 'submitJob'}}>  Do it</button>
            {{/if}}
          </form>

      {{/if}}

    {{else}}
    This room looks empty.
    Use {{#link-to "ou.hosts"}}Edit Hosts{{/link-to}} to add some hosts to this room.
    {{/if}}


text:
package ubic.gemma.web.controller.genome;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import ubic.gemma.core.analysis.sequence.BlatResult2Psl;
import ubic.gemma.model.genome.sequenceAnalysis.BlatResult;
import ubic.gemma.persistence.service.genome.sequenceAnalysis.BlatResultService;
import ubic.gemma.web.view.TextView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Collection;
import java.util.HashSet;

/**
 * See goldenPath help on custom track. This simply generates text that can be used to
 * view our alignments in the UCSC browser. For example, urls like the following would work:
 *

 * also this
 *

 * Where the 'id' is the id in our system of the BLAT result to be views, and www.example.ca should be replaced with
 * ConfigUtils.getBaseUrl() (configured with gemma.baseurl)
 *
 * @author pavlidis
 */
@Controller
public class BlatResultTrackController extends AbstractController {

    @Autowired
    private BlatResultService blatResultService;

    @Override
    protected ModelAndView handleRequestInternal( HttpServletRequest request, HttpServletResponse response ) {
        String idS = request.getParameter( "id" );
        Long id = null;
        try {
            id = Long.parseLong( idS );
        } catch ( NumberFormatException e ) {
            // return error view.
        }
        Collection<Long> ids = new HashSet<Long>();
        ids.add( id );

        Collection<BlatResult> res = blatResultService.load( ids );

        if ( res.size() == 0 ) {
            // should be an error.
        }

        assert res.size() == 1;

        BlatResult toView = res.iterator().next();

        toView = blatResultService.thaw( toView );

        String val = BlatResult2Psl.blatResult2PslTrack( toView );

        return new ModelAndView( new TextView(), "text", val );

    }

}


text:
/*jslint white: true, onevar: true, devel: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, strict: false, newcap: true, immed: true */
/*globals window: false */

// Include this script BEFORE any scripts you want to scan for bad globals.
// After the scripts you want to scan, run BADGLOBALS.check() and watch firebug.
// This script will only work in Firefox or Chrome, NOT in Internet Explorer.
var BADGLOBALS = (function (window) {
	var report,
		skip = [],
		that = {
			check: function (exclude) {
				var prop,
					val,
					bad = [],
					good = [],
					skipped = [];

				exclude = exclude || [];

				for (prop in window) {
					if (window.hasOwnProperty(prop)) {
						if (skip.indexOf(prop) >= 0 || exclude.indexOf(prop) >= 0) {
							skipped.push(prop);
						} else {
							val = window[prop];
							if (delete window[prop]) {
								console.warn("Found non-var global %o with value %o", prop, val);
								bad.push(prop);
								try {
									window[prop] = val;
								} catch (e) {
									console.error("Oops, there was an error putting %o back :(", prop);
								}
							} else {
								good.push(prop);
							}
						}
					}
				}
				report = {
					bad: bad,
					good: good,
					skipped: skipped
				};
			},
			exclude: function () {
				var i = 0,
					l = arguments.length;

				for (; i < l; i += 1) {
					skip.push(arguments[i]);
				}
			},
			report: function () {
				if (!report) {
					that.check();
				}
				return report;
			}
		},
		prop;

	for (prop in window) {
		if (window.hasOwnProperty(prop)) {
			skip.push(prop);
		}
	}

	return that;
}(window));


text:
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Orleans;
using Orleans.TestingHost;
using TestExtensions;
using UnitTests.GrainInterfaces;
using Xunit;
using Orleans.Hosting;
using Orleans.Services;

namespace Tester
{
    public class GrainServiceTests : OrleansTestingBase, IClassFixture<GrainServiceTests.Fixture>
    {
        public class Fixture : BaseTestClusterFixture
        {
            protected override void ConfigureTestCluster(TestClusterBuilder builder)
            {
                builder.Options.InitialSilosCount = 1;
                builder.AddSiloBuilderConfigurator<GrainServiceSiloBuilderConfigurator>();

                // register LegacyGrainService the legacy way
                builder.ConfigureLegacyConfiguration(legacy =>
                {
                    legacy.ClusterConfiguration.Globals.RegisterGrainService("LegacyGrainService",
                        "Tester.LegacyGrainService, Tester",
                        new Dictionary<string, string> {{"test-property", "xyz"}});
                });
            }

            private class GrainServiceSiloBuilderConfigurator : ISiloBuilderConfigurator
            {
                public void Configure(ISiloHostBuilder hostBuilder)
                {
                    hostBuilder.ConfigureServices(services =>
                        // register client for LegacyGrainService the legacy way
                        services.AddSingleton<ILegacyGrainServiceClient, LegacyGrainServiceClient>())
                    // register TestGrainService the modern way
                    .AddTestGrainService("abc");
                }
            }
        }

        public GrainServiceTests(Fixture fixture)
        {
            this.GrainFactory = fixture.GrainFactory;
        }

        public IGrainFactory GrainFactory { get; set; }

        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("GrainServices")]
        public async Task SimpleInvokeGrainService_Legacy()
        {
            IGrainServiceTestGrain grain = this.GrainFactory.GetGrain<IGrainServiceTestGrain>(0);
            var grainId = await grain.GetHelloWorldUsingCustomService_Legacy();
            Assert.Equal("Hello World from Legacy Grain Service", grainId);
            var prop = await grain.GetServiceConfigProperty_Legacy("test-property");
            Assert.Equal("xyz", prop);
        }

        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("GrainServices")]
        public async Task GrainServiceWasStarted_Legacy()
        {
            IGrainServiceTestGrain grain = GrainFactory.GetGrain<IGrainServiceTestGrain>(0);
            var prop = await grain.CallHasStarted_Legacy();
            Assert.True(prop);
        }

        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("GrainServices")]
        public async Task GrainServiceWasStartedInBackground_Legacy()
        {
            IGrainServiceTestGrain grain = GrainFactory.GetGrain<IGrainServiceTestGrain>(0);
            var prop = await grain.CallHasStartedInBackground_Legacy();
            Assert.True(prop);
        }

        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("GrainServices")]
        public async Task GrainServiceWasInit_Legacy()
        {
            IGrainServiceTestGrain grain = GrainFactory.GetGrain<IGrainServiceTestGrain>(0);
            var prop = await grain.CallHasInit_Legacy();
            Assert.True(prop);
        }

        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("GrainServices")]
        public async Task SimpleInvokeGrainService()
        {
            IGrainServiceTestGrain grain = this.GrainFactory.GetGrain<IGrainServiceTestGrain>(0);
            var grainId = await grain.GetHelloWorldUsingCustomService();
            Assert.Equal("Hello World from Test Grain Service", grainId);
            var prop = await grain.GetServiceConfigProperty();
            Assert.Equal("abc", prop);
        }

        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("GrainServices")]
        public async Task GrainServiceWasStarted()
        {
            IGrainServiceTestGrain grain = GrainFactory.GetGrain<IGrainServiceTestGrain>(0);
            var prop = await grain.CallHasStarted();
            Assert.True(prop);
        }

        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("GrainServices")]
        public async Task GrainServiceWasStartedInBackground()
        {
            IGrainServiceTestGrain grain = GrainFactory.GetGrain<IGrainServiceTestGrain>(0);
            var prop = await grain.CallHasStartedInBackground();
            Assert.True(prop);
        }

        [Fact, TestCategory("BVT"), TestCategory("Functional"), TestCategory("GrainServices")]
        public async Task GrainServiceWasInit()
        {
            IGrainServiceTestGrain grain = GrainFactory.GetGrain<IGrainServiceTestGrain>(0);
            var prop = await grain.CallHasInit();
            Assert.True(prop);
        }
    }
}


text:
title: Build an Image Search Abstraction Layer
localeTitle: 构建图像搜索抽象层
---
## 构建图像搜索抽象层

这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/coding-interview-prep/take-home-projects/build-an-image-search-abstraction-layer/index.md) 。

[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。


text:
.. service:: ElasticTranscoder

.. apiref:: ElasticTranscoder


text:
package com.datastax.driver.core;

import com.datastax.driver.core.utils.Bytes;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.*;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * This class provides sample values for each primitive data type.
 * <p/>
 * These values have no particular meaning, the goal is just to have an instance that can be used in automated tests.
 */
public class PrimitiveTypeSamples {

    static Map<DataType, Object> samples(ProtocolVersion protocolVersion) {
        try {
            final Collection<DataType> primitiveTypes = TestUtils.allPrimitiveTypes(protocolVersion);
            ImmutableMap<DataType, Object> data = ImmutableMap.<DataType, Object>builder()
                    .put(DataType.ascii(), "ascii")
                    .put(DataType.bigint(), Long.MAX_VALUE)
                    .put(DataType.blob(), Bytes.fromHexString("0xCAFE"))
                    .put(DataType.cboolean(), Boolean.TRUE)
                    .put(DataType.decimal(), new BigDecimal("12.3E+7"))
                    .put(DataType.cdouble(), Double.MAX_VALUE)
                    .put(DataType.cfloat(), Float.MAX_VALUE)
                    .put(DataType.inet(), InetAddress.getByName("123.123.123.123"))
                    .put(DataType.tinyint(), Byte.MAX_VALUE)
                    .put(DataType.smallint(), Short.MAX_VALUE)
                    .put(DataType.cint(), Integer.MAX_VALUE)
                    .put(DataType.duration(), Duration.from("PT30H20M"))
                    .put(DataType.text(), "text")
                    .put(DataType.timestamp(), new Date(872835240000L))
                    .put(DataType.date(), LocalDate.fromDaysSinceEpoch(16071))
                    .put(DataType.time(), 54012123450000L)
                    .put(DataType.timeuuid(), UUID.fromString("FE2B4360-28C6-11E2-81C1-0800200C9A66"))
                    .put(DataType.uuid(), UUID.fromString("067e6162-3b6f-4ae2-a171-2470b63dff00"))
                    .put(DataType.varint(), new BigInteger(Integer.toString(Integer.MAX_VALUE) + "000"))
                    .build();

            // Only include data types that support the desired protocol version.
            Map<DataType, Object> result = Maps.filterKeys(data, new Predicate<DataType>() {
                @Override
                public boolean apply(DataType input) {
                    return primitiveTypes.contains(input);
                }
            });

            // Check that we cover all types (except counter and duration)
            // Duration is excluded because it can't be used in collections and udts.   It is tested separately
            // in DurationIntegrationTest.
            List<DataType> tmp = Lists.newArrayList(primitiveTypes);
            tmp.removeAll(result.keySet());

            List<DataType> expectedFilteredTypes = Lists.newArrayList(DataType.counter());

            assertThat(tmp)
                    .as("new datatype not covered in test")
                    .containsOnlyElementsOf(expectedFilteredTypes);

            return result;
        } catch (UnknownHostException e) {
            throw new AssertionError(e);
        }
    }
}


text:
<!DOCTYPE HTML>

<title>Uses of Class com.brettonw.bedrock.bag.BagArray (Bag 1.5.30 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-05-27">
<meta name="description" content="use: package: com.brettonw.bedrock.bag, class: BagArray">
<meta name="generator" content="javadoc/ClassUseWriter">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

Uses of Class
com.brettonw.bedrock.bag.BagArray

Packages that use BagArray

Package
Description

com.brettonw.bedrock.bag

Provides text-based storage of objects and un-formatted data in a simple, hierarchical key/value
 store.

com.brettonw.bedrock.bag.entry

com.brettonw.bedrock.bag.formats

Provides FormatReader and FormatWriter classes in support of the bedrock package.

Uses of BagArray in com.brettonw.bedrock.bag

Methods in com.brettonw.bedrock.bag that return BagArray

Modifier and Type
Method
Description

BagArray
BagArray.add(Object object)

Adds the element at the end of the underlying array store.

static <ArrayType>
BagArray
BagArrayFrom.array(ArrayType... array)

static BagArray
BagArray.concat(BagArray left,
BagArray right)

static BagArray
BagArrayFrom.file(File file)

static BagArray
BagArrayFrom.file(File file,
String mimeType)

static BagArray
BagArrayFrom.file(File file,
String mimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.file(File file,
Supplier<BagArray> fail)

BagArray
BagArray.filter(Predicate<Object> predicate)

BagArray
Bag.getBagArray(String key)

Retrieve a mapped element and return it as a BagArray.

BagArray
Bag.getBagArray(String key,
Supplier<BagArray> notFound)

Retrieve a mapped element and return it as a BagArray.

BagArray
BagArray.getBagArray(int index)

Retrieve an indexed element and return it as a BagArray.

static BagArray
BagArrayFrom.inputStream(InputStream inputStream)

static BagArray
BagArrayFrom.inputStream(InputStream inputStream,
String mimeType)

static BagArray
BagArrayFrom.inputStream(InputStream inputStream,
String mimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.inputStream(InputStream inputStream,
Supplier<BagArray> fail)

BagArray
BagArray.insert(int index,
Object object)

Inserts the element at the given index of the underlying array store.

BagArray
BagArray.map(Function<Object,Object> function)

static BagArray
BagArray.open(Object object)

Create a new BagArray and "add" the object.

BagArray
BagArray.query(BooleanExpr match,
SelectKey selectKey)

BagArray
BagArray.remove(int index)

Removes the element at the given index of the underlying array store.

BagArray
BagArray.replace(int index,
Object object)

Replaces the element at the given index of the underlying array store.

static BagArray
BagArrayFrom.resource(Class context,
String name)

static BagArray
BagArrayFrom.resource(Class context,
String name,
String mimeType)

static BagArray
BagArrayFrom.resource(Class context,
String name,
String mimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.resource(Class context,
String name,
Supplier<BagArray> fail)

BagArray
BagArray.select(SelectKey selectKey)

BagArray
BagArray.sort(SortKey... keys)

static BagArray
BagArrayFrom.sourceAdapter(SourceAdapter sourceAdapter)

static BagArray
BagArrayFrom.sourceAdapter(SourceAdapter sourceAdapter,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.string(String string)

static BagArray
BagArrayFrom.string(String string,
String mimeType)

static BagArray
BagArrayFrom.string(String string,
String mimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.string(String string,
Supplier<BagArray> fail)

BagArray
BagArray.subset(int start,
int count)

static BagArray
BagArrayFrom.url(String urlString)

static BagArray
BagArrayFrom.url(String urlString,
Bag postData,
String postDataMimeType)

static BagArray
BagArrayFrom.url(String urlString,
Bag postData,
String postDataMimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.url(String urlString,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.url(URL url)

static BagArray
BagArrayFrom.url(URL url,
Bag postData,
String postDataMimeType)

static BagArray
BagArrayFrom.url(URL url,
Bag postData,
String postDataMimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.url(URL url,
Supplier<BagArray> fail)

Methods in com.brettonw.bedrock.bag with parameters of type BagArray

Modifier and Type
Method
Description

static BagArray
BagArray.concat(BagArray left,
BagArray right)

static SortKey[]
SortKey.keys(BagArray keys)

Method parameters in com.brettonw.bedrock.bag with type arguments of type BagArray

Modifier and Type
Method
Description

static BagArray
BagArrayFrom.file(File file,
String mimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.file(File file,
Supplier<BagArray> fail)

BagArray
Bag.getBagArray(String key,
Supplier<BagArray> notFound)

Retrieve a mapped element and return it as a BagArray.

static BagArray
BagArrayFrom.inputStream(InputStream inputStream,
String mimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.inputStream(InputStream inputStream,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.resource(Class context,
String name,
String mimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.resource(Class context,
String name,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.sourceAdapter(SourceAdapter sourceAdapter,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.string(String string,
String mimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.string(String string,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.url(String urlString,
Bag postData,
String postDataMimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.url(String urlString,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.url(URL url,
Bag postData,
String postDataMimeType,
Supplier<BagArray> fail)

static BagArray
BagArrayFrom.url(URL url,
Supplier<BagArray> fail)

Constructors in com.brettonw.bedrock.bag with parameters of type BagArray

Constructor
Description

BagArray(BagArray bagArray)

Create a new BagArray as deep copy of another BagArray

SelectKey(BagArray bagArray)

SelectKey(SelectType type,
BagArray keysArray)

SelectKey(SelectType type,
BagArray keysArray,
BagArray asArray)

Uses of BagArray in com.brettonw.bedrock.bag.entry

Constructors in com.brettonw.bedrock.bag.entry with parameters of type BagArray

Constructor
Description

HandlerObjectFromTitlesArray(BagArray titlesArray,
Handler arrayHandler)

Uses of BagArray in com.brettonw.bedrock.bag.formats

Methods in com.brettonw.bedrock.bag.formats that return BagArray

Modifier and Type
Method
Description

BagArray
ArrayFormatReader.readBagArray()

static BagArray
FormatReader.readBagArray(SourceAdapter sourceAdapter)

BagArray
FormatReaderComposite.readBagArray()

BagArray
FormatReaderJson.readBagArray()

BagArray
FormatReaderTable.readBagArray()

Methods in com.brettonw.bedrock.bag.formats with parameters of type BagArray

Modifier and Type
Method
Description

abstract String
FormatWriter.write(BagArray bagArray)

static String
FormatWriter.write(BagArray bagArray,
String format)

String
FormatWriterJson.write(BagArray bagArray)

String
FormatWriterText.write(BagArray bagArray)

Constructors in com.brettonw.bedrock.bag.formats with parameters of type BagArray

Constructor
Description

FormatReaderTable(String input,
Handler arrayHandler,
BagArray titlesArray)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Copyright © 2020. All rights reserved.


text:
namespace Dolores {
#ifndef		CHECK
#define CHECK(condition)								\
	if(!(condition))Log::Fatal("Check failed: " #condition \
		" at %s, line %d ,\n",__FILE__,__LINE__);
#endif

#ifndef CHECK_NOTNULL
#define CHECK_NOTNULL (pointer)\
	if ((pointer) == nullptr) Log::Fatal( #pointer " Can't be NULL");
#endif
	enum class LogLevel :int64_t {
		Fatal = -1,
		Warning = 0,
		Info = 1,
		Debug = 2,
	};

	class Log {
	private:
		static void Write(LogLevel level, const char* level_str, const char* format, va_list val) {
			if (level <= GetLevel()) {
				printf("[Dolores] [%s] ", level_str);
				vprintf(format, val);
				printf("\n");
				fflush(stdout);
			}
		}
		// a trick to use static variable in header file.
		// May be not good, but avoid to use an additional cpp file
		static LogLevel& GetLevel() { static LogLevel level=LogLevel::Debug; return level; }

	public:
		static void ResetLogLevel(LogLevel level) {
			GetLevel() = level;
		}

		static void Fatal(const char* format, ...) {
			va_list val;
			va_start(val, format);
			fprintf(stderr, "[Dolores] [Fatal] ");
			vfprintf(stderr, format, val);
			fprintf(stderr, "\n");
			fflush(stderr);
			va_end(val);
			exit(1);
		}

		static void Debug(const char* format, ...) {
			va_list val;
			va_start(val, format);
			Write(LogLevel::Debug, "Debug", format, val);
			va_end(val);
		}

		static void Info(const char *format, ...) {
			va_list val;
			va_start(val, format);
			Write(LogLevel::Info, "Info", format, val);
			va_end(val);
		}

		static void Warning(const char *format, ...) {
			va_list val;
			va_start(val, format);
			Write(LogLevel::Warning, "Warning", format, val);
			va_end(val);
		}
	};
}


text:
@interface ZHHomeViewcontroller : ZHBaseViewController <UITableViewDataSource, UITableViewDelegate>

-(void)reloadTableView:(NSArray *)array;

-(void)setHomeNavgationController:(UINavigationController *)navigationController;

@end


text:
--表结构
CREATE TABLE `address` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code_value` varchar(32) DEFAULT NULL COMMENT '区域编码',
`name` varchar(128) DEFAULT NULL COMMENT '区域名称',
`remark` varchar(128) DEFAULT NULL COMMENT '说明',
`pid` varchar(32) DEFAULT NULL COMMENT 'pid是code_value',
PRIMARY KEY (`id`),
KEY `ix_name` (`name`,`code_value`,`pid`)
) ENGINE=InnoDB AUTO_INCREMENT=1033 DEFAULT CHARSET=utf8 COMMENT='行政区域表';

--mysql 实现树结构查询
--方法一
CREATE PROCEDURE sp_showChildLst(IN rootId varchar(20))
BEGIN
CREATE TEMPORARY TABLE IF NOT EXISTS tmpLst
(sno int primary key auto_increment,code_value VARCHAR(20),depth int);
DELETE FROM tmpLst;

CALL sp_createChildLst(rootId,0);

select tmpLst.*,address.* from tmpLst,address where tmpLst.code_value=address.code_value order by tmpLst.sno;
END

CREATE PROCEDURE sp_createChildLst(IN rootId varchar(20),IN nDepth INT)
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE b VARCHAR(20);
DECLARE cur1 CURSOR FOR SELECT code_value FROM address where pid=rootId;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;

insert into tmpLst values (null,rootId,nDepth);
SET @@max_sp_recursion_depth = 10;
OPEN cur1;

FETCH cur1 INTO b;
WHILE done=0 DO
CALL sp_createChildLst(b,nDepth+1);
FETCH cur1 INTO b;
END WHILE;

CLOSE cur1;
END
--方法二(此方法有线程安全问题)
CREATE PROCEDURE sp_getAddressChild_list(in idd varchar(36))
begin
declare lev int;
set lev=1;
drop table if exists tmp1;
CREATE TABLE tmp1(code_value VARCHAR(36),`name` varchar(50),pid varchar(36) ,levv INT);
INSERT tmp1 SELECT code_value,`name`,pid,1 FROM address WHERE pid=idd;
while row_count()>0
do
set lev=lev+1;
INSERT tmp1 SELECT t.code_value,t.`name`,t.pid,lev from address t join tmp1 a on t.pid=a.code_value AND levv=lev-1;
end while ;
INSERT tmp1 SELECT code_value,`name`,pid,0 FROM address WHERE code_value=idd;
SELECT * FROM tmp1;
end
--方法三
CREATE FUNCTION fn_getAddress_ChildList_test(rootId INT) RETURNS varchar(1000) CHARSET utf8 #rootId为你要查询的节点
BEGIN
#声明两个临时变量
DECLARE temp VARCHAR(1000);
DECLARE tempChd VARCHAR(1000);
SET temp = '$';
SET tempChd=CAST(rootId AS CHAR);#把rootId强制转换为字符
WHILE tempChd is not null DO
SET temp = CONCAT(temp,',',tempChd);#循环把所有节点连接成字符串。
SELECT GROUP_CONCAT(code_value) INTO tempChd FROM address where FIND_IN_SET(pid,tempChd)>0;
END WHILE;
RETURN temp;

END
--方法四
CREATE PROCEDURE sp_findAddressChild(iid varchar(50),layer bigint(20))
BEGIN
/*创建接受查询的临时表 */
create temporary table if not exists tmp_table(id varchar(50),code_value varchar(50),name varchar(50),pid VARCHAR(50)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*最高允许递归数*/
SET @@max_sp_recursion_depth = 10 ;
call sp_iterativeAddress(iid,layer);/*核心数据收集*/
select * from tmp_table ;/* 展现 */
drop temporary table if exists tmp_table ;/*删除临时表*/
END

CREATE PROCEDURE sp_iterativeAddress(iid varchar(50),layer bigint(20))
BEGIN
DECLARE t_id INT;
declare t_codeValue varchar(50) default iid ;
declare t_name varchar(50) character set utf8;
declare t_pid varchar(50) character set utf8;

/* 游标定义 */
declare cur1 CURSOR FOR select id,code_value,`name`,pid from address where pid=iid ;
declare CONTINUE HANDLER FOR SQLSTATE '02000' SET t_codeValue = null;

/* 允许递归深度 */
if layer>0 then
OPEN cur1 ;
FETCH cur1 INTO t_id,t_codeValue,t_name,t_pid ;
WHILE ( t_codeValue is not null )
DO
/* 核心数据收集 */
insert into tmp_table values(t_id,t_codeValue,t_name,t_pid);
call sp_iterativeAddress(t_codeValue,layer-1);
FETCH cur1 INTO t_id,t_codeValue,t_name,t_pid ;
END WHILE;
end if;
END
--方法五 SQL实现
SELECT `name`,code_value AS code_value,pid AS 父ID ,levels AS 父到子之间级数, paths AS 父到子路径 FROM (
SELECT `name`,code_value,pid,
@le:= IF (pid = 0 ,0,
IF( LOCATE( CONCAT('|',pid,':'),@pathlevel) > 0 ,
SUBSTRING_INDEX( SUBSTRING_INDEX(@pathlevel,CONCAT('|',pid,':'),-1),'|',1) +1
,@le+1) ) levels
, @pathlevel:= CONCAT(@pathlevel,'|',code_value,':', @le ,'|') pathlevel
, @pathnodes:= IF( pid =0,',0',
CONCAT_WS(',',
IF( LOCATE( CONCAT('|',pid,':'),@pathall) > 0 ,
SUBSTRING_INDEX( SUBSTRING_INDEX(@pathall,CONCAT('|',pid,':'),-1),'|',1)
,@pathnodes ) ,pid ) )paths
,@pathall:=CONCAT(@pathall,'|',code_value,':', @pathnodes ,'|') pathall
FROM address,
(SELECT @le:=0,@pathlevel:='', @pathall:='',@pathnodes:='') vv
ORDER BY pid,code_value
) src
ORDER BY pid
--方法6  存储过程(SQL实现)
create procedure query_all_add_children(in inPid varchar(50))
begin
select id,code_value,name,remark,pid,p2id,p3id,p4id,p5id
from(
select a1.id,a1.code_value,a1.name,a1.remark,
a1.pid,a2.pid p2id,a3.pid p3id,a4.pid p4id,a5.pid p5id
from
address a1 left join address a2
on(a1.pid=a2.code_value)
left join address a3
on(a2.pid=a3.code_value)
left join address a4
on(a3.pid=a4.code_value)
left join address a5
on(a4.pid=a5.code_value)
) al
where
(pid=inPid
or p2id=inPid
or p3id=inPid
or p4id=inPid
or p5id=inPid
);
end


text:
package design.Classes;

import utilities.AnnotationFeeder;
import utilities.GetInfo;
import utilities.UploadAsync;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;

import components.DatabaseHandler.AdministrativeDatabase;
import components.DatabaseHandler.AnnotationDatabase;
import components.DatabaseHandler.LocationAccelerationDatabase;
import components.Location.AnnotationsValues;
import components.Service.CollectingService;

import config.Variables.Constants;
import config.Variables.Variables;

public class ServiceHandling extends Activity {
	boolean isServiceOn = false;
	Button serviceHandlingButton;
	String[] annotations;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		GetInfo gI = new GetInfo(this);
		isServiceOn = gI.isServiceOn();

		AdministrativeDatabase adminDb = new AdministrativeDatabase(
				Constants.databaseName, Constants.adminTable,
				getApplicationContext());

		Log.d("TAG FOR USERID", adminDb.getUserId() + " ");

		ScrollView currentScrollView = new ScrollView(this);

		final LinearLayout currentLineraLayout = new LinearLayout(this);

		currentLineraLayout.setOrientation(LinearLayout.VERTICAL);

		@SuppressWarnings("deprecation")
		LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.FILL_PARENT,
				LinearLayout.LayoutParams.FILL_PARENT);

		currentScrollView.addView(currentLineraLayout);

		TextView titleText = new TextView(this);
		titleText.setSingleLine(true);

		titleText.setText("Mobility Collector Control Center");
		titleText.setPadding(0, 0, 0, 50);
		titleText.setTextSize(20);
		titleText.setGravity(Gravity.CENTER_HORIZONTAL);

		serviceHandlingButton = new Button(this);
		serviceHandlingButton.setGravity(Gravity.CENTER_HORIZONTAL);
		changeText(isServiceOn);

		currentLineraLayout.addView(titleText, layoutParams);
		currentLineraLayout.addView(serviceHandlingButton, layoutParams);

		if (Variables.areAnnotationsAllowed) {

			AnnotationDatabase annotationDatabase = new AnnotationDatabase(Constants.databaseName, Constants.annotationTable, this);

			AnnotationsValues previousAnnotation = annotationDatabase
					.getLastInsertedAnnotation();

			TextView annotationText = new TextView(this);
			annotationText.setSingleLine(true);

			annotationText.setText("Annotating menu");
			annotationText.setPadding(0, 50, 0, 25);
			annotationText.setTextSize(18);
			annotationText.setGravity(Gravity.LEFT);

			RadioGroup annotationRadioGroup = new RadioGroup(this);
			annotationRadioGroup.setOrientation(RadioGroup.VERTICAL);

			annotations = new String[Variables.annotationsStrings
					.split("!__!").length];
			annotations = Variables.annotationsStrings.split("!__!");

			final RadioButton[] annotationItem = new RadioButton[annotations.length];

			for (int i = 0; i < annotations.length; i++) {
				annotationItem[i] = new RadioButton(this);
				annotationRadioGroup.addView(annotationItem[i]);
				annotationItem[i].setText(annotations[i]);
			}

			if (previousAnnotation != null) {
				for (int i=0;i < annotations.length; i++)
					if (annotations[i].equalsIgnoreCase(previousAnnotation.getAnnotationValues()))
				{
						annotationItem[i].setChecked(true);

				}
			}

			annotationRadioGroup
					.setOnCheckedChangeListener(new OnCheckedChangeListener() {

						@Override
						public void onCheckedChanged(RadioGroup group,
								int checkedId) {
							// TODO Auto-generated method stub

							try {
								AnnotationFeeder.getInstance(
										getApplicationContext()).feedMe(
										annotationItem[(checkedId - 1)%annotations.length].getText()
												.toString());
							} catch (Exception e) {
								// TODO Auto-generated catch block
								e.printStackTrace();
							}

						}
					});

			currentLineraLayout.addView(annotationText);

			currentLineraLayout.addView(annotationRadioGroup);
		}

		serviceHandlingButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent collectionServiceIntent = new Intent(
						CollectingService.class.getName());

				if (!isServiceOn) {
					isServiceOn = true;
					changeText(isServiceOn);
					try {
						startService(collectionServiceIntent);

					} catch (Exception e) {
						// TODO Auto-generated catch block
						Log.d("error tag", e.toString());
					}
				} else {
					isServiceOn = false;
					stopService(collectionServiceIntent);
					changeText(isServiceOn);
				}
			}
		});
		this.setContentView(currentScrollView);
	}

	private void changeText(boolean isServiceOn2) {
		if (isServiceOn2) {
			serviceHandlingButton.setText("Stop collection");
			serviceHandlingButton.setTextColor(Color.RED);
		} else {
			serviceHandlingButton.setText("Start collection");
			serviceHandlingButton.setTextColor(Color.BLUE);
		}
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuItem aboutItem = menu.add("About");

		aboutItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {

			@Override
			public boolean onMenuItemClick(MenuItem item) {
				Intent aboutIntent = new Intent(ServiceHandling.this,
						AboutPage.class);
				try {
					startActivity(aboutIntent);
				} catch (Exception e) {
					Log.d("EXCEPTION", e.toString());
				}
				return false;
			}
		});

		MenuItem adminItem = menu.add("Admin");

		adminItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {

			@Override
			public boolean onMenuItemClick(MenuItem item) {
				Intent adminIntent = new Intent(ServiceHandling.this,
						AdminLogin.class);
				try {
					startActivity(adminIntent);
				} catch (Exception e) {
					Log.d("EXCEPTION", e.toString());
				}
				return false;
			}
		});

		MenuItem dbStatus = menu.add("DB Status");

		dbStatus.setOnMenuItemClickListener(new OnMenuItemClickListener() {

			@SuppressWarnings("static-access")
			@Override
			public boolean onMenuItemClick(MenuItem item) {
				LocationAccelerationDatabase locationDb = new LocationAccelerationDatabase(
						Constants.databaseName, Constants.locationTable,
						getApplicationContext());
				Toast.makeText(
						getApplicationContext(),
						"DB STATUS: "
								+ locationDb.getAllLocationsFromDatabase()
										.size(), Toast.LENGTH_LONG).show();
				return false;
			}
		});

		MenuItem manualDb = menu.add("Manual Upload");

		manualDb.setOnMenuItemClickListener(new OnMenuItemClickListener() {

			@Override
			public boolean onMenuItemClick(MenuItem item) {
				new UploadAsync(getApplicationContext()).execute();
				return false;
			}
		});
		return super.onCreateOptionsMenu(menu);
	}
}


text:
namespace Sistema_De_Gestion_Clinica
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
            this.button5 = new System.Windows.Forms.Button();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.button3 = new System.Windows.Forms.Button();
            this.button4 = new System.Windows.Forms.Button();
            this.panel1 = new System.Windows.Forms.Panel();
            this.tableLayoutPanel1.SuspendLayout();
            this.tableLayoutPanel2.SuspendLayout();
            this.SuspendLayout();
            //
            // tableLayoutPanel1
            //
            this.tableLayoutPanel1.ColumnCount = 2;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 554F));
            this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.panel1, 1, 0);
            this.tableLayoutPanel1.Location = new System.Drawing.Point(2, 3);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 1;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(633, 340);
            this.tableLayoutPanel1.TabIndex = 0;
            //
            // tableLayoutPanel2
            //
            this.tableLayoutPanel2.ColumnCount = 1;
            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel2.Controls.Add(this.button5, 0, 0);
            this.tableLayoutPanel2.Controls.Add(this.button1, 0, 1);
            this.tableLayoutPanel2.Controls.Add(this.button2, 0, 2);
            this.tableLayoutPanel2.Controls.Add(this.button3, 0, 3);
            this.tableLayoutPanel2.Controls.Add(this.button4, 0, 4);
            this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3);
            this.tableLayoutPanel2.Name = "tableLayoutPanel2";
            this.tableLayoutPanel2.RowCount = 5;
            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
            this.tableLayoutPanel2.Size = new System.Drawing.Size(73, 334);
            this.tableLayoutPanel2.TabIndex = 1;
            //
            // button5
            //
            this.button5.Location = new System.Drawing.Point(3, 3);
            this.button5.Name = "button5";
            this.button5.Size = new System.Drawing.Size(67, 60);
            this.button5.TabIndex = 4;
            this.button5.Text = "CITAS";
            this.button5.UseVisualStyleBackColor = true;
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(3, 69);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(67, 60);
            this.button1.TabIndex = 0;
            this.button1.Text = "Record \r\nde\r\nPaciente";
            this.button1.UseVisualStyleBackColor = true;
            //
            // button2
            //
            this.button2.Location = new System.Drawing.Point(3, 135);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(67, 60);
            this.button2.TabIndex = 1;
            this.button2.Text = "Registro \r\nde\r\nPaciente";
            this.button2.UseVisualStyleBackColor = true;
            //
            // button3
            //
            this.button3.Location = new System.Drawing.Point(3, 201);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(67, 60);
            this.button3.TabIndex = 2;
            this.button3.Text = "Registro \r\nde\r\nDoctor";
            this.button3.UseVisualStyleBackColor = true;
            //
            // button4
            //
            this.button4.Location = new System.Drawing.Point(3, 267);
            this.button4.Name = "button4";
            this.button4.Size = new System.Drawing.Size(67, 60);
            this.button4.TabIndex = 3;
            this.button4.Text = "Registro \r\nde\r\nTipos Examenes";
            this.button4.UseVisualStyleBackColor = true;
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.SystemColors.ControlLight;
            this.panel1.Location = new System.Drawing.Point(82, 3);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(543, 334);
            this.panel1.TabIndex = 0;
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(639, 346);
            this.Controls.Add(this.tableLayoutPanel1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel2.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
        private System.Windows.Forms.Button button5;
        private System.Windows.Forms.Button button4;
        private System.Windows.Forms.Button button3;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button1;
    }
}


text:
/**
 * The CSS shown here will not be introduced in the Quickstart guide, but shows
 * how you can use CSS to style your Element's container.
 */
.StripeElement {
  background-color: white;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  box-shadow: 0 1px 3px 0 #e6ebf1;
  -webkit-transition: box-shadow 150ms ease;
  transition: box-shadow 150ms ease;
}

.StripeElement--focus {
  box-shadow: 0 1px 3px 0 #cfd7df;
}

.StripeElement--invalid {
  border-color: #fa755a;
}

.StripeElement--webkit-autofill {
  background-color: #fefde5 !important;
}


text:
import time

from django.http import HttpResponse
import redis

from fserver.models import *

log = logging.getLogger(__name__)

class Writer(object):
    def __init__(self, input):
        self.input = input
        self.csv = input.split(',')

    def is_correct_input(self):

        if System.objects.get_by_name_and_version(self.csv[0], self.csv[1]) is None:
            log.critical('Cannot find System (%s, %s)' % (self.csv[0], self.csv[1]))
            return False
        if Account.objects.get_by_broker_and_account(self.csv[10], self.csv[11]) is None:
            log.critical('Cannot find Account (%s, %s)' % (self.csv[10], self.csv[11]))
            return False

        if self.csv[4].lower() not in ('buy', 'sell'):
            log.critical('Invalid trade direction: %s' % self.csv[4].lower())
            return False

        if len(self.csv[9]) != 16:
            log.critical('Invalid date: %s' % self.csv[9])
            return False

        self.csv[9] = "%s:00" % self.csv[9]

        return True

def index(request):
    if request.method != 'GET' or request.GET.get('csv') is None:
        return HttpResponse('NO DATA')

        # w = Writer('Pin+EMA;1;EURUSD;M15;BUY;1.20000;1.20010;1.20000;1.20005;2012-05-16 12:15:00;FxPro;3492358;')
    w = Writer(request.GET['csv'])

    if w.is_correct_input() is False:
        return HttpResponse('INCORRECT INPUT')

    s = Signal()
    s.system = System.objects.get_by_name_and_version(w.csv[0], w.csv[1])
    s.account = Account.objects.get_by_broker_and_account(w.csv[10], w.csv[11])
    s.mode = 'NEW'
    s.pair = Pair.objects.get_by_name(w.csv[2].upper())
    s.tf = w.csv[3].upper()
    s.direction = w.csv[4].lower()
    s.open = w.csv[5]
    s.high = w.csv[6]
    s.low = w.csv[7]
    s.close = w.csv[8]
    s.subscribed_accounts = ','.join(settings.LIVE_ACCOUNTS)
    s.client_time = datetime.datetime.fromtimestamp(time.mktime(time.strptime(w.csv[9], '%Y-%m-%d %H:%M:%S')))
    s.comment = w.csv[12]

    # if   s.account.broker.timezone != '' and s.account.broker.timezone.startswith('+'):
    # 	s.client_time = s.client_time + datetime.timedelta(hours=int(s.account.broker.timezone[1:]))
    # elif s.account.broker.timezone != '' and s.account.broker.timezone.startswith('-'):
    # 	s.client_time = s.client_time - datetime.timedelta(hours=int(s.account.broker.timezone[1:]))

    try:
        s.save()
    except Exception, e:
        print e
        return HttpResponse('ERROR')

    SystemLog.objects.add_log(broker=w.csv[10], account=w.csv[11], action='signal_stored', signal_id=s.id)

    return HttpResponse('OK,%d' % s.id)

def bar(request):
    # BROKER;ACCOUNT;PAIR;TF;TIME;O;H;L;C

    try:
        bar = Bar()
        bar.broker_account = Account.objects.get_by_broker_and_account(request.GET['broker'], request.GET['account'])
        bar.pair = Pair.objects.get_by_name(request.GET['pair'])
        bar.tf = request.GET['tf'].upper()
        bar.open = Decimal(request.GET['open'])
        bar.high = Decimal(request.GET['high'])
        bar.low = Decimal(request.GET['low'])
        bar.close = Decimal(request.GET['close'])
        try:
            bar.time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(float(request.GET['time'])))
        except ValueError:
            bar.time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(float(request.GET['time']) / 1000))

        if bar.open == bar.high and bar.open == bar.low and bar.open == bar.close:
            return HttpResponse('FLAT BAR')

        bar.save()
        return HttpResponse('OK')
    except Exception, e:
        print e
        return HttpResponse('FAILED')

def update(request):
    trade_id = int(request.GET['trade_id'])
    profit = Decimal(request.GET['profit'])

    key = "trade_%s" % (trade_id)

    pool = redis.ConnectionPool(host=settings.REDIS_HOST, port=settings.REDIS_PORT, db=settings.REDIS_DB)
    r = redis.Redis(connection_pool=pool)
    r.rpush(key, str(profit))

    trade = Trade.objects.get(id=trade_id)
    trade.last_profit = profit
    trade.save()

    Account.objects.get_by_broker_and_account(request.GET['broker'], request.GET['account']).ping()

    return HttpResponse('OK')

def ping(request):
    Account.objects.get_by_broker_and_account(request.GET['broker'], request.GET['account']).ping()

    return HttpResponse('OK')

def pair(request):
    pair = Pair.objects.get_by_name(request.GET['pair'])
    pair.pip_value = Decimal(request.GET['pip_value'])
    pair.point = int(request.GET['digits'])
    pair.pip_worth_usd = Decimal(request.GET['pip_worth_usd'])
    pair.pip_worth_gbp = Decimal(request.GET['pip_worth_gbp'])
    pair.save()

    Account.objects.get_by_broker_and_account(request.GET['broker'], request.GET['account']).ping()

    return HttpResponse('OK')


text:
(function() {
  var D, E, Element, Event;
  var __slice = Array.prototype.slice, __hasProp = Object.prototype.hasOwnProperty;

  Event = require('./event').Event;

  Element = (function() {

    function Element() {
      var arg, args, k, kid, node, nodeType, _i, _j, _len, _len2;
      nodeType = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
      this._ = node = document.createElement(nodeType);
      for (_i = 0, _len = args.length; _i < _len; _i++) {
        arg = args[_i];
        if ((typeof arg) === 'string') {
          node.className = arg;
        } else if (arg instanceof Array) {
          for (_j = 0, _len2 = arg.length; _j < _len2; _j++) {
            kid = arg[_j];
            if ((typeof kid) === 'string') {
              node.appendChild(document.createTextNode(kid));
            } else {
              node.appendChild(kid._);
            }
          }
        } else {
          for (k in arg) {
            if (!__hasProp.call(arg, k)) continue;
            node[k] = "" + arg[k];
          }
        }
      }
    }

    Element.prototype.appendChildren = function(arr) {
      var x, _i, _len, _results;
      _results = [];
      for (_i = 0, _len = arr.length; _i < _len; _i++) {
        x = arr[_i];
        _results.push(this.appendChild(x));
      }
      return _results;
    };

    Element.prototype.appendChild = function(x) {
      return this._.appendChild(x._);
    };

    Element.prototype.removeChildren = function() {
      var x, _results;
      x = this._.lastChild;
      _results = [];
      while (x) {
        this._.removeChild(x);
        _results.push(x = this._.lastChild);
      }
      return _results;
    };

    Element.prototype.setChildren = function(arr) {
      var x, _i, _len, _results;
      this.removeChildren();
      _results = [];
      for (_i = 0, _len = arr.length; _i < _len; _i++) {
        x = arr[_i];
        _results.push(this.appendChild(x));
      }
      return _results;
    };

    Element.prototype.setChild = function(x) {
      return this.setChildren([x]);
    };

    Element.prototype.prependChild = function(x) {
      if (this._.childNodes.length === 0) {
        this._.appendChild(x._);
      } else {

      }
      return this._.insertBefore(x._, this._.firstChild);
    };

    Element.prototype.insertBefore = function(kid, existingKid) {
      return this._.insertBefore(kid._, existingKid._);
    };

    Element.prototype.appendToBody = function() {
      return document.body.appendChild(this._);
    };

    Element.prototype.appendToHead = function() {
      return document.getElementsByTagName("head")[0].appendChild(this._);
    };

    Element.prototype.appendTo = function(x) {
      return x._.appendChild(this._);
    };

    Element.prototype.prependTo = function(x) {
      return x.prependChild(this);
    };

    Element.prototype.remove = function() {
      var _ref;
      return (_ref = this._.parentNode) != null ? _ref.removeChild(this._) : void 0;
    };

    Element.prototype.setTextChild = function(text) {
      this.removeChildren();
      return this._.appendChild(document.createTextNode(text));
    };

    Element.prototype.setOpacity = function(fraction) {
      var percent;
      percent = Math.round(100 * fraction);
      return this.setStyles({
        opacity: fraction,
        filter: "alpha(opacity=" + percent + ")",
        '-ms-filter': "progid:DXImageTransform.Microsoft.Alpha(opacity=" + percent + ")"
      });
    };

    Element.prototype.setStyles = function(d) {
      var k, v, _results;
      _results = [];
      for (k in d) {
        if (!__hasProp.call(d, k)) continue;
        v = d[k];
        _results.push(this._.style[k] = v);
      }
      return _results;
    };

    Element.prototype.setPos = function(r) {
      return this.setStyles({
        left: Math.round(r.x),
        top: Math.round(r.y)
      });
    };

    Element.prototype.setRect = function(r) {
      return this.setStyles({
        left: Math.round(r.x) + 'px',
        top: Math.round(r.y) + 'px',
        width: Math.round(r.w) + 'px',
        height: Math.round(r.h) + 'px'
      });
    };

    Element.prototype.on = function(k, f) {
      return this._['on' + k] = function(event) {
        return f(new Event(event));
      };
    };

    Element.prototype.setClasses = function(classes) {
      return this._.className = classes.join(' ');
    };

    Element.prototype.getClasses = function() {
      if (this._.className) {
        return this._.className.split(' ');
      } else {
        return [];
      }
    };

    Element.prototype.addClass = function(className) {
      var arr;
      arr = this.getClasses();
      if (arr.indexOf(className) === -1) {
        arr.push(className);
        return this.setClasses(arr);
      }
    };

    Element.prototype.removeClass = function(className) {
      var arr, i;
      arr = this.getClasses();
      i = arr.indexOf(className);
      if (i !== -1) {
        arr.splice(i, 1);
        return this.setClasses(arr);
      }
    };

    Element.prototype.getValue = function() {
      return this._.value;
    };

    Element.prototype.setValue = function(x) {
      return this._.value = x;
    };

    Element.prototype.scrollToBottom = function() {
      return this._.scrollTop = this._.scrollHeight - this._.clientHeight;
    };

    return Element;

  })();

  E = function() {
    var args;
    args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
    return (function(func, args, ctor) {
      ctor.prototype = func.prototype;
      var child = new ctor, result = func.apply(child, args);
      return typeof result === "object" ? result : child;
    })(Element, args, function() {});
  };

  D = function() {
    var args;
    args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
    return (function(func, args, ctor) {
      ctor.prototype = func.prototype;
      var child = new ctor, result = func.apply(child, args);
      return typeof result === "object" ? result : child;
    })(Element, ['div'].concat(__slice.call(args)), function() {});
  };

  module.exports = {
    Element: Element,
    E: E,
    D: D
  };

}).call(this);


text:
class PrefRegistrySimple;
class PrefService;

namespace policy {

class PolicyService;

// This class observes the device setting "DeviceWallpaperImage", and sets
// "policy.device_wallpaper_image_file_path" pref appropriately based on the
// file path with fetched wallpaper image.
class DeviceWallpaperImageExternalDataHandler final
    : public DeviceCloudExternalDataPolicyHandler {
 public:
  DeviceWallpaperImageExternalDataHandler(PrefService* local_state,
                                          PolicyService* policy_service);
  ~DeviceWallpaperImageExternalDataHandler() override;

  static void RegisterPrefs(PrefRegistrySimple* registry);

  // DeviceCloudExternalDataPolicyHandler:
  void OnDeviceExternalDataCleared(const std::string& policy) override;
  void OnDeviceExternalDataFetched(const std::string& policy,
                                   std::unique_ptr<std::string> data,
                                   const base::FilePath& file_path) override;
  void Shutdown() override;

 private:
  PrefService* const local_state_;

  std::unique_ptr<DeviceCloudExternalDataPolicyObserver>
      device_wallpaper_image_observer_;

  DISALLOW_COPY_AND_ASSIGN(DeviceWallpaperImageExternalDataHandler);
};

}  // namespace policy

#endif  // CHROME_BROWSER_CHROMEOS_POLICY_EXTERNAL_DATA_HANDLERS_DEVICE_WALLPAPER_IMAGE_EXTERNAL_DATA_HANDLER_H_


text:
#pragma once
#include <aws/evidently/CloudWatchEvidently_EXPORTS.h>
#include <aws/core/Region.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{

namespace CloudWatchEvidently
{
namespace CloudWatchEvidentlyEndpoint
{
AWS_CLOUDWATCHEVIDENTLY_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
} // namespace CloudWatchEvidentlyEndpoint
} // namespace CloudWatchEvidently
} // namespace Aws


text:
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>NYC Property Data Extractor</title>
    <link rel="stylesheet" type="text/css" href="css/leaflet.css">
    <link rel="stylesheet" type="text/css" href="css/leaflet.draw.css">
    <link rel="stylesheet" type="text/css" href="css/styles.css">

NYC Property Transaction Extractor

About: x

This Map lets you inspect information about New York City properties such as who the owner is, the zoning, and year built.

Zoom into a neighborhood and then use the drawing tools on the right to select and inspect properties.

You may then hover over the properties to view info about them.

Coming Soon: Download Property data!

Click to draw a shape ☞