text:
package org.mapfish.print.map.geotools;

import org.geotools.data.DataStore;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.geotools.map.Layer;
import org.geotools.map.MapContent;
import org.geotools.renderer.lite.StreamingRenderer;
import org.geotools.styling.Style;
import org.geotools.styling.StyleVisitor;
import org.locationtech.jts.util.Assert;
import org.mapfish.print.ExceptionUtils;
import org.mapfish.print.FloatingPointUtil;
import org.mapfish.print.attribute.map.MapLayer;
import org.mapfish.print.attribute.map.MapfishMapContext;
import org.mapfish.print.http.HttpRequestFetcher;
import org.mapfish.print.http.MfClientHttpRequestFactory;
import org.mapfish.print.map.AbstractLayerParams;
import org.mapfish.print.processor.Processor;

import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ExecutorService;

import static org.mapfish.print.Constants.OPACITY_PRECISION;

/**
 * The AbstractGeotoolsLayer class.
 */
public abstract class AbstractGeotoolsLayer implements MapLayer {

    private final ExecutorService executorService;
    private final AbstractLayerParams params;

    /**
     * Constructor.
     *
     * @param executorService the thread pool for doing the rendering.
     * @param params the parameters for this layer
     */
    protected AbstractGeotoolsLayer(final ExecutorService executorService, final AbstractLayerParams params) {
        this.executorService = executorService;
        this.params = params;
    }

    /**
     * Copy constructor.
     *
     * @param other The source.
     */
    protected AbstractGeotoolsLayer(final AbstractGeotoolsLayer other) {
        this.executorService = other.executorService;
        this.params = other.params;
    }

    @Override
    public final Optional<MapLayer> tryAddLayer(final MapLayer newLayer) {
        return Optional.empty();
    }

    @Override
    public void prepareRender(final MapfishMapContext transformer) {

    }

    @Override
    public final void render(
            final Graphics2D graphics2D,
            final MfClientHttpRequestFactory clientHttpRequestFactory,
            final MapfishMapContext transformer, final Processor.ExecutionContext context) {
        java.awt.geom.AffineTransform originalTransform = graphics2D.getTransform();

        MapfishMapContext layerTransformer = getLayerTransformer(transformer);

        if (!FloatingPointUtil.equals(transformer.getRotation(), 0.0) && !this.supportsNativeRotation()) {
            graphics2D.setTransform(transformer.getTransform());
        }

        Rectangle paintArea = new Rectangle(layerTransformer.getMapSize());
        MapContent content = new MapContent();
        try {
            List<? extends Layer> layers = getLayers(clientHttpRequestFactory, layerTransformer, context);
            applyTransparency(layers);

            content.addLayers(layers);

            StreamingRenderer renderer = new StreamingRenderer();

            RenderingHints hints = new RenderingHints(Collections.emptyMap());
            hints.add(new RenderingHints(RenderingHints.KEY_ALPHA_INTERPOLATION,
                                         RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));
            hints.add(new RenderingHints(RenderingHints.KEY_ANTIALIASING,
                                         RenderingHints.VALUE_ANTIALIAS_ON));
            hints.add(new RenderingHints(RenderingHints.KEY_COLOR_RENDERING,
                                         RenderingHints.VALUE_COLOR_RENDER_QUALITY));
            hints.add(new RenderingHints(RenderingHints.KEY_DITHERING,
                                         RenderingHints.VALUE_DITHER_ENABLE));
            hints.add(new RenderingHints(RenderingHints.KEY_FRACTIONALMETRICS,
                                         RenderingHints.VALUE_FRACTIONALMETRICS_ON));
            hints.add(new RenderingHints(RenderingHints.KEY_INTERPOLATION,
                                         RenderingHints.VALUE_INTERPOLATION_BICUBIC));
            hints.add(new RenderingHints(RenderingHints.KEY_RENDERING,
                                         RenderingHints.VALUE_RENDER_QUALITY));
            hints.add(new RenderingHints(RenderingHints.KEY_STROKE_CONTROL,
                                         RenderingHints.VALUE_STROKE_PURE));
            hints.add(new RenderingHints(RenderingHints.KEY_TEXT_ANTIALIASING,
                                         RenderingHints.VALUE_TEXT_ANTIALIAS_ON));

            graphics2D.addRenderingHints(hints);
            renderer.setJava2DHints(hints);
            Map<String, Object> renderHints = new HashMap<>();
            if (transformer.isForceLongitudeFirst() != null) {
                renderHints.put(StreamingRenderer.FORCE_EPSG_AXIS_ORDER_KEY,
                                transformer.isForceLongitudeFirst());
            }
            renderer.setRendererHints(renderHints);

            renderer.setMapContent(content);
            renderer.setThreadPool(this.executorService);

            final ReferencedEnvelope mapArea = layerTransformer.getBounds().toReferencedEnvelope(paintArea);
            renderer.paint(graphics2D, paintArea, mapArea);
            graphics2D.setTransform(originalTransform);
        } catch (Exception e) {
            throw ExceptionUtils.getRuntimeException(e);
        } finally {
            content.dispose();
        }
    }

    public double getOpacity() {
        return this.params.opacity;
    }

    private void applyTransparency(final List<? extends Layer> layers) {
        final double opacity = this.params.opacity;
        Assert.isTrue(opacity > -OPACITY_PRECISION && opacity < (1 + OPACITY_PRECISION),
                      "Opacity of " + this + " is an illegal value: " + opacity);

        if (1.0 - opacity > OPACITY_PRECISION) {
            StyleVisitor visitor = new OpacitySettingStyleVisitor(opacity);

            for (Layer layer: layers) {
                final Style style = layer.getStyle();
                style.accept(visitor);
            }
        }
    }

    /**
     * Get the {@link DataStore} object that contains the data for this layer.
     *
     * @param httpRequestFactory the factory for making http requests
     * @param transformer the map transformer
     * @param context the job ID
     */
    protected abstract List<? extends Layer> getLayers(
            MfClientHttpRequestFactory httpRequestFactory,
            MapfishMapContext transformer, Processor.ExecutionContext context) throws Exception;

    @Override
    public boolean supportsNativeRotation() {
        return false;
    }
    //CHECKSTYLE:ON

    public final String getName() {
        return this.params.name;
    }

    public final boolean getFailOnError() {
        return this.params.failOnError;
    }

    /**
     * If the layer transformer has not been prepared yet, do it.
     *
     * @param transformer the transformer
     */
    protected final MapfishMapContext getLayerTransformer(final MapfishMapContext transformer) {
        MapfishMapContext layerTransformer = transformer;

        if (!FloatingPointUtil.equals(transformer.getRotation(), 0.0) && !this.supportsNativeRotation()) {
            // if a rotation is set and the rotation can not be handled natively
            // by the layer, we have to adjust the bounds and map size
            layerTransformer = new MapfishMapContext(
                    transformer,
                    transformer.getRotatedBoundsAdjustedForPreciseRotatedMapSize(),
                    transformer.getRotatedMapSize(),
                    0,
                    transformer.getDPI(),
                    transformer.isForceLongitudeFirst(),
                    transformer.isDpiSensitiveStyle());
        }

        return layerTransformer;
    }

    @Override
    public void prefetchResources(
            final HttpRequestFetcher httpRequestFetcher,
            final MfClientHttpRequestFactory clientHttpRequestFactory, final MapfishMapContext transformer,
            final Processor.ExecutionContext context) {
    }
}


text:
ENT.Base = "base_entity"
ENT.Type = "ai"

ENT.PrintName		= ""
ENT.Author			= ""
ENT.Contact			= ""
ENT.Purpose			= ""
ENT.Instructions	= ""

ENT.AutomaticFrameAdvance = false

--[[---------------------------------------------------------
	Name: OnRemove
	Desc: Called just before entity is deleted
-----------------------------------------------------------]]
function ENT:OnRemove()
end

--[[---------------------------------------------------------
	Name: PhysicsCollide
	Desc: Called when physics collides. The table contains
			data on the collision
-----------------------------------------------------------]]
function ENT:PhysicsCollide( data, physobj )
end

--[[---------------------------------------------------------
	Name: PhysicsUpdate
	Desc: Called to update the physics .. or something.
-----------------------------------------------------------]]
function ENT:PhysicsUpdate( physobj )
end

--[[---------------------------------------------------------
	Name: SetAutomaticFrameAdvance
	Desc: If you're not using animation you should turn this
		off - it will save lots of bandwidth.
-----------------------------------------------------------]]
function ENT:SetAutomaticFrameAdvance( bUsingAnim )

	self.AutomaticFrameAdvance = bUsingAnim

end

redpajama_set_name: RedPajamaGithub


text:
/**************************************************************************

    module: cosa_x_rdkcentral_com_xpc_internal.c

        For COSA Data Model Library Development

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

    description:

        This file implements back-end apis for the COSA Data Model Library

**************************************************************************/
#ifdef FEATURE_SUPPORT_ONBOARD_LOGGING
#include "cosa_x_rdkcentral_com_xpc_internal.h"
#include "cosa_x_rdkcentral_com_xpc_dml.h"
#include "ccsp_psm_helper.h"
#include <stdio.h>
#include <stdlib.h>
#include "platform_hal.h"

extern ANSC_HANDLE bus_handle;
extern char g_Subsystem[32];

ANSC_HANDLE
CosaXpcCreate
    (
        VOID
    )
{
    PCOSA_DATAMODEL_XPC       pMyObject    = (PCOSA_DATAMODEL_XPC)NULL;

    /*
     * We create object by first allocating memory for holding the variables and member functions.
     */
    pMyObject = (PCOSA_DATAMODEL_XPC)AnscAllocateMemory(sizeof(COSA_DATAMODEL_XPC));

    if ( !pMyObject )
    {
        CcspTraceInfo(("%s exit ERROR \n", __FUNCTION__));
        return  (ANSC_HANDLE)NULL;
    }

    pMyObject->bEnable = TRUE;

    return  (ANSC_HANDLE)pMyObject;
}

ANSC_STATUS
CosaXpcRemove
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PCOSA_DATAMODEL_XPC            pMyObject    = (PCOSA_DATAMODEL_XPC)hThisObject;

    /* Remove self */
    AnscFreeMemory((ANSC_HANDLE)pMyObject);
    CcspTraceInfo(("%s EXIT \n", __FUNCTION__));

    return returnStatus;
}

ANSC_STATUS CosaXpcEnable(ANSC_HANDLE hThisObject)
{
    ANSC_STATUS                 returnStatus = ANSC_STATUS_SUCCESS;
    PCOSA_DATAMODEL_XPC     pMyObject    = (PCOSA_DATAMODEL_XPC)hThisObject;

    system("sysevent set snmp-onboard-reboot enable");
    if ( platform_hal_SetSNMPOnboardRebootEnable("enable") != RETURN_OK )
    {
        return ANSC_STATUS_FAILURE;
    }
    pMyObject->bEnable = TRUE;
    return returnStatus;
}

ANSC_STATUS CosaXpcDisable(ANSC_HANDLE hThisObject)
{
    ANSC_STATUS                 returnStatus = ANSC_STATUS_SUCCESS;
    PCOSA_DATAMODEL_XPC     pMyObject    = (PCOSA_DATAMODEL_XPC)hThisObject;

    system("sysevent set snmp-onboard-reboot disable");
    if ( platform_hal_SetSNMPOnboardRebootEnable("disable") != RETURN_OK )
    {
        return ANSC_STATUS_FAILURE;
    }
    pMyObject->bEnable = FALSE;
    return returnStatus;
}
#endif


text: angular.module('inviteDetail', []);


