text:
using System;
using CubeWorld.Tiles;

namespace CubeWorld.World.Generator
{
    public class MidpointDisplacementWorldGenerator : CubeWorldGenerator
    {
        private byte tileType;
        public float roughness;
        private Random rnd = new Random();
        private float[,] map;
        private WorldSizeRelativeValue fromYRV;
        private WorldSizeRelativeValue toYRV;
        private int mapDimension;

        public MidpointDisplacementWorldGenerator(
            WorldSizeRelativeValue fromYRV,
            WorldSizeRelativeValue toYRV,
            float roughness,
			byte tileType)
        {
            this.fromYRV = fromYRV;
            this.toYRV = toYRV;
            this.roughness = roughness;
            this.tileType = tileType;
        }

        public override bool Generate(CubeWorld world)
        {
			TileManager tileManager = world.tileManager;

            int fromY = fromYRV.EvaluateInt(world);
            int toY = toYRV.EvaluateInt(world);

            width = tileManager.sizeX;
            height = tileManager.sizeZ;

            map = new float[width + 1, height + 1];

            //StartMidpointDisplacment();
            //Assign the four corners of the intial grid random color values
            //These will end up being the colors of the four corners of the applet.

            float c1, c2, c3, c4;
            c1 = (float)rnd.NextDouble();
            c2 = (float)rnd.NextDouble();
            c3 = (float)rnd.NextDouble();
            c4 = (float)rnd.NextDouble();

            DivideGrid(0, 0, width, height, c1, c2, c3, c4);

            for (int x = 0; x < tileManager.sizeX; x++)
            {
                for (int z = 0; z < tileManager.sizeZ; z++)
                {
                    float d = map[x, z];

                    int y = fromY + (int)(d * (toY - fromY));

                    while (y >= fromY)
                        tileManager.SetTileType(new TilePosition(x, y--, z), tileType);
                }
            }

            return true;
        }

        public override string ToString()
        {
            return "Filling terrain with midpoint displacement";
        }

        private int width;
        private int height;

        //Randomly displaces value for midpoint depending on size
        //of grid piece.
        float Displace(float num)
        {
            float max = num / (float)(width + height) * roughness;
            return ((float)rnd.NextDouble() - 0.5f) * max;
        }

        //This is the recursive function that implements the random midpoint
        //displacement algorithm.  It will call itself until the grid pieces
        //become smaller than one pixel.
        void DivideGrid(int x, int y, int width, int height, float c1, float c2, float c3, float c4)
        {
            float Edge1, Edge2, Edge3, Edge4, Middle;
            int newWidth = width / 2;
            int newHeight = height / 2;

            if (width > 1 || height > 1)
            {
                Middle = (c1 + c2 + c3 + c4) / 4 + Displace(newWidth + newHeight);	//Randomly displace the midpoint!
                Edge1 = (c1 + c2) / 2;	//Calculate the edges by averaging the two corners of each edge.
                Edge2 = (c2 + c3) / 2;
                Edge3 = (c3 + c4) / 2;
                Edge4 = (c4 + c1) / 2;

                //Make sure that the midpoint doesn't accidentally "randomly displaced" past the boundaries!
                if (Middle < 0)
                {
                    Middle = 0;
                }
                else if (Middle > 1.0f)
                {
                    Middle = 1.0f;
                }

                //Do the operation over again for each of the four new grids.
                DivideGrid(x, y, newWidth, newHeight, c1, Edge1, Middle, Edge4);
                DivideGrid(x + newWidth, y, newWidth, newHeight, Edge1, c2, Edge2, Middle);
                DivideGrid(x + newWidth, y + newHeight, newWidth, newHeight, Middle, Edge2, c3, Edge3);
                DivideGrid(x, y + newHeight, newWidth, newHeight, Edge4, Middle, Edge3, c4);
            }
            else	//This is the "base case," where each grid piece is less than the size of a pixel.
            {
                //The four corners of the grid piece will be averaged and drawn as a single pixel.
                float c = (c1 + c2 + c3 + c4) / 4;

                map[(int)x, (int)y] = c;
            }
        }

        private float normalize(float v)
        {
            if (v > 1.0f)
                v = 1.0f;
            else if (v < 0.0f)
                v = 0.0f;
            return v;
        }

        private void StartMidpointDisplacment()
        {
            mapDimension = width;

            float tr, tl, br, bl, center;

            // top left
            map[0, 0] = (float)rnd.NextDouble();
            tl = map[0, 0];

            // bottom left
            map[0, mapDimension] = (float)rnd.NextDouble();
            bl = map[0, mapDimension];

            // top right
            map[mapDimension, 0] = (float)rnd.NextDouble();
            tr = map[mapDimension, 0];

            // bottom right
            map[mapDimension, mapDimension] = (float)rnd.NextDouble();
            br = map[mapDimension, mapDimension];

            // Center
            map[mapDimension / 2, mapDimension / 2] = map[0, 0] + map[0, mapDimension] + map[mapDimension, 0] + map[mapDimension, mapDimension] / 4;
            map[mapDimension / 2, mapDimension / 2] = normalize(map[mapDimension / 2, mapDimension / 2]);
            center = map[mapDimension / 2, mapDimension / 2];

            map[mapDimension / 2, mapDimension] = bl + br + center / 3;
            map[mapDimension / 2, 0] = tl + tr + center / 3;
            map[mapDimension, mapDimension / 2] = tr + br + center / 3;
            map[0, mapDimension / 2] = tl + bl + center / 3;

            MidpointDisplacment(mapDimension);
        }

        private void MidpointDisplacment(int dimension)
        {
		    int newDimension = dimension / 2;
            float topRight, topLeft, bottomLeft, bottomRight, center;
            int i, j;

		    if (newDimension > 1){
			    for(i = newDimension; i <= width; i += newDimension){
				    for(j = newDimension; j <= height; j += newDimension)
                    {
					    int x = i - (newDimension / 2);
                        int y = j - (newDimension / 2);

					    topLeft = map[i - newDimension, j - newDimension];
					    topRight = map[i,j - newDimension];
					    bottomLeft = map[i - newDimension,j];
					    bottomRight = map[i,j];

					    // Center
					    map[x,y] = (topLeft + topRight + bottomLeft + bottomRight) / 4 + Displace(dimension);
					    map[x,y] = normalize(map[x,y]);
					    center = map[x,y];

					    // Top
					    if(j - (newDimension * 2) + (newDimension / 2) > 0){
						    map[x,j - newDimension] = (topLeft + topRight + center + map[x,j - dimension + (newDimension / 2)]) / 4 + Displace(dimension);;
					    }else{
						    map[x,j - newDimension] = (topLeft + topRight + center) / 3+ Displace(dimension);
					    }

					    map[x,j - newDimension] = normalize(map[x,j - newDimension]);

					    // Bottom
					    if(j + (newDimension / 2) < mapDimension){
						    map[x,j] = (bottomLeft + bottomRight + center + map[x,j + (newDimension / 2)]) / 4+ Displace(dimension);
					    }else{
						    map[x,j] = (bottomLeft + bottomRight + center) / 3+ Displace(dimension);
					    }

					    map[x,j] = normalize(map[x,j]);

					    //Right
					    if(i + (newDimension / 2) < mapDimension){
						    map[i,y] = (topRight + bottomRight + center + map[i + (newDimension / 2),y]) / 4+ Displace(dimension);
					    }else{
						    map[i,y] = (topRight + bottomRight + center) / 3+ Displace(dimension);
					    }

					    map[i,y] = normalize(map[i,y]);

					    // Left
					    if(i - (newDimension * 2) + (newDimension / 2) > 0){
						    map[i - newDimension,y] = (topLeft + bottomLeft + center + map[i - dimension + (newDimension / 2),y]) / 4 + Displace(dimension);;
					    }else{
						    map[i - newDimension,y] = (topLeft + bottomLeft + center) / 3+ Displace(dimension);
					    }

					    map[i - newDimension,y] = normalize(map[i - newDimension,y]);
				    }
			    }
			    MidpointDisplacment(newDimension);
		    }
	    }

    }
}


text:
function cdata = loadLayoutIcon(imagefilename,bgcol)
%loadLayoutIcon  Load an icon and set the transparent color
%
%   cdata = uiextras.loadLayoutIcon(filename) tries to load the icon specified by
%   filename. If the icon is a PNG file with transparency then transparent
%   pixels are set to NaN. If not, then any pixel that is pure green is set
%   to transparent (i.e. "green screen"). The resulting CDATA is an RGB
%   double array.
%
%   cdata = uiextras.loadLayoutIcon(filename,bgcol) tries to merge with the
%   specified background colour bgcol. Fully transparent pixels are still
%   set to NaN, but partially transparent ones are merged with the
%   background.
%
%   See also: IMREAD

%   Copyright 2005-2010 The MathWorks Ltd.
%   $Revision: 1.1 $
%   $Date: 2014/01/17 14:54:59 $

error( nargchk( 1, 2, nargin ) );
if nargin < 2
    bgcol = get( 0, 'DefaultUIControlBackgroundColor' );
end

% First try normally
this_dir = fileparts( mfilename( 'fullpath' ) );
icon_dir = fullfile( this_dir, 'Resources' );
if exist( imagefilename, 'file' )
    [cdata,map,alpha] = imread( imagefilename );
elseif exist( fullfile( icon_dir, imagefilename ), 'file' )
    [cdata,map,alpha] = imread( fullfile( icon_dir, imagefilename ));
else
    error( 'GUILayout:loadIcon:FileNotFound', 'Cannot open file ''%s''.', imagefilename );
end

if ~isempty( map )
    cdata = ind2rgb( cdata, map );
end

% Convert to double before applying transparency
cdata = convertToDouble( cdata );

[rows,cols,depth] = size( cdata ); %#ok<NASGU>
if ~isempty( alpha )
alpha = convertToDouble( alpha );
    f = find( alpha==0 );
    if ~isempty( f )
        cdata(f) = nan;
        cdata(f + rows*cols) = nan;
        cdata(f + 2*rows*cols) = nan;
    end

    % Now blend partial alphas
    f = find( alpha(:)>0 & alpha(:)<1 );
    if ~isempty(f)
        cdata(f) = cdata(f).*alpha(f) + bgcol(1)*(1-alpha(f));
        cdata(f + rows*cols) = cdata(f + rows*cols).*alpha(f) + bgcol(2)*(1-alpha(f));
        cdata(f + 2*rows*cols) = cdata(f + 2*rows*cols).*alpha(f) + bgcol(3)*(1-alpha(f));
    end

else
    % Instead do a "green screen", treating anything pure-green as transparent
    f = find((cdata(:,:,1)==0) & (cdata(:,:,2)==1) & (cdata(:,:,3)==0));
    cdata(f) = nan;
    cdata(f + rows*cols) = nan;
    cdata(f + 2*rows*cols) = nan;

end

%-------------------------------------------------------------------------%
function cdata = convertToDouble( cdata )
% Convert an image to double precision in the range 0 to 1
switch lower( class( cdata ) )
    case 'double'
    % Do nothing
    case 'single'
        cdata = double( cdata );
    case 'uint8'
        cdata = double( cdata ) / 255;
    case 'uint16'
        cdata = double( cdata ) / 65535;
    case 'int8'
        cdata = ( double( cdata ) + 128 ) / 255;
    case 'int16'
        cdata = ( double( cdata ) + 32768 ) / 65535;
    otherwise
        error( 'GUILayout:LoadIcon:BadCData', ...
            'Image data of type ''%s'' is not supported.', class( cdata ) );
end