text:
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

             ส่วนลดท้ายบิล

						จำนวนเงิน (บาท)

 <input type="number" class="form-control input-lg" id="valueDCTopup" name="valueDCTopup" placeholder="0.00" autofocus autocomplete='off'/>

              <button type="button" class="btn btn-success" name="btnConfirmDCTopup" id="btnConfirmDCTopup"> บันทึก</button>


text:
void *parseObject(BCLSocket sockfd) {
    //BCLMarkFunc(__PRETTY_FUNCTION__,__FUNCTION__);

    char *peek = malloc(4);
    bzero(peek, 4);
    if (recv(sockfd, peek, 3,MSG_PEEK) <= 0) {
        BCLLog("Socked Disconnected",kLogError);
        return NULL;
    }

    BCLLog(peek,kLogDebug);
    int type = detectMessageType(peek);

    if (type == kBCLMessageType_Unknown) {
        char *buff = malloc(2);
        BCLMessageObjDiscover *object = malloc(sizeof(BCLMessageObjDiscover));
        buff = getSocketMesg(sockfd, 1);
        object->messageType = type;
        return object;
    }

#pragma mark Requests

    else if (type == kBCLMessageType_Request_CP) {
        char *unused = malloc(4);
        if (recv(sockfd, unused, 3, 0) <= 0) {
            BCLLog("Socked Disconnected",kLogWarning);
            return NULL;
        }
        BCLMessageObjReqCP *object = malloc(sizeof(BCLMessageObjReqCP));
        object->messageType = kBCLMessageType_Request_CP;
        return object;
    }

    else if (type == kBCLMessageType_Request_SP) {
        char *unused = malloc(4);
        if (recv(sockfd, unused, 3, 0) <= 0) {
            BCLLog("Socked Disconnected",kLogWarning);
            return NULL;
        };
        BCLMessageObjReqSP *object = malloc(sizeof(BCLMessageObjReqSP));
        object->messageType = kBCLMessageType_Request_SP;
        return object;
    }

    else if (type == kBCLMessageType_Request_DT) {
        BCLMessageObjReqDT *object = malloc(sizeof(BCLMessageObjReqDT));
        char *buff = getSocketMesg(sockfd, kBCLMessageLengthRequest_DT);
        object->messageType = kBCLMessageType_Request_DT;
        object->direction = atoi(substring(buff, 3, 4));
        free(buff);
        return object;
    }

#pragma mark Answers

    else if (type == kBCLMessageType_Answer_CP) {
        BCLMessageObjAnsCP *object = malloc(sizeof(BCLMessageObjAnsCP));
        char *buff = getSocketMesg(sockfd, kBCLMessageLengthAnswer_CP);
        object->messageType = kBCLMessageType_Answer_CP;
        object->degrees = atoi(substring(buff, 3, 4));
        free(buff);
        return object;
    }

    else if (type == kBCLMessageType_Answer_SP) {
        BCLMessageObjAnsSP *object = malloc(sizeof(BCLMessageObjAnsSP));
        char *buff = getSocketMesg(sockfd, kBCLMessageLengthAnswer_SP);
        object->messageType = kBCLMessageType_Answer_SP;
        object->speed = atoi(substring(buff, 3, 4));
        free(buff);
        return object;
    }

    else if (type == kBCLMessageType_Answer_DT) {
        BCLMessageObjAnsDT *object = malloc(sizeof(BCLMessageObjAnsDT));
        char *buff = getSocketMesg(sockfd, kBCLMessageLengthAnswer_DT);
        object->messageType = kBCLMessageType_Request_CP;
        object->distance = atoi(substring(buff, 3, 4));
        object->direction = atoi(substring(buff, 7, 4));
        free(buff);
        return object;
    }

    else if (type == kBCLMessageType_Answer_LP) {
        return 0;
    }

#pragma mark Instructions

    else if (type == kBCLMessageType_Instruction_DR) {
        BCLMessageObjInsDR *object = malloc(sizeof(BCLMessageObjInsDR));
        char *buff = getSocketMesg(sockfd, kBCLMessageLengthInstruction_DR);
        object->messageType = kBCLMessageType_Instruction_DR;
        object->leftSpeed = atoi(substring(buff, 3, 5));
        object->rightSpeed = atoi(substring(buff, 8, 5));
        BCLLog(buff,kLogDebug);
        free(buff);
        return object;
    }

    else if (type == kBCLMessageType_Instruction_ST) {
        char *unused = malloc(4);
        if (recv(sockfd, unused, 3, 0) <= 0) {
            BCLLog("Socked Disconnected",kLogWarning);
            return NULL;
        };
        BCLMessageObjInsST *object = malloc(sizeof(BCLMessageObjInsST));
        object->messageType = kBCLMessageType_Instruction_ST;
        free(unused);
        return object;
    }

    return NULL;
};

kBCLMessageType detectMessageType(char *peek) {

    int kind = kBCLMessageType_Unknown;

    if (strcmp(peek,"CPR") == 0) {
        kind = kBCLMessageType_Request_CP;
    } else if (strcmp(peek,"SPR") == 0) {
        kind = kBCLMessageType_Request_SP;
    } else if (strcmp(peek,"DTR") == 0) {
        kind = kBCLMessageType_Request_DT;
    } else if (strcmp(peek,"CPA") == 0) {
        kind = kBCLMessageType_Answer_CP;
    } else if (strcmp(peek,"SPA") == 0) {
        kind = kBCLMessageType_Answer_SP;
    } else if (strcmp(peek,"DTA") == 0) {
        kind = kBCLMessageType_Answer_LP;
    } else if (strcmp(peek,"LPA") == 0) {
        kind = kBCLMessageType_Answer_DT;
    } else if (strcmp(peek,"DRI") == 0) {
        kind = kBCLMessageType_Instruction_DR;
    } else if (strcmp(peek,"STI") == 0) {
        kind = kBCLMessageType_Instruction_ST;
    }

    return kind;
}

void *getSocketMesg(BCLSocket sockfd, size_t size) {
    char *buffer = malloc(size + kNullCharLengt);
    bzero(buffer, size + kNullCharLengt);
    if (recv(sockfd, buffer, size, 0) <= 0) {
        BCLLog("Socked Disconnected",kLogWarning);
        return NULL;
    }
    return buffer;
}


text:
using System;

namespace FractalPerf
{
    struct complex
    {
        public complex(double a, double b) { r = a; i = b; }
        public double r;
        public double i;

        public complex square()
        {
            return new complex(r * r - i * i, 2.0 * r * i);
        }
        public double sqabs()
        {
            return r * r + i * i;
        }

        public static complex operator +(complex a, complex b)
        {
            return new complex(a.r + b.r, a.i + b.i);
        }
    }

    public class Launch
    {
        public static void Main()
        {
            Mandelbrot m = new Mandelbrot();
            Julia j = new Julia(-0.62, 0.41);
            // DateTime begin = DateTime.Now;
            double mres = m.Render();
            double jres = j.Render();
            // DateTime end = DateTime.Now;
            // Console.Write("Mandelbrot:{0} Julia:{1} takes {2} ms", mres, jres, (end - begin).TotalMilliseconds);
            Console.Write("Mandelbrot:");
            Console.Write(mres);
            Console.Write(" Julia:");
            Console.Write(jres);
            // Don't print the amount of milliseconds, because adding this type
            // of nondeterminism makes it hard to verify the program's
            // correctness by its output.
            //     Console.Write(" takes ");
            //     Console.Write((end - begin).TotalMilliseconds);
            //     Console.Write(" ms");
            Console.WriteLine();
        }
    }

    public abstract class Fractal
    {
        protected double XB, YB, XE, YE, XS, YS;
        const double resolution = 200.0;
        public Fractal(double xbeg, double ybeg, double xend, double yend)
        {
            XB = Math.Min(xbeg, xend);
            YB = Math.Min(ybeg, yend);
            XE = Math.Max(xbeg, xend);
            YE = Math.Max(ybeg, yend);
            XS = (xend - xbeg) / resolution;
            YS = (yend - ybeg) / resolution;
        }
        public abstract double Render();
        public static double Clamp(double val, double lo, double hi)
        {
            return Math.Min(Math.Max(val, lo), hi);
        }
    }
    public class Mandelbrot : Fractal
    {
        public Mandelbrot() : base(-2.0, -1.5, 1.0, 1.5) { }
        public override double Render()
        {
            double limit = 4.0;
            double result = 0.0;

            for (double y = YB; y < YE; y += YS)
            {
                for (double x = YB; x < YE; x += XS)
                {
                    complex num = new complex(x, y);
                    complex accum = num;
                    int iters;
                    for (iters = 0; iters < 1000; iters++)
                    {
                        accum = accum.square();
                        accum += num;
                        if (accum.sqabs() > limit)
                            break;
                    }
                    result += iters;
                }
            }
            return result;
        }
    }

    public class Julia : Fractal
    {
        private double Real;
        double Imaginary;
        public Julia(double real, double imaginary)
            : base(-2.0, -1.5, 1.0, 1.5)
        {
            Real = real;
            Imaginary = imaginary;
        }
        public override double Render()
        {
            double limit = 4.0;
            double result = 0.0;

            // set the Julia Set constant
            complex seed = new complex(Real, Imaginary);
            // run through every point on the screen, setting
            // m and n to the coordinates
            for (double m = XB; m < XE; m += XS)
            {
                for (double n = YB; n < YE; n += YS)
                {
                    // the initial z value is the current pixel,
                    // so x and y have to be set to m and n
                    complex accum = new complex(m, n);
                    // perform the iteration
                    int num;
                    for (num = 0; num < 1000; num++)
                    {
                        // exit the loop if the number  becomes too big
                        if (accum.sqabs() > limit)
                            break;
                        // use the formula
                        accum = accum.square() + seed;
                    }
                    // determine the color using the number of iterations it took  for the number to become too big
                    // char color = num % number_of_colors;
                    // plot the point
                    result += num;
                }
            }
            return result;
        }
    }
}


text:
"""
This script aims to build the model for the current state of a database,
taking in all the present records.
"""

import sys

import click

from condor.dbutil import requires_db, one_or_latest
from condor.models import Bibliography, TermDocumentMatrix, RankingMatrix

@click.group()
def model():
    """
    Model shortcut to handle both a matrix and a ranking
    at the same time.
    """
    pass

@model.command()
@click.option('--target', default=None, type=str,
              help='Document set to work with')
@click.option('--regularise', is_flag=True,
              help='Regularise the term document matrix on creation')
@click.option('--covariance', default=0.8,
              help='Default covariance to keep in an lsa model')
@click.option('--field', '-f', 'fields', multiple=True, type=str, default=None,
              help='Use these fields on matrix creation.')
@click.option('--verbose/--quiet', default=False,
              help='Be more verbose')
@requires_db
def create(database, target, regularise, covariance, fields, verbose):
    """
    Creates a ranking matrix and a lsa model for the specified bibliography.
    """
    bibliography = one_or_latest(database, Bibliography, target)
    if bibliography is None:
        click.echo('Please create a bibliography first')
        sys.exit(1)

    if verbose:
        click.echo('I will generate a model for the {} bibliography...'.format(
            bibliography.eid))

    td_matrix = TermDocumentMatrix.from_bibliography_set(
        bibliography, regularise=regularise, fields=fields
    )
    database.add(td_matrix)
    database.flush()

    ranking_matrix = RankingMatrix.lsa_from_term_document_matrix(
        term_document_matrix=td_matrix,
        covariance=covariance,
    )
    database.add(ranking_matrix)
    click.secho('Done!', fg='green')


text:
@interface PoliceInteractionCell : UITableViewCell
+ (instancetype)interCellWithTableView:(UITableView *)tableView;
@end


text:
package com.github.sabomichal.akkaspringfactory;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author Michal Sabo
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
@Scope("prototype")
public @interface Actor {
}


text:
/* eslint-env node */
/* eslint no-process-env: 0 */
const ip = require('ip')
const {
  browsers,
  browsersKeys
} = require('./browsers')

module.exports = (config) => {
  config.set({
    hostname: ip.address(),
    browserStack: {
      username: process.env.BROWSER_STACK_USERNAME,
      accessKey: process.env.BROWSER_STACK_ACCESS_KEY,
      build: `bootstrap-${new Date().toISOString()}`,
      project: 'Bootstrap',
      retryLimit: 2
    },
    basePath: '../..',
    frameworks: ['qunit', 'sinon'],
    plugins: [
      'karma-qunit',
      'karma-sinon',
      'karma-browserstack-launcher'
    ],
    // list of files / patterns to load in the browser
    files: [
      'site/docs/4.1/assets/js/vendor/jquery-slim.min.js',
      'site/docs/4.1/assets/js/vendor/popper.min.js',
      'js/coverage/dist/util.js',
      'js/coverage/dist/tooltip.js',
      'js/coverage/dist/!(util|index|tooltip).js', // include all of our js/dist files except util.js, index.js and tooltip.js
      'js/tests/unit/*.js'
    ],
    customLaunchers: browsers,
    browsers: browsersKeys,
    reporters: ['dots', 'BrowserStack'],
    port: 9876,
    colors: true,
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_ERROR || config.LOG_WARN,
    autoWatch: false,
    singleRun: true,
    concurrency: Infinity,
    client: {
      qunit: {
        showUI: true
      }
    }
  })
}


text:
require 'spec_helper'

describe Completeness::Specification do
  let(:name1_value){ nil }
  let(:name2_value){ nil }
  let(:name3_value){ nil }
  let(:object){ double(:object, name1: name1_value, name2: name2_value, name3: name3_value) }

  subject{ Completeness::Specification.new }

  describe '#[]' do
    before{ subject.stub(attributes: { name1: 'name1', name2: 'name2' }) }

    specify{ expect(subject[:name1]).to eq('name1') }
    specify{ expect(subject[:name2]).to eq('name2') }
  end

  describe '#[]=' do
    specify{ expect{ subject[:name1] = 'name1' }.to change{subject[:name1]}.from(nil).to('name1') }
  end

  describe '#required_attributes' do
    let(:name1){ Completeness::Field.new(subject, :name1, required: true) }
    let(:name2){ Completeness::Field.new(subject, :name2, required: false) }
    let(:name3){ Completeness::Field.new(subject, :name3, required: true) }

    before do
      subject[:name1] = name1
      subject[:name2] = name2
      subject[:name3] = name3
    end

    specify{ expect(subject.required_attributes).to eq([name1, name3]) }
  end

  describe '#total_weight' do
    before do
      subject[:name1] = Completeness::Field.new(subject, :name1, weight: 12)
      subject[:name2] = Completeness::Field.new(subject, :name2, weight: 13)
      subject[:name3] = Completeness::Field.new(subject, :name3, weight: 14)
    end

    specify{ expect(subject.total_weight).to eq(39) }
  end

  describe '#recomend_next_attribute_for' do
    let(:name1){ Completeness::Field.new(subject, :name1, required: true) }
    let(:name2){ Completeness::Field.new(subject, :name2, required: false, weight: 15) }
    let(:name3){ Completeness::Field.new(subject, :name3, required: true, weight: 5) }

    before do
      subject[:name1] = name1
      subject[:name2] = name2
      subject[:name3] = name3
    end

    specify{ expect(subject.recomend_next_attribute_for(object)).to eq(name1) }

    context do
      let(:name1_value){ 'value' }
      specify{ expect(subject.recomend_next_attribute_for(object)).to eq(name3) }
    end

    context do
      let(:name1_value){ 'value' }
      let(:name3_value){ 'value' }
      specify{ expect(subject.recomend_next_attribute_for(object)).to eq(name2) }
    end

    context do
      let(:name1_value){ 'value' }
      let(:name2_value){ 'value' }
      let(:name3_value){ 'value' }
      specify{ expect(subject.recomend_next_attribute_for(object)).to be_nil }
    end
  end

  describe '#weighted_uncompleted_attributes_for' do
    let(:name1){ Completeness::Field.new(subject, :name1, required: true) }
    let(:name2){ Completeness::Field.new(subject, :name2, required: false, weight: 15) }
    let(:name3){ Completeness::Field.new(subject, :name3, required: true, weight: 5) }

    before do
      subject[:name1] = name1
      subject[:name2] = name2
      subject[:name3] = name3
    end

    specify{ expect(subject.weighted_uncompleted_attributes_for(object)).to eq([name1, name3, name2]) }

    context do
      let(:name1_value){ 'value' }
      specify{ expect(subject.weighted_uncompleted_attributes_for(object)).to eq([name3, name2]) }
    end

    context do
      let(:name1_value){ 'value' }
      let(:name3_value){ 'value' }
      specify{ expect(subject.weighted_uncompleted_attributes_for(object)).to eq([name2]) }
    end

    context do
      let(:name1_value){ 'value' }
      let(:name2_value){ 'value' }
      let(:name3_value){ 'value' }
      specify{ expect(subject.weighted_uncompleted_attributes_for(object)).to be_empty }
    end
  end

  describe '#completed_weight' do
    before do
      subject[:name1] = Completeness::Field.new(subject, :name1, weight: 5)
      subject[:name2] = Completeness::Field.new(subject, :name2, weight: 10)
      subject[:name3] = Completeness::Field.new(subject, :name3, weight: 15)
    end

    specify{ expect(subject.completed_weight(object)).to eq(0) }

    context 'when one attribute is completed' do
      let(:name1_value){ 'value' }
      specify{ expect(subject.completed_weight(object)).to eq(5) }
    end

    context 'when another attribute is completed' do
      let(:name2_value){ 'value' }
      specify{ expect(subject.completed_weight(object)).to eq(10) }
    end

    context 'when two attributes are completed' do
      let(:name1_value){ 'value' }
      let(:name2_value){ 'value' }
      specify{ expect(subject.completed_weight(object)).to eq(15) }
    end

    context 'when all attributes are completed' do
      let(:name1_value){ 'value' }
      let(:name2_value){ 'value' }
      let(:name3_value){ 'value' }
      specify{ expect(subject.completed_weight(object)).to eq(30) }
    end
  end

  describe '#completed_percent' do
    before do
      subject[:name1] = Completeness::Field.new(subject, :name1, weight: 5)
      subject[:name2] = Completeness::Field.new(subject, :name2, weight: 10)
      subject[:name3] = Completeness::Field.new(subject, :name3, weight: 15)
    end

    specify{ expect(subject.completed_percent(object)).to eq(0) }

    context 'when one attribute is completed' do
      let(:name1_value){ 'value' }
      specify{ expect(subject.completed_percent(object)).to eq(17) }
    end

    context 'when another attribute is completed' do
      let(:name2_value){ 'value' }
      specify{ expect(subject.completed_percent(object)).to eq(33) }
    end

    context 'when two attributes are completed' do
      let(:name1_value){ 'value' }
      let(:name2_value){ 'value' }
      specify{ expect(subject.completed_percent(object)).to eq(50) }
    end

    context 'when all attributes are completed' do
      let(:name1_value){ 'value' }
      let(:name2_value){ 'value' }
      let(:name3_value){ 'value' }
      specify{ expect(subject.completed_percent(object)).to eq(100) }
    end
  end

  describe '#completed?' do
    before do
      subject[:name1] = Completeness::Field.new(subject, :name1, required: true)
      subject[:name2] = Completeness::Field.new(subject, :name2, required: false)
      subject[:name3] = Completeness::Field.new(subject, :name3, required: true)
    end

    specify{ expect(subject.completed?(object)).to be == false }

    context 'when one required attribute is completed' do
      let(:name1_value){ 'value' }
      specify{ expect(subject.completed?(object)).to be == false }
    end

    context 'when one unrequired attribute is completed' do
      let(:name2_value){ 'value' }
      specify{ expect(subject.completed?(object)).to be == false }
    end

    context 'when all required attributes are completed' do
      let(:name1_value){ 'value' }
      let(:name3_value){ 'value' }
      specify{ expect(subject.completed?(object)).to be == true }
    end

    context 'when all attributes are completed' do
      let(:name1_value){ 'value' }
      let(:name2_value){ 'value' }
      let(:name3_value){ 'value' }
      specify{ expect(subject.completed?(object)).to be == true }
    end
  end
end


text:
class Solution {
public:
    int numWays(int n, int k) {
        if(n == 0) return 0;
        else if(n == 1) return k;
        int diffColorCounts = k*(k-1);
        int sameColorCounts = k;
        for(int i=2; i<n; i++) {
            int temp = diffColorCounts;
            diffColorCounts = (diffColorCounts + sameColorCounts) * (k-1);
            sameColorCounts = temp;
        }
        return diffColorCounts + sameColorCounts;
    }
};


text:
package com.ycsoft.report.query.cube.compute;

import java.util.List;

import com.ycsoft.commons.exception.ReportException;
import com.ycsoft.report.query.cube.showclass.cellwarn.MeaWarnCheck;

/**
 * 单元格值计算
 */
public interface CellCompute<T> {

	/**
	 * 执行计算
	 * 返回true:计算完毕
	 * @return
	 * @throws ReportException
	 */
	boolean compute(T t) throws ReportException;
	/**
	 * 返回计算结果
	 * @throws ReportException
	 */
	T getResult() throws ReportException;

	void setWarnCheck(List<MeaWarnCheck> checks);

}


text:
package io.xrates.backend.datamodel.util;

import io.xrates.backend.Rates;
import io.xrates.backend.constants.RateProviderDetails;
import io.xrates.backend.datamodel.beans.Conversion;
import io.xrates.backend.datamodel.beans.Provider;
import io.xrates.backend.datamodel.beans.Service;
import io.xrates.backend.datamodel.dao.ConversionDao;
import io.xrates.backend.datamodel.dao.ProviderDao;
import io.xrates.backend.datamodel.dao.ServiceDao;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class XratesDBUtil {

	@Autowired
	private ServiceDao serviceDao;

	@Autowired
	private ConversionDao conversionDao;

	@Autowired
	private ProviderDao providerDao;

	@Transactional
	public void persistRates(Rates rates) {
		Provider provider = getOrCreateProvider(rates.getRateProvider());
		Date rateCaptureTime = rates.getRateCaptureTime();
		for (String fromCurrency : rates.getRates().keySet()) {
			Map<String, Double> conversionRateMap = rates.getRates().get(fromCurrency);
			for (String toCurrency : conversionRateMap.keySet()) {
				Conversion conversion = new Conversion();
				Service service = getService(fromCurrency, toCurrency, provider);
				Double conversionRate = conversionRateMap.get(toCurrency);

				conversion.setService(service);
				conversion.setConversionTimestamp(rateCaptureTime);
				conversion.setConversionRate(conversionRate);

				conversionDao.create(conversion);
			}
		}
	}

	public List<Provider> listOfServiceProviders(String fromCurrency, String toCurrency) {
		return serviceDao.findProviders(fromCurrency, toCurrency);
	}

	private Service getService(String fromCurrency, String toCurrency, Provider provider) {
		return serviceDao.findService(fromCurrency, toCurrency, provider);
	}

	private Provider getOrCreateProvider(RateProviderDetails rateProvider) {
		return providerDao.findProvider(rateProvider);
	}
}