redpajama_set_name: RedPajamaGithub


text:
from .cvc import CvcParser
from .darknet import DarknetParser
from .dollar import DollarParser
from .kitti import KittiParser
from .pascalvoc import PascalVocParser
from .pickle import PickleParser
from .vatic import VaticParser
from .yaml import YamlParser

__all__ = ['annotation_formats']

annotation_formats = {
    'cvc': CvcParser,
    'darknet': DarknetParser,
    'dollar': DollarParser,
    'kitti': KittiParser,
    'pickle': PickleParser,
    'pascalvoc': PascalVocParser,
    'vatic': VaticParser,
    'yaml': YamlParser,
}


text:
package org.apache.calcite.rel.rules;

import org.apache.calcite.plan.RelOptRuleCall;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rel.core.Aggregate;
import org.apache.calcite.rel.core.Project;
import org.apache.calcite.schema.impl.StarTable;

import org.immutables.value.Value;

/** Variant of {@link AggregateStarTableRule} that accepts a {@link Project}
 * between the {@link Aggregate} and its {@link StarTable.StarTableScan}
 * input. */
@Value.Enclosing
public class AggregateProjectStarTableRule extends AggregateStarTableRule {
  /** Creates an AggregateProjectStarTableRule. */
  protected AggregateProjectStarTableRule(Config config) {
    super(config);
  }

  @Override public void onMatch(RelOptRuleCall call) {
    final Aggregate aggregate = call.rel(0);
    final Project project = call.rel(1);
    final StarTable.StarTableScan scan = call.rel(2);
    final RelNode rel =
        AggregateProjectMergeRule.apply(call, aggregate, project);
    final Aggregate aggregate2;
    final Project project2;
    if (rel instanceof Aggregate) {
      project2 = null;
      aggregate2 = (Aggregate) rel;
    } else if (rel instanceof Project) {
      project2 = (Project) rel;
      aggregate2 = (Aggregate) project2.getInput();
    } else {
      return;
    }
    apply(call, project2, aggregate2, scan);
  }

  /** Rule configuration. */
  @Value.Immutable
  @SuppressWarnings("immutables:subtype")
  public interface Config extends AggregateStarTableRule.Config {
    Config DEFAULT = ImmutableAggregateProjectStarTableRule.Config.of()
        .withOperandFor(Aggregate.class, Project.class,
            StarTable.StarTableScan.class);

    @Override default AggregateProjectStarTableRule toRule() {
      return new AggregateProjectStarTableRule(this);
    }

    /** Defines an operand tree for the given classes. */
    default Config withOperandFor(Class<? extends Aggregate> aggregateClass,
        Class<? extends Project> projectClass,
        Class<StarTable.StarTableScan> scanClass) {
      return withOperandSupplier(b0 ->
          b0.operand(aggregateClass)
              .predicate(Aggregate::isSimple)
              .oneInput(b1 ->
                  b1.operand(projectClass)
                      .oneInput(b2 ->
                          b2.operand(scanClass).noInputs())))
          .as(Config.class);
    }
  }
}


text:
layout: default
title: 404 - Page not found
permalink: /404.html
---

Whoops, this page doesn't exist.

Move along. (404 error)


text:
package com.nortal.spring.cw.core.web.component.composite.simple;

/**
 * Identifies an element as containing data
 *
 * @author Alrik Peets
 * @param <C>
 *           Data class
 */
public interface DataHolder {
	<C> C getData();

	void setData(Object data);

}


text:
from django.db import models
from django.utils import timezone

from zerver.models import Realm, UserProfile, Stream, Recipient
from zerver.lib.str_utils import ModelReprMixin
from zerver.lib.timestamp import floor_to_day

import datetime

from typing import Optional, Tuple, Union, Dict, Any, Text

class FillState(ModelReprMixin, models.Model):
    property = models.CharField(max_length=40, unique=True) # type: Text
    end_time = models.DateTimeField() # type: datetime.datetime

    # Valid states are {DONE, STARTED}
    DONE = 1
    STARTED = 2
    state = models.PositiveSmallIntegerField() # type: int

    last_modified = models.DateTimeField(auto_now=True) # type: datetime.datetime

    def __unicode__(self):
        # type: () -> Text
        return u"<FillState: %s %s %s>" % (self.property, self.end_time, self.state)

# The earliest/starting end_time in FillState
# We assume there is at least one realm
def installation_epoch():
    # type: () -> datetime.datetime
    earliest_realm_creation = Realm.objects.aggregate(models.Min('date_created'))['date_created__min']
    return floor_to_day(earliest_realm_creation)

def last_successful_fill(property):
    # type: (str) -> Optional[datetime.datetime]
    fillstate = FillState.objects.filter(property=property).first()
    if fillstate is None:
        return None
    if fillstate.state == FillState.DONE:
        return fillstate.end_time
    return fillstate.end_time - datetime.timedelta(hours=1)

# would only ever make entries here by hand
class Anomaly(ModelReprMixin, models.Model):
    info = models.CharField(max_length=1000) # type: Text

    def __unicode__(self):
        # type: () -> Text
        return u"<Anomaly: %s... %s>" % (self.info, self.id)

class BaseCount(ModelReprMixin, models.Model):
    # Note: When inheriting from BaseCount, you may want to rearrange
    # the order of the columns in the migration to make sure they
    # match how you'd like the table to be arranged.
    property = models.CharField(max_length=32) # type: Text
    subgroup = models.CharField(max_length=16, null=True) # type: Text
    end_time = models.DateTimeField() # type: datetime.datetime
    value = models.BigIntegerField() # type: int
    anomaly = models.ForeignKey(Anomaly, null=True) # type: Optional[Anomaly]

    class Meta(object):
        abstract = True

class InstallationCount(BaseCount):

    class Meta(object):
        unique_together = ("property", "subgroup", "end_time")

    def __unicode__(self):
        # type: () -> Text
        return u"<InstallationCount: %s %s %s>" % (self.property, self.subgroup, self.value)

class RealmCount(BaseCount):
    realm = models.ForeignKey(Realm)

    class Meta(object):
        unique_together = ("realm", "property", "subgroup", "end_time")
        index_together = ["property", "end_time"]

    def __unicode__(self):
        # type: () -> Text
        return u"<RealmCount: %s %s %s %s>" % (self.realm, self.property, self.subgroup, self.value)

class UserCount(BaseCount):
    user = models.ForeignKey(UserProfile)
    realm = models.ForeignKey(Realm)

    class Meta(object):
        unique_together = ("user", "property", "subgroup", "end_time")
        # This index dramatically improves the performance of
        # aggregating from users to realms
        index_together = ["property", "realm", "end_time"]

    def __unicode__(self):
        # type: () -> Text
        return u"<UserCount: %s %s %s %s>" % (self.user, self.property, self.subgroup, self.value)

class StreamCount(BaseCount):
    stream = models.ForeignKey(Stream)
    realm = models.ForeignKey(Realm)

    class Meta(object):
        unique_together = ("stream", "property", "subgroup", "end_time")
        # This index dramatically improves the performance of
        # aggregating from streams to realms
        index_together = ["property", "realm", "end_time"]

    def __unicode__(self):
        # type: () -> Text
        return u"<StreamCount: %s %s %s %s %s>" % (self.stream, self.property, self.subgroup, self.value, self.id)


text:
<?php