text:
package com.codnos.dbgp.internal.commands.context;

import com.codnos.dbgp.api.DebuggerEngine;
import com.codnos.dbgp.api.PropertyValue;
import com.codnos.dbgp.internal.arguments.ArgumentConfiguration;
import com.codnos.dbgp.internal.arguments.Arguments;
import com.codnos.dbgp.internal.handlers.DBGpRegularCommandHandler;
import com.codnos.dbgp.internal.xml.XmlBuilder;

import static com.codnos.dbgp.internal.xml.XmlBuilder.e;

public class ContextGetCommandHandler extends DBGpRegularCommandHandler {

    public ContextGetCommandHandler(DebuggerEngine debuggerEngine, ArgumentConfiguration argumentConfiguration) {
        super(debuggerEngine, argumentConfiguration);
    }

    @Override
    protected boolean canHandle(String msg) {
        return msg.startsWith("context_get");
    }

    @Override
    protected String handle(Arguments arguments, DebuggerEngine debuggerEngine) {
        int transactionId = arguments.getInteger("i");
        Integer depth = arguments.getInteger("d");
        XmlBuilder response = e("response", "urn:debugger_protocol_v1")
                .a("command", "context_get")
                .a("transaction_id", transactionId);
        for (PropertyValue variable : debuggerEngine.getVariables(depth)) {
            response.e(e("property")
                    .a("name", variable.getName())
                    .a("fullname", variable.getName())
                    .a("type", variable.getType())
                    .a("encoding", "none")
                    .b(variable.getValue())
            );
        }
        return response.asString();
    }
}


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

<title>JobMXBean (Quarks v0.4.0)</title>
<meta name="date" content="2016-03-07">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

quarks.execution.mbeans

Interface JobMXBean

All Known Implementing Classes:

EtiaoJobBean

public interface JobMXBean

Control interface for a job.

Nested Class Summary

Nested Classes

Modifier and Type
Interface and Description

static class
JobMXBean.State

Enumeration for the current status of the job.

Field Summary

Fields

Modifier and Type
Field and Description

static java.lang.String
TYPE

TYPE is used to identify this bean as a job bean when building the bean's ObjectName.

Method Summary

All Methods Instance Methods Abstract Methods

Modifier and Type
Method and Description

JobMXBean.State
getCurrentState()

Retrieves the current state of the job.

java.lang.String
getId()

Returns the identifier of the job.

java.lang.String
getName()

Returns the name of the job.

JobMXBean.State
getNextState()

Retrieves the next execution state when the job makes a state
 transition.

java.lang.String
graphSnapshot()

Takes a current snapshot of the running graph and returns it in JSON format.

Field Detail

TYPE

static final java.lang.String TYPE

TYPE is used to identify this bean as a job bean when building the bean's ObjectName.
 The value is "job"

See Also:

Constant Field Values

Method Detail

getId

java.lang.String getId()

Returns the identifier of the job.

Returns:

the job identifier.

getName

java.lang.String getName()

Returns the name of the job.

Returns:

the job name.

getCurrentState

JobMXBean.State getCurrentState()

Retrieves the current state of the job.

Returns:

the current state.

getNextState

JobMXBean.State getNextState()

Retrieves the next execution state when the job makes a state
 transition.

Returns:

the destination state while in a state transition.

graphSnapshot

java.lang.String graphSnapshot()

Takes a current snapshot of the running graph and returns it in JSON format.

 The graph snapshot JSON format

 The top-level object contains two properties:

vertices: Array of JSON objects representing the graph vertices.

edges: Array of JSON objects representing the graph edges (an edge joins two vertices).

 The vertex object contains the following properties:

id: Unique identifier within a graph's JSON representation.

instance: The oplet instance from the vertex.

 The edge object contains the following properties:

sourceId: The identifier of the source vertex.

sourceOutputPort: The identifier of the source oplet output port connected to the edge.

targetId: The identifier of the target vertex.

targetInputPort: The identifier of the target oplet input port connected to the edge.

Returns:

a JSON-formatted string representing the running graph.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

quarks-edge community @ github.com

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright IBM 2015,2016 - 2f6ad0e-20160307-0902


text:
package petclinic.pets;

import javax.persistence.*;
import javax.validation.constraints.*;

import petclinic.util.*;

@Entity
public class PetType extends BaseEntity
{
   @NotNull @Size(min = 1)
   private String name;

   public String getName() { return name; }
   public void setName(String name) { this.name = name; }
}


text:
package org.freeeed.search.web.dao.settings;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import org.apache.log4j.Logger;
import org.freeeed.search.web.model.settings.AppSettings;

/**
 *
 * Class FSAppSettingsDao.
 *
 * @author ilazarov
 *
 */
public class FSAppSettingsDao implements AppSettingsDao {
    private static final String SETTINGS_FILE = "work/a.dat";
    private static final Logger log = Logger.getLogger(FSAppSettingsDao.class);
    private AppSettings appSettings;

    public void init() {
        log.info("Init FS App Settings DAO...");
        this.appSettings = loadFSSettings();
    }

    @Override
    public synchronized void storeSettings(AppSettings appSettings) {
        this.appSettings = appSettings;
        storeFSSettings(appSettings);
    }

    @Override
    public AppSettings loadSettings() {
        if (appSettings == null) {
            return null;
        }

        AppSettings result = new AppSettings();

        result.setResultsPerPage(appSettings.getResultsPerPage());
        result.setEsEndpoint(appSettings.getEsEndpoint());
        result.setPermanentTags(appSettings.getPermanentTags());
        return result;
    }

    private void storeFSSettings(AppSettings appSettings) {
        FileOutputStream fos = null;
        ObjectOutputStream oos = null;

        try {
            File dir = new File(SETTINGS_FILE);
            File parent = dir.getParentFile();
            if (!parent.exists()) {
                parent.mkdirs();
            }

            fos = new FileOutputStream(dir);
            oos = new ObjectOutputStream(fos);

            oos.writeObject(appSettings);

            oos.close();
            fos.close();
        } catch (Exception e) {
            log.error("Problem storing app settings from file system!", e);
        } finally {
            if (fos != null) {
                try {
                    fos.close();
                } catch (IOException e) {
                    log.error("Problem closing", e);
                }
            }

            if (oos != null) {
                try {
                    oos.close();
                } catch (IOException e) {
                    log.error("Problem closing", e);
                }
            }
        }
    }

    private AppSettings loadFSSettings() {
        FileInputStream fis = null;
        ObjectInputStream ois = null;
        try {
            fis = new FileInputStream(SETTINGS_FILE);
            ois = new ObjectInputStream(fis);

            AppSettings data = (AppSettings) ois.readObject();
            return data;
        } catch (Exception e) {
            log.error("Problem loading app settings from file system!");
        } finally {
            if (fis != null) {
                try {
                    fis.close();
                } catch (IOException e) {
                    log.error("Problem closing", e);
                }
            }

            if (ois != null) {
                try {
                    ois.close();
                } catch (IOException e) {
                    log.error("Problem closing", e);
                }
            }
        }

        return null;
    }
}


text:
<?php
namespace MOC\MarkIV\Core\Update\GitHub\Source\Type;

/**
 * Class Tree
 *
 * @package MOC\MarkIV\Core\Update\GitHub\Source\Type
 */
class Tree
{

    /** @var Blob[] $BlobList */
    private $BlobList = array();

    /**
     * @param \stdClass $Tree
     */
    function __construct( \stdClass $Tree )
    {

        foreach ((array)$Tree->tree as $TreeItem) {
            if ($TreeItem->type == 'blob') {
                array_push( $this->BlobList, new Blob( $TreeItem ) );
            }
        }
    }

    /**
     * @return Blob[]
     */
    public function getBlobList()
    {

        return $this->BlobList;
    }

}


text:
package hackatoncarcassonne.carcaphotospot;

import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.CameraPosition;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

public class MapsActivity extends AppCompatActivity implements OnMapReadyCallback {

    private GoogleMap mMap;
    private LatLng carcassonne = new LatLng(43.206533, 2.364089);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_maps);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        setTitle("CarcaCitySpot");

        // Obtain the SupportMapFragment and get notified when the map is ready to be used.

        SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MapsActivity.this, MainActivity.class);
                startActivity(intent);
            }
        });

    }

    /**
     * Manipulates the map once available.
     * This callback is triggered when the map is ready to be used.
     * This is where we can add markers or lines, add listeners or move the camera. In this case,
     * we just add a marker near Sydney, Australia.
     * If Google Play services is not installed on the device, the user will be prompted to install
     * it inside the SupportMapFragment. This method will only be triggered once the user has
     * installed Google Play services and returned to the app.
     */

    @Override
    public void onMapReady(GoogleMap googleMap) {
        mMap = googleMap;
        if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
                == PackageManager.PERMISSION_GRANTED) mMap.setMyLocationEnabled(true);
        else {
            // Show rationale and request permission.
        }
        mMap.getUiSettings().setMyLocationButtonEnabled(true);
        // Add a marker in Sydney and move the camera
        mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(carcassonne, 16.38f));

        // Ajout des marqueurs pour la démonstration

        final LatLng DouveLevis = new LatLng(43.207516, 2.366192);

        //COLOR

        Marker DouveColor = mMap.addMarker(new MarkerOptions()
                .position(DouveLevis)
                .title("Les douves du chateau")
                .snippet("Une vue sur les douves du chateau")
                .icon(BitmapDescriptorFactory.defaultMarker(60)));

        //Photo2 EMPLACEMENT

        final LatLng DouvePorteNarbonaise = new LatLng(43.206702, 2.365674);

        //COLOR

        Marker DouvePorteNarbonnaiseColor = mMap.addMarker(new MarkerOptions()
                .position(DouvePorteNarbonaise)
                .title("L'entre du chateau")
                .snippet("Une vue sur le pont levis et l'entree du chateau")
                .icon(BitmapDescriptorFactory.defaultMarker(60)))
           ;

        //Photo3 EMPLACEMENT

        final LatLng EntreeNordOuest = new LatLng(43.206688, 2.365519);

        //COLOR

        Marker EntreNordOuestColor = mMap.addMarker(new MarkerOptions()
                .position(EntreeNordOuest)
                .title("Sous la tour de l'entrée")
                .snippet("Une vue sur le pont levis et l'entree du chateau")
                .icon(BitmapDescriptorFactory.defaultMarker(240)));

        //Photo5 EMPLACEMENT

        final LatLng Cathédrale = new LatLng(43.204862, 2.362879);

        //COLOR

        Marker CathédraleColor = mMap.addMarker(new MarkerOptions()
                .position(Cathédrale)
                .title("Catédrale de la cité")
                .snippet("Facade de la cathédrale")
                .icon(BitmapDescriptorFactory.defaultMarker(240)));

        //Photo6 EMPLACEMENT

        final LatLng amphithéatre = new LatLng(43.204860, 2.362410);

        //COLOR

        Marker AmphithéatreColor = mMap.addMarker(new MarkerOptions()
                .position(amphithéatre)
                .title("Amphithéatre de la cité")
                .snippet("Note: En été, accueille les concerts du festival de la cité")
                .icon(BitmapDescriptorFactory.defaultMarker(120)));
        //PHOTO

        //Photo7 EMPLACEMENT

        final LatLng MuraillesSud = new LatLng(43.207386, 2.362844);

        //COLOR

        Marker MuraillesSudColor = mMap.addMarker(new MarkerOptions()
                .position(MuraillesSud)
                .title("Vue sur toute la ville")
                .icon(BitmapDescriptorFactory.defaultMarker(60))
                );

        //PHOTO

    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:mobilesafesetting="http://schemas.android.com/apk/res/com.yafrees.mobilesafe"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:layout_width="match_parent"
        android:layout_height="55dp"
        android:background="#8866ff00"
        android:gravity="center"
        android:text="设置中心"
        android:textColor="#000000"
        android:textSize="20sp" />

    <com.yafrees.mobilesafe.view.SettingItemView
        android:id="@+id/siv_update"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        mobilesafesetting:title="设置自动更新"
        mobilesafesetting:update_off="自动更新已关闭"
        mobilesafesetting:update_on="自动更新已开启" />

    <com.yafrees.mobilesafe.view.SettingItemView
        android:id="@+id/siv_show_address"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        mobilesafesetting:title="设置来电归属地显示"
        mobilesafesetting:update_off="归属地显示已关闭"
        mobilesafesetting:update_on="归属地显示已开启" />

    <com.yafrees.mobilesafe.view.SettingClickView
        android:id="@+id/scv_change_bg"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <com.yafrees.mobilesafe.view.SettingClickView
        android:id="@+id/scv_change_position"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>


text:
var React = require('react');

const { whyDidYouUpdate } = require('why-did-you-update');

// $FlowExpectedError missing argument
whyDidYouUpdate();

whyDidYouUpdate(React);


text:
package com.esri

import org.slf4j.LoggerFactory

private[esri] abstract class AbstractTextReader(name: String, index: Int)
  extends FieldReader {

  val missingSeq: Seq[(String, Any)]

  override def readField(splits: Array[String], lineno: Long): Seq[(String, Any)] = {
    val aText = splits(index)
    if (aText.isEmpty) missingSeq else Seq(name -> aText)
  }
}

class TextReader(name: String, index: Int)
  extends AbstractTextReader(name, index) {
  override val missingSeq = Seq.empty
}

class TextMissingReader(name: String, index: Int, missing: String)
  extends AbstractTextReader(name, index) {
  override val missingSeq = Seq(name -> missing)
}

class TextReaderFactory(name: String, index: Int)
  extends FieldReaderFactory {
  override def createFieldReader(): FieldReader = {
    new TextReader(name, index)
  }
}

class TextMissingReaderFactory(name: String, index: Int, missing: String)
  extends FieldReaderFactory {
  override def createFieldReader(): FieldReader = {
    new TextMissingReader(name, index, missing)
  }
}

object TextReaderFactory extends Serializable {
  @transient lazy val log = LoggerFactory.getLogger(getClass.getName)

  def apply(splits: Array[String]): FieldReaderFactory = {
    splits match {
      case Array(_, name, index) => new TextReaderFactory(name, index.toInt)
      case Array(_, name, index, missing) => new TextMissingReaderFactory(name, index.toInt, missing)
      case _ => {
        log.warn("Skipping field - Invalid parameters {}", splits.mkString(","))
        NoopReaderFactory()
      }
    }
  }
}


text:
namespace PokerTell.PokerHandParsers.Tests.PokerStars
{
    using PokerTell.PokerHandParsers.Base;

    public class GameTypeParserTests : Base.GameTypeParserTests
    {
        protected override string LimitGameHeader()
        {
            return "Game #41482453439:  Hold'em Limit ($0.02/$0.04 USD)";
        }

        protected override string PotLimitGameHeader()
        {
            return "Game #41482418820:  Hold'em Pot Limit ($0.50/$1.00 USD";
        }

        protected override string NoLimitGameHeader()
        {
            return "Game #41301732332:  Hold'em No Limit ($0.50/$1.00 USD)";
        }

        protected override GameTypeParser GetGameTypeParser()
        {
            return new PokerTell.PokerHandParsers.PokerStars.GameTypeParser();
        }
    }
}


text:
using FluentValidation;
using FluentValidation.Results;

namespace DavidLievrouw.Utils.MSBuild.Tasks {
  public class Models {
    public static readonly ValidationResult ValidationResultSuccess = new ValidationResult();
    public static readonly ValidationResult ValidationResultFailure = new ValidationResult(new[] {new ValidationFailure("FakeProp", "FakeError")});
    public static readonly ValidationException ValidationException = new ValidationException(ValidationResultFailure.Errors);
  }
}


text:
cask :v1 => 'caprine' do
  version '0.2.0'
  sha256 'e51adb5283277f4f6c207143491940cb72f126d1bfcd97dca35ee51fd77478c0'

  url "https://github.com/sindresorhus/caprine/releases/download/#{version}/Caprine-osx-#{version}.zip"
  appcast 'https://github.com/sindresorhus/caprine/releases.atom'
  name 'Caprine'
  homepage 'https://github.com/sindresorhus/caprine'
  license :mit

  app 'Caprine.app'
end


text:
package edu.utep.cs.jasg.testFramework;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/** Compares if the content of two text files is equal. */
public class FileComparator {

	public static boolean areEqual(String file1, String file2){

		Path file1Path = Paths.get(file1);
		Path file2Path = Paths.get(file2);

		Charset charset = Charset.forName("US-ASCII");
		try (
				BufferedReader reader1 = Files.newBufferedReader(file1Path, charset);
				BufferedReader reader2 = Files.newBufferedReader(file2Path, charset);
				) {
			String file1Line = null;
			String file2Line = null;
			while ((file1Line = reader1.readLine()) != null
					&& (file2Line = reader2.readLine()) != null) {
				//System.out.println(file1Line);
				//System.out.println(file2Line);
				if(!file1Line.equals(file2Line))
					return false;
			}
		} catch (IOException x) {
			System.err.format("IOException: %s%n", x);
			return false;
		}
		return true;
	}

}


text:
package com.moebuff.discord.utils.reflect;

import com.moebuff.discord.utils.UnhandledException;
import org.apache.commons.lang3.reflect.FieldUtils;

import java.lang.reflect.Field;

/**
 * 字段工具,简化了反射操作,但这并不意味着会提高执行效率,若方法搭配不好反而会降低甚至引发错误。
 *
 * @author muto
 * @see FieldUtils
 */
public class FieldKit {
    /**
     * 在类中获取已被声明的字段,若字段并非公共成员,则取消 Java 语言访问检查。
     *
     * @param c         被反射的类,不能为null
     * @param fieldName 字段名
     * @return 若字段未被声明,则返回null
     * @throws IllegalArgumentException if the class is {@code null}, or the field name is blank or empty
     */
    public static Field getDeclaredField(Class<?> c, String fieldName) {
        return FieldUtils.getDeclaredField(c, fieldName, true);
    }

    /**
     * 移除final修饰符。需要注意的是,对于String和基本类型的静态常量,JVM通常会将代码中对此常量引用的地方替换成相应的值。
     */
    public static void removeFinalModifier(Field f) {
        Field m = getDeclaredField(Field.class, "modifiers");
        if (MemberUtils.isFinal(m)) {
            writeField(m, f, f.getModifiers() & MemberUtils.NOT_FINAL);
            return;
        }

        //The "modifiers" is not a field in the Field class on Android.
        if (m == null) f.setAccessible(true);
    }

    // write field
    //==========================================================================================

    /**
     * Writes a {@link Field}.
     *
     * @param f      to write
     * @param target the object to call on, may be {@code null} for {@code static} fields
     * @param value  to set
     * @throws IllegalArgumentException if the field is {@code null} or {@code value} is not assignable
     * @throws UnhandledException       if the field is {@code final}
     */
    public static void writeField(Field f, Object target, Object value) {
        try {
            FieldUtils.writeField(f, target, value, true);
        } catch (IllegalAccessException e) {
            throw new UnhandledException(e);
        }
    }

    /**
     * Writes a {@link Field}. Only the specified class will be considered.
     *
     * @param fieldName the field name to obtain
     * @param target    the object to reflect, must not be {@code null}
     * @param value     to set
     * @throws IllegalArgumentException if {@code target} is {@code null},
     *                                  {@code fieldName} is blank or empty or could not be found,
     *                                  or {@code value} is not assignable
     */
    public static void writeField(String fieldName, Object target, Object value) {
        try {
            FieldUtils.writeDeclaredField(target, fieldName, value, true);
        } catch (IllegalAccessException e) {
            throw new UnhandledException(e);//理论上这个错误不会出现
        }
    }

    /**
     * 修改一个静态字段。该方法与执行 {@code writeField(f, null, value)} 的结果相同。
     *
     * @param f     to write
     * @param value to set
     * @see #writeField(Field, Object, Object)
     */
    public static void writeStaticField(Field f, Object value) {
        writeField(f, null, value);
    }

    /**
     * 修改一个静态字段,该字段由 fieldName 指定并在类中已被声明。
     *
     * @param c         被反射的类,不能为null
     * @param fieldName 字段名
     * @param value     to set
     * @see #writeField(Field, Object, Object)
     * @see #getDeclaredField(Class, String)
     */
    public static void writeStaticField(Class<?> c, String fieldName, Object value) {
        writeField(getDeclaredField(c, fieldName), null, value);
    }

    /**
     * 修改常量。在执行 {@link #writeField(Field, Object, Object)} 前移除了final修饰符。
     *
     * @param f      to write
     * @param target the object to call on, may be {@code null} for {@code static} fields
     * @param value  to set
     * @see #removeFinalModifier(Field)
     */
    public static void writeConstant(Field f, Object target, Object value) {
        removeFinalModifier(f);
        writeField(f, target, value);
    }

    /**
     * 修改一个在 {@code target} 对象所表示的类中已被声明的常量。
     *
     * @param fieldName 字段名
     * @param target    将被放射的对象,不能为null
     * @param value     to set
     * @see #writeConstant(Field, Object, Object)
     * @see #getDeclaredField(Class, String)
     */
    public static void writeConstant(String fieldName, Object target, Object value) {
        writeConstant(getDeclaredField(target.getClass(), fieldName), target, value);
    }

    /**
     * 修改一个静态常量。该方法与执行 {@code writeConstant(f, null, value)} 的结果相同。
     *
     * @param f     to write
     * @param value to set
     * @see #writeConstant(Field, Object, Object)
     */
    public static void writeStaticConstant(Field f, Object value) {
        writeConstant(f, null, value);
    }

    /**
     * 修改一个静态常量,该字段由 fieldName 指定并在类中已被声明。
     *
     * @param c         被反射的类,不能为null
     * @param fieldName 字段名
     * @param value     to set
     * @see #writeConstant(Field, Object, Object)
     * @see #getDeclaredField(Class, String)
     */
    public static void writeStaticConstant(Class<?> c, String fieldName, Object value) {
        writeConstant(getDeclaredField(c, fieldName), null, value);
    }

    // read field
    //==========================================================================================

    /**
     * Reads a {@link Field}.
     *
     * @param f      the field to use
     * @param target the object to call on, may be {@code null} for {@code static} fields
     * @return the field value
     * @throws IllegalArgumentException if the field is {@code null}
     */
    public static Object readField(Field f, Object target) {
        try {
            return FieldUtils.readField(f, target, true);
        } catch (IllegalAccessException e) {
            throw new UnhandledException(e);//理论上这个错误不会出现
        }
    }

    /**
     * Gets a {@link Field} value by name. Only the class of the specified object will be considered.
     *
     * @param target    the object to reflect, must not be {@code null}
     * @param fieldName the field name to obtain
     * @return the Field object
     * @throws IllegalArgumentException if {@code target} is {@code null},or the field name is blank
     *                                  or empty or could not be found
     */
    public static Object readField(String fieldName, Object target) {
        try {
            return FieldUtils.readDeclaredField(target, fieldName, true);
        } catch (IllegalAccessException e) {
            throw new UnhandledException(e);//理论上这个错误不会出现
        }
    }