include 'header.php'; ?>
<?php if (!isset($emailsent)) { ?>

    <form method="post" action="/register" data-toggle="validator">
        <input type="hidden" name="csrftoken" value="<?php /** @noinspection PhpUndefinedVariableInspection */
        echo $csrftoken; ?>">

<?php echo _('Register'); ?>

            <?php
            if (isset($iplocked)) {
                echo '
 ' . _('You have performed too many login attempts. Your IP address will be unblocked three hours after the last attempt.') . '
';
            } elseif (isset($emailexisting)) {
                echo '
 ' . _('An account with the e-mail address you specified already exists.') . '
';
            } elseif (isset($emailsenderror)) {
                echo '
 ' . _('An internal error occurred while sending the confirmation e-mail. Please try again.') . '
';
            } else {
                echo _('
Register to access Tell-OP.
If you have already registered and you did not get an e-mail asking to verify your account, simply register again to have another one sent to you.
');
            }
            ?>
            <div class="form-group<?php if (isset($emailerror) && $emailerror) {echo ' has-error';} ?>">
                <?php echo _('E-mail address'); ?>
                <input type="email" class="form-control" id="email" name="email" placeholder="<?php echo _('E-mail address'); ?>" data-error="<?php echo _('You must enter a valid e-mail address.'); ?>" required<?php if (isset($_POST['email'])) {echo ' value="'.htmlspecialchars($_POST['email']).'"';} ?> maxlength="254">

<?php if (isset($emailerror) && $emailerror) {echo _('You must enter a valid e-mail address.'); } ?>

            <div class="form-group<?php if (isset($emailconfirmerror) && $emailconfirmerror) {echo ' has-error';} ?>">
                <?php echo _('Confirm e-mail address'); ?>
                <input type="email" class="form-control" id="emailconfirm" name="emailconfirm" placeholder="<?php echo _('Confirm e-mail address'); ?>" data-match="#email" data-error="<?php echo _('The address you typed is not valid or the e-mail addresses do not match.'); ?>" required<?php if (isset($_POST['emailconfirm'])) {echo ' value="'.htmlspecialchars($_POST['emailconfirm']).'"';} ?> maxlength="254">

<?php if (isset($emailconfirmerror) && $emailconfirmerror) {echo _('The address you typed is not valid or the e-mail addresses do not match.'); } ?>

            <div class="form-group<?php if (isset($missingpassword) && $missingpassword) {echo ' has-error';} ?>">
                <?php echo _('Password'); ?>
                <input type="password" class="form-control" id="password" name="password" placeholder="<?php echo _('Password'); ?>" data-error="<?php echo _('You must enter a password.'); ?>" required>

<?php if (isset($missingpassword) && $missingpassword) {echo _('You must enter your password.'); } ?>

            <div class="form-group<?php if (isset($confirmpassworderror) && $confirmpassworderror) {echo ' has-error';} ?>">
                <?php echo _('Confirm password'); ?>
                <input type="password" class="form-control" id="passwordconfirm" name="passwordconfirm" placeholder="<?php echo _('Confirm password'); ?>" data-match="#password" data-error="<?php echo _('The passwords do not match.'); ?>" required>

<?php if (isset($confirmpassworderror) && $confirmpassworderror) {echo _('The passwords do not match.'); } ?>

            <div class="form-group<?php if (isset($titleerror) && $titleerror) {echo ' has-error';} ?>">
                <?php echo _('Title'); ?>
                <input type="text" class="form-control" id="title" name="title" placeholder="<?php echo _('Title'); ?>" data-error="<?php echo _('The title can be at most 50 characters long.'); ?>"<?php if (isset($_POST['title'])) {echo ' value="'.htmlspecialchars($_POST['title']).'"';} ?> maxlength="50">

<?php if (isset($titleerror) && $titleerror) {echo _('The title can be at most 50 characters long.'); } ?>

            <div class="form-group<?php if (isset($displaynameerror) && $displaynameerror) {echo ' has-error';} ?>">
                <?php echo _('Name and surname'); ?>
                <input type="text" class="form-control" id="displayname" name="displayname" placeholder="<?php echo _('Name and surname'); ?>" <?php if (isset($_POST['displayname'])) {echo ' value="'.htmlspecialchars($_POST['displayname']).'"';} ?> data-error="<?php echo _('You must enter your name and surname and it must be at most 250 characters long'); ?>" required maxlength="250">

<?php if (isset($displaynameerror) && $displaynameerror) {echo _('You must enter your name and surname and it must be at most 250 characters long.'); } ?>

            <div class="form-group<?php if (isset($langlevelerror) && $langlevelerror) {echo ' has-error';} ?>">
                <?php echo _('Language level'); ?>
                <select size="1" class="form-control" id="languagelevel" name="languagelevel" data-error="<?php echo _('You must specify a language level.'); ?>" required>
                    <option value="A1"<?php if (isset($_POST['languagelevel']) && $_POST['languagelevel'] == 'A1') {echo ' selected';}?>><?php echo _('A1: breakthrough'); ?></option>
                    <option value="A2"<?php if (isset($_POST['languagelevel']) && $_POST['languagelevel'] == 'A2') {echo ' selected';}?>><?php echo _('A2: waystage'); ?></option>
                    <option value="B1"<?php if (isset($_POST['languagelevel']) && $_POST['languagelevel'] == 'B1') {echo ' selected';}?>><?php echo _('B1: threshold'); ?></option>
                    <option value="B2"<?php if (isset($_POST['languagelevel']) && $_POST['languagelevel'] == 'B2') {echo ' selected';}?>><?php echo _('B2: vantage'); ?></option>
                    <option value="C1"<?php if (isset($_POST['languagelevel']) && $_POST['languagelevel'] == 'C1') {echo ' selected';}?>><?php echo _('C1: effective operational proficiency'); ?></option>
                    <option value="C2"<?php if (isset($_POST['languagelevel']) && $_POST['languagelevel'] == 'C2') {echo ' selected';}?>><?php echo _('C2: mastery'); ?></option>
                </select>

<?php
                // Translators: the "data-modal-title" attributes must be translated as well.
                echo _('By clicking on Sign up, you agree to our
Terms of service and to our
Privacy policy.'); ?>

                    <button type="submit" class="btn btn-default pull-right"><?php echo _('Sign up'); ?></button>

    </form>

                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

                    <button type="button" class="btn btn-primary" data-dismiss="modal"><?php echo _('Close'); ?></button>

    <?php $additionalincludes[] = '/js/registration.js'; ?>

<?php } else { ?>

<?php echo _('Confirm your e-mail address'); ?>

<?php echo _('We have sent you an e-mail to verify your address. Please click the link contained in it to complete the account creation process.'); ?>

<?php } ?>
<?php include 'footer.php'; ?>


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta
      name="description"
      content="Web site created using create-react-app"
    />

    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

    <title>Live Python in the Browser</title>

    You need to enable JavaScript to run this app.


text:
<?xml version="1.0" encoding="UTF-8"?>
<project
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://maven.apache.org/POM/4.0.0"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.microsoft.azure.java.samples.moviedb</groupId>
    <artifactId>web-app</artifactId>
    <version>0.1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <parent>
        <groupId>com.microsoft.azure.java.samples.moviedb</groupId>
        <artifactId>movie-db-java-on-azure</artifactId>
        <version>0.1.0-SNAPSHOT</version>
    </parent>
    <properties>
        <java.version>1.8</java.version>
        <docker.image.prefix>${env.ACR_LOGIN_SERVER}</docker.image.prefix>
        <newrelic.version>3.37.0</newrelic.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.test.skip>true</maven.test.skip>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security.oauth</groupId>
            <artifactId>spring-security-oauth2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.thymeleaf.extras</groupId>
            <artifactId>thymeleaf-extras-springsecurity4</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <dependency>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-storage</artifactId>
            <version>5.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.newrelic.agent.java</groupId>
            <artifactId>newrelic-java</artifactId>
            <version>${newrelic.version}</version>
            <scope>provided</scope>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>4.3.7.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>unpack-zip</id>
                        <phase>package</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.newrelic.agent.java</groupId>
                                    <artifactId>newrelic-java</artifactId>
                                    <version>${newrelic.version}</version>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                    <destFileName>newrelic</destFileName>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.directory}/newrelic</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>1.5.3.RELEASE</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.4.11</version>
                <configuration>
                    <serverId>${env.ACR_NAME}</serverId>
                    <registryUrl>https://${env.ACR_LOGIN_SERVER}</registryUrl>
                    <dockerDirectory>src/main/docker/base</dockerDirectory>
                    <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${project.build.directory}</directory>
                            <include>${project.build.finalName}.jar</include>
                        </resource>
                    </resources>
                </configuration>
                <executions>
                    <execution>
                        <id>with-new-relic</id>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <configuration>
                            <dockerDirectory>src/main/docker/new-relic</dockerDirectory>
                            <imageName>${docker.image.prefix}/${project.artifactId}-w-new-relic</imageName>
                            <buildArgs>
                                <NEW_RELIC_LICENSE_KEY>${env.NEW_RELIC_LICENSE_KEY}</NEW_RELIC_LICENSE_KEY>
                                <NEW_RELIC_APP_NAME>${env.WEBAPP_NEW_RELIC_APP_NAME}</NEW_RELIC_APP_NAME>
                            </buildArgs>
                            <resources>
                                <resource>
                                    <targetPath>/</targetPath>
                                    <directory>${project.build.directory}</directory>
                                    <include>${project.build.finalName}.jar</include>
                                </resource>
                                <resource>
                                    <targetPath>/</targetPath>
                                    <directory>${project.build.directory}/newrelic</directory>
                                    <include>newrelic.jar</include>
                                </resource>
                                <resource>
                                    <targetPath>/</targetPath>
                                    <directory>${project.build.directory}/newrelic</directory>
                                    <include>newrelic.yml</include>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>with-overops</id>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <configuration>
                            <dockerDirectory>src/main/docker/overops</dockerDirectory>
                            <imageName>${docker.image.prefix}/${project.artifactId}-w-overops</imageName>
                            <buildArgs>
                                <OVEROPSSK>${env.OVEROPSSK}</OVEROPSSK>
                            </buildArgs>
                            <resources>
                                <resource>
                                    <targetPath>/</targetPath>
                                    <directory>${project.build.directory}</directory>
                                    <include>${project.build.finalName}.jar</include>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>all</id>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <configuration>
                            <dockerDirectory>src/main/docker/all</dockerDirectory>
                            <imageName>${docker.image.prefix}/${project.artifactId}-w-all</imageName>
                            <buildArgs>
                                <NEW_RELIC_LICENSE_KEY>${env.NEW_RELIC_LICENSE_KEY}</NEW_RELIC_LICENSE_KEY>
                                <NEW_RELIC_APP_NAME>${env.WEBAPP_NEW_RELIC_APP_NAME}</NEW_RELIC_APP_NAME>
                                <OVEROPSSK>${env.OVEROPSSK}</OVEROPSSK>
                            </buildArgs>
                            <resources>
                                <resource>
                                    <targetPath>/</targetPath>
                                    <directory>${project.build.directory}</directory>
                                    <include>${project.build.finalName}.jar</include>
                                </resource>
                                <resource>
                                    <targetPath>/</targetPath>
                                    <directory>${project.build.directory}/newrelic</directory>
                                    <include>newrelic.jar</include>
                                </resource>
                                <resource>
                                    <targetPath>/</targetPath>
                                    <directory>${project.build.directory}/newrelic</directory>
                                    <include>newrelic.yml</include>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
<?php

namespace APHPUnit\Testcases;

require_once __DIR__ . '/../config.inc.php';
require_once PORTSTREE_LIB_PATH . '/config.inc.php';

define('TEST_PORTSTREE', __DIR__ . '/portstree');

/**
  * scan existing portstree and check
  * if we only found categories containing ports
  *
  **/
function testScanPortsTree() {

  $arrExpected = array('categorywithport' => array('port'),
                       'anothercategorywithport' => array('port', 'port2', 'port3'));

  $arrReal = \Portstree\get_portlist_from(TEST_PORTSTREE);

  assertEquals($arrReal, $arrExpected);

}

/**
  * check for exception in case of wrong parameter datatype
  *
  **/
function testScannedPortsTreeIsNotAString() {

  $cloScanWithException = function() {
    \Portstree\get_portlist_from(23);
  };
  expectException($cloScanWithException, '\Exception');

  $cloScanWithException = function() {
    \Portstree\get_portlist_from(NULL);
  };
  expectException($cloScanWithException, '\Exception');

  $cloScanWithException = function() {
    \Portstree\get_portlist_from(array());
  };
  expectException($cloScanWithException, '\Exception');

}

/**
  * check for exception if given portstree is not a dir
  *
  **/
function testScannedPortsTreeIsNotADir() {

  // create nonexisting dir-path
  while(true) {
    $strNoneExistingDir = '/' . uniqid();
    if(!is_dir($strNoneExistingDir) && !is_file($strNoneExistingDir))
      break;
  }

  $cloScanWithException = function() use ($strNoneExistingDir) {
    \Portstree\get_portlist_from($strNoneExistingDir);
  };
  expectException($cloScanWithException, '\Exception');

}

/**
  * check for exception if given portstree is a file in reality
  *
  **/
function testScannedPortsTreeIsAFile() {

  $strFile = tempnam(sys_get_temp_dir(), 'asap-testcase');

  $cloScanWithException = function() use ($strFile) {
    \Portstree\get_portlist_from($strFile);
  };
  expectException($cloScanWithException, '\Exception');

  unlink($strFile);

}

/**
  * check for exception if given portstree is not readable
  *
  **/
function testScannedPortsTreeIsNotReadable() {

  // generate tmp-dir name
  while(true) {
    $strDirName = sys_get_temp_dir() . 'asap-testcase-' . uniqid();
    if(!is_dir($strDirName) && !file_exists($strDirName))
      break;
  }

  mkdir($strDirName, 0000);

  $cloScanWithException = function() use ($strDirName) {
    \Portstree\get_portlist_from($strDirName);
  };
  expectException($cloScanWithException, '\Exception');

  rmdir($strDirName);

}

/**
  * check if scan result is persisted correctly
  *
  **/
function testScannedPortPersistence() {

}


text:
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-2.0-xr-w32-bld/build/xpfe/appshell/public/nsIWindowMediator.idl
 */

#ifndef __gen_nsIWindowMediator_h__
#define __gen_nsIWindowMediator_h__

#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

#ifndef __gen_nsISimpleEnumerator_h__
#include "nsISimpleEnumerator.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
#define NS_WINDOWMEDIATOR_CID \
{ 0x0659cb83, 0xfaad, 0x11d2, { 0x8e, 0x19, 0xb2, 0x06, 0x62, 0x0a, 0x65, 0x7c } }
#define NS_WINDOWMEDIATOR_CONTRACTID \
  "@mozilla.org/appshell/window-mediator;1"
class nsIXULWindow; /* forward declaration */

class nsIWidget; /* forward declaration */

class nsIDOMWindowInternal; /* forward declaration */

class nsIWindowMediatorListener; /* forward declaration */

/* starting interface:    nsIWindowMediator */
#define NS_IWINDOWMEDIATOR_IID_STR "0659cb81-faad-11d2-8e19-b206620a657c"

#define NS_IWINDOWMEDIATOR_IID \
  {0x0659cb81, 0xfaad, 0x11d2, \
    { 0x8e, 0x19, 0xb2, 0x06, 0x62, 0x0a, 0x65, 0x7c }}

class NS_NO_VTABLE NS_SCRIPTABLE nsIWindowMediator : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWINDOWMEDIATOR_IID)

  /** Return an enumerator which iterates over all windows of type aWindowType
    * from the oldest window to the youngest.
    * @param  aWindowType the returned enumerator will enumerate only
    *                     windows of this type. ("type" is the
    *                     |windowtype| attribute of the XML <window> element.)
    *                     If null, all windows will be enumerated.
    * @return an enumerator of nsIDOMWindows
    */
  /* nsISimpleEnumerator getEnumerator (in wstring aWindowType); */
  NS_SCRIPTABLE NS_IMETHOD GetEnumerator(const PRUnichar *aWindowType, nsISimpleEnumerator **_retval NS_OUTPARAM) = 0;

  /** Identical to getEnumerator except:
    * @return an enumerator of nsIXULWindows
  */
  /* nsISimpleEnumerator getXULWindowEnumerator (in wstring aWindowType); */
  NS_SCRIPTABLE NS_IMETHOD GetXULWindowEnumerator(const PRUnichar *aWindowType, nsISimpleEnumerator **_retval NS_OUTPARAM) = 0;

  /** Return an enumerator which iterates over all windows of type aWindowType
    * in their z (front-to-back) order. Note this interface makes
    * no requirement that a window couldn't be revisited if windows
    * are re-ordered while z-order enumerators are active.
    * @param  aWindowType the returned enumerator will enumerate only
    *                     windows of this type. ("type" is the
    *                     |windowtype| attribute of the XML <window> element.)
    *                     If null, all windows will be enumerated.
    * @param  aFrontToBack if true, the enumerator enumerates windows in order
    *                      from front to back. back to front if false.
    * @return an enumerator of nsIDOMWindows
    */
  /* nsISimpleEnumerator getZOrderDOMWindowEnumerator (in wstring aWindowType, in boolean aFrontToBack); */
  NS_SCRIPTABLE NS_IMETHOD GetZOrderDOMWindowEnumerator(const PRUnichar *aWindowType, PRBool aFrontToBack, nsISimpleEnumerator **_retval NS_OUTPARAM) = 0;

  /** Identical to getZOrderDOMWindowEnumerator except:
    * @return an enumerator of nsIXULWindows
    */
  /* nsISimpleEnumerator getZOrderXULWindowEnumerator (in wstring aWindowType, in boolean aFrontToBack); */
  NS_SCRIPTABLE NS_IMETHOD GetZOrderXULWindowEnumerator(const PRUnichar *aWindowType, PRBool aFrontToBack, nsISimpleEnumerator **_retval NS_OUTPARAM) = 0;

  /** This is a shortcut for simply fetching the first window in
    * front to back order.
    * @param  aWindowType return the topmost window of this type.
    *                     ("type" is the |windowtype| attribute of
    *                     the XML <window> element.)
    *                     If null, return the topmost window of any type.
    * @return the topmost window
    */
  /* nsIDOMWindowInternal getMostRecentWindow (in wstring aWindowType); */
  NS_SCRIPTABLE NS_IMETHOD GetMostRecentWindow(const PRUnichar *aWindowType, nsIDOMWindowInternal **_retval NS_OUTPARAM) = 0;

  /** Add the window to the list of known windows. Listeners (see
    * addListener) will be notified through their onOpenWindow method.
    * @param aWindow the window to add
    */
  /* [noscript] void registerWindow (in nsIXULWindow aWindow); */
  NS_IMETHOD RegisterWindow(nsIXULWindow *aWindow) = 0;

  /** Remove the window from the list of known windows. Listeners (see
    * addListener) will be be notified through their onCloseWindow method.
    * @param aWindow the window to remove
    */
  /* [noscript] void unregisterWindow (in nsIXULWindow aWindow); */
  NS_IMETHOD UnregisterWindow(nsIXULWindow *aWindow) = 0;

  /** Call this method when a window gains focus. It's a primitive means of
    * determining the most recent window. It's no longer necessary and it
    * really should be removed.
    * @param aWindow the window which has gained focus
    */
  /* [noscript] void updateWindowTimeStamp (in nsIXULWindow aWindow); */
  NS_IMETHOD UpdateWindowTimeStamp(nsIXULWindow *aWindow) = 0;

  /** Call this method when a window's title changes. Listeners (see
    * addListener) will be notified through their onWindowTitleChange method.
    * @param aWindow the window whose title has changed
    * @param inTitle the window's new title
    */
  /* [noscript] void updateWindowTitle (in nsIXULWindow aWindow, in wstring inTitle); */
  NS_IMETHOD UpdateWindowTitle(nsIXULWindow *aWindow, const PRUnichar *inTitle) = 0;

  enum { zLevelTop = 1U };

  enum { zLevelBottom = 2U };

  enum { zLevelBelow = 3U };

  /** A window wants to be moved in z-order. Calculate whether and how
    * it should be constrained. Note this method is advisory only:
    * it changes nothing either in WindowMediator's internal state
    * or with the window.
    * Note it compares the nsIXULWindow to nsIWidgets. A pure interface
    * would use all nsIXULWindows. But we expect this to be called from
    * callbacks originating in native window code. They are expected to
    * hand us comparison values which are pulled from general storage
    * in the native widget, and may not correspond to an nsIWidget at all.
    * For that reason this interface requires only objects one step
    * removed from the native window (nsIWidgets), and its implementation
    * must be very understanding of what may be completely invalid
    * pointers in those parameters.
    *
    * @param inWindow the window in question
    * @param inPosition requested position
    *                   values: zLevelTop: topmost window. zLevelBottom: bottom.
    *                   zLevelBelow: below ioBelow. (the value of ioBelow will
    *                   be ignored for zLevelTop and Bottom.)
    * @param inBelow if inPosition==zLevelBelow, the window
    *                 below which inWindow wants to be placed. Otherwise this
    *                 variable is ignored.
    * @param outPosition constrained position, values like inPosition.
    * @param outBelow if outPosition==zLevelBelow, the window
    *                 below which inWindow should be placed. Otherwise this
    *                 this value will be null.
    * @return PR_TRUE if the position returned is different from
    *         the position given.
    */
  /* [noscript] boolean calculateZPosition (in nsIXULWindow inWindow, in unsigned long inPosition, in nsIWidget inBelow, out unsigned long outPosition, out nsIWidget outBelow); */
  NS_IMETHOD CalculateZPosition(nsIXULWindow *inWindow, PRUint32 inPosition, nsIWidget *inBelow, PRUint32 *outPosition NS_OUTPARAM, nsIWidget **outBelow NS_OUTPARAM, PRBool *_retval NS_OUTPARAM) = 0;

  /** A window has been positioned behind another. Inform WindowMediator
    * @param inWindow the window in question
    * @param inPosition new position. values:
    *                   zLevelTop: topmost window.
    *                   zLevelBottom: bottom.
    *                   zLevelBelow: below inBelow. (inBelow is ignored
    *                                for other values of inPosition.)
    * @param inBelow the window inWindow is behind, if zLevelBelow
    */
  /* [noscript] void setZPosition (in nsIXULWindow inWindow, in unsigned long inPosition, in nsIXULWindow inBelow); */
  NS_IMETHOD SetZPosition(nsIXULWindow *inWindow, PRUint32 inPosition, nsIXULWindow *inBelow) = 0;

  /** Return the window's Z level (as defined in nsIXULWindow).
    * @param aWindow the window in question
    * @return aWindow's z level
    */
  /* [noscript] PRUint32 getZLevel (in nsIXULWindow aWindow); */
  NS_IMETHOD GetZLevel(nsIXULWindow *aWindow, PRUint32 *_retval NS_OUTPARAM) = 0;

  /** Set the window's Z level (as defined in nsIXULWindow). The implementation
    * will reposition the window as necessary to match its new Z level.
    * The implementation will assume a window's Z level to be
    * nsIXULWindow::normalZ until it has been informed of a different level.
    * @param aWindow the window in question
    * @param aZLevel the window's new Z level
    */
  /* [noscript] void setZLevel (in nsIXULWindow aWindow, in PRUint32 aZLevel); */
  NS_IMETHOD SetZLevel(nsIXULWindow *aWindow, PRUint32 aZLevel) = 0;

  /** Register a listener for window status changes.
    * keeps strong ref? (to be decided)
    * @param aListener the listener to register
    */
  /* void addListener (in nsIWindowMediatorListener aListener); */
  NS_SCRIPTABLE NS_IMETHOD AddListener(nsIWindowMediatorListener *aListener) = 0;

  /** Unregister a listener of window status changes.
    * @param aListener the listener to unregister
    */
  /* void removeListener (in nsIWindowMediatorListener aListener); */
  NS_SCRIPTABLE NS_IMETHOD RemoveListener(nsIWindowMediatorListener *aListener) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIWindowMediator, NS_IWINDOWMEDIATOR_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIWINDOWMEDIATOR \
  NS_SCRIPTABLE NS_IMETHOD GetEnumerator(const PRUnichar *aWindowType, nsISimpleEnumerator **_retval NS_OUTPARAM); \
  NS_SCRIPTABLE NS_IMETHOD GetXULWindowEnumerator(const PRUnichar *aWindowType, nsISimpleEnumerator **_retval NS_OUTPARAM); \
  NS_SCRIPTABLE NS_IMETHOD GetZOrderDOMWindowEnumerator(const PRUnichar *aWindowType, PRBool aFrontToBack, nsISimpleEnumerator **_retval NS_OUTPARAM); \
  NS_SCRIPTABLE NS_IMETHOD GetZOrderXULWindowEnumerator(const PRUnichar *aWindowType, PRBool aFrontToBack, nsISimpleEnumerator **_retval NS_OUTPARAM); \
  NS_SCRIPTABLE NS_IMETHOD GetMostRecentWindow(const PRUnichar *aWindowType, nsIDOMWindowInternal **_retval NS_OUTPARAM); \
  NS_IMETHOD RegisterWindow(nsIXULWindow *aWindow); \
  NS_IMETHOD UnregisterWindow(nsIXULWindow *aWindow); \
  NS_IMETHOD UpdateWindowTimeStamp(nsIXULWindow *aWindow); \
  NS_IMETHOD UpdateWindowTitle(nsIXULWindow *aWindow, const PRUnichar *inTitle); \
  NS_IMETHOD CalculateZPosition(nsIXULWindow *inWindow, PRUint32 inPosition, nsIWidget *inBelow, PRUint32 *outPosition NS_OUTPARAM, nsIWidget **outBelow NS_OUTPARAM, PRBool *_retval NS_OUTPARAM); \
  NS_IMETHOD SetZPosition(nsIXULWindow *inWindow, PRUint32 inPosition, nsIXULWindow *inBelow); \
  NS_IMETHOD GetZLevel(nsIXULWindow *aWindow, PRUint32 *_retval NS_OUTPARAM); \
  NS_IMETHOD SetZLevel(nsIXULWindow *aWindow, PRUint32 aZLevel); \
  NS_SCRIPTABLE NS_IMETHOD AddListener(nsIWindowMediatorListener *aListener); \
  NS_SCRIPTABLE NS_IMETHOD RemoveListener(nsIWindowMediatorListener *aListener);

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIWINDOWMEDIATOR(_to) \
  NS_SCRIPTABLE NS_IMETHOD GetEnumerator(const PRUnichar *aWindowType, nsISimpleEnumerator **_retval NS_OUTPARAM) { return _to GetEnumerator(aWindowType, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD GetXULWindowEnumerator(const PRUnichar *aWindowType, nsISimpleEnumerator **_retval NS_OUTPARAM) { return _to GetXULWindowEnumerator(aWindowType, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD GetZOrderDOMWindowEnumerator(const PRUnichar *aWindowType, PRBool aFrontToBack, nsISimpleEnumerator **_retval NS_OUTPARAM) { return _to GetZOrderDOMWindowEnumerator(aWindowType, aFrontToBack, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD GetZOrderXULWindowEnumerator(const PRUnichar *aWindowType, PRBool aFrontToBack, nsISimpleEnumerator **_retval NS_OUTPARAM) { return _to GetZOrderXULWindowEnumerator(aWindowType, aFrontToBack, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD GetMostRecentWindow(const PRUnichar *aWindowType, nsIDOMWindowInternal **_retval NS_OUTPARAM) { return _to GetMostRecentWindow(aWindowType, _retval); } \
  NS_IMETHOD RegisterWindow(nsIXULWindow *aWindow) { return _to RegisterWindow(aWindow); } \
  NS_IMETHOD UnregisterWindow(nsIXULWindow *aWindow) { return _to UnregisterWindow(aWindow); } \
  NS_IMETHOD UpdateWindowTimeStamp(nsIXULWindow *aWindow) { return _to UpdateWindowTimeStamp(aWindow); } \
  NS_IMETHOD UpdateWindowTitle(nsIXULWindow *aWindow, const PRUnichar *inTitle) { return _to UpdateWindowTitle(aWindow, inTitle); } \
  NS_IMETHOD CalculateZPosition(nsIXULWindow *inWindow, PRUint32 inPosition, nsIWidget *inBelow, PRUint32 *outPosition NS_OUTPARAM, nsIWidget **outBelow NS_OUTPARAM, PRBool *_retval NS_OUTPARAM) { return _to CalculateZPosition(inWindow, inPosition, inBelow, outPosition, outBelow, _retval); } \
  NS_IMETHOD SetZPosition(nsIXULWindow *inWindow, PRUint32 inPosition, nsIXULWindow *inBelow) { return _to SetZPosition(inWindow, inPosition, inBelow); } \
  NS_IMETHOD GetZLevel(nsIXULWindow *aWindow, PRUint32 *_retval NS_OUTPARAM) { return _to GetZLevel(aWindow, _retval); } \
  NS_IMETHOD SetZLevel(nsIXULWindow *aWindow, PRUint32 aZLevel) { return _to SetZLevel(aWindow, aZLevel); } \
  NS_SCRIPTABLE NS_IMETHOD AddListener(nsIWindowMediatorListener *aListener) { return _to AddListener(aListener); } \
  NS_SCRIPTABLE NS_IMETHOD RemoveListener(nsIWindowMediatorListener *aListener) { return _to RemoveListener(aListener); }

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIWINDOWMEDIATOR(_to) \
  NS_SCRIPTABLE NS_IMETHOD GetEnumerator(const PRUnichar *aWindowType, nsISimpleEnumerator **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEnumerator(aWindowType, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD GetXULWindowEnumerator(const PRUnichar *aWindowType, nsISimpleEnumerator **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetXULWindowEnumerator(aWindowType, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD GetZOrderDOMWindowEnumerator(const PRUnichar *aWindowType, PRBool aFrontToBack, nsISimpleEnumerator **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetZOrderDOMWindowEnumerator(aWindowType, aFrontToBack, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD GetZOrderXULWindowEnumerator(const PRUnichar *aWindowType, PRBool aFrontToBack, nsISimpleEnumerator **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetZOrderXULWindowEnumerator(aWindowType, aFrontToBack, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD GetMostRecentWindow(const PRUnichar *aWindowType, nsIDOMWindowInternal **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMostRecentWindow(aWindowType, _retval); } \
  NS_IMETHOD RegisterWindow(nsIXULWindow *aWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterWindow(aWindow); } \
  NS_IMETHOD UnregisterWindow(nsIXULWindow *aWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterWindow(aWindow); } \
  NS_IMETHOD UpdateWindowTimeStamp(nsIXULWindow *aWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->UpdateWindowTimeStamp(aWindow); } \
  NS_IMETHOD UpdateWindowTitle(nsIXULWindow *aWindow, const PRUnichar *inTitle) { return !_to ? NS_ERROR_NULL_POINTER : _to->UpdateWindowTitle(aWindow, inTitle); } \
  NS_IMETHOD CalculateZPosition(nsIXULWindow *inWindow, PRUint32 inPosition, nsIWidget *inBelow, PRUint32 *outPosition NS_OUTPARAM, nsIWidget **outBelow NS_OUTPARAM, PRBool *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->CalculateZPosition(inWindow, inPosition, inBelow, outPosition, outBelow, _retval); } \
  NS_IMETHOD SetZPosition(nsIXULWindow *inWindow, PRUint32 inPosition, nsIXULWindow *inBelow) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetZPosition(inWindow, inPosition, inBelow); } \
  NS_IMETHOD GetZLevel(nsIXULWindow *aWindow, PRUint32 *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetZLevel(aWindow, _retval); } \
  NS_IMETHOD SetZLevel(nsIXULWindow *aWindow, PRUint32 aZLevel) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetZLevel(aWindow, aZLevel); } \
  NS_SCRIPTABLE NS_IMETHOD AddListener(nsIWindowMediatorListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddListener(aListener); } \
  NS_SCRIPTABLE NS_IMETHOD RemoveListener(nsIWindowMediatorListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveListener(aListener); }

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsWindowMediator : public nsIWindowMediator
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIWINDOWMEDIATOR

  nsWindowMediator();

private:
  ~nsWindowMediator();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsWindowMediator, nsIWindowMediator)

nsWindowMediator::nsWindowMediator()
{
  /* member initializers and constructor code */
}

nsWindowMediator::~nsWindowMediator()
{
  /* destructor code */
}

/* nsISimpleEnumerator getEnumerator (in wstring aWindowType); */
NS_IMETHODIMP nsWindowMediator::GetEnumerator(const PRUnichar *aWindowType, nsISimpleEnumerator **_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsISimpleEnumerator getXULWindowEnumerator (in wstring aWindowType); */
NS_IMETHODIMP nsWindowMediator::GetXULWindowEnumerator(const PRUnichar *aWindowType, nsISimpleEnumerator **_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsISimpleEnumerator getZOrderDOMWindowEnumerator (in wstring aWindowType, in boolean aFrontToBack); */
NS_IMETHODIMP nsWindowMediator::GetZOrderDOMWindowEnumerator(const PRUnichar *aWindowType, PRBool aFrontToBack, nsISimpleEnumerator **_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsISimpleEnumerator getZOrderXULWindowEnumerator (in wstring aWindowType, in boolean aFrontToBack); */
NS_IMETHODIMP nsWindowMediator::GetZOrderXULWindowEnumerator(const PRUnichar *aWindowType, PRBool aFrontToBack, nsISimpleEnumerator **_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIDOMWindowInternal getMostRecentWindow (in wstring aWindowType); */
NS_IMETHODIMP nsWindowMediator::GetMostRecentWindow(const PRUnichar *aWindowType, nsIDOMWindowInternal **_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void registerWindow (in nsIXULWindow aWindow); */
NS_IMETHODIMP nsWindowMediator::RegisterWindow(nsIXULWindow *aWindow)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void unregisterWindow (in nsIXULWindow aWindow); */
NS_IMETHODIMP nsWindowMediator::UnregisterWindow(nsIXULWindow *aWindow)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void updateWindowTimeStamp (in nsIXULWindow aWindow); */
NS_IMETHODIMP nsWindowMediator::UpdateWindowTimeStamp(nsIXULWindow *aWindow)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void updateWindowTitle (in nsIXULWindow aWindow, in wstring inTitle); */
NS_IMETHODIMP nsWindowMediator::UpdateWindowTitle(nsIXULWindow *aWindow, const PRUnichar *inTitle)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] boolean calculateZPosition (in nsIXULWindow inWindow, in unsigned long inPosition, in nsIWidget inBelow, out unsigned long outPosition, out nsIWidget outBelow); */
NS_IMETHODIMP nsWindowMediator::CalculateZPosition(nsIXULWindow *inWindow, PRUint32 inPosition, nsIWidget *inBelow, PRUint32 *outPosition NS_OUTPARAM, nsIWidget **outBelow NS_OUTPARAM, PRBool *_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void setZPosition (in nsIXULWindow inWindow, in unsigned long inPosition, in nsIXULWindow inBelow); */
NS_IMETHODIMP nsWindowMediator::SetZPosition(nsIXULWindow *inWindow, PRUint32 inPosition, nsIXULWindow *inBelow)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] PRUint32 getZLevel (in nsIXULWindow aWindow); */
NS_IMETHODIMP nsWindowMediator::GetZLevel(nsIXULWindow *aWindow, PRUint32 *_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void setZLevel (in nsIXULWindow aWindow, in PRUint32 aZLevel); */
NS_IMETHODIMP nsWindowMediator::SetZLevel(nsIXULWindow *aWindow, PRUint32 aZLevel)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void addListener (in nsIWindowMediatorListener aListener); */
NS_IMETHODIMP nsWindowMediator::AddListener(nsIWindowMediatorListener *aListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeListener (in nsIWindowMediatorListener aListener); */
NS_IMETHODIMP nsWindowMediator::RemoveListener(nsIWindowMediatorListener *aListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

#endif /* __gen_nsIWindowMediator_h__ */


text:
const webpack = require('webpack');
const WebpackAssetsManifest = require('webpack-assets-manifest');
const {VueLoaderPlugin} = require('vue-loader');
const path = require('path');

module.exports = {
    mode: (process.env.NODE_ENV === 'production') ? 'production' : 'development',
    entry: {
        Account: '~/pages/Account.js',
        Dashboard: '~/pages/Dashboard.js',
        AdminApiKeys: '~/pages/Admin/ApiKeys.js',
        AdminAuditLog: '~/pages/Admin/AuditLog.js',
        AdminBackups: '~/pages/Admin/Backups.js',
        AdminBranding: '~/pages/Admin/Branding.js',
        AdminCustomFields: '~/pages/Admin/CustomFields.js',
        AdminGeoLite: '~/pages/Admin/GeoLite.js',
        AdminPermissions: '~/pages/Admin/Permissions.js',
        AdminSettings: '~/pages/Admin/Settings.js',
        AdminShoutcast: '~/pages/Admin/Shoutcast.js',
        AdminStations: '~/pages/Admin/Stations.js',
        AdminStorageLocations: '~/pages/Admin/StorageLocations.js',
        AdminUsers: '~/pages/Admin/Users.js',
        PublicFullPlayer: '~/pages/Public/FullPlayer.js',
        PublicHistory: '~/pages/Public/History.js',
        PublicOnDemand: '~/pages/Public/OnDemand.js',
        PublicPlayer: '~/pages/Public/Player.js',
        PublicRequests: '~/pages/Public/Requests.js',
        PublicSchedule: '~/pages/Public/Schedule.js',
        PublicWebDJ: '~/pages/Public/WebDJ.js',
        Recover: '~/pages/Recover.js',
        SetupRegister: '~/pages/Setup/Register.js',
        SetupSettings: '~/pages/Setup/Settings.js',
        SetupStation: '~/pages/Setup/Station.js',
        StationsAutomation: '~/pages/Stations/Automation.js',
        StationsLiquidsoapConfig: '~/pages/Stations/LiquidsoapConfig.js',
        StationsMedia: '~/pages/Stations/Media.js',
        StationsMounts: '~/pages/Stations/Mounts.js',
        StationsPlaylists: '~/pages/Stations/Playlists.js',
        StationsPodcasts: '~/pages/Stations/Podcasts.js',
        StationsProfile: '~/pages/Stations/Profile.js',
        StationsProfileEdit: '~/pages/Stations/ProfileEdit.js',
        StationsQueue: '~/pages/Stations/Queue.js',
        StationsRemotes: '~/pages/Stations/Remotes.js',
        StationsStreamers: '~/pages/Stations/Streamers.js',
        StationsReportsListeners: '~/pages/Stations/Reports/Listeners.js',
        StationsReportsRequests: '~/pages/Stations/Reports/Requests.js',
        StationsReportsOverview: '~/pages/Stations/Reports/Overview.js',
        StationsReportsPerformance: '~/pages/Stations/Reports/Performance.js',
        StationsReportsSoundExchange: '~/pages/Stations/Reports/SoundExchange.js',
        StationsReportsTimeline: '~/pages/Stations/Reports/Timeline.js',
        StationsSftpUsers: '~/pages/Stations/SftpUsers.js',
        StationsWebhooks: '~/pages/Stations/Webhooks.js'
    },
    resolve: {
        enforceExtension: false,
        alias: {
            '~': path.resolve(__dirname, './vue')
        },
        extensions: ['.js', '.vue', '.json']
    },
    output: {
        path: path.resolve(__dirname, '../web/static/webpack_dist'),
        publicPath: '/static/webpack_dist/',
        filename: '[name].[contenthash].js',
        sourceMapFilename: '[name].[contenthash].map',
        library: '[name]',
        assetModuleFilename: 'images/[contenthash][ext]'
    },
    optimization: {
        splitChunks: {
            cacheGroups: {
                translations: {
                    test: /translations\.json$/,
                    chunks: 'all',
                    enforce: true,
                    name: 'translations'
                },
                vendor: {
                    test: /[\\/]node_modules[\\/]/,
                    chunks: 'all',
                    enforce: true,
                    name(module) {
                        // get the name. E.g. node_modules/packageName/not/this/part.js
                        // or node_modules/packageName
                        const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];

                        // npm package names are URL-safe, but some servers don't like @ symbols
                        return `vendor-${packageName.replace('@', '')}`;
                    }
                }
            }
        }
    },
    module: {
        rules: [
            {
                test: /\.vue$/i,
                use: [
                    'vue-loader'
                ]
            },
            {
                test: /\.scss$/i,
                use: [
                    'vue-style-loader',
                    'css-loader',
                    'sass-loader'
                ]
            },
            {
                test: /\.css$/i,
                use: [
                    'vue-style-loader',
                    'css-loader'
                ]
            },
            {
                test: /\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/i,
                type: 'asset/resource'
            }
        ]
    },
    plugins: [
        new WebpackAssetsManifest({
            output: path.resolve(__dirname, '../web/static/webpack.json'),
            writeToDisk: true,
            merge: true,
            publicPath: true,
            entrypoints: true
        }),
        new VueLoaderPlugin()
    ],
    target: 'web',
    performance: {
        hints: false
    }
};


text:
import unittest

import six

from socketio import packet

class TestPacket(unittest.TestCase):
    def test_encode_default_packet(self):
        pkt = packet.Packet()
        self.assertEqual(pkt.packet_type, packet.EVENT)
        self.assertIsNone(pkt.data)
        self.assertIsNone(pkt.namespace)
        self.assertIsNone(pkt.id)
        self.assertEqual(pkt.attachment_count, 0)
        self.assertEqual(pkt.encode(), '2')

    def test_decode_default_packet(self):
        pkt = packet.Packet(encoded_packet='2')
        self.assertTrue(pkt.encode(), '2')

    def test_encode_text_event_packet(self):
        pkt = packet.Packet(packet_type=packet.EVENT,
                            data=[six.text_type('foo')])
        self.assertEqual(pkt.packet_type, packet.EVENT)
        self.assertEqual(pkt.data, ['foo'])
        self.assertEqual(pkt.encode(), '2["foo"]')

    def test_decode_text_event_packet(self):
        pkt = packet.Packet(encoded_packet='2["foo"]')
        self.assertEqual(pkt.packet_type, packet.EVENT)
        self.assertEqual(pkt.data, ['foo'])
        self.assertEqual(pkt.encode(), '2["foo"]')

    def test_encode_binary_event_packet(self):
        pkt = packet.Packet(packet_type=packet.EVENT, data=b'1234')
        self.assertEqual(pkt.packet_type, packet.BINARY_EVENT)
        self.assertEqual(pkt.data, b'1234')
        a = ['51-{"_placeholder":true,"num":0}', b'1234']
        b = ['51-{"num":0,"_placeholder":true}', b'1234']
        encoded_packet = pkt.encode()
        self.assertTrue(encoded_packet == a or encoded_packet == b)

    def test_decode_binary_event_packet(self):
        pkt = packet.Packet(encoded_packet='51-{"_placeholder":true,"num":0}')
        pkt.reconstruct_binary([b'1234'])
        self.assertEqual(pkt.packet_type, packet.BINARY_EVENT)
        self.assertEqual(pkt.data, b'1234')

    def test_encode_text_ack_packet(self):
        pkt = packet.Packet(packet_type=packet.ACK,
                            data=[six.text_type('foo')])
        self.assertEqual(pkt.packet_type, packet.ACK)
        self.assertEqual(pkt.data, ['foo'])
        self.assertEqual(pkt.encode(), '3["foo"]')

    def test_decode_text_ack_packet(self):
        pkt = packet.Packet(encoded_packet='3["foo"]')
        self.assertEqual(pkt.packet_type, packet.ACK)
        self.assertEqual(pkt.data, ['foo'])
        self.assertEqual(pkt.encode(), '3["foo"]')

    def test_encode_binary_ack_packet(self):
        pkt = packet.Packet(packet_type=packet.ACK, data=b'1234')
        self.assertEqual(pkt.packet_type, packet.BINARY_ACK)
        self.assertEqual(pkt.data, b'1234')
        a = ['61-{"_placeholder":true,"num":0}', b'1234']
        b = ['61-{"num":0,"_placeholder":true}', b'1234']
        encoded_packet = pkt.encode()
        self.assertTrue(encoded_packet == a or encoded_packet == b)

    def test_decode_binary_ack_packet(self):
        pkt = packet.Packet(encoded_packet='61-{"_placeholder":true,"num":0}')
        pkt.reconstruct_binary([b'1234'])
        self.assertEqual(pkt.packet_type, packet.BINARY_ACK)
        self.assertEqual(pkt.data, b'1234')

    def test_invalid_binary_packet(self):
        self.assertRaises(ValueError, packet.Packet, packet_type=packet.ERROR,
                          data=b'123')

    def test_encode_namespace(self):
        pkt = packet.Packet(packet_type=packet.EVENT,
                            data=[six.text_type('foo')], namespace='/bar')
        self.assertEqual(pkt.namespace, '/bar')
        self.assertEqual(pkt.encode(), '2/bar,["foo"]')

    def test_decode_namespace(self):
        pkt = packet.Packet(encoded_packet='2/bar,["foo"]')
        self.assertEqual(pkt.namespace, '/bar')
        self.assertEqual(pkt.encode(), '2/bar,["foo"]')

    def test_encode_namespace_no_data(self):
        pkt = packet.Packet(packet_type=packet.EVENT, namespace='/bar')
        self.assertEqual(pkt.encode(), '2/bar')

    def test_decode_namespace_no_data(self):
        pkt = packet.Packet(encoded_packet='2/bar')
        self.assertEqual(pkt.namespace, '/bar')
        self.assertEqual(pkt.encode(), '2/bar')

    def test_encode_id(self):
        pkt = packet.Packet(packet_type=packet.EVENT,
                            data=[six.text_type('foo')], id=123)
        self.assertEqual(pkt.id, 123)
        self.assertEqual(pkt.encode(), '2123["foo"]')

    def test_decode_id(self):
        pkt = packet.Packet(encoded_packet='2123["foo"]')
        self.assertEqual(pkt.id, 123)
        self.assertEqual(pkt.encode(), '2123["foo"]')

    def test_encode_namespace_and_id(self):
        pkt = packet.Packet(packet_type=packet.EVENT,
                            data=[six.text_type('foo')], namespace='/bar',
                            id=123)
        self.assertEqual(pkt.namespace, '/bar')
        self.assertEqual(pkt.id, 123)
        self.assertEqual(pkt.encode(), '2/bar,123["foo"]')

    def test_decode_namespace_and_id(self):
        pkt = packet.Packet(encoded_packet='2/bar,123["foo"]')
        self.assertEqual(pkt.namespace, '/bar')
        self.assertEqual(pkt.id, 123)
        self.assertEqual(pkt.encode(), '2/bar,123["foo"]')

    def test_encode_many_binary(self):
        pkt = packet.Packet(packet_type=packet.EVENT,
                            data={'a': six.text_type('123'),
                                  'b': b'456',
                                  'c': [b'789', 123]})
        self.assertEqual(pkt.packet_type, packet.BINARY_EVENT)
        ep = pkt.encode()
        self.assertEqual(len(ep), 3)
        self.assertIn(b'456', ep)
        self.assertIn(b'789', ep)

    def test_encode_many_binary_ack(self):
        pkt = packet.Packet(packet_type=packet.ACK,
                            data={'a': six.text_type('123'),
                                  'b': b'456',
                                  'c': [b'789', 123]})
        self.assertEqual(pkt.packet_type, packet.BINARY_ACK)
        ep = pkt.encode()
        self.assertEqual(len(ep), 3)
        self.assertIn(b'456', ep)
        self.assertIn(b'789', ep)

    def test_decode_many_binary(self):
        pkt = packet.Packet(encoded_packet=(
            '52-{"a":"123","b":{"_placeholder":true,"num":0},'
            '"c":[{"_placeholder":true,"num":1},123]}'))
        pkt.reconstruct_binary([b'456', b'789'])
        self.assertEqual(pkt.packet_type, packet.BINARY_EVENT)
        self.assertEqual(pkt.data['a'], '123')
        self.assertEqual(pkt.data['b'], b'456')
        self.assertEqual(pkt.data['c'], [b'789', 123])

    def test_decode_many_binary_ack(self):
        pkt = packet.Packet(encoded_packet=(
            '62-{"a":"123","b":{"_placeholder":true,"num":0},'
            '"c":[{"_placeholder":true,"num":1},123]}'))
        pkt.reconstruct_binary([b'456', b'789'])
        self.assertEqual(pkt.packet_type, packet.BINARY_ACK)
        self.assertEqual(pkt.data['a'], '123')
        self.assertEqual(pkt.data['b'], b'456')
        self.assertEqual(pkt.data['c'], [b'789', 123])


text:
<?php
require_once 'core/CCounter.class.php';
$CC=new CCounter();
?>

<title>Click Counter Example</title>

Click Counter PHP - Example use

Click a link to increase the relative counter.

<a href="<?php print_r($CC::getHref('link1.html')); ?>" target="_blank">Link1

<a href="<?php print_r($CC::getHref('link2.html')); ?>" target="_blank">Link2

<a href="<?php print_r($CC::getHref('link3.html')); ?>" target="_blank">Link3

<a href="<?php print_r($CC::getHref('link4.html')); ?>" target="_blank">Link4

<a href="<?php print_r($CC::getHref('link5.html')); ?>" target="_blank">Link5 (404 page, link broken example)


text:
#import <Foundation/NSString.h>

@interface NSString_win1252 : NSString {
	NSUInteger  _length;
	unsigned char _bytes[1];
}

@end

unichar *NSWin1252ToUnicode(const char *cString,NSUInteger length,
							NSUInteger *resultLength,NSZone *zone);

char *NSUnicodeToWin1252(const unichar *characters,NSUInteger length,
						 BOOL lossy,NSUInteger *resultLength,NSZone *zone,BOOL zeroTerminate);

NSString *NSString_win1252NewWithBytes(NSZone *zone,
									   const char *bytes,NSUInteger length);

NSString *NSWin1252CStringNewWithCharacters(NSZone *zone,
                                            const unichar *characters,NSUInteger length,BOOL lossy);

NSUInteger NSGetWin1252CStringWithMaxLength(const unichar *characters,NSUInteger length,
                                            NSUInteger *location,char *cString,NSUInteger maxLength,BOOL lossy);


text:
@interface NWSGoogleMapsResult : NSObject
@property (nonatomic, copy) NSString *formatted;
@property (nonatomic, strong) NSArray *components;
@property (nonatomic, copy) NSString *country;
@property (nonatomic, copy) NSString *state;
@property (nonatomic, copy) NSString *area;
@property (nonatomic, copy) NSString *local;
@property (nonatomic, copy) NSString *city;
@property (nonatomic, assign) double latitude;
@property (nonatomic, assign) double longitude;
@end @implementation NWSGoogleMapsResult @end

@interface NWSGoogleMapsViewController() <CLLocationManagerDelegate>
@end

@implementation NWSGoogleMapsViewController {
    MKMapView *_mapView;
    UILabel *_label;
    NWSEndpoint *_endpoint;
    CLLocationManager *_manager;
}

- (NWSEndpoint *)setupReverseGeoEndpoint
{
    NWSBlockTransform *cityTransform = [[NWSBlockTransform alloc] initWithBlock:^id(NSArray *components, NWSMappingContext *context) {
        for (NSDictionary *component in components) {
            if ([component[@"types"][0] isEqualToString:@"locality"]) {
                return component[@"long_name"];
            }
        }
        return nil;
    }];

    NWSBlockTransform *countryTransform = [[NWSBlockTransform alloc] initWithBlock:^id(NSArray *components, NWSMappingContext *context) {
        for (NSDictionary *component in components) {
            if ([component[@"types"][0] isEqualToString:@"country"]) {
                return component[@"long_name"];
            }
        }
        return nil;
    }];

    NWSMapping *resultMapping = [[NWSMapping alloc] init];
    [resultMapping setObjectClass:NWSGoogleMapsResult.class];
    [resultMapping addAttributeWithElementPath:@"formatted_address" objectPath:@"formatted"];
    [resultMapping addAttributeWithElementPath:@"address_components" objectPath:@"city" transform:cityTransform];
    [resultMapping addAttributeWithElementPath:@"address_components" objectPath:@"country" transform:countryTransform];

    NWSHTTPEndpoint *result = [[NWSHTTPEndpoint alloc] init];
    result.urlString = @"http://maps.googleapis.com/maps/api/geocode/json?latlng=$(latitude),$(longitude)&sensor=true";
    result.responseMapping = resultMapping;
    result.responsePath = [NWSPath pathFromString:@"results.0"];

    return result;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    // setup Spaghetti endpoint
    _endpoint = [self setupReverseGeoEndpoint];

    // mapview
    CGRect b = self.view.bounds;
    _mapView = [[MKMapView alloc] initWithFrame:b];
    [self.view addSubview:_mapView];

    // text label
    _label = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, b.size.width - 40, 40)];
    _label.font = [UIFont systemFontOfSize:13];
    _label.textAlignment = NSTextAlignmentCenter;
    _label.text = @"Tap below to lookup you location..";
    [self.view addSubview:_label];

    // lookup button
    UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    button.frame = CGRectMake(20, b.size.height - 100, b.size.width - 40, 40);
    [button setTitle:@"What's here?" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(press) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    // start location updates
    CLLocationManager *manager = [[CLLocationManager alloc] init];
    manager.delegate = self;
    [manager startUpdatingLocation];
    _manager = manager;
}

- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
    // set map to current location
    CLLocation *location = locations.lastObject;
    [_mapView setRegion:MKCoordinateRegionMakeWithDistance(location.coordinate, 10000, 10000) animated:YES];
    [_manager stopUpdatingLocation];
    _manager.delegate = nil;
    _manager = nil;
}

- (void)press
{
    // lookup city and country
    CLLocationCoordinate2D coord = _mapView.centerCoordinate;
    [_endpoint startWithParameters:@{@"latitude":@(coord.latitude), @"longitude":@(coord.longitude)} block:^(NWSGoogleMapsResult *result) {
        _label.text = [NSString stringWithFormat:@"%@ in %@", result.city, result.country];
    }];
}

@end


text:
'''
NormalizeData_v2
Written by J.Hayes
Last editted 1/30/2017

Program reads through peakfit files, adds spectra labels and io data, and then returns the
normalized peak areas for the elements of interest

Program Inputs:
1) peakfit file directory
2) header file
3) io file directory
4) output directory
5) calcium analysis boolean (true or false)

Program Outputs:
None (saves normalized data in normalized folder created in output directory)

'''

from os import listdir, mkdir
from os.path import isfile, join, isdir, basename
import numpy as np
import pandas as pd

#Replaces the headers so that each set of peak fits is labelled with the sample name
def Replace_Header(data_file, header_file):
	data = pd.read_csv(data_file, index_col = 0)
	headers = pd.read_csv(header_file, index_col = 0)
	plate_name = basename(data_file).split("_")[0]
	for plate in headers.index:
		if plate.lower() == plate_name.lower():
			data.columns = list(headers.ix[plate])
	return data

#Parse through all elements investigated and return only elements of interest (dataframe)
def Element_Parse(data, ca_analysis):
	if ca_analysis:
		element_list = ['Ca']
	else:
		#Can change list as needed
		element_list = ['Mn','Cu','Co','Ni','Fe','Zn','Mo','Se','Rb']

	for element in data.index:
		if element not in element_list:
			data = data.drop(element)
	return data

#Searches through list of Io files and picks appropriate Io file
def Io_Grabber(data_file, io_dir):
	plate_name = basename(data_file).split('_')[0]
	io_files = [f for f in listdir(io_dir) if isfile(join(io_dir, f))]
	possible_io_matches = [f for f in io_files if plate_name in f]
	io_data = pd.DataFrame()
	if len(possible_io_matches) > 1:
		for pos_match in possible_io_matches:
			match_name = pos_match.split('_')[0]
			if match_name == plate_name:
				matching_io = pos_match
				io_data = Io_File_Parse(join(io_dir, matching_io))
	elif len(possible_io_matches) < 1:
		print("Hmm, I can't find a matching Io file for %s" %plate_name)
		io_data = pd.DataFrame()
	else:
		matching_io = possible_io_matches[0]
		io_data = Io_File_Parse(join(io_dir, matching_io))
	return io_data

#Parses through the Io file and picks out the Io values, returns them as a data frame
def Io_File_Parse(io_file):
	io_data = []
	with open(io_file, 'r') as f:
		for line in f:
			if "#" not in line and line != '\n':
				line = line.split('\t')
				io_value = float(line[4]) #Number here is Io column; may change
				io_data.append(io_value)
	df = pd.DataFrame({'Io': io_data})
	df = df.transpose()
	return df

#Normalizes the data by dividing each peak area by the corresponding Io value
def Normalize_Areas(data, io):
	io.columns = data.columns.values
	data = data.append(io)
	data = data/data.ix['Io']
	return data

def Data_Process(data_file, header_file, io_dir, ca_analysis):
	df = Replace_Header(data_file, header_file)
	df = Element_Parse(df, ca_analysis)
	io = Io_Grabber(data_file, io_dir)
	if not io.empty:
		df = Normalize_Areas(df, io)
		return df
	else:
		print("Sorry, it appears something went wrong. Likely, I couldn't find the appropriate Io File. Please try again.")
		return io

def Batch_Process(peakfit_dir, header_file, io_dir, output_dir, ca_analysis):
	#Make sure save directory exists, if not, make it
	save_dir = join(output_dir, 'normalized')
	if not isdir(save_dir):
		mkdir(save_dir)

	file_list = [f for f in listdir(peakfit_dir) if isfile(join(peakfit_dir, f))]

	for file in file_list:
		save_name = file.replace('.csv', '') + '_norm.csv'
		save_name = join(save_dir, save_name)
		file = join(peakfit_dir, file)
		peak_fit = Data_Process(file, header_file, io_dir, ca_analysis)
		if not peak_fit.empty:
			peak_fit.to_csv(save_name)


text:
function OutputImage = ColouredImageYellowBlue(InputImage)
%ColouredImageYellowBlue  converts a gray image into a yellow-blue image.
%
% inputs
%   InputImage  the input gray scale image
%
% outputs
%   OutputImage  the RGB image which is yellow-blue opponency.
%

InputImage = InputImage ./ max(abs(InputImage(:)));

OutputImage(:, :, 1) = max(InputImage, 0);
OutputImage(:, :, 2) = OutputImage(:, :, 1);
OutputImage(:, :, 3) = max(-InputImage, 0);
OutputImage = uint8(NormaliseChannel(OutputImage, 0, 1, [], []) .* 255);

end


text:
<dom-module id="fireworks-stats">

  <template>
  Stats

  Filter: <select id="mode" on-change="updateStats">
  		<option value="-1">All modes</option>
   <option value=1>Regular game</option>
   <option value=2>Rainbows</option>
   <option value=5>Limited rainbows</option>
   <option value=3>Wildcards</option>
   <option value=4>Limited wildcards</option>
  </select>
  <select id="numplayers" on-change="updateStats">
  	<option value="-1">All game sizes</option>
  	<option value=2>2-player games</option>
  	<option value=3>3-player games</option>
  	<option value=4>4-player games</option>
  	<option value=5>5-player games</option>
  	</select>

Game time: [[_friendlyTime(totalTime)]]

Games

	Games	Perfect	Bombed out	Out of plays	Mean score

  <template is="dom-repeat" items="{{stats}}" as="item" filter="showGameStats" sort="_sortByGames" id="gameStats">

  [[item.name]]
  [[item.games]]
  [[item.perfectGames]] [[_computePercent(item.perfectGames,item.games)]]
  [[item.bombedGames]] [[_computePercent(item.bombedGames,item.games)]]
  [[item.outOfPlays]] [[_computePercent(item.outOfPlays,item.games)]]
  [[item.score]]

  </template>

Turns

	Turns	Plays	Bombs	Discards	Hints	Mean time

  <template is="dom-repeat" items="{{stats}}" as="item" filter="showTurnStats" sort="_sortByTurns" id="turnStats">

  [[item.name]]
  [[item.turns]]
  [[item.plays]] [[_computePercent(item.plays,item.turns)]]
  [[item.bombs]] [[_computePercent(item.bombs,item.turns)]]
  [[item.discards]] [[_computePercent(item.discards,item.turns)]]
  [[item.hints]] [[_computePercent(item.hints,item.turns)]]
  [[item.time]]s

  </template>

  </template>

</dom-module>


text:
Con este montaje final vamos a potenciar todo lo aprendido en los montajes anteriores, para crear un sistema un poco más complejo, como puede ser el control de alguna pieza articulada.

Para el montaje vamos a necesitar los siguientes componentes electrónicos:
- 1x Placa Arduino Uno
- 1x Cable USB
- 1x Protoboard
- 9x Cable Macho-Macho
- 1x Servo
- 1x Joystick

Para este montaje vamos a diseñar un pequeño sistema que mueva el servo en función del movimiento horizontal del Joystick a izquierda y derecha, además el movimiento vertical del joystick, será traducido en el número de grados que se puede mover el servo cada vez, mostrando el ángulo actual y la velocidad establecida.

El esquema a seguir para el montaje del circuito es el siguiente:

![Alt text](ESQUEMA6_JOYSTICK+SERVOMOTOR.jpg?raw=true "ESQUEMA6_JOYSTICK+SERVO")


text:
function Get-TestRailCase
{
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
        [Alias('id')]
        [int]
        $CaseId
    )

    PROCESS
    {
        $Uri = "get_case/$CaseId"
        $Parameters = [System.Web.HttpUtility]::ParseQueryString([String]::Empty)

        Request-TestRailUri -Uri $Uri -Parameters $Parameters
    }
}

function Get-TestRailCases
{
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
        [Alias('project_id')]
        [int]
        $ProjectId,

        [Parameter(Mandatory=$false)]
        [int]
        $SuiteId,

        [Parameter(Mandatory=$false)]
        [int]
        $SectionId,

        [Parameter(Mandatory=$false)]
        [DateTime]
        $CreatedBefore,

        [Parameter(Mandatory=$false)]
        [DateTime]
        $CreatedAfter,

        [Parameter(Mandatory=$false)]
        [int[]]
        $CreatedBy,

        [Parameter(Mandatory=$false)]
        [int]
        $MilestoneId,

        [Parameter(Mandatory=$false)]
        [int[]]
        $PriorityId,

        [Parameter(Mandatory=$false)]
        [int[]]
        $TypeId,

        [Parameter(Mandatory=$false)]
        [DateTime]
        $UpdatedBefore,

        [Parameter(Mandatory=$false)]
        [DateTime]
        $UpdatedAfter,

        [Parameter(Mandatory=$false)]
        [int[]]
        $UpdatedBy
    )

    PROCESS
    {
        $Uri = "get_cases/$ProjectId"
        $Parameters = [System.Web.HttpUtility]::ParseQueryString([String]::Empty)

        if ( $PSBoundParameters.ContainsKey("SuiteId") )
        {
            Add-UriParameters -Parameters $Parameters -Hash @{ "suite_id" = $SuiteId }
        }

        if ( $PSBoundParameters.ContainsKey("SectionId") )
        {
            Add-UriParameters -Parameters $Parameters -Hash @{ "section_id" = $SectionId }
        }

        if ( $PSBoundParameters.ContainsKey("CreatedAfter") )
        {
            $CreatedAfterTS = ConvertTo-UnixTimestamp -DateTime $CreatedAfter
            Add-UriParameters -Parameters $Parameters -Hash @{ created_after = $CreatedAfterTS }
        }

        if ( $PSBoundParameters.ContainsKey("CreatedBefore") )
        {
            $CreatedBeforeTS = ConvertTo-UnixTimestamp -DateTime $CreatedBefore
            Add-UriParameters -Parameters $Parameters -Hash @{ created_before = $CreatedBeforeTS }
        }

        if ( $PSBoundParameters.ContainsKey("CreatedBy") )
        {
            Add-UriParameters -Parameters $Parameters -Hash @{ created_by = [string]::Join(",", $CreatedBy) }
        }

        if ( $PSBoundParameters.ContainsKey("MilestoneId") )
        {
            Add-UriParameters -Parameters $Parameters -Hash @{ "milestone_id" = $MilestoneId }
        }

        if ( $PSBoundParameters.ContainsKey("PriorityId") )
        {
            Add-UriParameters -Parameters $Parameters -Hash @{ "priority_id" = [string]::Join(",", $PriorityId) }
        }

        if ( $PSBoundParameters.ContainsKey("TypeId") )
        {
            Add-UriParameters -Parameters $Parameters -Hash @{ "type_id" = [string]::Join(",", $TypeId) }
        }

        if ( $PSBoundParameters.ContainsKey("UpdatedAfter") )
        {
            $UpdatedAfterTS = ConvertTo-UnixTimestamp -DateTime $UpdatedAfter
            Add-UriParameters -Parameters $Parameters -Hash @{ "updated_after" = $UpdatedAfterTS }
        }

        if ( $PSBoundParameters.ContainsKey("UpdatedBefore") )
        {
            $UpdatedBeforeTS = ConvertTo-UnixTimestamp -DateTime $UpdatedBefore
            Add-UriParameters -Parameters $Parameters -Hash @{ "updated_before" = $UpdatedBeforeTS }
        }

        if ( $PSBoundParameters.ContainsKey("UpdatedBy") )
        {
            Add-UriParameters -Parameters $Parameters -Hash @{ "updated_by" = [string]::Join(",", $UpdatedBy) }
        }

        Request-TestRailUri -Uri $Uri -Parameters $Parameters
    }
}

function Add-TestRailCase
{
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory=$true)]
        [int]
        $SectionId,

        [Parameter(Mandatory=$true)]
        [string]
        $Title,

        [Parameter(Mandatory=$false)]
        [int]
        $TypeId,

        [Parameter(Mandatory=$false)]
        [int]
        $PriorityId,

        [Parameter(Mandatory=$false)]
        [string]
        $Estimate,

        [Parameter(Mandatory=$false)]
        [int]
        $MilestoneId,

        [Parameter(Mandatory=$false)]
        [string[]]
        $Refs,

        [Parameter(Mandatory=$false)]
        [HashTable]
        $CustomFields = @{}
    )

    PROCESS
    {
        $Uri = "add_case/$SectionId"
        $Parameters = @{}

        $Parameters["title"] = $Title

        if ( $PSBoundParameters.ContainsKey("TypeId") )
        {
            $Parameters["type_id"] = $TypeId
        }

        if ( $PSBoundParameters.ContainsKey("PriorityId") )
        {
            $Parameters["priority_id"] = $PriorityId
        }

        if ( $PSBoundParameters.ContainsKey("Estimate") )
        {
            $Parameters["estimate"] = $Estimate
        }

        if ( $PSBoundParameters.ContainsKey("MilestoneId") )
        {
            $Parameters["milestone_id"] = $MilestoneId
        }

        if ( $PSBoundParameters.ContainsKey("MilestoneId") )
        {
            $Parameters[ "milestone_id"] = $MilestoneId
        }

        if ( $PSBoundParameters.ContainsKey("Refs") )
        {
            $Parameters["refs"] = [string]::Join(",", $Refs)
        }

        $CustomFields.Keys |% {
            $Key = $_
            if ( $Key -notmatch "^custom_" )
            {
                $Key = "custom_" + $Key
            }

            $Parameters.Add($Key, $CustomFields[$_])
        }

        Submit-TestRailUri -Uri $Uri -Parameters $Parameters
    }
}

function Set-TestRailCase
{
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory=$true)]
        [int]
        $CaseId,

        [Parameter(Mandatory=$false)]
        [string]
        $Title,

        [Parameter(Mandatory=$false)]
        [int]
        $TypeId,

        [Parameter(Mandatory=$false)]
        [int]
        $PriorityId,

        [Parameter(Mandatory=$false)]
        [string]
        $Estimate,

        [Parameter(Mandatory=$false)]
        [int]
        $MilestoneId,

        [Parameter(Mandatory=$false)]
        [string[]]
        $Refs,

        [Parameter(Mandatory=$false)]
        [HashTable]
        $CustomFields = @{}
    )

    PROCESS
    {
        $Uri = "update_case/$CaseId"
        $Parameters = @{}

        if ( $PSBoundParameters.ContainsKey("Title") )
        {
            $Parameters["title"] = $Title
        }

        if ( $PSBoundParameters.ContainsKey("TypeId") )
        {
            $Parameters["type_id"] = $TypeId
        }

        if ( $PSBoundParameters.ContainsKey("PriorityId") )
        {
            $Parameters["priority_id"] = $PriorityId
        }

        if ( $PSBoundParameters.ContainsKey("Estimate") )
        {
            $Parameters["estimate"] = $Estimate
        }

        if ( $PSBoundParameters.ContainsKey("MilestoneId") )
        {
            $Parameters["milestone_id"] = $MilestoneId
        }

        if ( $PSBoundParameters.ContainsKey("MilestoneId") )
        {
            $Parameters["milestone_id"] = $MilestoneId
        }

        if ( $PSBoundParameters.ContainsKey("Refs") )
        {
            $Parameters["refs"] = [string]::Join(",", $Refs)
        }

        $CustomFields.Keys |% {
            $Key = $_
            if ( $Key -notmatch "^custom_" )
            {
                $Key = "custom_" + $Key
            }

            $Parameters.Add($Key, $CustomFields[$_])
        }

        Submit-TestRailUri -Uri $Uri -Parameters $Parameters
    }
}

function Remove-TestRailCase
{
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory=$true)]
        [int]
        $CaseId
    )

    PROCESS
    {
        $Uri = "delete_case/$CaseId"
        $Parameters = @{}

        Submit-TestRailUri -Uri $Uri -Parameters $Parameters
    }
}


text:
      Truyen 4U

      Scrapy

      {{::item.title}}

          <input type="text" placeholder="Search...">

        <button class="hidden-btn" id="search-skillset"></button>

          Edit Profile

          Change Profile Picture

          Change Password

          Manage Social Accounts

          Signout

      Sign in


text:
type: page
permalink: /404.html
---

# 404

Sorry, we can't seem to find this page.

Home
Contact


text:
<?php

require_once 'dbconn.php';

$dom = new DOMDocument("1.0");
$node = $dom->createElement("markers");
$parnode = $dom->appendChild($node);

// Opens a connection to a MySQL server

// Select all the rows in the markers table

$query = "SELECT * FROM qrstore join qrtag on qrstore.idQR=qrtag.idQR";
$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}

$query2="Select * from qrtag";
$result2=mysql_query($query2);

header("Content-type: text/xml");

// Iterate through the rows, adding XML nodes for each

while ($row = @mysql_fetch_assoc($result)){
  // ADD TO XML DOCUMENT NODE

  $node = $dom->createElement("marker");
  $newnode = $parnode->appendChild($node);
  $newnode->setAttribute("idQR",$row['idQR']);
  $newnode->setAttribute("Location", $row['Location']);
    $newnode->setAttribute("Latitude", $row['latitude']);
  $newnode->setAttribute("Longitude", $row['longitude']);
  $newnode->setAttribute("Landmark", $row['Landmark']);
$newnode->setAttribute("First_Tagged_at", $row['firsttagged']);
$newnode->setAttribute("Last_Tagged_at", $row['lasttagged']);
$newnode->setAttribute("Upvotes", $row['upvotes']);
}

echo $dom->saveXML();

?>


text:
<?php

class Google_Service_SecurityCommandCenter_SecurityCenterProperties extends Google_Collection
{
  protected $collection_key = 'resourceOwners';
  public $resourceName;
  public $resourceOwners;
  public $resourceParent;
  public $resourceProject;
  public $resourceType;

  public function setResourceName($resourceName)
  {
    $this->resourceName = $resourceName;
  }
  public function getResourceName()
  {
    return $this->resourceName;
  }
  public function setResourceOwners($resourceOwners)
  {
    $this->resourceOwners = $resourceOwners;
  }
  public function getResourceOwners()
  {
    return $this->resourceOwners;
  }
  public function setResourceParent($resourceParent)
  {
    $this->resourceParent = $resourceParent;
  }
  public function getResourceParent()
  {
    return $this->resourceParent;
  }
  public function setResourceProject($resourceProject)
  {
    $this->resourceProject = $resourceProject;
  }
  public function getResourceProject()
  {
    return $this->resourceProject;
  }
  public function setResourceType($resourceType)
  {
    $this->resourceType = $resourceType;
  }
  public function getResourceType()
  {
    return $this->resourceType;
  }
}