    /**
     * 获取静态字段的值。该方法与执行 {@code readField(f, null)} 的结果相同。
     *
     * @param f 将被读取的字段
     * @return 静态字段的值
     * @see #readField(Field, Object)
     */
    public static Object readStaticField(Field f) {
        return readField(f, null);
    }

    /**
     * Reads the named {@code static} {@link Field}. Superclasses will be considered.
     *
     * @param c         the {@link Class} to reflect, must not be {@code null}
     * @param fieldName the field name to obtain
     * @return the Field object
     * @throws IllegalArgumentException if the class is {@code null}, or the field name is blank or empty,
     *                                  is not {@code static}, or could not be found
     */
    public static Object readStaticField(Class<?> c, String fieldName) {
        try {
            return FieldUtils.readStaticField(c, fieldName, true);
        } catch (IllegalAccessException e) {
            throw new UnhandledException(e);//理论上这个错误不会出现
        }
    }
}


text:
namespace chromeos {
namespace ime {
namespace rulebased {

class RulesData;

enum Modifiers {
  MODIFIER_NONE = 0,
  MODIFIER_SHIFT = 1 << 0,
  MODIFIER_ALTGR = 1 << 1,
  MODIFIER_CAPSLOCK = 1 << 2,
};

struct ProcessKeyResult {
  bool key_handled = false;
  std::string commit_text;
  std::string composition_text;
};

class Engine {
 public:
  Engine();

  Engine(const Engine&) = delete;
  Engine& operator=(const Engine&) = delete;

  ~Engine();

  static bool IsImeSupported(const std::string& id);

  void Activate(const std::string& id);
  void Reset();
  ProcessKeyResult ProcessKey(mojom::DomCode code, uint8_t modifier_state);

 private:
  void ClearHistory();
  ProcessKeyResult ProcessBackspace();

  std::unique_ptr<const RulesData> current_data_;
  std::string current_id_;

  // Current state.
  // The current context (composition).
  std::string context_;
  // The current transat position.
  // Refers to RulesData::Transform for details about transat.
  int transat_ = -1;

  // History state.
  // The history context, before entering ambiguous transforms.
  std::string history_context_;
  // The history transat, before entering ambiguous transforms.
  int history_transat_ = -1;
  // The history ambiguous string which matches the history prune regexp.
  std::string history_ambi_;
};

}  // namespace rulebased
}  // namespace ime
}  // namespace chromeos

#endif  // ASH_SERVICES_IME_PUBLIC_CPP_RULEBASED_ENGINE_H_


text:
namespace chrono {
namespace fea {

ChLoadContactSurfaceMesh::ChLoadContactSurfaceMesh(std::shared_ptr<ChContactSurfaceMesh> cmesh) : contactmesh(cmesh) {}

void ChLoadContactSurfaceMesh::OutputSimpleMesh(std::vector<ChVector<>>& vert_pos,
                                                std::vector<ChVector<>>& vert_vel,
                                                std::vector<ChVector<int>>& triangles) {
    vert_pos.clear();
    vert_vel.clear();
    triangles.clear();
    size_t vertex_index = 0;
    auto trilist = this->contactmesh->GetTriangleList();
    // auxiliary map container to go from pointer-based mesh to index-based mesh:
    std::map<ChNodeFEAxyz*, size_t> ptr_ind_map;
    for (size_t i = 0; i < trilist.size(); ++i) {
        if (!ptr_ind_map.count(trilist[i]->GetNode1().get())) {
            ptr_ind_map.insert({trilist[i]->GetNode1().get(), vertex_index});
            vert_pos.push_back(trilist[i]->GetNode1()->GetPos());
            vert_vel.push_back(trilist[i]->GetNode1()->GetPos_dt());
            ++vertex_index;
        }
        if (!ptr_ind_map.count(trilist[i]->GetNode2().get())) {
            ptr_ind_map.insert({trilist[i]->GetNode2().get(), vertex_index});
            vert_pos.push_back(trilist[i]->GetNode2()->GetPos());
            vert_vel.push_back(trilist[i]->GetNode2()->GetPos_dt());
            ++vertex_index;
        }
        if (!ptr_ind_map.count(trilist[i]->GetNode3().get())) {
            ptr_ind_map.insert({trilist[i]->GetNode3().get(), vertex_index});
            vert_pos.push_back(trilist[i]->GetNode3()->GetPos());
            vert_vel.push_back(trilist[i]->GetNode3()->GetPos_dt());
            ++vertex_index;
        }
    }
    for (size_t i = 0; i < trilist.size(); ++i) {
        triangles.push_back(ChVector<int>((int)ptr_ind_map.at(trilist[i]->GetNode1().get()),
                                          (int)ptr_ind_map.at(trilist[i]->GetNode2().get()),
                                          (int)ptr_ind_map.at(trilist[i]->GetNode3().get())));
    }
}

void ChLoadContactSurfaceMesh::InputSimpleForces(const std::vector<ChVector<>> vert_forces,
                                                 const std::vector<int> vert_ind) {
    // check the vert_forces and vert_ind arrays must have same size:
    assert(vert_forces.size() == vert_ind.size());
    // reset the previously applied forces if any:
    this->forces.clear();

    // prepare auxiliary map container to go from index-based mesh to pointer-based mesh:
    size_t vertex_index = 0;
    auto trilist = this->contactmesh->GetTriangleList();
    std::map<ChNodeFEAxyz*, size_t> ptr_ind_map;
    std::vector<std::shared_ptr<ChNodeFEAxyz>> ind_ptr_map;
    for (size_t i = 0; i < trilist.size(); ++i) {
        if (!ptr_ind_map.count(trilist[i]->GetNode1().get())) {
            ptr_ind_map.insert({trilist[i]->GetNode1().get(), vertex_index});
            ind_ptr_map.push_back(trilist[i]->GetNode1());
            ++vertex_index;
        }
        if (!ptr_ind_map.count(trilist[i]->GetNode2().get())) {
            ptr_ind_map.insert({trilist[i]->GetNode2().get(), vertex_index});
            ind_ptr_map.push_back(trilist[i]->GetNode2());
            ++vertex_index;
        }
        if (!ptr_ind_map.count(trilist[i]->GetNode3().get())) {
            ptr_ind_map.insert({trilist[i]->GetNode3().get(), vertex_index});
            ind_ptr_map.push_back(trilist[i]->GetNode3());
            ++vertex_index;
        }
    }
    // Populate the array of applied loads to nodes
    for (size_t i = 0; i < vert_forces.size(); ++i) {
        std::shared_ptr<ChNodeFEAxyz> mnode = ind_ptr_map[vert_ind[i]];
        auto mforce = std::make_shared<ChLoadXYZnode>(mnode);
        mforce->loader.SetForce(vert_forces[i]);
        this->forces.push_back(mforce);
    }
}

void ChLoadContactSurfaceMesh::SetContactMesh(std::shared_ptr<ChContactSurfaceMesh> mmesh) {
    contactmesh = mmesh;
    forces.clear();
}

// -----------------------------------------------------------------------------

int ChLoadContactSurfaceMesh::LoadGet_ndof_x() {
    int ndoftot = 0;
    for (int i = 0; i < forces.size(); ++i)
        ndoftot += forces[i]->LoadGet_ndof_x();
    return ndoftot;
}

int ChLoadContactSurfaceMesh::LoadGet_ndof_w() {
    int ndoftot = 0;
    for (int i = 0; i < forces.size(); ++i)
        ndoftot += forces[i]->LoadGet_ndof_w();
    return ndoftot;
}

void ChLoadContactSurfaceMesh::LoadGetStateBlock_x(ChState& mD) {
    int ndoftot = 0;
    for (int i = 0; i < forces.size(); ++i) {
        forces[i]->loader.GetLoadable()->LoadableGetStateBlock_x(ndoftot, mD);
        ndoftot += forces[i]->loader.GetLoadable()->LoadableGet_ndof_x();
    }
}

void ChLoadContactSurfaceMesh::LoadGetStateBlock_w(ChStateDelta& mD) {
    int ndoftot = 0;
    for (int i = 0; i < forces.size(); ++i) {
        forces[i]->loader.GetLoadable()->LoadableGetStateBlock_w(ndoftot, mD);
        ndoftot += forces[i]->loader.GetLoadable()->LoadableGet_ndof_w();
    }
}

void ChLoadContactSurfaceMesh::LoadStateIncrement(const ChState& x, const ChStateDelta& dw, ChState& x_new) {
    int ndoftotx = 0;
    int ndoftotw = 0;
    for (int i = 0; i < forces.size(); ++i) {
        forces[i]->loader.GetLoadable()->LoadableStateIncrement(ndoftotx, x_new, x, ndoftotw, dw);
        ndoftotx += forces[i]->loader.GetLoadable()->LoadableGet_ndof_x();
        ndoftotw += forces[i]->loader.GetLoadable()->LoadableGet_ndof_w();
    }
}

// -----------------------------------------------------------------------------

void ChLoadContactSurfaceMesh::ComputeQ(ChState* state_x, ChStateDelta* state_w) {
    for (int i = 0; i < forces.size(); ++i) {
        forces[i]->ComputeQ(state_x, state_w);
    }
}

void ChLoadContactSurfaceMesh::ComputeJacobian(ChState* state_x,
                                               ChStateDelta* state_w,
                                               ChMatrix<>& mK,
                                               ChMatrix<>& mR,
                                               ChMatrix<>& mM) {
    for (int i = 0; i < forces.size(); ++i) {
        forces[i]->ComputeJacobian(state_x, state_w, mK, mR, mM);
    }
}

// -----------------------------------------------------------------------------

void ChLoadContactSurfaceMesh::CreateJacobianMatrices() {
    for (int i = 0; i < forces.size(); ++i) {
        forces[i]->CreateJacobianMatrices();
    }
}

void ChLoadContactSurfaceMesh::LoadIntLoadResidual_F(ChVectorDynamic<>& R, const double c) {
    for (int i = 0; i < forces.size(); ++i) {
        forces[i]->LoadIntLoadResidual_F(R, c);
    }
}

void ChLoadContactSurfaceMesh::InjectKRMmatrices(ChSystemDescriptor& mdescriptor) {
    for (int i = 0; i < forces.size(); ++i) {
        forces[i]->InjectKRMmatrices(mdescriptor);
    }
}

void ChLoadContactSurfaceMesh::KRMmatricesLoad(double Kfactor, double Rfactor, double Mfactor) {
    for (int i = 0; i < forces.size(); ++i) {
        forces[i]->KRMmatricesLoad(Kfactor, Rfactor, Mfactor);
    }
}

}  // end namespace fea
}  // end namespace chrono


text:
extern crate csv;

mod day01;
mod day02;


text:
grunt build
set NODE_ENV=production
export NODE_ENV=production
grunt build


text:
package com.dmdirc.ui.messages;

import com.dmdirc.config.binding.ConfigBinding;
import com.dmdirc.events.BaseChannelTextEvent;
import com.dmdirc.events.BaseQueryTextEvent;
import com.dmdirc.events.ChannelHighlightEvent;
import com.dmdirc.events.DisplayProperty;
import com.dmdirc.events.DisplayableEvent;
import com.dmdirc.events.QueryHighlightEvent;
import com.dmdirc.events.UnreadStatusChangedEvent;
import com.dmdirc.events.eventbus.EventBus;
import com.dmdirc.interfaces.WindowModel;
import com.dmdirc.util.colours.Colour;

import java.util.Optional;

import net.engio.mbassy.listener.Handler;

/**
 * Tracks unread messages and other notifications.
 */
public class UnreadStatusManagerImpl implements UnreadStatusManager {

    private final EventBus eventBus;
    private final WindowModel container;
    private final ColourManager colourManager;

    private int unreadLines;
    private Optional<Colour> notificationColour = Optional.empty();

    private Optional<Colour> miscellaneousColour = Optional.of(Colour.GREEN);
    private Optional<Colour> messageColour = Optional.of(Colour.BLUE);
    private Optional<Colour> highlightColour = Optional.of(Colour.RED);

    public UnreadStatusManagerImpl(final WindowModel container) {
        this.container = container;
        this.eventBus = container.getEventBus();
        this.colourManager = new ColourManagerImpl(container.getConfigManager());
    }

    @Handler
    public void handleDisplayableEvent(final DisplayableEvent event) {
        if (includeEvent(event)) {
            updateStatus(miscellaneousColour, unreadLines + 1);
        }
    }

    @Handler
    public void handleChannelTextEvent(final BaseChannelTextEvent event) {
        if (includeEvent(event)) {
            updateStatus(messageColour);
        }
    }

    @Handler
    public void handleQueryTextEvent(final BaseQueryTextEvent event) {
        if (includeEvent(event)) {
            updateStatus(messageColour);
        }
    }

    @Handler
    public void handleChannelHighlightEvent(final ChannelHighlightEvent event) {
        if (includeEvent(event)) {
            updateStatus(highlightColour);
        }
    }

    @Handler
    public void handleQueryHighlightEvent(final QueryHighlightEvent event) {
        if (includeEvent(event)) {
            updateStatus(highlightColour);
        }
    }

    private boolean includeEvent(final DisplayableEvent event) {
        return event.getSource().equals(container)
                && !event.getDisplayProperty(DisplayProperty.DO_NOT_DISPLAY).orElse(false);
    }

    @Override
    public int getUnreadLines() {
        return unreadLines;
    }

    @Override
    public Optional<Colour> getNotificationColour() {
        return notificationColour;
    }

    @Override
    public void clearStatus() {
        updateStatus(Optional.empty(), 0);
    }

    private void updateStatus(final Optional<Colour> desiredColour) {
        updateStatus(desiredColour, unreadLines);
    }

    private void updateStatus(final Optional<Colour> desiredColour, final int newUnreadCount) {
        final Optional<Colour> newColour = getBestColour(desiredColour, notificationColour);
        final boolean updated = !newColour.equals(notificationColour)
                || newUnreadCount != unreadLines;
        notificationColour = newColour;
        unreadLines = newUnreadCount;

        if (updated) {
            publishChangedEvent();
        }
    }

    private Optional<Colour> getBestColour(
            final Optional<Colour> desiredColour,
            final Optional<Colour> existingColour) {
        if (!desiredColour.isPresent()) {
            // If we're trying to explicitly reset, go with the empty one.
            return desiredColour;
        }

        if (desiredColour.equals(highlightColour)
                || !existingColour.isPresent()
                || existingColour.equals(miscellaneousColour)) {
            return desiredColour;
        } else {
            return existingColour;
        }
    }

    @ConfigBinding(domain = "ui", key = "miscellaneousNotificationColour")
    void handleMiscellaneousColour(final String colour) {
        final Optional<Colour> newColour = Optional.ofNullable(
                colourManager.getColourFromString(colour, Colour.GREEN));
        if (notificationColour.equals(miscellaneousColour)) {
            notificationColour = newColour;
            publishChangedEvent();
        }
        miscellaneousColour = newColour;
    }

    @ConfigBinding(domain = "ui", key = "messageNotificationColour")
    void handleMessageColour(final String colour) {
        final Optional<Colour> newColour = Optional.ofNullable(
                colourManager.getColourFromString(colour, Colour.BLUE));
        if (notificationColour.equals(messageColour)) {
            notificationColour = newColour;
            publishChangedEvent();
        }
        messageColour = newColour;
    }

    @ConfigBinding(domain = "ui", key = "highlightNotificationColour")
    void handleHighlightColour(final String colour) {
        final Optional<Colour> newColour = Optional.ofNullable(
                colourManager.getColourFromString(colour, Colour.RED));
        if (notificationColour.equals(highlightColour)) {
            notificationColour = newColour;
            publishChangedEvent();
        }
        highlightColour = newColour;
    }

    private void publishChangedEvent() {
        eventBus.publishAsync(new UnreadStatusChangedEvent(container, this, notificationColour,
                unreadLines));
    }

}


text:
Jerms' Blog
====
The source code for Jeremy's awesome blog!

# License
---

The source code uses the MIT license because MIT is cool.

# The Source
----

The website is statically generated using [HarpJS](http://harpjs.com/). All of the pages are written with the
[Jade templating language](http://jade-lang.com/). Moreover, the server is run and compiled using a custom script
through [NodeJS](http://nodejs.org/).

The preview server and compilation must be run through the custom scripts because of the custom hashtag filtering
support.

# Running the server
----

To run the server and the plugins I wrote for the server, you'll need Harp and fs.extra.

```
	npm install harp fs.extra
```

After doing that, you can run the server using

```
    node server.js --port 80
```

The server should dynamically regenerate the site when changes are made. Also, the server should also generate
new pages for hashtag searches, or add new posts to existing hashtag pages. The filtered pages
are generated in the filter folder and can be accessed using a URL in the format

```
    <Base>/filter/<Hashtag>
```

To build the website, run

```
    node server.js build
```

# Creating new posts
----

Creating posts is a tedious and repetitive process, involving dating and naming folders appropriately, adding
the appropriate metadata to the _data.json file. Instead, I wrote a simple script that allows the addition
and removal of new posts. Namely, post.js

To create a new post, simply run

```
    node post.js <Title> <Description> <Tags> <Banner>
```

Title is pretty self-explanatory. It's the title of your post.

Description, also self-explanatory.

Tags are simply hashtags that will be used by your post. They're made into links on each
post and simply filter out posts with the same hashtag. To define hashtags for a particular
post, simply use a string in the form

```
	"#c++ #programming #mathematics"
```

Banner refers to a banner image to use for the post. Make sure you define one, otherwise your
default banner will be this:

![There was an image here. It's no longer here.]( http://goo.gl/fSV1oN )

The script will create a new folder with a [title].jade file and add  the new post at the top of the JSON data.

# About the server.js and post.js scripts
---

The server.js and post.js scripts uses NodeJS to function properly. Moreover, the two scripts use
synchronous calls rather than asynchronous calls to simplify its development. Also, the two are meant to
be run in the command line anyway, so it's okay.

# Excelsior
---

![](http://i.imgur.com/wT4KmJp.gif)


text:
<title>Cancelar Solicitud de Acceso a Sistemas de Información </title>

         <link href="<?= base_url(); ?>webroot/orgchart/css/jquery.orgchart.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">

                    Cancelar Solicitud de acceso a sistemas de Información

            <a class="btn-floating btn-large tooltipped" data-tooltip="Regresar" data-position="top" data-delay="50" href="<?=base_url().'/accesoSistemas/acceso_si_rh'?>">
                undo

            <button class="btn-floating btn-large white tooltipped scrollToTop" data-tooltip="Scroll to top" data-position="top" data-delay="50">
          keyboard_arrow_up
            </button>

                <?php
                $numSol=$this->session->userdata('NumSol');
                ?>
                No. de Solicitud
                <input name="noSolicitud" id="noSolicitud" type="text" value="<?=$numSol?>" class="black-text" readonly="readonly">

                Motivo de Cancelacion
               <input name="motivoCan" id="motivoCan" type="text" value="" class="black-text">

                <button class="btn"  onclick="cancelarSolicitudRH()">Cancelar Solicitud</button>


text:
Waffle Negotiate Setup Instructions Using Cargo Plugin
======================================================

Cargo Plugin currently configured for tomcat 8.5.x.

To deploy using cargo plugin to tomcat 8.5.x

- Build the application

    mvn clean package

- To run cargo

    mvn cargo:run

- The app will be available at:

    http://localhost:8080/waffle-negotiate/

- Use 'admin' as logon without any password to test the negotiate


text:
/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package functioncalls.plugin;

import functioncalls.graph.*;
import ghidra.graph.viewer.GraphPerspectiveInfo;
import ghidra.program.model.listing.Function;

/**
 * This class allows clients to retrieve and work on the graph and its related data.  Also,
 * this class makes caching the data herein simple.
 */
interface FcgData {

	/**
	 * The function of this data
	 * @return the function
	 */
	Function getFunction();

	/**
	 * The graph of this data
	 *
	 * @return the graph
	 */
	FunctionCallGraph getGraph();

	/**
	 * Returns the cache of {@link Function} edges.  These edges are not in the graph, but
	 * rather are simple edges that represent a link between two functions.  This is used to
	 * track existing edges that are not yet in the graph, which may be added later as the
	 * relevant nodes are inserted into the graph.
	 *
	 * @return the cache
	 */
	FunctionEdgeCache getFunctionEdgeCache();

	/**
	 * True if this data has a valid function
	 * @return true if this data has a valid function
	 */
	boolean hasResults();

	/**
	 * False if the graph in this data has not yet been loaded
	 * @return false if the graph in this data has not yet been loaded
	 */
	boolean isInitialized();

	/**
	 * Dispose the contents of this data
	 */
	void dispose();

	/**
	 * Returns the view's graph perspective.  This is used by the view to restore itself.
	 * @return the view's graph perspective
	 */
	GraphPerspectiveInfo<FcgVertex, FcgEdge> getGraphPerspective();

	/**
	 * Sets the view information for this graph data.  This will be later used by the view
	 * to restore itself.
	 *
	 * @param info the perspective
	 */
	void setGraphPerspective(GraphPerspectiveInfo<FcgVertex, FcgEdge> info);

	/**
	 * Returns true if this data's function is equal to the given function
	 *
	 * @param f the function to test
	 * @return true if this data's function is equal to the given function
	 */
	boolean isFunction(Function f);
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DreamNucleus.Commands.Results;

namespace DreamNucleus.Commands.Playground
{
    public class LongCommand : ISuccessResult<LongCommand, long>
    {
        public int Id { get; set; }

        public LongCommand(int id)
        {
            Id = id;
        }

        public LongCommand()
        {
        }
    }

    public class LongCommandHandler : IAsyncCommandHandler<LongCommand, long>
    {
        public async Task<long> ExecuteAsync(LongCommand command)
        {
            await Task.Delay(1);
            return 1;
        }
    }
}


text:
HTABLE_SPARSE(strmap, uint32_t, char *);

static inline uint32_t strhashf(const char **a) {
  return hash32(*a, strlen(*a));
}

static inline int strcmpf(const char **a, const char **b) {
  return strcmp(*a, *b);
}

IMPLEMENT_HTABLE_SPARSE(static inline, strmap, uint32_t, char *, strhashf, strcmpf);

struct linemap_entry {
  int32_t dst_line;
  uint32_t dst_file_id;
};

struct linemap {
  char *data;
  size_t len;

  struct linemap_entry *entries; // length: max_src_line + 1
  size_t max_src_line;

  struct strmap file_ids; // keys points in `data`
  uint32_t next_file_id;
  char **file_names; // points in `data`
  size_t file_names_needed_space;
};

int linemap_read(struct linemap *linemap, const char *dir, const char *base_fn,
                 uint32_t primary_file, uint32_t first_additional_n_file);
void linemap_destroy(struct linemap *linemap);
int32_t linemap_lookup(uint32_t *file, const struct linemap *linemap, int32_t src_line);


text:
/*
pdb-rmsd computes the RMSD between two sets of carbon-alpha ATOM records read
from PDB files. Namely, each set of ATOM records is specified by a four-tuple:
a PDB file path, a chain identifier, and an inclusive range of residue indices.
Notably, both sets of cabon-alpha ATOM records must be exactly the same size.

A PDB file may either be plain text or compressed using the Lempel-Ziv coding
(i.e., gzip). If the PDB file is gzipped, it must end with a '.gz' extension.

Usage:
	pdb-rmsd pdb-file chain-id start stop pdb-file chain-id start stop

Details

The algorithm used to compute RMSD is based on the Kabsch algorithm for
computing the optimal rotational matrix which minimizes RMSD between two paired
sets of points.

More precisely, the algorithm is described in great detail here:
http://cnx.org/content/m11608/latest/#MatrixAlignment.
*/
package main


text:
#ifndef __mdsObject_h_
#define __mdsObject_h_

#include <string>
#include <vector>

#include "mdoProxyInterface.h"
#include "mdsDatabaseAPI.h"

namespace mds
{

/** This class represent an object in the local database */
class Object : public mdo::ProxyInterface
{
public:

  Object();
  ~Object();

  void MarkAsDirty();

protected:
  bool m_MarkDirty;

};

} // end namespace

#endif // _mdsObject_h_


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='MALTRow',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('month', models.DateField(db_index=True)),
                ('user_id', models.TextField()),
                ('username', models.TextField()),
                ('email', models.EmailField(max_length=75)),
                ('is_web_user', models.BooleanField(default=False)),
                ('domain_name', models.TextField(db_index=True)),
                ('num_of_forms', models.PositiveIntegerField()),
                ('app_id', models.TextField()),
                ('is_app_deleted', models.BooleanField(default=False)),
                ('wam', models.NullBooleanField(default=None)),
                ('pam', models.NullBooleanField(default=None)),
            ],
            options={
            },
            bases=(models.Model,),
        ),
        migrations.AlterUniqueTogether(
            name='maltrow',
            unique_together=set([('month', 'domain_name', 'user_id', 'app_id')]),
        ),
    ]


text:
/*============================================================================*
 *                              Header Files
 *============================================================================*/
#include <os_msg.h>
#include <os_task.h>
#include <gap.h>
#include <gap_le.h>
#include "ble_tizenrt_scatternet_app_task.h"
#include <app_msg.h>
#include "ble_tizenrt_scatternet_app.h"
#include "ble_tizenrt_app.h"
#include <stdio.h>
#include <basic_types.h>
#include <gap_msg.h>

/** @defgroup  SCATTERNET_APP_TASK Scatternet App Task
    * @brief This file handles the implementation of application task related functions.
    *
    * Create App task and handle events & messages
    * @{
    */
/*============================================================================*
 *                              Macros
 *============================================================================*/
#define BLE_TIZENRT_SCATTERNET_APP_TASK_PRIORITY             5         /* Task priorities */
#define BLE_TIZENRT_SCATTERNET_APP_TASK_STACK_SIZE           256 * 4   /* Task stack size */
#define BLE_TIZENRT_SCATTERNET_CALLBACK_TASK_PRIORITY        BLE_TIZENRT_SCATTERNET_APP_TASK_PRIORITY         /* Task priorities */
#define BLE_TIZENRT_SCATTERNET_CALLBACK_TASK_STACK_SIZE      256 * 8   /* Task stack size */
#define BLE_TIZENRT_SCATTERNET_MAX_NUMBER_OF_GAP_MESSAGE     0x20      /* GAP message queue size */
#define BLE_TIZENRT_SCATTERNET_MAX_NUMBER_OF_IO_MESSAGE      0x20      /* IO message queue size */
#define BLE_TIZENRT_SCATTERNET_MAX_NUMBER_OF_EVENT_MESSAGE   (BLE_TIZENRT_SCATTERNET_MAX_NUMBER_OF_GAP_MESSAGE + BLE_TIZENRT_SCATTERNET_MAX_NUMBER_OF_IO_MESSAGE)    /* Event message queue size */
#define BLE_TIZENRT_SCATTERNET_MAX_NUMBER_OF_CALLBACK_MESSAGE      0x20      /* IO message queue size */

/*============================================================================*
 *                              Variables
 *============================================================================*/
void *ble_tizenrt_scatternet_app_task_handle = NULL;   /* APP Task handle */
void *ble_tizenrt_scatternet_evt_queue_handle = NULL;  /* Event queue handle */
void *ble_tizenrt_scatternet_io_queue_handle = NULL;   /* IO queue handle */

void *ble_tizenrt_scatternet_callback_task_handle = NULL;   /* Callback Task handle */
void *ble_tizenrt_scatternet_callback_queue_handle = NULL;  /* Callback Queue handle */

static void *start_bt_stack_sem_handle = NULL;
extern T_GAP_DEV_STATE ble_tizenrt_scatternet_gap_dev_state;

/*============================================================================*
 *                              Functions
 *============================================================================*/
/**
 * @brief        App task to handle events & messages
 * @param[in]    p_param    Parameters sending to the task
 * @return       void
 */
void ble_tizenrt_scatternet_app_main_task(void *p_param)
{
    (void)p_param;
    uint8_t event;

    os_sem_give(start_bt_stack_sem_handle);

    data_uart_init(ble_tizenrt_scatternet_evt_queue_handle, ble_tizenrt_scatternet_io_queue_handle);
    while (true)
    {
        if (os_msg_recv(ble_tizenrt_scatternet_evt_queue_handle, &event, 0xFFFFFFFF) == true)
        {
            if (event == EVENT_IO_TO_APP)
            {
                T_IO_MSG io_msg;
                if (os_msg_recv(ble_tizenrt_scatternet_io_queue_handle, &io_msg, 0) == true)
                {
                    ble_tizenrt_scatternet_app_handle_io_msg(io_msg);
                }
            }
            else
            {
                gap_handle_msg(event);
            }
        }
    }
    debug_print("Init Success \n");
}

void ble_tizenrt_scatternet_callback_main_task(void *p_param)
{
    (void)p_param;
    T_TIZENRT_APP_CALLBACK_MSG callback_msg;

    while (true)
    {
        if (os_msg_recv(ble_tizenrt_scatternet_callback_queue_handle, &callback_msg, 0xFFFFFFFF) == true)
        {
            debug_print("Recieve msg type %d \n", callback_msg.type);
            ble_tizenrt_scatternet_handle_callback_msg(callback_msg);
        }
    }
}
/**
 * @brief  Initialize App task
 * @return void
 */
void ble_tizenrt_scatternet_app_task_init(void)
{
    os_msg_queue_create(&ble_tizenrt_scatternet_io_queue_handle, BLE_TIZENRT_SCATTERNET_MAX_NUMBER_OF_IO_MESSAGE,
                            sizeof(T_IO_MSG));
    os_msg_queue_create(&ble_tizenrt_scatternet_evt_queue_handle, BLE_TIZENRT_SCATTERNET_MAX_NUMBER_OF_EVENT_MESSAGE,
                            sizeof(uint8_t));

    os_msg_queue_create(&ble_tizenrt_scatternet_callback_queue_handle, BLE_TIZENRT_SCATTERNET_MAX_NUMBER_OF_CALLBACK_MESSAGE,
                            sizeof(T_TIZENRT_APP_CALLBACK_MSG));

    os_sem_create(&start_bt_stack_sem_handle, 0, 1);

    os_task_create(&ble_tizenrt_scatternet_app_task_handle, "ble_scatternet_app", ble_tizenrt_scatternet_app_main_task,
                        0, BLE_TIZENRT_SCATTERNET_APP_TASK_STACK_SIZE, BLE_TIZENRT_SCATTERNET_APP_TASK_PRIORITY);
    os_task_create(&ble_tizenrt_scatternet_callback_task_handle, "scatternet_tizenrt_callback", ble_tizenrt_scatternet_callback_main_task,
                        0, BLE_TIZENRT_SCATTERNET_CALLBACK_TASK_STACK_SIZE, BLE_TIZENRT_SCATTERNET_CALLBACK_TASK_PRIORITY);

    if (os_sem_take(start_bt_stack_sem_handle, 0xFFFFFFFF) == true) {
        gap_start_bt_stack(ble_tizenrt_scatternet_evt_queue_handle, ble_tizenrt_scatternet_io_queue_handle,
                        BLE_TIZENRT_SCATTERNET_MAX_NUMBER_OF_GAP_MESSAGE);
        os_sem_delete(start_bt_stack_sem_handle);
        start_bt_stack_sem_handle = NULL;
    }
    debug_print("Init Done \n");
}

extern T_ATTRIB_APPL *tizenrt_ble_service_tbl;
extern uint32_t *scan_filter_tmr_handle;
extern void *ble_tizenrt_read_sem;
extern void *ble_tizenrt_write_sem;
extern void *ble_tizenrt_write_no_rsp_sem;
#if defined(CONFIG_BLE_INDICATION)
extern void *ble_tizenrt_indicate_sem;
#endif
extern void *ble_tizenrt_modify_whitelist_sem;
void ble_tizenrt_scatternet_app_task_deinit(void)
{
    if (ble_tizenrt_scatternet_io_queue_handle) {
        os_msg_queue_delete(ble_tizenrt_scatternet_io_queue_handle);
    }
    if (ble_tizenrt_scatternet_evt_queue_handle) {
        os_msg_queue_delete(ble_tizenrt_scatternet_evt_queue_handle);
    }
    if (ble_tizenrt_scatternet_app_task_handle) {
        os_task_delete(ble_tizenrt_scatternet_app_task_handle);
    }

    if (ble_tizenrt_scatternet_callback_queue_handle) {
        os_msg_queue_delete(ble_tizenrt_scatternet_callback_queue_handle);
    }
    if (ble_tizenrt_scatternet_callback_task_handle) {
        os_task_delete(ble_tizenrt_scatternet_callback_task_handle);
    }

    if (scan_filter_tmr_handle) {
        os_timer_delete(&scan_filter_tmr_handle);
    }
    if (ble_tizenrt_read_sem) {
        os_mutex_delete(ble_tizenrt_read_sem);
    }
    if (ble_tizenrt_write_sem) {
        os_mutex_delete(ble_tizenrt_write_sem);
    }
    if (ble_tizenrt_write_no_rsp_sem) {
        os_mutex_delete(ble_tizenrt_write_no_rsp_sem);
    }
#if defined(CONFIG_BLE_INDICATION)
    if (ble_tizenrt_indicate_sem) {
        os_mutex_delete(ble_tizenrt_indicate_sem);
    }
#endif
    if (ble_tizenrt_modify_whitelist_sem) {
        os_mutex_delete(ble_tizenrt_modify_whitelist_sem);
    }

    ble_tizenrt_scatternet_io_queue_handle = NULL;
    ble_tizenrt_scatternet_evt_queue_handle = NULL;
    ble_tizenrt_scatternet_app_task_handle = NULL;

    ble_tizenrt_scatternet_callback_task_handle = NULL;
    ble_tizenrt_scatternet_callback_queue_handle = NULL;

    os_mem_free(tizenrt_ble_service_tbl);

    ble_tizenrt_scatternet_gap_dev_state.gap_init_state = 0;
    ble_tizenrt_scatternet_gap_dev_state.gap_adv_sub_state = 0;
    ble_tizenrt_scatternet_gap_dev_state.gap_adv_state = 0;
    ble_tizenrt_scatternet_gap_dev_state.gap_scan_state = 0;
    ble_tizenrt_scatternet_gap_dev_state.gap_conn_state = 0;
}

/** @} */ /* End of group SCATTERNET_APP_TASK */